Skip to content

Commit 0a91893

Browse files
authored
Merge pull request kubernetes#92119 from BenTheElder/agnhost-sync
agnhost sync
2 parents 4043d4c + 279ce5d commit 0a91893

File tree

9 files changed

+39
-39
lines changed

9 files changed

+39
-39
lines changed

test/conformance/testdata/conformance.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,12 +1355,12 @@
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 slaves, frontend application, frontend service and agnhost master service
1360-
and agnhost slave service. Using frontend service, the test will write an entry
1361-
into the guestbook application which will store the entry into the backend agnhost
1362-
store. Application flow MUST work as expected and the data written MUST be available
1363-
to read.
1358+
description: Create Guestbook application that contains an agnhost primary server,
1359+
2 agnhost replicas, frontend application, frontend service and agnhost primary
1360+
service and agnhost replica service. Using frontend service, the test will write
1361+
an entry into the guestbook application which will store the entry into the backend
1362+
agnhost store. Application flow MUST work as expected and the data written MUST
1363+
be available to read.
13641364
release: v1.9
13651365
file: test/e2e/kubectl/kubectl.go
13661366
- testname: Kubectl, check version v1
@@ -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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,12 @@ var _ = SIGDescribe("Kubectl client", func() {
343343
forEachGBFile := func(run func(s string)) {
344344
guestbookRoot := "test/e2e/testing-manifests/guestbook"
345345
for _, gbAppFile := range []string{
346-
"agnhost-slave-service.yaml",
346+
"agnhost-replica-service.yaml",
347347
"agnhost-master-service.yaml",
348348
"frontend-service.yaml",
349349
"frontend-deployment.yaml.in",
350350
"agnhost-master-deployment.yaml.in",
351-
"agnhost-slave-deployment.yaml.in",
351+
"agnhost-replica-deployment.yaml.in",
352352
} {
353353
contents := commonutils.SubstituteImageName(string(e2etestfiles.ReadOrDie(filepath.Join(guestbookRoot, gbAppFile))))
354354
run(contents)
@@ -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 slaves, frontend application, frontend service and agnhost master service and agnhost slave 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/e2e/testing-manifests/guestbook/agnhost-slave-deployment.yaml.in renamed to test/e2e/testing-manifests/guestbook/agnhost-replica-deployment.yaml.in

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

test/images/agnhost/README.md

Lines changed: 6 additions & 6 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,13 +211,13 @@ 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
215-
kubectl create -f ${guestbook}/agnhost-slave-service.yaml
214+
kubectl create -f ${guestbook}/agnhost-primary-service.yaml
215+
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 -
220-
cat ${guestbook}/agnhost-slave-deployment.yaml.in | sed ${sed_expr} | kubectl create -f -
219+
cat ${guestbook}/agnhost-primary-deployment.yaml.in | sed ${sed_expr} | kubectl create -f -
220+
cat ${guestbook}/agnhost-replica-deployment.yaml.in | sed ${sed_expr} | kubectl create -f -
221221
```
222222

223223

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
}

test/utils/image/manifest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ const (
202202

203203
func initImageConfigs() map[int]Config {
204204
configs := map[int]Config{}
205-
configs[Agnhost] = Config{promoterE2eRegistry, "agnhost", "2.13"}
205+
configs[Agnhost] = Config{promoterE2eRegistry, "agnhost", "2.19"}
206206
configs[AgnhostPrivate] = Config{PrivateRegistry, "agnhost", "2.6"}
207207
configs[AuthenticatedAlpine] = Config{gcAuthenticatedRegistry, "alpine", "3.7"}
208208
configs[AuthenticatedWindowsNanoServer] = Config{gcAuthenticatedRegistry, "windows-nanoserver", "v1"}

0 commit comments

Comments
 (0)