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

🌱 Controller-runtime v0.19.0 & Controller-tools v0.16.1 #675

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

akutz
Copy link
Collaborator

@akutz akutz commented Aug 20, 2024

What does this PR do, and why is it needed?

This patch updates VM Operator to Controller-Runtime v0.19.0 and Controller-Tools v0.16.1.

Please note that this change apparently requires updating to controller-tools v0.16 as well, or else manifest generation fails per #675 (comment). To the VM Op team, please note one aspect of controller-tools v0.16 is deduplicating RBAC per kubernetes-sigs/controller-tools#937, hence the major diff to our role.yaml file.

Which issue(s) is/are addressed by this PR? (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Fixes NA

Are there any special notes for your reviewer:

cc @sbueringer

Please add a release note if necessary:

Update Controller-Runtime to v0.19.0 and Controller-Tools v0.16.1.

@github-actions github-actions bot added the size/M Denotes a PR that changes 30-99 lines. label Aug 20, 2024
@akutz
Copy link
Collaborator Author

akutz commented Aug 20, 2024

@sbueringer , it's failing here when running controller-gen:

make generate-manifests
make[2]: Entering directory '/home/runner/work/vm-operator/vm-operator'
hack/tools/bin/linux_amd64/controller-gen \
	paths=github.com/vmware-tanzu/vm-operator/api/... \
	crd:crdVersions=v1 \
	output:crd:dir=config/crd/bases \
	output:none
Error: /home/runner/go/pkg/mod/k8s.io/[email protected]/core/v1/doc.go:21:1: missing argument "" (at <input>)
Error: /home/runner/go/pkg/mod/k8s.io/[email protected]/core/v1/doc.go:21:1: missing argument "" (at <input>)
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".ConditionStatus
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".TypedLocalObjectReference
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".ConditionStatus
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".TypedLocalObjectReference
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".PersistentVolumeClaimVolumeSource
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".ResourceList
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".PersistentVolumeClaimVolumeSource
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".ResourceList
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".PersistentVolumeClaimVolumeSource
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".PersistentVolumeClaimVolumeSource
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".PersistentVolumeClaimVolumeSource
k8s.io/api/core/v1:-: unknown type "k8s.io/api/core/v1".PersistentVolumeClaimVolumeSource
github.com/vmware-tanzu/vm-operator/api/v1alpha3:-: unable to locate schema for type "k8s.io/api/core/v1".PersistentVolumeClaimVolumeSource
github.com/vmware-tanzu/vm-operator/api/v1alpha1:-: unable to locate schema for type "k8s.io/api/core/v1".ConditionStatus
github.com/vmware-tanzu/vm-operator/api/v1alpha1:-: unable to locate schema for type "k8s.io/api/core/v1".TypedLocalObjectReference
github.com/vmware-tanzu/vm-operator/api/v1alpha1:-: unable to locate schema for type "k8s.io/api/core/v1".PersistentVolumeClaimVolumeSource
github.com/vmware-tanzu/vm-operator/api/v1alpha1:-: unable to locate schema for type "k8s.io/api/core/v1".ResourceList
github.com/vmware-tanzu/vm-operator/api/v1alpha2:-: unable to locate schema for type "k8s.io/api/core/v1".PersistentVolumeClaimVolumeSource
Error: not all generators ran successfully
run `controller-gen paths=github.com/vmware-tanzu/vm-operator/api/... crd:crdVersions=v1 output:crd:dir=config/crd/bases output:none -w` to see all available markers, or `controller-gen paths=github.com/vmware-tanzu/vm-operator/api/... crd:crdVersions=v1 output:crd:dir=config/crd/bases output:none -h` for usage

It works once I upgrade controller-tools to v0.16. Does controller-runtime v0.19.0 somehow force a dependency on controller-tools v0.16+?

@github-actions github-actions bot added size/L Denotes a PR that changes 100-499 lines. and removed size/M Denotes a PR that changes 30-99 lines. labels Aug 20, 2024
@akutz akutz changed the title 🌱 Controller-runtime v0.19.0 🌱 Controller-runtime v0.19.0 & Controller-tools v0.16.1 Aug 20, 2024
Copy link
Contributor

@aruneshpa aruneshpa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to cross references a bunch of randomly references roles to make sure they were ported correctly. Seems so.

LGTM.

@sbueringer
Copy link

sbueringer commented Aug 21, 2024

@akutz

It works once I upgrade controller-tools to v0.16. Does controller-runtime v0.19.0 somehow force a dependency on controller-tools v0.16+?

It's not controller-runtime that does it, it's k8s.io/api v0.31.0 (xref: kubernetes-sigs/controller-tools#1000)

@sbueringer
Copy link

lgtm +/- the linter findings

@sbueringer
Copy link

I tried to cross references a bunch of randomly references roles to make sure they were ported correctly. Seems so.

We diff'ed all our roles in Cluster API when making the change in controller-gen and we have a lot :) (just for some additional confidence)

@akutz akutz force-pushed the feature/controller-runtime-v0.19.0 branch 2 times, most recently from aef8004 to 1322631 Compare August 21, 2024 14:04
@github-actions github-actions bot added size/XL Denotes a PR that changes 500-999 lines. and removed size/L Denotes a PR that changes 100-499 lines. labels Aug 21, 2024
This patch updates VM Operator to Controller-Runtime v0.19.0 and
Controller-Tools v0.16.1 as it is required to work with the new
k8s.io dependency pulled in by Controller-Runtime.

This patch also addresses a bunch of linting issues brought to
light by stale linting caches on developer systems and on GitHub
actions where part of the cache key is the sum of the go.mod file.
Since the module file changed, it ran with a clean cache, revelealing
the issues.

Finally, this patch updates a few tests to set conditions' field
LastTransitionTime to a non-empty value since that is now a required
field.
@akutz akutz force-pushed the feature/controller-runtime-v0.19.0 branch from 1322631 to 4ebacd1 Compare August 21, 2024 14:52
Copy link

Code Coverage

Package Line Rate Health
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/clustercontentlibraryitem 81%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/contentlibraryitem 85%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/utils 97%
github.com/vmware-tanzu/vm-operator/controllers/infra/capability 89%
github.com/vmware-tanzu/vm-operator/controllers/infra/configmap 71%
github.com/vmware-tanzu/vm-operator/controllers/infra/node 77%
github.com/vmware-tanzu/vm-operator/controllers/infra/secret 77%
github.com/vmware-tanzu/vm-operator/controllers/storagepolicyquota 97%
github.com/vmware-tanzu/vm-operator/controllers/util/encoding 73%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/storagepolicyusage 99%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/virtualmachine 87%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/volume 87%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineclass 75%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinepublishrequest 81%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinereplicaset 68%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice 83%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/providers 92%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesetresourcepolicy 80%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1 72%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions 88%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1/patch 78%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha2 73%
github.com/vmware-tanzu/vm-operator/pkg/builder 95%
github.com/vmware-tanzu/vm-operator/pkg/conditions 88%
github.com/vmware-tanzu/vm-operator/pkg/config 100%
github.com/vmware-tanzu/vm-operator/pkg/config/env 100%
github.com/vmware-tanzu/vm-operator/pkg/context/operation 100%
github.com/vmware-tanzu/vm-operator/pkg/patch 78%
github.com/vmware-tanzu/vm-operator/pkg/prober 91%
github.com/vmware-tanzu/vm-operator/pkg/prober/probe 90%
github.com/vmware-tanzu/vm-operator/pkg/prober/worker 77%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere 75%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/client 80%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/clustermodules 71%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/config 72%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/contentlibrary 74%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/credentials 100%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/network 80%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/placement 11%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/session 73%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/sysprep 100%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/vcenter 82%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/virtualmachine 77%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/vmlifecycle 67%
github.com/vmware-tanzu/vm-operator/pkg/record 78%
github.com/vmware-tanzu/vm-operator/pkg/topology 90%
github.com/vmware-tanzu/vm-operator/pkg/util 87%
github.com/vmware-tanzu/vm-operator/pkg/util/annotations 0%
github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit 89%
github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit/validate 91%
github.com/vmware-tanzu/vm-operator/pkg/util/image 100%
github.com/vmware-tanzu/vm-operator/pkg/util/kube 80%
github.com/vmware-tanzu/vm-operator/pkg/util/kube/cource 100%
github.com/vmware-tanzu/vm-operator/pkg/util/kube/spq 100%
github.com/vmware-tanzu/vm-operator/pkg/util/ptr 100%
github.com/vmware-tanzu/vm-operator/pkg/util/resize 97%
github.com/vmware-tanzu/vm-operator/pkg/util/vmopv1 91%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/client 68%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/vm 86%
github.com/vmware-tanzu/vm-operator/pkg/webconsolevalidation 100%
github.com/vmware-tanzu/vm-operator/webhooks/common 100%
github.com/vmware-tanzu/vm-operator/webhooks/persistentvolumeclaim/validation 95%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/mutation 87%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/validation 95%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/mutation 62%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/validation 89%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinepublishrequest/validation 92%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinereplicaset/validation 90%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/mutation 67%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/validation 92%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesetresourcepolicy/validation 89%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation 92%
github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation 92%
Summary 81% (9039 / 11163)

Minimum allowed line rate is 79%

@akutz akutz merged commit af97d5f into vmware-tanzu:main Aug 21, 2024
11 checks passed
@akutz akutz deleted the feature/controller-runtime-v0.19.0 branch August 21, 2024 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-not-required size/XL Denotes a PR that changes 500-999 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants