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
This commit is contained in:
Benjamin Elder 2020-06-19 11:37:39 -07:00
parent d65a3b15bf
commit 279ce5d89e
6 changed files with 22 additions and 22 deletions

View File

@ -1355,8 +1355,8 @@
- testname: Kubectl, guestbook application - testname: Kubectl, guestbook application
codename: '[sig-cli] Kubectl client Guestbook application should create and stop codename: '[sig-cli] Kubectl client Guestbook application should create and stop
a working application [Conformance]' a working application [Conformance]'
description: Create Guestbook application that contains an agnhost master server, description: Create Guestbook application that contains an agnhost primary server,
2 agnhost replicas, frontend application, frontend service and agnhost master 2 agnhost replicas, frontend application, frontend service and agnhost primary
service and agnhost replica service. Using frontend service, the test will write 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 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 agnhost store. Application flow MUST work as expected and the data written MUST
@ -1397,11 +1397,11 @@
- testname: Kubectl, create service, replication controller - testname: Kubectl, create service, replication controller
codename: '[sig-cli] Kubectl client Kubectl expose should create services for rc [Conformance]' 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 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 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 to 6379, port that agnhost primary is listening. Using kubectl expose the agnhost
master as a service at port 2345. The service MUST be listening on port 2345 and primary as a service at port 2345. The service MUST be listening on port 2345
the target port is set to 6379, port that agnhost master is listening. and the target port is set to 6379, port that agnhost primary is listening.
release: v1.9 release: v1.9
file: test/e2e/kubectl/kubectl.go file: test/e2e/kubectl/kubectl.go
- testname: Kubectl, label update - testname: Kubectl, label update

View File

@ -358,7 +358,7 @@ var _ = SIGDescribe("Kubectl client", func() {
/* /*
Release : v1.9 Release : v1.9
Testname: Kubectl, guestbook application 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() { framework.ConformanceIt("should create and stop a working application ", func() {
defer forEachGBFile(func(contents string) { defer forEachGBFile(func(contents string) {
@ -1230,7 +1230,7 @@ metadata:
/* /*
Release : v1.9 Release : v1.9
Testname: Kubectl, create service, replication controller 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() { framework.ConformanceIt("should create services for rc ", func() {
controllerJSON := commonutils.SubstituteImageName(string(readTestFileOrDie(agnhostControllerFilename))) controllerJSON := commonutils.SubstituteImageName(string(readTestFileOrDie(agnhostControllerFilename)))

View File

@ -194,13 +194,13 @@ Usage:
Starts a HTTP server on the given `--http-port` (default: 80), serving various endpoints representing a Starts a HTTP server on the given `--http-port` (default: 80), serving various endpoints representing a
guestbook app. The endpoints and their purpose are: 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). 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, - `/get`: Returns `{"data": value}`, where the `value` is the stored value for the given `key` if non-empty,
or the entire store. or the entire store.
- `/set`: Will set the given key-value pair in its own store and propagate it to its replicas, if any. - `/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. 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`. if the given `cmd` is `get`.
Usage: Usage:
@ -211,12 +211,12 @@ sed_expr="s|{{.AgnhostImage}}|us.gcr.io/k8s-artifacts-prod/e2e-test-images/agnho
# create the services. # create the services.
kubectl create -f ${guestbook}/frontend-service.yaml 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 kubectl create -f ${guestbook}/agnhost-replica-service.yaml
# create the deployments. # create the deployments.
cat ${guestbook}/frontend-deployment.yaml.in | sed ${sed_expr} | kubectl create -f - 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 - cat ${guestbook}/agnhost-replica-deployment.yaml.in | sed ${sed_expr} | kubectl create -f -
``` ```

View File

@ -1 +1 @@
2.19 2.20

View File

@ -49,7 +49,7 @@ import (
) )
func main() { func main() {
rootCmd := &cobra.Command{Use: "app", Version: "2.19"} rootCmd := &cobra.Command{Use: "app", Version: "2.20"}
rootCmd.AddCommand(auditproxy.CmdAuditProxy) rootCmd.AddCommand(auditproxy.CmdAuditProxy)
rootCmd.AddCommand(connect.CmdConnect) rootCmd.AddCommand(connect.CmdConnect)

View File

@ -38,10 +38,10 @@ var CmdGuestbook = &cobra.Command{
Short: "Creates a HTTP server with various endpoints representing a guestbook app", 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: 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. - /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. - /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), Args: cobra.MaximumNArgs(0),
Run: main, Run: main,
} }
@ -88,7 +88,7 @@ func registerNode(registerTo, port string) {
} }
request := fmt.Sprintf("register?host=%s", host.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) _, err = net.ResolveTCPAddr("tcp", hostPort)
if err != nil { 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) 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) response, err := dialHTTP(request, hostPort)
if err != nil { 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) time.Sleep(sleep)
continue continue
} }
@ -106,7 +106,7 @@ func registerNode(registerTo, port string) {
responseJSON := make(map[string]interface{}) responseJSON := make(map[string]interface{})
err = json.Unmarshal([]byte(response), &responseJSON) err = json.Unmarshal([]byte(response), &responseJSON)
if err != nil { 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 var ok bool
@ -118,7 +118,7 @@ func registerNode(registerTo, port string) {
return return
} }
log.Fatal("Timed out while registering to master.") log.Fatal("Timed out while registering to primary.")
} }
func startHTTPServer(port string) { 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'. // 'set' or agnhost-replica if the given cmd is 'get'.
func guestbookHandler(w http.ResponseWriter, r *http.Request) { func guestbookHandler(w http.ResponseWriter, r *http.Request) {
values, err := url.Parse(r.URL.RequestURI()) values, err := url.Parse(r.URL.RequestURI())
@ -250,7 +250,7 @@ func guestbookHandler(w http.ResponseWriter, r *http.Request) {
return return
} }
host := "agnhost-master" host := "agnhost-primary"
if cmd == "get" { if cmd == "get" {
host = "agnhost-replica" host = "agnhost-replica"
} }