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

Support custom labels in Jaeger all-in-one deployments (#629) #1153

Merged
merged 4 commits into from
Aug 12, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,7 @@ k8s.io/apimachinery v0.18.2 h1:44CmtbmkzVDAhCpRVSiP2R5PPrC2RtlIv/MoB8xpdRA=
k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA=
k8s.io/apimachinery v0.18.3 h1:pOGcbVAhxADgUYnjS08EFXs9QMl8qaH5U4fr5LGUrSk=
k8s.io/apimachinery v0.18.3/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko=
k8s.io/apimachinery v0.18.6 h1:RtFHnfGNfd1N0LeSrKCUznz5xtUP1elRGvHJbL3Ntag=
k8s.io/apiserver v0.0.0-20190918160949-bfa5e2e684ad/go.mod h1:XPCXEwhjaFN29a8NldXA901ElnKeKLrLtREO9ZhFyhg=
k8s.io/apiserver v0.0.0-20191122221311-9d521947b1e1/go.mod h1:RbsZY5zzBIWnz4KbctZsTVjwIuOpTp4Z8oCgFHN4kZQ=
k8s.io/apiserver v0.18.0/go.mod h1:3S2O6FeBBd6XTo0njUrLxiqk8GNy6wWOftjhJcXYnjw=
Expand Down
2 changes: 1 addition & 1 deletion pkg/deployment/all_in_one.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (a *AllInOne) Get() *appsv1.Deployment {
},
Spec: appsv1.DeploymentSpec{
Selector: &metav1.LabelSelector{
MatchLabels: labels,
jpkrohling marked this conversation as resolved.
Show resolved Hide resolved
MatchLabels: commonSpec.Labels,
},
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Expand Down
5 changes: 5 additions & 0 deletions pkg/deployment/all_in_one_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ func TestAllInOneLabels(t *testing.T) {
assert.Equal(t, "operator", dep.Spec.Template.Labels["name"])
assert.Equal(t, "world", dep.Spec.Template.Labels["hello"])
assert.Equal(t, "false", dep.Spec.Template.Labels["another"])

// Deployment selectors should be the same as the template labels.
assert.Equal(t, "operator", dep.Spec.Selector.MatchLabels["name"])
assert.Equal(t, "world", dep.Spec.Selector.MatchLabels["hello"])
assert.Equal(t, "false", dep.Spec.Selector.MatchLabels["another"])
}

func TestAllInOneHasOwner(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/storage/elasticsearch_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/jaegertracing/jaeger-operator/pkg/account"
v1 "github.com/jaegertracing/jaeger-operator/pkg/apis/jaegertracing/v1"
"github.com/jaegertracing/jaeger-operator/pkg/cronjob"
"github.com/jaegertracing/jaeger-operator/pkg/util"
"github.com/jaegertracing/jaeger-operator/pkg/account"
)

// EnableRollover returns true if rollover should be enabled
Expand Down Expand Up @@ -45,12 +45,12 @@ func elasticsearchDependencies(jaeger *v1.Jaeger) []batchv1.Job {
Labels: commonSpec.Labels,
},
Spec: corev1.PodSpec{
RestartPolicy: corev1.RestartPolicyOnFailure,
RestartPolicy: corev1.RestartPolicyOnFailure,
Affinity: commonSpec.Affinity,
Tolerations: commonSpec.Tolerations,
SecurityContext: commonSpec.SecurityContext,
ServiceAccountName: account.JaegerServiceAccountFor(jaeger, account.EsRolloverComponent),
Volumes: commonSpec.Volumes,
Volumes: commonSpec.Volumes,
Containers: []corev1.Container{
{
Name: name,
Expand Down