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

updating dependencies and code to support k8s 1.28 #51

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

acornett21
Copy link
Contributor

Description of the change:

Motivation for the change:
To keep project current.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 15, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 15, 2024
Makefile Show resolved Hide resolved
oceanc80
oceanc80 previously approved these changes Jan 16, 2024
@oceanc80 oceanc80 dismissed their stale review January 16, 2024 21:07

e2e tests failing

@everettraven
Copy link
Collaborator

Looks like the e2e tests are failing due to

- need to update this to "leases" I think.

@acornett21
Copy link
Contributor Author

Looks like the e2e tests are failing due to

  • need to update this to "leases" I think.

I'm not sure what we want to do for this flag, since there can only be one value now and it's hardcoded to resourcelock.LeasesResourceLock (I have yet to push that update). The helm plugin does not expose this flag, so I'm not sure if removal or deprecation is the best option for this flag.

@everettraven
Copy link
Collaborator

Looks like the e2e tests are failing due to

  • need to update this to "leases" I think.

I'm not sure what we want to do for this flag, since there can only be one value now and it's hardcoded to resourcelock.LeasesResourceLock (I have yet to push that update). The helm plugin does not expose this flag, so I'm not sure if removal or deprecation is the best option for this flag.

Based on https://github.com/kubernetes-sigs/controller-runtime/blob/6747c42ce33966b0e77cac278c6b9087cc2f51c7/pkg/manager/manager.go#L146-L177 it looks like we should update the default value of that flag to "leases"

@acornett21
Copy link
Contributor Author

acornett21 commented Jan 17, 2024

Based on https://github.com/kubernetes-sigs/controller-runtime/blob/6747c42ce33966b0e77cac278c6b9087cc2f51c7/pkg/manager/manager.go#L146-L177 it looks like we should update the default value of that flag to "leases"

Just to restate again, there can only be one value and it's hardcoded and cannot come from the flag, so IMO the flag doesn't serve a purpose and should either be deprecated or removed. I'd prefer removal since other plugins do not have this flag.

@everettraven
Copy link
Collaborator

everettraven commented Jan 17, 2024

Based on https://github.com/kubernetes-sigs/controller-runtime/blob/6747c42ce33966b0e77cac278c6b9087cc2f51c7/pkg/manager/manager.go#L146-L177 it looks like we should update the default value of that flag to "leases"

Just to restate again, there can only be one value and it's hardcoded and cannot come from the flag, so IMO the flag doesn't serve a purpose and should either be deprecated or removed. I'd prefer removal since other plugins do not have this flag.

Maybe I'm misunderstanding, but I don't see a reason for this to be hardcoded? This still appears to be a configurable option based on https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/pkg/manager#Options. The default should be updated to reflect the default used by controller-runtime and the description updated to reflect what controller-runtime recommends, which is that this option only be modified if you know what you are doing.

We most certainly can deprecate this flag, but we unfortunately cannot just remove it.

EDIT: To add onto this, I do see that in client-go the only possible resource lock is "leases" https://github.com/kubernetes/client-go/blob/94205f8c40c617ffa7b5cf1927448cfd2e99ebf5/tools/leaderelection/resourcelock/interface.go#L166-L189

That being said, I think it makes sense to keep this a configurable flag since it is configurable in controller-runtime. Doesn't mean anything but "leases" has to work (and we can document this if necessary) but keeping it around prevents additional work beyond modifying the default if in the future there are new resource lock types added/removed/changed

@acornett21 acornett21 force-pushed the update_k8s_1_28 branch 2 times, most recently from aec9606 to f252bcb Compare January 17, 2024 22:08
Comment on lines 163 to 168
flagSet.StringVar(&f.LeaderElectionResourceLock,
"leader-elect-resource-lock",
"configmapsleases",
"The type of resource object that is used for locking during leader election."+
" Supported options are 'leases', 'endpointsleases' and 'configmapsleases'. Default is configmapsleases.",
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we can just remove this without it being a breaking change and requiring a new major version. I'd prefer if we changed this to something like:

	flagSet.StringVar(&f.LeaderElectionResourceLock,
		"leader-elect-resource-lock",
		resourcelock.LeasesResourceLock,
		"determines which resource lock to use for leader election, defaults to \"leases\". Change this value only if you know what you are doing.",
	)

and then remove the hardcoded setting below

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's also acceptable to deprecate this flag and have it "do nothing". We just can't remove it right now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This flag isn't in the helm-plugin so I was trying to remove it for consistency/clarity across plugins. I'll move to deprecate it, since IMO that's more clear to end users.

Copy link
Collaborator

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

Marking as "Request Changes" to properly signal the review status of this PR from my end. Reasoning for requesting changes is https://github.com/operator-framework/ansible-operator-plugins/pull/51/files#r1457477413

Copy link
Collaborator

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

/lgtm

Will merge pending passing CI

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 22, 2024
Signed-off-by: Adam D. Cornett <adc@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 22, 2024
Copy link

openshift-ci bot commented Jan 22, 2024

New changes are detected. LGTM label has been removed.

@everettraven everettraven merged commit 422d542 into operator-framework:main Jan 23, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants