Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to controller-runtime 0.19.1 / Kube 1.31 #293

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion cmd/checkconfig/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ func validateRequiredJobAnnotations(a []string, c config.JobConfig) error {
var errs []error
for _, annotation := range annotations {
if _, ok := job.Annotations[annotation]; !ok {
errs = append(errs, fmt.Errorf(annotation))
errs = append(errs, errors.New(annotation))
}
}
return utilerrors.NewAggregate(errs)
Expand Down
4 changes: 2 additions & 2 deletions cmd/peribolos/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ func configureTeamMembers(client teamMembersClient, orgName string, gt github.Te
if err != nil {
// Augment the error with the operation we attempted so that the error makes sense after return
err = fmt.Errorf("UpdateTeamMembership(%s(%s), %s, %t) failed: %w", gt.Slug, gt.Name, user, super, err)
logrus.Warnf(err.Error())
logrus.Warn(err)
} else if tm.State == github.StatePending {
logrus.Infof("Invited %s to %s(%s) as a %s", user, gt.Slug, gt.Name, role)
} else {
Expand All @@ -1301,7 +1301,7 @@ func configureTeamMembers(client teamMembersClient, orgName string, gt github.Te
if err != nil {
// Augment the error with the operation we attempted so that the error makes sense after return
err = fmt.Errorf("RemoveTeamMembership(%s(%s), %s) failed: %w", gt.Slug, gt.Name, user, err)
logrus.Warnf(err.Error())
logrus.Warn(err)
} else {
logrus.Infof("Removed %s from team %s(%s)", user, gt.Slug, gt.Name)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/pipeline/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type controller struct {
pjLister prowjoblisters.ProwJobLister
pjInformer cache.SharedIndexInformer

workqueue workqueue.RateLimitingInterface
workqueue workqueue.TypedRateLimitingInterface[string]

recorder record.EventRecorder

Expand All @@ -83,7 +83,7 @@ type controllerOptions struct {
pipelineConfigs map[string]pipelineConfig
totURL string
prowConfig config.Getter
rl workqueue.RateLimitingInterface
rl workqueue.TypedRateLimitingInterface[string]
}

// pjNamespace returns the prow namespace from configuration
Expand Down Expand Up @@ -229,7 +229,7 @@ func (c *controller) runWorker() {
func() {
defer c.workqueue.Done(key)

if err := reconcile(c, key.(string)); err != nil {
if err := reconcile(c, key); err != nil {
runtime.HandleError(fmt.Errorf("failed to reconcile %s: %w", key, err))
return // Do not forget so we retry later.
}
Expand Down
22 changes: 11 additions & 11 deletions cmd/pipeline/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,32 +159,32 @@ func (r *fakeReconciler) cancelPipelineRun(context string, pr *pipelinev1.Pipeli
}

type fakeLimiter struct {
workqueue.RateLimitingInterface
workqueue.TypedRateLimitingInterface[string]
added string
}

func (fl *fakeLimiter) ShutDown() {}
func (fl *fakeLimiter) ShuttingDown() bool {
return false
}
func (fl *fakeLimiter) Get() (interface{}, bool) {
func (fl *fakeLimiter) Get() (string, bool) {
return "not implemented", true
}
func (fl *fakeLimiter) Done(interface{}) {}
func (fl *fakeLimiter) Forget(interface{}) {}
func (fl *fakeLimiter) AddRateLimited(a interface{}) {
fl.added = a.(string)
func (fl *fakeLimiter) Done(string) {}
func (fl *fakeLimiter) Forget(string) {}
func (fl *fakeLimiter) AddRateLimited(a string) {
fl.added = a
}
func (fl *fakeLimiter) Add(a interface{}) {
fl.added = a.(string)
func (fl *fakeLimiter) Add(a string) {
fl.added = a
}
func (fl *fakeLimiter) AddAfter(a interface{}, d time.Duration) {
fl.added = a.(string)
func (fl *fakeLimiter) AddAfter(a string, d time.Duration) {
fl.added = a
}
func (fl *fakeLimiter) Len() int {
return 0
}
func (fl *fakeLimiter) NumRequeues(item interface{}) int {
func (fl *fakeLimiter) NumRequeues(item string) int {
return 0
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/pipeline/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func main() {
pipelineConfigs: pipelineConfigs,
totURL: o.totURL,
prowConfig: configAgent.Config,
rl: kube.RateLimiter(controllerName),
rl: kube.RateLimiter[string](controllerName),
}
controller, err := newController(opts)
if err != nil {
Expand Down
283 changes: 171 additions & 112 deletions config/prow/cluster/prowjob-crd/prowjob_customresourcedefinition.yaml

Large diffs are not rendered by default.

69 changes: 36 additions & 33 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/fsouza/fake-gcs-server v1.19.4
github.com/go-git/go-git/v5 v5.12.0
github.com/go-test/deep v1.0.7
github.com/golang/glog v1.2.0
github.com/golang/glog v1.2.1
github.com/gomodule/redigo v1.8.5
github.com/google/go-cmp v0.6.0
github.com/google/gofuzz v1.2.1-0.20210504230335-f78f29fc09ea
Expand All @@ -44,9 +44,9 @@ require (
github.com/hashicorp/golang-lru v1.0.2
github.com/mattn/go-zglob v0.0.2
github.com/maxbrunsfeld/counterfeiter/v6 v6.4.1
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/client_golang v1.19.1
github.com/prometheus/client_model v0.6.1
github.com/prometheus/common v0.54.0
github.com/prometheus/common v0.55.0
github.com/shurcooL/githubv4 v0.0.0-20210725200734-83ba7b4c9228
github.com/sirupsen/logrus v1.9.3
github.com/spf13/pflag v1.0.5
Expand All @@ -56,27 +56,27 @@ require (
go4.org v0.0.0-20201209231011-d4a079459e60
gocloud.dev v0.19.0
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
golang.org/x/net v0.25.0
golang.org/x/oauth2 v0.20.0
golang.org/x/net v0.26.0
golang.org/x/oauth2 v0.21.0
golang.org/x/sync v0.7.0
golang.org/x/text v0.15.0
golang.org/x/text v0.16.0
golang.org/x/time v0.5.0
gomodules.xyz/jsonpatch/v2 v2.4.0
google.golang.org/api v0.181.0
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda
google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5
google.golang.org/grpc v1.64.0
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157
google.golang.org/grpc v1.65.0
google.golang.org/protobuf v1.34.2
gopkg.in/fsnotify.v1 v1.4.7
gopkg.in/ini.v1 v1.62.0
gopkg.in/robfig/cron.v2 v2.0.0-20150107220207-be2e0b0deed5
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.30.1
k8s.io/apimachinery v0.30.1
k8s.io/client-go v0.30.1
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
k8s.io/api v0.31.0
k8s.io/apimachinery v0.31.0
k8s.io/client-go v0.31.0
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
knative.dev/pkg v0.0.0-20240416145024-0f34a8815650
sigs.k8s.io/controller-runtime v0.18.5
sigs.k8s.io/controller-runtime v0.19.1
sigs.k8s.io/yaml v1.4.0
)

Expand All @@ -97,27 +97,28 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/blendle/zapdriver v1.3.1 // indirect
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fvbommel/sortorder v1.0.1 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt v3.2.1+incompatible // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
Expand All @@ -126,7 +127,7 @@ require (
github.com/google/cel-go v0.20.1 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/wire v0.4.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
Expand All @@ -145,44 +146,46 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/spdystream v0.4.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/prometheus/statsd_exporter v0.22.7 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f // indirect
github.com/skeema/knownhosts v1.2.2 // indirect
github.com/smartystreets/goconvey v1.8.1 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/trivago/tgo v1.0.7 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.27.0 // indirect
go.opentelemetry.io/otel/metric v1.27.0 // indirect
go.opentelemetry.io/otel/trace v1.27.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/tools v0.20.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apiextensions-apiserver v0.30.1 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/apiextensions-apiserver v0.31.0 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
Expand Down
Loading