Skip to content

update for 1.32 release #97

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

Merged
merged 2 commits into from
Jan 21, 2025
Merged

Conversation

d-honeybadger
Copy link
Contributor

Routine upgrade of go modules, including k8s packages.
Required a bit of refactoring b/c of webhook.Validator interface being removed in controller-runtime 0.20.0 (default in in-line comments)

Complete()
}

//+kubebuilder:webhook:path=/validate-databases-digitalocean-com-v1alpha1-databasecluster,mutating=false,failurePolicy=fail,sideEffects=None,groups=databases.digitalocean.com,resources=databaseclusters,verbs=create;update,versions=v1alpha1,name=vdatabasecluster.kb.io,admissionReviewVersions=v1
// +kubebuilder:webhook:path=/validate-databases-digitalocean-com-v1alpha1-databasecluster,mutating=false,failurePolicy=fail,sideEffects=None,groups=databases.digitalocean.com,resources=databaseclusters,verbs=create;update,versions=v1alpha1,name=vdatabasecluster.kb.io,admissionReviewVersions=v1
type DatabaseClusterValidator struct{}
Copy link
Contributor Author

@d-honeybadger d-honeybadger Jan 21, 2025

Choose a reason for hiding this comment

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

Webhook refactor due to conroller-runtime v0.20 breaking changes:

webhook.Validator interface was removed. The reason for removal is discussed in this issue.

TL;DR is webhook.Validator interface was supposed to be implemented by the api types, and that coupled api packages with webhooks, which was bad design wrt importing api types in other projects (created dependencies resolution issues).

The way to do webhooks now is with the webhook.CustomValidator interface. And, since coupling of api packages w/ webhooks was highlighted as a bad idea, I moved the webhooks into their own package.

func (f *FakeDatabasesService) List(_ context.Context, _ *godo.ListOptions) ([]godo.Database, *godo.Response, error) {
panic("not implemented")
// satisfy interface for unimplemented methods
godo.DatabasesService
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So that we don't have to keep adding more and more irrelevant methods that do nothing but panic anyway,

Copy link
Contributor

@gottwald gottwald left a comment

Choose a reason for hiding this comment

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

LGTM. Thx for the inline explanation!

@d-honeybadger d-honeybadger merged commit 85c3228 into main Jan 21, 2025
2 checks passed
@d-honeybadger d-honeybadger deleted the dkomsa/update-for-1.32-release branch January 21, 2025 19:27
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.

2 participants