Closed noahgoldman closed 5 years ago
@noahgoldman thanks for this issue! Great catch - I definitely missed this while making the injector more modular. Let me see if i can get a quick PR up for you.
More info shortly!
@noahgoldman can you check out the :latest
build now? Hopefully this is fixed :)
What's going on?
Setting a custom annotation namespace
-annotation-namespace
does not effect theinjector.tumblr.com/status
annotation.The root cause seems quite clear from reading the source. The
/status
annotation is set in webhook.go#L462, using the config.InjectionStatusAnnotation package-level variable. This variable is hardcoded to useannotationNamespaceDefault
, which is set to"injector.tumblr.com"
. This pretty clearly explains why the user-specified configuration is ignored.Interestingly, both
/request
and/status
are properly formatted usingAnnotationNamespace
in (*WebhookServer).getSidecarConfigurationRequested. Seems like that configuration format just needs to be used in both places.Expected Behavior
Setting
-annotation-namespace=sidecar-injector.eks.qcinternal.io
should cause Pods with injected sidecars to have the annotationsidecar-injector.eks.qcinternal.io/status: injected
. Instead, we seeinjector.tumblr.com/status: injected
. The annotation setting which sidecar configuration to use issidecar-injector.eks.qcinternal.io/request
.Reproducer
The injector is launched with the following arguments:
I'm going to omit sidecar configurations in particular, as the root cause seems quite obvious and the configurations are for internal tools. I can provide similar information if necessary.
Version Deets
v1.13.8
v0.1.7