-
Notifications
You must be signed in to change notification settings - Fork 455
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
[chore] Refactor Webhooks to their own packages #2210
[chore] Refactor Webhooks to their own packages #2210
Conversation
config/webhook/manifests.yaml
Outdated
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.
The order of these is reversing, but is a noop AFAICT
if inst.Spec.Nginx.Image == autoInstNginx { | ||
inst.Spec.Nginx.Image = u.DefaultAutoInstNginx | ||
inst.Annotations[v1alpha1.AnnotationDefaultAutoInstrumentationNginx] = u.DefaultAutoInstNginx | ||
func (u *InstrumentationUpgrade) upgrade(_ context.Context, inst v1alpha1.Instrumentation) *v1alpha1.Instrumentation { |
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.
the previous way was really annoying me. If anyone has problems with this, i am happy to revert it.
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
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
config/webhook/manifests.yaml
Outdated
@@ -10,9 +10,9 @@ webhooks: | |||
service: | |||
name: webhook-service | |||
namespace: system | |||
path: /mutate-opentelemetry-io-v1alpha1-instrumentation | |||
path: /mutate-opentelemetry-io-v1alpha1-opentelemetrycollector |
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.
why are these changes here?
I am concerned that this will cause issues for the upgrade (also the upgrade test was changed )
…or into refactor-webhooks-pt1
…or into refactor-webhooks-pt1
…or into refactor-webhooks-pt1
@pavolloffay should be good to go now! |
// Package webhookhandler contains the webhook that injects sidecars into pods. | ||
package webhookhandler | ||
// Package sidecar contains the webhook that injects sidecars into pods. | ||
package sidecar |
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.
I don't think we should call this package sidecar
The package exposes a mutator API that allows mutating pod objects. It is used for instrumentation and sidecar
* lots of moving things around and simplifcation * moves webhook manifest * rename * generate * Add back annotations * Fix tests, simplify code * naming * fix borked test * FIX TESTS * oops * move things back * update manifests * fix a miss * fix tests * Rename
Description:
This PR updates how webhooks are created and managed by the operator by moving them out of types and into an internal package. In the future this will let us add more complex logic to the webhooks, but for now this mostly is a no-op. One benefit for instrumentation webhooks is that we no longer need to add the annotations to the resource for defaulting because we can add a config field to the instrumentation webhook. All tests have been moved over and replaced with the actual webhooks.
Link to tracking Issue: n/a
Testing: tested locally.
Documentation: n/a