Skip to content

Commit

Permalink
Check if annotation sidecar.istio.io/inject exists
Browse files Browse the repository at this point in the history
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>
  • Loading branch information
cnvergence committed Apr 19, 2022
1 parent 6126133 commit 4e33d89
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
7 changes: 5 additions & 2 deletions pkg/deployment/all_in_one.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ func (a *AllInOne) Get() *appsv1.Deployment {
for k, v := range commonSpec.Annotations {
podAnnotations[k] = v
}
podAnnotations["sidecar.istio.io/inject"] = "false"
_, ok := podAnnotations["sidecar.istio.io/inject"]
if !ok {
podAnnotations["sidecar.istio.io/inject"] = "false"
}

options := allArgs(a.jaeger.Spec.AllInOne.Options,
a.jaeger.Spec.Storage.Options.Filter(a.jaeger.Spec.Storage.Type.OptionsPrefix()))
Expand Down Expand Up @@ -124,7 +127,7 @@ func (a *AllInOne) Get() *appsv1.Deployment {
Name: a.jaeger.Name,
Namespace: a.jaeger.Namespace,
Labels: commonSpec.Labels,
Annotations: commonSpec.Annotations,
Annotations: baseCommonSpec.Annotations,
OwnerReferences: []metav1.OwnerReference{{
APIVersion: a.jaeger.APIVersion,
Kind: a.jaeger.Kind,
Expand Down
7 changes: 5 additions & 2 deletions pkg/deployment/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ func (c *Collector) Get() *appsv1.Deployment {
for k, v := range commonSpec.Annotations {
podAnnotations[k] = v
}
podAnnotations["sidecar.istio.io/inject"] = "false"
_, ok := podAnnotations["sidecar.istio.io/inject"]
if !ok {
podAnnotations["sidecar.istio.io/inject"] = "false"
}

var envFromSource []corev1.EnvFromSource
if len(c.jaeger.Spec.Storage.SecretName) > 0 {
Expand Down Expand Up @@ -113,7 +116,7 @@ func (c *Collector) Get() *appsv1.Deployment {
Name: c.name(),
Namespace: c.jaeger.Namespace,
Labels: commonSpec.Labels,
Annotations: commonSpec.Annotations,
Annotations: baseCommonSpec.Annotations,
OwnerReferences: []metav1.OwnerReference{{
APIVersion: c.jaeger.APIVersion,
Kind: c.jaeger.Kind,
Expand Down
5 changes: 4 additions & 1 deletion pkg/deployment/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ func (i *Ingester) Get() *appsv1.Deployment {
for k, v := range commonSpec.Annotations {
podAnnotations[k] = v
}
podAnnotations["sidecar.istio.io/inject"] = "false"
_, ok := podAnnotations["sidecar.istio.io/inject"]
if !ok {
podAnnotations["sidecar.istio.io/inject"] = "false"
}

var envFromSource []corev1.EnvFromSource
if len(i.jaeger.Spec.Storage.SecretName) > 0 {
Expand Down
7 changes: 5 additions & 2 deletions pkg/deployment/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ func (q *Query) Get() *appsv1.Deployment {
for k, v := range commonSpec.Annotations {
podAnnotations[k] = v
}
podAnnotations["sidecar.istio.io/inject"] = "false"
_, ok := podAnnotations["sidecar.istio.io/inject"]
if !ok {
podAnnotations["sidecar.istio.io/inject"] = "false"
}

options := allArgs(q.jaeger.Spec.Query.Options,
q.jaeger.Spec.Storage.Options.Filter(q.jaeger.Spec.Storage.Type.OptionsPrefix()))
Expand Down Expand Up @@ -110,7 +113,7 @@ func (q *Query) Get() *appsv1.Deployment {
Name: fmt.Sprintf("%s-query", q.jaeger.Name),
Namespace: q.jaeger.Namespace,
Labels: commonSpec.Labels,
Annotations: commonSpec.Annotations,
Annotations: baseCommonSpec.Annotations,
OwnerReferences: []metav1.OwnerReference{{
APIVersion: q.jaeger.APIVersion,
Kind: q.jaeger.Kind,
Expand Down

0 comments on commit 4e33d89

Please sign in to comment.