-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conversation
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{} |
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.
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 |
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.
So that we don't have to keep adding more and more irrelevant methods that do nothing but panic anyway,
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. Thx for the inline explanation!
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)