Skip to content

Commit 279ce5d

Browse files
committed
s/master/primary in agnhost guestbook test references & agnhost code
to do in follow-up: update the agnhost deployments and references to those when the new image is pushed
1 parent d65a3b1 commit 279ce5d

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

test/conformance/testdata/conformance.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,8 +1355,8 @@
13551355
- testname: Kubectl, guestbook application
13561356
codename: '[sig-cli] Kubectl client Guestbook application should create and stop
13571357
a working application [Conformance]'
1358-
description: Create Guestbook application that contains an agnhost master server,
1359-
2 agnhost replicas, frontend application, frontend service and agnhost master
1358+
description: Create Guestbook application that contains an agnhost primary server,
1359+
2 agnhost replicas, frontend application, frontend service and agnhost primary
13601360
service and agnhost replica service. Using frontend service, the test will write
13611361
an entry into the guestbook application which will store the entry into the backend
13621362
agnhost store. Application flow MUST work as expected and the data written MUST
@@ -1397,11 +1397,11 @@
13971397
- testname: Kubectl, create service, replication controller
13981398
codename: '[sig-cli] Kubectl client Kubectl expose should create services for rc [Conformance]'
13991399
description: Create a Pod running agnhost listening to port 6379. Using kubectl
1400-
expose the agnhost master replication controllers at port 1234. Validate that
1400+
expose the agnhost primary replication controllers at port 1234. Validate that
14011401
the replication controller is listening on port 1234 and the target port is set
1402-
to 6379, port that agnhost master is listening. Using kubectl expose the agnhost
1403-
master as a service at port 2345. The service MUST be listening on port 2345 and
1404-
the target port is set to 6379, port that agnhost master is listening.
1402+
to 6379, port that agnhost primary is listening. Using kubectl expose the agnhost
1403+
primary as a service at port 2345. The service MUST be listening on port 2345
1404+
and the target port is set to 6379, port that agnhost primary is listening.
14051405
release: v1.9
14061406
file: test/e2e/kubectl/kubectl.go
14071407
- testname: Kubectl, label update

test/e2e/kubectl/kubectl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ var _ = SIGDescribe("Kubectl client", func() {
358358
/*
359359
Release : v1.9
360360
Testname: Kubectl, guestbook application
361-
Description: Create Guestbook application that contains an agnhost master server, 2 agnhost replicas, frontend application, frontend service and agnhost master service and agnhost replica service. Using frontend service, the test will write an entry into the guestbook application which will store the entry into the backend agnhost store. Application flow MUST work as expected and the data written MUST be available to read.
361+
Description: Create Guestbook application that contains an agnhost primary server, 2 agnhost replicas, frontend application, frontend service and agnhost primary service and agnhost replica service. Using frontend service, the test will write an entry into the guestbook application which will store the entry into the backend agnhost store. Application flow MUST work as expected and the data written MUST be available to read.
362362
*/
363363
framework.ConformanceIt("should create and stop a working application ", func() {
364364
defer forEachGBFile(func(contents string) {
@@ -1230,7 +1230,7 @@ metadata:
12301230
/*
12311231
Release : v1.9
12321232
Testname: Kubectl, create service, replication controller
1233-
Description: Create a Pod running agnhost listening to port 6379. Using kubectl expose the agnhost master replication controllers at port 1234. Validate that the replication controller is listening on port 1234 and the target port is set to 6379, port that agnhost master is listening. Using kubectl expose the agnhost master as a service at port 2345. The service MUST be listening on port 2345 and the target port is set to 6379, port that agnhost master is listening.
1233+
Description: Create a Pod running agnhost listening to port 6379. Using kubectl expose the agnhost primary replication controllers at port 1234. Validate that the replication controller is listening on port 1234 and the target port is set to 6379, port that agnhost primary is listening. Using kubectl expose the agnhost primary as a service at port 2345. The service MUST be listening on port 2345 and the target port is set to 6379, port that agnhost primary is listening.
12341234
*/
12351235
framework.ConformanceIt("should create services for rc ", func() {
12361236
controllerJSON := commonutils.SubstituteImageName(string(readTestFileOrDie(agnhostControllerFilename)))

test/images/agnhost/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,13 @@ Usage:
194194
Starts a HTTP server on the given `--http-port` (default: 80), serving various endpoints representing a
195195
guestbook app. The endpoints and their purpose are:
196196

197-
- `/register`: A guestbook replica will subscribe to a master, to its given `--replicaof` endpoint. The master
197+
- `/register`: A guestbook replica will subscribe to a primary, to its given `--replicaof` endpoint. The primary
198198
will then push any updates it receives to its registered replicas through the `--backend-port` (default: 6379).
199199
- `/get`: Returns `{"data": value}`, where the `value` is the stored value for the given `key` if non-empty,
200200
or the entire store.
201201
- `/set`: Will set the given key-value pair in its own store and propagate it to its replicas, if any.
202202
Will return `{"data": "Updated"}` to the caller on success.
203-
- `/guestbook`: Will proxy the request to `agnhost-master` if the given `cmd` is `set`, or `agnhost-replica`
203+
- `/guestbook`: Will proxy the request to `agnhost-primary` if the given `cmd` is `set`, or `agnhost-replica`
204204
if the given `cmd` is `get`.
205205

206206
Usage:
@@ -211,12 +211,12 @@ sed_expr="s|{{.AgnhostImage}}|us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnho
211211

212212
# create the services.
213213
kubectl create -f ${guestbook}/frontend-service.yaml
214-
kubectl create -f ${guestbook}/agnhost-master-service.yaml
214+
kubectl create -f ${guestbook}/agnhost-primary-service.yaml
215215
kubectl create -f ${guestbook}/agnhost-replica-service.yaml
216216

217217
# create the deployments.
218218
cat ${guestbook}/frontend-deployment.yaml.in | sed ${sed_expr} | kubectl create -f -
219-
cat ${guestbook}/agnhost-master-deployment.yaml.in | sed ${sed_expr} | kubectl create -f -
219+
cat ${guestbook}/agnhost-primary-deployment.yaml.in | sed ${sed_expr} | kubectl create -f -
220220
cat ${guestbook}/agnhost-replica-deployment.yaml.in | sed ${sed_expr} | kubectl create -f -
221221
```
222222

test/images/agnhost/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.19
1+
2.20

test/images/agnhost/agnhost.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import (
4949
)
5050

5151
func main() {
52-
rootCmd := &cobra.Command{Use: "app", Version: "2.19"}
52+
rootCmd := &cobra.Command{Use: "app", Version: "2.20"}
5353

5454
rootCmd.AddCommand(auditproxy.CmdAuditProxy)
5555
rootCmd.AddCommand(connect.CmdConnect)

test/images/agnhost/guestbook/guestbook.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ var CmdGuestbook = &cobra.Command{
3838
Short: "Creates a HTTP server with various endpoints representing a guestbook app",
3939
Long: `Starts a HTTP server on the given --http-port (default: 80), serving various endpoints representing a guestbook app. The endpoints and their purpose are:
4040
41-
- /register: A guestbook replica will subscribe to a master, to its given --replicaof endpoint. The master will then push any updates it receives to its registered replicas through the --backend-port.
41+
- /register: A guestbook replica will subscribe to a primary, to its given --replicaof endpoint. The primary will then push any updates it receives to its registered replicas through the --backend-port.
4242
- /get: Returns '{"data": value}', where the value is the stored value for the given key if non-empty, or the entire store.
4343
- /set: Will set the given key-value pair in its own store and propagate it to its replicas, if any. Will return '{"data": "Updated"}' to the caller on success.
44-
- /guestbook: Will proxy the request to agnhost-master if the given cmd is 'set', or agnhost-replica if the given cmd is 'get'.`,
44+
- /guestbook: Will proxy the request to agnhost-primary if the given cmd is 'set', or agnhost-replica if the given cmd is 'get'.`,
4545
Args: cobra.MaximumNArgs(0),
4646
Run: main,
4747
}
@@ -88,7 +88,7 @@ func registerNode(registerTo, port string) {
8888
}
8989

9090
request := fmt.Sprintf("register?host=%s", host.String())
91-
log.Printf("Registering to master: %s/%s", hostPort, request)
91+
log.Printf("Registering to primary: %s/%s", hostPort, request)
9292
_, err = net.ResolveTCPAddr("tcp", hostPort)
9393
if err != nil {
9494
log.Printf("unable to resolve %s, --replicaof param and/or --backend-port param are invalid: %v. Retrying in %s.", hostPort, err, sleep)
@@ -98,15 +98,15 @@ func registerNode(registerTo, port string) {
9898

9999
response, err := dialHTTP(request, hostPort)
100100
if err != nil {
101-
log.Printf("encountered error while registering to master: %v. Retrying in %s.", err, sleep)
101+
log.Printf("encountered error while registering to primary: %v. Retrying in %s.", err, sleep)
102102
time.Sleep(sleep)
103103
continue
104104
}
105105

106106
responseJSON := make(map[string]interface{})
107107
err = json.Unmarshal([]byte(response), &responseJSON)
108108
if err != nil {
109-
log.Fatalf("Error while unmarshaling master's response: %v", err)
109+
log.Fatalf("Error while unmarshaling primary's response: %v", err)
110110
}
111111

112112
var ok bool
@@ -118,7 +118,7 @@ func registerNode(registerTo, port string) {
118118
return
119119
}
120120

121-
log.Fatal("Timed out while registering to master.")
121+
log.Fatal("Timed out while registering to primary.")
122122
}
123123

124124
func startHTTPServer(port string) {
@@ -226,7 +226,7 @@ func setHandler(w http.ResponseWriter, r *http.Request) {
226226
}
227227
}
228228

229-
// guestbookHandler will proxy the request to agnhost-master if the given cmd is
229+
// guestbookHandler will proxy the request to agnhost-primary if the given cmd is
230230
// 'set' or agnhost-replica if the given cmd is 'get'.
231231
func guestbookHandler(w http.ResponseWriter, r *http.Request) {
232232
values, err := url.Parse(r.URL.RequestURI())
@@ -250,7 +250,7 @@ func guestbookHandler(w http.ResponseWriter, r *http.Request) {
250250
return
251251
}
252252

253-
host := "agnhost-master"
253+
host := "agnhost-primary"
254254
if cmd == "get" {
255255
host = "agnhost-replica"
256256
}

0 commit comments

Comments
 (0)