Skip to content

Commit

Permalink
No modify annotation when injecting
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Vargas <[email protected]>
  • Loading branch information
rubenvp8510 committed Feb 12, 2020
1 parent 16592e0 commit 4f86b64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/inject/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ const (
func Sidecar(jaeger *v1.Jaeger, dep *appsv1.Deployment) *appsv1.Deployment {
deployment.NewAgent(jaeger) // we need some initialization from that, but we don't actually need the agent's instance here
logFields := jaeger.Logger().WithField("deployment", dep.Name)

if jaeger == nil || (dep.Annotations[Annotation] != jaeger.Name && dep.Annotations[AnnotationLegacy] != jaeger.Name) {
// At this point is assumed that if the annotation is true, and jaeger instance is not null,
// it was selected in previous steps by Select , so might be the only instance present.
if jaeger == nil || ((dep.Annotations[Annotation] != jaeger.Name && dep.Annotations[AnnotationLegacy] != jaeger.Name) && dep.Annotations[Annotation] != "true") {
logFields.Debug("skipping sidecar injection")
} else {
decorate(dep)
Expand Down Expand Up @@ -98,7 +99,6 @@ func Select(target *appsv1.Deployment, ns *corev1.Namespace, availableJaegerPods
// jaeger instance to use!
// first, we make sure we normalize the name:
jaeger := &availableJaegerPods.Items[0]
target.Annotations[Annotation] = jaeger.Name
return jaeger
}
return nil
Expand Down

0 comments on commit 4f86b64

Please sign in to comment.