Skip to content

Commit

Permalink
feat(kuma-cp) add tests for overriding admin server config
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubdyszkiewicz committed Dec 11, 2019
1 parent 94335b2 commit b93b9d0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/admin-server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ func pingWs() *restful.WebService {
Route(ws.GET("/ping").To(func(request *restful.Request, response *restful.Response) {
_, _ = response.Write([]byte(`pong`))
}),
)
)
return ws
}
29 changes: 29 additions & 0 deletions pkg/config/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ var _ = Describe("Config loader", func() {
Expect(cfg.DataplaneTokenServer.Public.TlsCertFile).To(Equal("/tmp/cert"))
Expect(cfg.DataplaneTokenServer.Public.ClientCertsDir).To(Equal("/tmp/certs"))

Expect(cfg.AdminServer.DataplaneTokenWs.Enabled).To(BeTrue())
Expect(cfg.AdminServer.Local.Port).To(Equal(uint32(1111)))
Expect(cfg.AdminServer.Public.Enabled).To(BeTrue())
Expect(cfg.AdminServer.Public.Port).To(Equal(uint32(2222)))
Expect(cfg.AdminServer.Public.Interface).To(Equal("192.168.0.1"))
Expect(cfg.AdminServer.Public.TlsKeyFile).To(Equal("/tmp/key"))
Expect(cfg.AdminServer.Public.TlsCertFile).To(Equal("/tmp/cert"))
Expect(cfg.AdminServer.Public.ClientCertsDir).To(Equal("/tmp/certs"))

Expect(cfg.Runtime.Kubernetes.AdmissionServer.Address).To(Equal("127.0.0.2"))
Expect(cfg.Runtime.Kubernetes.AdmissionServer.Port).To(Equal(uint32(9443)))
Expect(cfg.Runtime.Kubernetes.AdmissionServer.CertDir).To(Equal("/var/run/secrets/kuma.io/kuma-admission-server/tls-cert"))
Expand Down Expand Up @@ -140,6 +149,18 @@ dataplaneTokenServer:
tlsCertFile: /tmp/cert
tlsKeyFile: /tmp/key
clientCertsDir: /tmp/certs
adminServer:
local:
port: 1111
public:
enabled: true
interface: 192.168.0.1
port: 2222
tlsCertFile: /tmp/cert
tlsKeyFile: /tmp/key
clientCertsDir: /tmp/certs
dataplaneTokenWs:
enabled: true
runtime:
kubernetes:
admissionServer:
Expand Down Expand Up @@ -180,6 +201,14 @@ guiServer:
"KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_TLS_KEY_FILE": "/tmp/key",
"KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_TLS_CERT_FILE": "/tmp/cert",
"KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_CLIENT_CERTS_DIR": "/tmp/certs",
"KUMA_ADMIN_SERVER_DATAPLANE_TOKEN_WS_ENABLED": "true",
"KUMA_ADMIN_SERVER_LOCAL_PORT": "1111",
"KUMA_ADMIN_SERVER_PUBLIC_ENABLED": "true",
"KUMA_ADMIN_SERVER_PUBLIC_INTERFACE": "192.168.0.1",
"KUMA_ADMIN_SERVER_PUBLIC_PORT": "2222",
"KUMA_ADMIN_SERVER_PUBLIC_TLS_KEY_FILE": "/tmp/key",
"KUMA_ADMIN_SERVER_PUBLIC_TLS_CERT_FILE": "/tmp/cert",
"KUMA_ADMIN_SERVER_PUBLIC_CLIENT_CERTS_DIR": "/tmp/certs",
"KUMA_REPORTS_ENABLED": "false",
"KUMA_KUBERNETES_ADMISSION_SERVER_ADDRESS": "127.0.0.2",
"KUMA_KUBERNETES_ADMISSION_SERVER_PORT": "9443",
Expand Down

0 comments on commit b93b9d0

Please sign in to comment.