Adds the statefulset.kubernetes.io/pod-name label allowing users to
attach a Service to an individual Pod.
This commit is contained in:
@@ -78,6 +78,11 @@ func TestIdentityMatches(t *testing.T) {
|
||||
if identityMatches(set, pod) {
|
||||
t.Error("identity matches for a Pod with the wrong namespace")
|
||||
}
|
||||
pod = newStatefulSetPod(set, 1)
|
||||
delete(pod.Labels, apps.StatefulSetPodNameLabel)
|
||||
if identityMatches(set, pod) {
|
||||
t.Error("identity matches for a Pod with the wrong statefulSetPodNameLabel")
|
||||
}
|
||||
}
|
||||
|
||||
func TestStorageMatches(t *testing.T) {
|
||||
@@ -127,6 +132,11 @@ func TestUpdateIdentity(t *testing.T) {
|
||||
if !identityMatches(set, pod) {
|
||||
t.Error("updateIdentity failed to update the Pods namespace")
|
||||
}
|
||||
delete(pod.Labels, apps.StatefulSetPodNameLabel)
|
||||
updateIdentity(set, pod)
|
||||
if !identityMatches(set, pod) {
|
||||
t.Error("updateIdentity failed to restore the statefulSetPodName label")
|
||||
}
|
||||
}
|
||||
|
||||
func TestUpdateStorage(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user