-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
✨ Move cluster-specifics from Manager into new pkg/cluster #1307
Conversation
This change is the first step towards implementing the corresponding [proposal][1]. It essentially consists of moving a bunch if code from pkg/manager into pkg/cluster, slightly adjusting some tests in pkg/manager and copying applicable tests from there into pkg/cluster. It is not yet the full implementation, because the `Manager` will only correctly start it's own cache and not other caches before starting the remaining `Runnables`. This behavior matches current behavior when building something that uses multiple caches and will be fixed in a follow-up. [1]: https://github.com/kubernetes-sigs/controller-runtime/blob/master/designs/move-cluster-specific-code-out-of-manager.md
Tests are failing because they still run with go 1.13 and we need at least 1.14 to get https://golang.org/doc/go1.14#language All tests succeed when running them locally with go 1.15: $ g rev-parse HEAD && ./hack/check-everything.sh
066bfea7df288d72eba0fcf98e1c21d72d8ec31b
fetching envtest tools@1.19.2 (into '/tmp/kubebuilder')
kubebuilder/bin/
kubebuilder/bin/etcd
kubebuilder/bin/kube-apiserver
kubebuilder/bin/kubectl
fetching envtest tools@1.19.2 (into './hack/../pkg/internal/testing/integration/assets')
kubebuilder/bin/
kubebuilder/bin/etcd
kubebuilder/bin/kube-apiserver
kubebuilder/bin/kubectl
setting up env vars
running generate
cd hack/tools && go build -tags=tools -o bin/controller-gen sigs.k8s.io/controller-tools/cmd/controller-gen
hack/tools/bin/controller-gen object paths="./pkg/config/v1alpha1/...;./examples/configfile/custom/v1alpha1/..."
running golangci-lint
/home/alvaro/git/golang/src/sigs.k8s.io/controller-runtime/hack/tools/bin/golangci-lint run -v
INFO [config_reader] Config search paths: [./ /home/alvaro/git/golang/src/sigs.k8s.io/controller-runtime /home/alvaro/git/golang/src/sigs.k8s.io /home/alvaro/git/golang/src /home/alvaro/git/golang /home/alvaro/git /home/alvaro /home /]
INFO [config_reader] Used config file .golangci.yml
INFO [lintersdb] Active 15 linters: [deadcode dupl errcheck goconst gocyclo goimports golint govet ineffassign lll misspell nakedret structcheck unparam varcheck]
INFO [lintersdb] Active 15 linters: [deadcode dupl errcheck goconst gocyclo goimports golint govet ineffassign lll misspell nakedret structcheck unparam varcheck]
INFO [loader] Go packages loading at mode 575 (compiled_files|deps|imports|types_sizes|exports_file|files|name) took 1.176958092s
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 36.749181ms
INFO [runner/goanalysis_metalinter/goanalysis] analyzers took 0s with no stages
INFO [runner/skip dirs] Skipped 1 issues from dir examples/configfile/builtin by pattern (^|/)examples($|/)
INFO [runner/skip dirs] Skipped 3 issues from dir examples/crd/pkg by pattern (^|/)examples($|/)
INFO [runner/skip dirs] Skipped 2 issues from dir examples/builtins by pattern (^|/)examples($|/)
INFO [runner/skip dirs] Skipped 2 issues from dir examples/configfile/custom by pattern (^|/)examples($|/)
INFO [runner] Issues before processing: 20, after processing: 0
INFO [runner] Processors filtering stat (out/in): skip_dirs: 12/20, identifier_marker: 11/11, exclude-rules: 0/11, filename_unadjuster: 20/20, skip_files: 20/20, exclude: 11/11, cgo: 20/20, path_prettifier: 20/20, autogenerated_exclude: 11/12
INFO [runner] processing took 699.659µs with stages: path_prettifier: 247.715µs, identifier_marker: 173.292µs, skip_dirs: 153.779µs, autogenerated_exclude: 59.115µs, exclude-rules: 54.087µs, cgo: 4.416µs, filename_unadjuster: 2.744µs, max_same_issues: 1.134µs, nolint: 780ns, max_from_linter: 466ns, diff: 431ns, skip_files: 343ns, uniq_by_line: 323ns, source_code: 296ns, exclude: 288ns, max_per_file_from_linter: 262ns, path_shortener: 188ns
INFO [runner] linters took 243.676365ms with stages: goanalysis_metalinter: 242.89809ms
INFO File cache stats: 0 entries of total size 0B
INFO Memory: 16 samples, avg is 84.0MB, max is 138.3MB
INFO Execution took 1.462513348s
verifying modules
go mod tidy
cd hack/tools; go mod tidy
running go test
ok sigs.k8s.io/controller-runtime 0.116s [no tests to run]
? sigs.k8s.io/controller-runtime/examples/builtins [no test files]
? sigs.k8s.io/controller-runtime/examples/configfile/builtin [no test files]
? sigs.k8s.io/controller-runtime/examples/configfile/custom [no test files]
? sigs.k8s.io/controller-runtime/examples/configfile/custom/v1alpha1 [no test files]
? sigs.k8s.io/controller-runtime/examples/crd [no test files]
? sigs.k8s.io/controller-runtime/examples/crd/pkg [no test files]
? sigs.k8s.io/controller-runtime/pkg [no test files]
ok sigs.k8s.io/controller-runtime/pkg/builder 16.257s
ok sigs.k8s.io/controller-runtime/pkg/cache 76.595s
? sigs.k8s.io/controller-runtime/pkg/cache/informertest [no test files]
? sigs.k8s.io/controller-runtime/pkg/cache/internal [no test files]
ok sigs.k8s.io/controller-runtime/pkg/client 26.301s
ok sigs.k8s.io/controller-runtime/pkg/client/apiutil 1.592s
ok sigs.k8s.io/controller-runtime/pkg/client/config 0.097s
ok sigs.k8s.io/controller-runtime/pkg/client/fake 0.394s
ok sigs.k8s.io/controller-runtime/pkg/cluster 16.843s
ok sigs.k8s.io/controller-runtime/pkg/config 0.095s
? sigs.k8s.io/controller-runtime/pkg/config/v1alpha1 [no test files]
ok sigs.k8s.io/controller-runtime/pkg/controller 20.875s
? sigs.k8s.io/controller-runtime/pkg/controller/controllertest [no test files]
ok sigs.k8s.io/controller-runtime/pkg/controller/controllerutil 15.719s
? sigs.k8s.io/controller-runtime/pkg/conversion [no test files]
ok sigs.k8s.io/controller-runtime/pkg/envtest 54.736s
? sigs.k8s.io/controller-runtime/pkg/envtest/printer [no test files]
? sigs.k8s.io/controller-runtime/pkg/event [no test files]
ok sigs.k8s.io/controller-runtime/pkg/handler 23.537s
ok sigs.k8s.io/controller-runtime/pkg/healthz 0.069s
ok sigs.k8s.io/controller-runtime/pkg/internal/controller 18.227s
? sigs.k8s.io/controller-runtime/pkg/internal/controller/metrics [no test files]
? sigs.k8s.io/controller-runtime/pkg/internal/log [no test files]
? sigs.k8s.io/controller-runtime/pkg/internal/objectutil [no test files]
ok sigs.k8s.io/controller-runtime/pkg/internal/recorder 17.635s
ok sigs.k8s.io/controller-runtime/pkg/internal/testing/integration 0.133s
ok sigs.k8s.io/controller-runtime/pkg/internal/testing/integration/addr 0.047s
ok sigs.k8s.io/controller-runtime/pkg/internal/testing/integration/internal 4.417s
ok sigs.k8s.io/controller-runtime/pkg/internal/testing/integration/internal/integration_tests 129.052s
? sigs.k8s.io/controller-runtime/pkg/leaderelection [no test files]
? sigs.k8s.io/controller-runtime/pkg/leaderelection/fake [no test files]
ok sigs.k8s.io/controller-runtime/pkg/log 0.052s
ok sigs.k8s.io/controller-runtime/pkg/log/zap 0.080s
ok sigs.k8s.io/controller-runtime/pkg/manager 15.128s
ok sigs.k8s.io/controller-runtime/pkg/manager/signals 1.051s
? sigs.k8s.io/controller-runtime/pkg/metrics [no test files]
? sigs.k8s.io/controller-runtime/pkg/patterns/application [no test files]
? sigs.k8s.io/controller-runtime/pkg/patterns/operator [no test files]
ok sigs.k8s.io/controller-runtime/pkg/predicate 0.215s
? sigs.k8s.io/controller-runtime/pkg/ratelimiter [no test files]
ok sigs.k8s.io/controller-runtime/pkg/reconcile 0.051s
ok sigs.k8s.io/controller-runtime/pkg/recorder 0.055s [no tests to run]
? sigs.k8s.io/controller-runtime/pkg/runtime [no test files]
ok sigs.k8s.io/controller-runtime/pkg/runtime/inject 0.107s
ok sigs.k8s.io/controller-runtime/pkg/scheme 0.068s
ok sigs.k8s.io/controller-runtime/pkg/source 11.157s
ok sigs.k8s.io/controller-runtime/pkg/source/internal 0.164s
ok sigs.k8s.io/controller-runtime/pkg/webhook 14.800s
ok sigs.k8s.io/controller-runtime/pkg/webhook/admission 0.265s
ok sigs.k8s.io/controller-runtime/pkg/webhook/conversion 0.214s
? sigs.k8s.io/controller-runtime/pkg/webhook/internal/certwatcher [no test files]
? sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics [no test files]
confirming examples compile (via go install)
passed |
/test pull-controller-runtime-test-master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/milestone v0.8.x
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, vincepri The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This change is the first step towards implementing the corresponding
proposal. It essentially consists of moving a bunch if code from
pkg/manager into pkg/cluster, slightly adjusting some tests in
pkg/manager and copying applicable tests from there into pkg/cluster.
It is not yet the full implementation, because the
Manager
will onlycorrectly start it's own cache and not other caches before starting the
remaining
Runnables
. This behavior matches current behavior whenbuilding something that uses multiple caches and will be fixed in a
follow-up.