Skip to content

Commit

Permalink
Merge b484849 into c1e6ee1
Browse files Browse the repository at this point in the history
  • Loading branch information
pavolloffay authored Oct 4, 2021
2 parents c1e6ee1 + b484849 commit a08d96b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/deployment/deployment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (r *ReconcileDeployment) Reconcile(request reconcile.Request) (reconcile.Re
return reconcile.Result{}, tracing.HandleError(err, span)
}

if dep.Labels["app"] == "jaeger" {
if dep.Labels["app"] == "jaeger" && dep.Labels["app.kubernetes.io/component"] != "query" {
// Don't touch jaeger deployments
return reconcile.Result{}, nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/inject/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func Needed(dep *appsv1.Deployment, ns *corev1.Namespace) bool {

// do not inject jaeger due to port collision
// do not inject if deployment's Annotation value is false
if dep.Labels["app"] == "jaeger" {
if dep.Labels["app"] == "jaeger" && dep.Labels["app.kubernetes.io/component"] != "query" {
return false
}

Expand Down
3 changes: 0 additions & 3 deletions pkg/strategy/production.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ func newProductionStrategy(ctx context.Context, jaeger *v1.Jaeger) S {
// prepare the deployments, which may get changed by the elasticsearch routine
cDep := collector.Get()
queryDep := inject.OAuthProxy(jaeger, query.Get())
if jaeger.Spec.Query.TracingEnabled == nil || *jaeger.Spec.Query.TracingEnabled == true {
queryDep = inject.Sidecar(jaeger, queryDep)
}
c.dependencies = storage.Dependencies(jaeger)

// assembles the pieces for an elasticsearch self-provisioned deployment via the elasticsearch operator
Expand Down
5 changes: 3 additions & 2 deletions pkg/strategy/production_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,9 @@ func TestAgentSidecarIsInjectedIntoQueryForStreamingForProduction(t *testing.T)
c := newProductionStrategy(context.Background(), j)
for _, dep := range c.Deployments() {
if strings.HasSuffix(dep.Name, "-query") {
assert.Equal(t, 2, len(dep.Spec.Template.Spec.Containers))
assert.Equal(t, "jaeger-agent", dep.Spec.Template.Spec.Containers[1].Name)
assert.Equal(t, "TestAgentSidecarIsInjectedIntoQueryForStreamingForProduction", dep.Annotations["sidecar.jaegertracing.io/inject"])
assert.Equal(t, 1, len(dep.Spec.Template.Spec.Containers))
assert.Equal(t, "jaeger-query", dep.Spec.Template.Spec.Containers[0].Name)
}
}
}
Expand Down

0 comments on commit a08d96b

Please sign in to comment.