Skip to content

Commit

Permalink
Add sidecar.istio.io/inject=false annotation to all-in-one, agent (da… (
Browse files Browse the repository at this point in the history
jaegertracing#67)

* Add sidecar.istio.io/inject=false annotation to all-in-one, agent (daemonset), query and collector

Signed-off-by: Gary Brown <gary@brownuk.com>
  • Loading branch information
objectiser authored and andream16 committed Oct 17, 2018
1 parent 07e6146 commit c676e73
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/deployment/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func (a *Agent) Get() *appsv1.DaemonSet {
annotations := map[string]string{
prometheusScrapeKey: prometheusScrapeValue,
prometheusPortKey: "5778",
"sidecar.istio.io/inject": "false",
}

return &appsv1.DaemonSet{
Expand Down
6 changes: 5 additions & 1 deletion pkg/deployment/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,9 @@ func TestGetDaemonSetDeployment(t *testing.T) {
jaeger := v1alpha1.NewJaeger("TestGetDaemonSetDeployment")
jaeger.Spec.Agent.Strategy = daemonSetStrategy
agent := NewAgent(jaeger)
assert.NotNil(t, agent.Get())

ds := agent.Get()
assert.NotNil(t, ds)

assert.Equal(t, "false", ds.Spec.Template.Annotations["sidecar.istio.io/inject"])
}
1 change: 1 addition & 0 deletions pkg/deployment/all-in-one.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func (a *AllInOne) Get() *appsv1.Deployment {
annotations := map[string]string{
prometheusScrapeKey: prometheusScrapeValue,
prometheusPortKey: "16686",
"sidecar.istio.io/inject": "false",
}

return &appsv1.Deployment{
Expand Down
2 changes: 2 additions & 0 deletions pkg/deployment/all-in-one_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ func TestDefaultAllInOneImage(t *testing.T) {
},
}
assert.Equal(t, envvars, d.Spec.Template.Spec.Containers[0].Env)

assert.Equal(t, "false", d.Spec.Template.ObjectMeta.Annotations["sidecar.istio.io/inject"])
}

func TestAllInOneHasOwner(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions pkg/deployment/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func (c *Collector) Get() *appsv1.Deployment {
annotations := map[string]string{
prometheusScrapeKey: prometheusScrapeValue,
prometheusPortKey: "14268",
"sidecar.istio.io/inject": "false",
}

return &appsv1.Deployment{
Expand Down
2 changes: 2 additions & 0 deletions pkg/deployment/collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,6 @@ func TestDefaultCollectorImage(t *testing.T) {
},
}
assert.Equal(t, envvars, containers[0].Env)

assert.Equal(t, "false", dep.Spec.Template.ObjectMeta.Annotations["sidecar.istio.io/inject"])
}
1 change: 1 addition & 0 deletions pkg/deployment/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func (q *Query) Get() *appsv1.Deployment {
annotations := map[string]string{
prometheusScrapeKey: prometheusScrapeValue,
prometheusPortKey: "16686",
"sidecar.istio.io/inject": "false",

// note that we are explicitly using a string here, not the value from `inject.Annotation`
// this has two reasons:
Expand Down
2 changes: 2 additions & 0 deletions pkg/deployment/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ func TestDefaultQueryImage(t *testing.T) {

assert.Len(t, containers, 1)
assert.Equal(t, "org/custom-query-image:123", containers[0].Image)

assert.Equal(t, "false", dep.Spec.Template.ObjectMeta.Annotations["sidecar.istio.io/inject"])
}

func TestQueryPodName(t *testing.T) {
Expand Down

0 comments on commit c676e73

Please sign in to comment.