From 9ce9e2a7aad4054ffff492090f044ef1e8395d08 Mon Sep 17 00:00:00 2001 From: Benjamin Elder Date: Sat, 13 Jun 2020 20:46:05 -0700 Subject: [PATCH 1/3] bump agnhost usage to current version --- test/utils/image/manifest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/image/manifest.go b/test/utils/image/manifest.go index a2233fb7ffc..e659c2cfe7a 100644 --- a/test/utils/image/manifest.go +++ b/test/utils/image/manifest.go @@ -202,7 +202,7 @@ const ( func initImageConfigs() map[int]Config { configs := map[int]Config{} - configs[Agnhost] = Config{promoterE2eRegistry, "agnhost", "2.13"} + configs[Agnhost] = Config{promoterE2eRegistry, "agnhost", "2.19"} configs[AgnhostPrivate] = Config{PrivateRegistry, "agnhost", "2.6"} configs[AuthenticatedAlpine] = Config{gcAuthenticatedRegistry, "alpine", "3.7"} configs[AuthenticatedWindowsNanoServer] = Config{gcAuthenticatedRegistry, "windows-nanoserver", "v1"} From d65a3b15bf4a720b09c32e9fff06928aab43c9e5 Mon Sep 17 00:00:00 2001 From: Benjamin Elder Date: Sat, 13 Jun 2020 20:51:37 -0700 Subject: [PATCH 2/3] update agnhost guestbook usage for s/slave/replica/ --- test/conformance/testdata/conformance.yaml | 10 +++++----- test/e2e/kubectl/kubectl.go | 6 +++--- ...ment.yaml.in => agnhost-replica-deployment.yaml.in} | 10 +++++----- ...slave-service.yaml => agnhost-replica-service.yaml} | 6 +++--- test/images/agnhost/README.md | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) rename test/e2e/testing-manifests/guestbook/{agnhost-slave-deployment.yaml.in => agnhost-replica-deployment.yaml.in} (70%) rename test/e2e/testing-manifests/guestbook/{agnhost-slave-service.yaml => agnhost-replica-service.yaml} (72%) diff --git a/test/conformance/testdata/conformance.yaml b/test/conformance/testdata/conformance.yaml index 2f060dc9cd0..5b48884240c 100755 --- a/test/conformance/testdata/conformance.yaml +++ b/test/conformance/testdata/conformance.yaml @@ -1356,11 +1356,11 @@ codename: '[sig-cli] Kubectl client Guestbook application should create and stop a working application [Conformance]' 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. + 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. release: v1.9 file: test/e2e/kubectl/kubectl.go - testname: Kubectl, check version v1 diff --git a/test/e2e/kubectl/kubectl.go b/test/e2e/kubectl/kubectl.go index 4f184aeda20..303304eecdd 100644 --- a/test/e2e/kubectl/kubectl.go +++ b/test/e2e/kubectl/kubectl.go @@ -343,12 +343,12 @@ var _ = SIGDescribe("Kubectl client", func() { forEachGBFile := func(run func(s string)) { guestbookRoot := "test/e2e/testing-manifests/guestbook" for _, gbAppFile := range []string{ - "agnhost-slave-service.yaml", + "agnhost-replica-service.yaml", "agnhost-master-service.yaml", "frontend-service.yaml", "frontend-deployment.yaml.in", "agnhost-master-deployment.yaml.in", - "agnhost-slave-deployment.yaml.in", + "agnhost-replica-deployment.yaml.in", } { contents := commonutils.SubstituteImageName(string(e2etestfiles.ReadOrDie(filepath.Join(guestbookRoot, gbAppFile)))) run(contents) @@ -358,7 +358,7 @@ var _ = SIGDescribe("Kubectl client", func() { /* Release : v1.9 Testname: Kubectl, guestbook application - 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. + 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. */ framework.ConformanceIt("should create and stop a working application ", func() { defer forEachGBFile(func(contents string) { diff --git a/test/e2e/testing-manifests/guestbook/agnhost-slave-deployment.yaml.in b/test/e2e/testing-manifests/guestbook/agnhost-replica-deployment.yaml.in similarity index 70% rename from test/e2e/testing-manifests/guestbook/agnhost-slave-deployment.yaml.in rename to test/e2e/testing-manifests/guestbook/agnhost-replica-deployment.yaml.in index 88f65d3e145..34bd3978ea6 100644 --- a/test/e2e/testing-manifests/guestbook/agnhost-slave-deployment.yaml.in +++ b/test/e2e/testing-manifests/guestbook/agnhost-replica-deployment.yaml.in @@ -1,25 +1,25 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: agnhost-slave + name: agnhost-replica spec: replicas: 2 selector: matchLabels: app: agnhost - role: slave + role: replica tier: backend template: metadata: labels: app: agnhost - role: slave + role: replica tier: backend spec: containers: - - name: slave + - name: replica image: {{.AgnhostImage}} - args: [ "guestbook", "--slaveof", "agnhost-master", "--http-port", "6379" ] + args: [ "guestbook", "--replicaof", "agnhost-master", "--http-port", "6379" ] resources: requests: cpu: 100m diff --git a/test/e2e/testing-manifests/guestbook/agnhost-slave-service.yaml b/test/e2e/testing-manifests/guestbook/agnhost-replica-service.yaml similarity index 72% rename from test/e2e/testing-manifests/guestbook/agnhost-slave-service.yaml rename to test/e2e/testing-manifests/guestbook/agnhost-replica-service.yaml index 93b06287bcf..e8873f54473 100644 --- a/test/e2e/testing-manifests/guestbook/agnhost-slave-service.yaml +++ b/test/e2e/testing-manifests/guestbook/agnhost-replica-service.yaml @@ -1,15 +1,15 @@ apiVersion: v1 kind: Service metadata: - name: agnhost-slave + name: agnhost-replica labels: app: agnhost - role: slave + role: replica tier: backend spec: ports: - port: 6379 selector: app: agnhost - role: slave + role: replica tier: backend diff --git a/test/images/agnhost/README.md b/test/images/agnhost/README.md index e006e4c1ab7..6d4b6918a33 100644 --- a/test/images/agnhost/README.md +++ b/test/images/agnhost/README.md @@ -212,12 +212,12 @@ sed_expr="s|{{.AgnhostImage}}|us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnho # create the services. kubectl create -f ${guestbook}/frontend-service.yaml kubectl create -f ${guestbook}/agnhost-master-service.yaml -kubectl create -f ${guestbook}/agnhost-slave-service.yaml +kubectl create -f ${guestbook}/agnhost-replica-service.yaml # create the deployments. cat ${guestbook}/frontend-deployment.yaml.in | sed ${sed_expr} | kubectl create -f - cat ${guestbook}/agnhost-master-deployment.yaml.in | sed ${sed_expr} | kubectl create -f - -cat ${guestbook}/agnhost-slave-deployment.yaml.in | sed ${sed_expr} | kubectl create -f - +cat ${guestbook}/agnhost-replica-deployment.yaml.in | sed ${sed_expr} | kubectl create -f - ``` From 279ce5d89e97a4bed8172c9e011abe8b95c92ad2 Mon Sep 17 00:00:00 2001 From: Benjamin Elder Date: Fri, 19 Jun 2020 11:37:39 -0700 Subject: [PATCH 3/3] 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 --- test/conformance/testdata/conformance.yaml | 12 ++++++------ test/e2e/kubectl/kubectl.go | 4 ++-- test/images/agnhost/README.md | 8 ++++---- test/images/agnhost/VERSION | 2 +- test/images/agnhost/agnhost.go | 2 +- test/images/agnhost/guestbook/guestbook.go | 16 ++++++++-------- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/test/conformance/testdata/conformance.yaml b/test/conformance/testdata/conformance.yaml index 5b48884240c..5dc07c956af 100755 --- a/test/conformance/testdata/conformance.yaml +++ b/test/conformance/testdata/conformance.yaml @@ -1355,8 +1355,8 @@ - testname: Kubectl, guestbook application codename: '[sig-cli] Kubectl client Guestbook application should create and stop a working application [Conformance]' - description: Create Guestbook application that contains an agnhost master server, - 2 agnhost replicas, frontend application, frontend service and agnhost master + 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 @@ -1397,11 +1397,11 @@ - testname: Kubectl, create service, replication controller codename: '[sig-cli] Kubectl client Kubectl expose should create services for rc [Conformance]' description: Create a Pod running agnhost listening to port 6379. Using kubectl - expose the agnhost master replication controllers at port 1234. Validate that + 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 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. + 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. release: v1.9 file: test/e2e/kubectl/kubectl.go - testname: Kubectl, label update diff --git a/test/e2e/kubectl/kubectl.go b/test/e2e/kubectl/kubectl.go index 303304eecdd..3fa8e64f1cd 100644 --- a/test/e2e/kubectl/kubectl.go +++ b/test/e2e/kubectl/kubectl.go @@ -358,7 +358,7 @@ var _ = SIGDescribe("Kubectl client", func() { /* Release : v1.9 Testname: Kubectl, guestbook application - 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. + 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. */ framework.ConformanceIt("should create and stop a working application ", func() { defer forEachGBFile(func(contents string) { @@ -1230,7 +1230,7 @@ metadata: /* Release : v1.9 Testname: Kubectl, create service, replication controller - 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. + 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. */ framework.ConformanceIt("should create services for rc ", func() { controllerJSON := commonutils.SubstituteImageName(string(readTestFileOrDie(agnhostControllerFilename))) diff --git a/test/images/agnhost/README.md b/test/images/agnhost/README.md index 6d4b6918a33..ba30f1b4681 100644 --- a/test/images/agnhost/README.md +++ b/test/images/agnhost/README.md @@ -194,13 +194,13 @@ Usage: Starts a HTTP server on the given `--http-port` (default: 80), serving various endpoints representing a guestbook app. The endpoints and their purpose are: -- `/register`: A guestbook replica will subscribe to a master, to its given `--replicaof` endpoint. The master +- `/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` (default: 6379). - `/get`: Returns `{"data": value}`, where the `value` is the stored value for the given `key` if non-empty, or the entire store. - `/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. -- `/guestbook`: Will proxy the request to `agnhost-master` if the given `cmd` is `set`, or `agnhost-replica` +- `/guestbook`: Will proxy the request to `agnhost-primary` if the given `cmd` is `set`, or `agnhost-replica` if the given `cmd` is `get`. Usage: @@ -211,12 +211,12 @@ sed_expr="s|{{.AgnhostImage}}|us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnho # create the services. kubectl create -f ${guestbook}/frontend-service.yaml -kubectl create -f ${guestbook}/agnhost-master-service.yaml +kubectl create -f ${guestbook}/agnhost-primary-service.yaml kubectl create -f ${guestbook}/agnhost-replica-service.yaml # create the deployments. cat ${guestbook}/frontend-deployment.yaml.in | sed ${sed_expr} | kubectl create -f - -cat ${guestbook}/agnhost-master-deployment.yaml.in | sed ${sed_expr} | kubectl create -f - +cat ${guestbook}/agnhost-primary-deployment.yaml.in | sed ${sed_expr} | kubectl create -f - cat ${guestbook}/agnhost-replica-deployment.yaml.in | sed ${sed_expr} | kubectl create -f - ``` diff --git a/test/images/agnhost/VERSION b/test/images/agnhost/VERSION index 15a3e92c6a7..a4b5a6f4a49 100644 --- a/test/images/agnhost/VERSION +++ b/test/images/agnhost/VERSION @@ -1 +1 @@ -2.19 +2.20 diff --git a/test/images/agnhost/agnhost.go b/test/images/agnhost/agnhost.go index 59b55d71d04..df20445105f 100644 --- a/test/images/agnhost/agnhost.go +++ b/test/images/agnhost/agnhost.go @@ -49,7 +49,7 @@ import ( ) func main() { - rootCmd := &cobra.Command{Use: "app", Version: "2.19"} + rootCmd := &cobra.Command{Use: "app", Version: "2.20"} rootCmd.AddCommand(auditproxy.CmdAuditProxy) rootCmd.AddCommand(connect.CmdConnect) diff --git a/test/images/agnhost/guestbook/guestbook.go b/test/images/agnhost/guestbook/guestbook.go index f3abb57fc24..f4e0df05aee 100644 --- a/test/images/agnhost/guestbook/guestbook.go +++ b/test/images/agnhost/guestbook/guestbook.go @@ -38,10 +38,10 @@ var CmdGuestbook = &cobra.Command{ Short: "Creates a HTTP server with various endpoints representing a guestbook app", 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: -- /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. +- /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. - /get: Returns '{"data": value}', where the value is the stored value for the given key if non-empty, or the entire store. - /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. -- /guestbook: Will proxy the request to agnhost-master if the given cmd is 'set', or agnhost-replica if the given cmd is 'get'.`, +- /guestbook: Will proxy the request to agnhost-primary if the given cmd is 'set', or agnhost-replica if the given cmd is 'get'.`, Args: cobra.MaximumNArgs(0), Run: main, } @@ -88,7 +88,7 @@ func registerNode(registerTo, port string) { } request := fmt.Sprintf("register?host=%s", host.String()) - log.Printf("Registering to master: %s/%s", hostPort, request) + log.Printf("Registering to primary: %s/%s", hostPort, request) _, err = net.ResolveTCPAddr("tcp", hostPort) if err != nil { log.Printf("unable to resolve %s, --replicaof param and/or --backend-port param are invalid: %v. Retrying in %s.", hostPort, err, sleep) @@ -98,7 +98,7 @@ func registerNode(registerTo, port string) { response, err := dialHTTP(request, hostPort) if err != nil { - log.Printf("encountered error while registering to master: %v. Retrying in %s.", err, sleep) + log.Printf("encountered error while registering to primary: %v. Retrying in %s.", err, sleep) time.Sleep(sleep) continue } @@ -106,7 +106,7 @@ func registerNode(registerTo, port string) { responseJSON := make(map[string]interface{}) err = json.Unmarshal([]byte(response), &responseJSON) if err != nil { - log.Fatalf("Error while unmarshaling master's response: %v", err) + log.Fatalf("Error while unmarshaling primary's response: %v", err) } var ok bool @@ -118,7 +118,7 @@ func registerNode(registerTo, port string) { return } - log.Fatal("Timed out while registering to master.") + log.Fatal("Timed out while registering to primary.") } func startHTTPServer(port string) { @@ -226,7 +226,7 @@ func setHandler(w http.ResponseWriter, r *http.Request) { } } -// guestbookHandler will proxy the request to agnhost-master if the given cmd is +// guestbookHandler will proxy the request to agnhost-primary if the given cmd is // 'set' or agnhost-replica if the given cmd is 'get'. func guestbookHandler(w http.ResponseWriter, r *http.Request) { values, err := url.Parse(r.URL.RequestURI()) @@ -250,7 +250,7 @@ func guestbookHandler(w http.ResponseWriter, r *http.Request) { return } - host := "agnhost-master" + host := "agnhost-primary" if cmd == "get" { host = "agnhost-replica" }