-
Notifications
You must be signed in to change notification settings - Fork 16
feat: add webhook and test to see that it updates a new workload #34
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
hessjcg
left a comment
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.
Updated based on @enocom review.
| // WorkloadAdmissionWebhook implementation of a controller-runtime webhook for all | ||
| // supported workload types: Deployment, DaemonSet, StatefulSet, Pod, CronJob, Job | ||
| type WorkloadAdmissionWebhook struct { | ||
| Client client.Client |
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.
Should this be a pointer?
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.
client.Client is an interface.
This is one of the weird things about Go is that interfaces could be implemented by pointers or values. Nobody uses a naming convention to indicate what is an interface and what is concrete type. The only syntax that indicates that something is concrete is accessing fields directly.
Adds the mutating webhook that will update workloads as they are created or modified.
config/**/*.yaml changes are all boilerplate or generated changes to enable the webhook controller.