Skip to content

Commit f2b2d44

Browse files
committed
s/master/primary in agnhost guestbook usage
1 parent 981f675 commit f2b2d44

9 files changed

+71
-71
lines changed

test/cmd/core.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -303,15 +303,15 @@ run_pod_tests() {
303303
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" ''
304304
# Command
305305
kubectl create -f test/fixtures/doc-yaml/admin/limitrange/valid-pod.yaml "${kube_flags[@]}"
306-
kubectl create -f test/e2e/testing-manifests/kubectl/agnhost-master-pod.yaml "${kube_flags[@]}"
307-
# Post-condition: valid-pod and agnhost-master PODs are created
308-
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'agnhost-master:valid-pod:'
306+
kubectl create -f test/e2e/testing-manifests/kubectl/agnhost-primary-pod.yaml "${kube_flags[@]}"
307+
# Post-condition: valid-pod and agnhost-primary PODs are created
308+
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'agnhost-primary:valid-pod:'
309309

310310
### Delete multiple PODs at once
311-
# Pre-condition: valid-pod and agnhost-master PODs exist
312-
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'agnhost-master:valid-pod:'
311+
# Pre-condition: valid-pod and agnhost-primary PODs exist
312+
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'agnhost-primary:valid-pod:'
313313
# Command
314-
kubectl delete pods valid-pod agnhost-master "${kube_flags[@]}" --grace-period=0 --force # delete multiple pods at once
314+
kubectl delete pods valid-pod agnhost-primary "${kube_flags[@]}" --grace-period=0 --force # delete multiple pods at once
315315
# Post-condition: no POD exists
316316
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" ''
317317

test/e2e/kubectl/kubectl.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ const (
9595
busyboxPodSelector = "app=busybox1"
9696
busyboxPodName = "busybox1"
9797
kubeCtlManifestPath = "test/e2e/testing-manifests/kubectl"
98-
agnhostControllerFilename = "agnhost-master-controller.json.in"
99-
agnhostServiceFilename = "agnhost-master-service.json"
98+
agnhostControllerFilename = "agnhost-primary-controller.json.in"
99+
agnhostServiceFilename = "agnhost-primary-service.json"
100100
httpdDeployment1Filename = "httpd-deployment1.yaml.in"
101101
httpdDeployment2Filename = "httpd-deployment2.yaml.in"
102102
httpdDeployment3Filename = "httpd-deployment3.yaml.in"
@@ -344,10 +344,10 @@ var _ = SIGDescribe("Kubectl client", func() {
344344
guestbookRoot := "test/e2e/testing-manifests/guestbook"
345345
for _, gbAppFile := range []string{
346346
"agnhost-replica-service.yaml",
347-
"agnhost-master-service.yaml",
347+
"agnhost-primary-service.yaml",
348348
"frontend-service.yaml",
349349
"frontend-deployment.yaml.in",
350-
"agnhost-master-deployment.yaml.in",
350+
"agnhost-primary-deployment.yaml.in",
351351
"agnhost-replica-deployment.yaml.in",
352352
} {
353353
contents := commonutils.SubstituteImageName(string(e2etestfiles.ReadOrDie(filepath.Join(guestbookRoot, gbAppFile))))
@@ -809,13 +809,13 @@ metadata:
809809
framework.RunKubectlOrDieInput(ns, string(serviceJSON[:]), "create", "-f", "-", nsFlag)
810810

811811
ginkgo.By("getting the original port")
812-
originalNodePort := framework.RunKubectlOrDie(ns, "get", "service", "agnhost-master", nsFlag, "-o", "jsonpath={.spec.ports[0].port}")
812+
originalNodePort := framework.RunKubectlOrDie(ns, "get", "service", "agnhost-primary", nsFlag, "-o", "jsonpath={.spec.ports[0].port}")
813813

814814
ginkgo.By("applying the same configuration")
815815
framework.RunKubectlOrDieInput(ns, string(serviceJSON[:]), "apply", "-f", "-", nsFlag)
816816

817817
ginkgo.By("getting the port after applying configuration")
818-
currentNodePort := framework.RunKubectlOrDie(ns, "get", "service", "agnhost-master", nsFlag, "-o", "jsonpath={.spec.ports[0].port}")
818+
currentNodePort := framework.RunKubectlOrDie(ns, "get", "service", "agnhost-primary", nsFlag, "-o", "jsonpath={.spec.ports[0].port}")
819819

820820
ginkgo.By("checking the result")
821821
if originalNodePort != currentNodePort {
@@ -1099,22 +1099,22 @@ metadata:
10991099
framework.RunKubectlOrDieInput(ns, controllerJSON, "create", "-f", "-", nsFlag)
11001100
framework.RunKubectlOrDieInput(ns, string(serviceJSON[:]), "create", "-f", "-", nsFlag)
11011101

1102-
ginkgo.By("Waiting for Agnhost master to start.")
1102+
ginkgo.By("Waiting for Agnhost primary to start.")
11031103
waitForOrFailWithDebug(1)
11041104

11051105
// Pod
11061106
forEachPod(func(pod v1.Pod) {
11071107
output := framework.RunKubectlOrDie(ns, "describe", "pod", pod.Name, nsFlag)
11081108
requiredStrings := [][]string{
1109-
{"Name:", "agnhost-master-"},
1109+
{"Name:", "agnhost-primary-"},
11101110
{"Namespace:", ns},
11111111
{"Node:"},
11121112
{"Labels:", "app=agnhost"},
1113-
{"role=master"},
1113+
{"role=primary"},
11141114
{"Annotations:"},
11151115
{"Status:", "Running"},
11161116
{"IP:"},
1117-
{"Controlled By:", "ReplicationController/agnhost-master"},
1117+
{"Controlled By:", "ReplicationController/agnhost-primary"},
11181118
{"Image:", agnhostImage},
11191119
{"State:", "Running"},
11201120
{"QoS Class:", "BestEffort"},
@@ -1124,28 +1124,28 @@ metadata:
11241124

11251125
// Rc
11261126
requiredStrings := [][]string{
1127-
{"Name:", "agnhost-master"},
1127+
{"Name:", "agnhost-primary"},
11281128
{"Namespace:", ns},
1129-
{"Selector:", "app=agnhost,role=master"},
1129+
{"Selector:", "app=agnhost,role=primary"},
11301130
{"Labels:", "app=agnhost"},
1131-
{"role=master"},
1131+
{"role=primary"},
11321132
{"Annotations:"},
11331133
{"Replicas:", "1 current", "1 desired"},
11341134
{"Pods Status:", "1 Running", "0 Waiting", "0 Succeeded", "0 Failed"},
11351135
{"Pod Template:"},
11361136
{"Image:", agnhostImage},
11371137
{"Events:"}}
1138-
checkKubectlOutputWithRetry(ns, requiredStrings, "describe", "rc", "agnhost-master", nsFlag)
1138+
checkKubectlOutputWithRetry(ns, requiredStrings, "describe", "rc", "agnhost-primary", nsFlag)
11391139

11401140
// Service
1141-
output := framework.RunKubectlOrDie(ns, "describe", "service", "agnhost-master", nsFlag)
1141+
output := framework.RunKubectlOrDie(ns, "describe", "service", "agnhost-primary", nsFlag)
11421142
requiredStrings = [][]string{
1143-
{"Name:", "agnhost-master"},
1143+
{"Name:", "agnhost-primary"},
11441144
{"Namespace:", ns},
11451145
{"Labels:", "app=agnhost"},
1146-
{"role=master"},
1146+
{"role=primary"},
11471147
{"Annotations:"},
1148-
{"Selector:", "app=agnhost", "role=master"},
1148+
{"Selector:", "app=agnhost", "role=primary"},
11491149
{"Type:", "ClusterIP"},
11501150
{"IP:"},
11511151
{"Port:", "<unset>", "6379/TCP"},
@@ -1244,11 +1244,11 @@ metadata:
12441244
framework.RunKubectlOrDieInput(ns, controllerJSON, "create", "-f", "-", nsFlag)
12451245

12461246
// It may take a while for the pods to get registered in some cases, wait to be sure.
1247-
ginkgo.By("Waiting for Agnhost master to start.")
1247+
ginkgo.By("Waiting for Agnhost primary to start.")
12481248
waitForOrFailWithDebug(1)
12491249
forEachPod(func(pod v1.Pod) {
1250-
framework.Logf("wait on agnhost-master startup in %v ", ns)
1251-
framework.LookForStringInLog(ns, pod.Name, "agnhost-master", "Paused", framework.PodStartTimeout)
1250+
framework.Logf("wait on agnhost-primary startup in %v ", ns)
1251+
framework.LookForStringInLog(ns, pod.Name, "agnhost-primary", "Paused", framework.PodStartTimeout)
12521252
})
12531253
validateService := func(name string, servicePort int, timeout time.Duration) {
12541254
err := wait.Poll(framework.Poll, timeout, func() (bool, error) {
@@ -1299,7 +1299,7 @@ metadata:
12991299
}
13001300

13011301
ginkgo.By("exposing RC")
1302-
framework.RunKubectlOrDie(ns, "expose", "rc", "agnhost-master", "--name=rm2", "--port=1234", fmt.Sprintf("--target-port=%d", agnhostPort), nsFlag)
1302+
framework.RunKubectlOrDie(ns, "expose", "rc", "agnhost-primary", "--name=rm2", "--port=1234", fmt.Sprintf("--target-port=%d", agnhostPort), nsFlag)
13031303
e2enetwork.WaitForService(c, ns, "rm2", true, framework.Poll, framework.ServiceStartTimeout)
13041304
validateService("rm2", 1234, framework.ServiceStartTimeout)
13051305

@@ -1481,7 +1481,7 @@ metadata:
14811481
nsFlag := fmt.Sprintf("--namespace=%v", ns)
14821482
ginkgo.By("creating Agnhost RC")
14831483
framework.RunKubectlOrDieInput(ns, controllerJSON, "create", "-f", "-", nsFlag)
1484-
ginkgo.By("Waiting for Agnhost master to start.")
1484+
ginkgo.By("Waiting for Agnhost primary to start.")
14851485
waitForOrFailWithDebug(1)
14861486
ginkgo.By("patching all pods")
14871487
forEachPod(func(pod v1.Pod) {
@@ -2062,7 +2062,7 @@ func forEachReplicationController(c clientset.Interface, ns, selectorKey, select
20622062
}
20632063

20642064
func validateReplicationControllerConfiguration(rc v1.ReplicationController) {
2065-
if rc.Name == "agnhost-master" {
2065+
if rc.Name == "agnhost-primary" {
20662066
if _, ok := rc.Annotations[v1.LastAppliedConfigAnnotation]; !ok {
20672067
framework.Failf("Annotation not found in modified configuration:\n%v\n", rc)
20682068
}

test/e2e/testing-manifests/guestbook/agnhost-master-deployment.yaml.in renamed to test/e2e/testing-manifests/guestbook/agnhost-primary-deployment.yaml.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: agnhost-master
4+
name: agnhost-primary
55
spec:
66
replicas: 1
77
selector:
88
matchLabels:
99
app: agnhost
10-
role: master
10+
role: primary
1111
tier: backend
1212
template:
1313
metadata:
1414
labels:
1515
app: agnhost
16-
role: master
16+
role: primary
1717
tier: backend
1818
spec:
1919
containers:
20-
- name: master
20+
- name: primary
2121
image: {{.AgnhostImage}}
2222
args: [ "guestbook", "--http-port", "6379" ]
2323
resources:
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
apiVersion: v1
22
kind: Service
33
metadata:
4-
name: agnhost-master
4+
name: agnhost-primary
55
labels:
66
app: agnhost
7-
role: master
7+
role: primary
88
tier: backend
99
spec:
1010
ports:
1111
- port: 6379
1212
targetPort: 6379
1313
selector:
1414
app: agnhost
15-
role: master
15+
role: primary
1616
tier: backend

test/e2e/testing-manifests/guestbook/agnhost-replica-deployment.yaml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
containers:
2020
- name: replica
2121
image: {{.AgnhostImage}}
22-
args: [ "guestbook", "--replicaof", "agnhost-master", "--http-port", "6379" ]
22+
args: [ "guestbook", "--replicaof", "agnhost-primary", "--http-port", "6379" ]
2323
resources:
2424
requests:
2525
cpu: 100m

test/e2e/testing-manifests/kubectl/agnhost-master-service.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

test/e2e/testing-manifests/kubectl/agnhost-master-controller.json.in renamed to test/e2e/testing-manifests/kubectl/agnhost-primary-controller.json.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@
22
"kind":"ReplicationController",
33
"apiVersion":"v1",
44
"metadata":{
5-
"name":"agnhost-master",
5+
"name":"agnhost-primary",
66
"labels":{
77
"app":"agnhost",
8-
"role":"master"
8+
"role":"primary"
99
}
1010
},
1111
"spec":{
1212
"replicas":1,
1313
"selector":{
1414
"app":"agnhost",
15-
"role":"master"
15+
"role":"primary"
1616
},
1717
"template":{
1818
"metadata":{
1919
"labels":{
2020
"app":"agnhost",
21-
"role":"master"
21+
"role":"primary"
2222
}
2323
},
2424
"spec":{
2525
"containers":[
2626
{
27-
"name":"agnhost-master",
27+
"name":"agnhost-primary",
2828
"image": "{{.AgnhostImage}}",
2929
"ports":[
3030
{

test/e2e/testing-manifests/kubectl/agnhost-master-pod.yaml renamed to test/e2e/testing-manifests/kubectl/agnhost-primary-pod.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ kind: Pod
33
metadata:
44
labels:
55
name: agnhost
6-
role: master
7-
name: agnhost-master
6+
role: primary
7+
name: agnhost-primary
88
spec:
99
containers:
10-
- name: master
10+
- name: primary
1111
image: gcr.io/kubernetes-e2e-test-images/agnhost:1.0
1212
env:
13-
- name: MASTER
13+
- name: PRIMARY
1414
value: "true"
1515
ports:
1616
- containerPort: 6379
1717
resources:
1818
limits:
1919
cpu: "0.1"
2020
volumeMounts:
21-
- mountPath: /agnhost-master-data
21+
- mountPath: /agnhost-primary-data
2222
name: data
2323
- name: sentinel
2424
image: gcr.io/kubernetes-e2e-test-images/agnhost:1.0
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"kind": "Service",
3+
"apiVersion": "v1",
4+
"metadata": {
5+
"name": "agnhost-primary",
6+
"labels": {
7+
"app": "agnhost",
8+
"role": "primary"
9+
}
10+
},
11+
"spec": {
12+
"ports": [
13+
{
14+
"port": 6379,
15+
"targetPort": "agnhost-server"
16+
}
17+
],
18+
"selector": {
19+
"app": "agnhost",
20+
"role": "primary"
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)