Skip to content

Commit

Permalink
Merge pull request kubeflow#448 from liyinan926/master
Browse files Browse the repository at this point in the history
Also add a label for the submission ID to other resources
  • Loading branch information
liyinan926 authored Mar 21, 2019
2 parents 1bbf0d0 + e362d4c commit 4b4335d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions pkg/controller/sparkapplication/sparkui.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func createSparkUIIngress(app *v1beta1.SparkApplication, service SparkService, i
Namespace: app.Namespace,
Labels: map[string]string{
config.SparkAppNameLabel: app.Name,
config.SubmissionIDLabel: app.Status.SubmissionID,
},
OwnerReferences: []metav1.OwnerReference{*getOwnerReference(app)},
},
Expand Down Expand Up @@ -114,6 +115,7 @@ func createSparkUIService(
Namespace: app.Namespace,
Labels: map[string]string{
config.SparkAppNameLabel: app.Name,
config.SubmissionIDLabel: app.Status.SubmissionID,
},
OwnerReferences: []metav1.OwnerReference{*getOwnerReference(app)},
},
Expand Down
6 changes: 2 additions & 4 deletions pkg/controller/sparkapplication/sparkui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ func TestCreateSparkUIService(t *testing.T) {
}
t.Fatal(err)
}
if len(service.Labels) != 1 ||
service.Labels[config.SparkAppNameLabel] != test.app.Name {
if service.Labels[config.SparkAppNameLabel] != test.app.Name {
t.Errorf("%s: service of app %s has the wrong labels", test.name, test.app.Name)
}
if !reflect.DeepEqual(test.expectedSelector, service.Spec.Selector) {
Expand Down Expand Up @@ -210,8 +209,7 @@ func TestCreateSparkUIIngress(t *testing.T) {
t.Fatal(err)
}

if len(ingress.Labels) != 1 ||
ingress.Labels[config.SparkAppNameLabel] != app.Name {
if ingress.Labels[config.SparkAppNameLabel] != app.Name {
t.Errorf("Ingress of app %s has the wrong labels", app.Name)
}

Expand Down

0 comments on commit 4b4335d

Please sign in to comment.