Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sidecar.istio.io/inject=false annotation to all-in-one, agent (da… #67

Merged
merged 1 commit into from
Oct 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pkg/deployment/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ func (a *Agent) Get() *appsv1.DaemonSet {
trueVar := true
selector := a.selector()
annotations := map[string]string{
"prometheus.io/scrape": "true",
"prometheus.io/port": "5778",
"prometheus.io/scrape": "true",
"prometheus.io/port": "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("TestNewAgent")
jaeger.Spec.Agent.Strategy = "daemonset"
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"])
}
5 changes: 3 additions & 2 deletions pkg/deployment/all-in-one.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ func (a *AllInOne) Get() *appsv1.Deployment {
selector := a.selector()
trueVar := true
annotations := map[string]string{
"prometheus.io/scrape": "true",
"prometheus.io/port": "16686",
"prometheus.io/scrape": "true",
"prometheus.io/port": "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
5 changes: 3 additions & 2 deletions pkg/deployment/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ func (c *Collector) Get() *appsv1.Deployment {
trueVar := true
replicas := int32(c.jaeger.Spec.Collector.Size)
annotations := map[string]string{
"prometheus.io/scrape": "true",
"prometheus.io/port": "14268",
"prometheus.io/scrape": "true",
"prometheus.io/port": "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"])
}
5 changes: 3 additions & 2 deletions pkg/deployment/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ func (q *Query) Get() *appsv1.Deployment {
trueVar := true
replicas := int32(q.jaeger.Spec.Query.Size)
annotations := map[string]string{
"prometheus.io/scrape": "true",
"prometheus.io/port": "16686",
"prometheus.io/scrape": "true",
"prometheus.io/port": "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