Skip to content

Commit 4b4335d

Browse files
authored
Merge pull request #448 from liyinan926/master
Also add a label for the submission ID to other resources
2 parents 1bbf0d0 + e362d4c commit 4b4335d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/controller/sparkapplication/sparkui.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ func createSparkUIIngress(app *v1beta1.SparkApplication, service SparkService, i
6565
Namespace: app.Namespace,
6666
Labels: map[string]string{
6767
config.SparkAppNameLabel: app.Name,
68+
config.SubmissionIDLabel: app.Status.SubmissionID,
6869
},
6970
OwnerReferences: []metav1.OwnerReference{*getOwnerReference(app)},
7071
},
@@ -114,6 +115,7 @@ func createSparkUIService(
114115
Namespace: app.Namespace,
115116
Labels: map[string]string{
116117
config.SparkAppNameLabel: app.Name,
118+
config.SubmissionIDLabel: app.Status.SubmissionID,
117119
},
118120
OwnerReferences: []metav1.OwnerReference{*getOwnerReference(app)},
119121
},

pkg/controller/sparkapplication/sparkui_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ func TestCreateSparkUIService(t *testing.T) {
6161
}
6262
t.Fatal(err)
6363
}
64-
if len(service.Labels) != 1 ||
65-
service.Labels[config.SparkAppNameLabel] != test.app.Name {
64+
if service.Labels[config.SparkAppNameLabel] != test.app.Name {
6665
t.Errorf("%s: service of app %s has the wrong labels", test.name, test.app.Name)
6766
}
6867
if !reflect.DeepEqual(test.expectedSelector, service.Spec.Selector) {
@@ -210,8 +209,7 @@ func TestCreateSparkUIIngress(t *testing.T) {
210209
t.Fatal(err)
211210
}
212211

213-
if len(ingress.Labels) != 1 ||
214-
ingress.Labels[config.SparkAppNameLabel] != app.Name {
212+
if ingress.Labels[config.SparkAppNameLabel] != app.Name {
215213
t.Errorf("Ingress of app %s has the wrong labels", app.Name)
216214
}
217215

0 commit comments

Comments
 (0)