Bumps up Addon Manager to v6.0-alpha.1 and updates related e2e test

This commit is contained in:
Zihong Zheng 2016-11-04 16:37:58 -07:00
parent 68f7a739c0
commit e8c66d4aee
4 changed files with 49 additions and 26 deletions

View File

@ -11,7 +11,7 @@
"containers": [ "containers": [
{ {
"name": "kube-addon-manager", "name": "kube-addon-manager",
"image": "REGISTRY/kube-addon-manager-ARCH:v5.2", "image": "REGISTRY/kube-addon-manager-ARCH:v6.0-alpha.1",
"resources": { "resources": {
"requests": { "requests": {
"cpu": "5m", "cpu": "5m",

View File

@ -11,7 +11,7 @@
"containers": [ "containers": [
{ {
"name": "kube-addon-manager", "name": "kube-addon-manager",
"image": "REGISTRY/kube-addon-manager-ARCH:v5.2", "image": "REGISTRY/kube-addon-manager-ARCH:v6.0-alpha.1",
"resources": { "resources": {
"requests": { "requests": {
"cpu": "5m", "cpu": "5m",

View File

@ -5,13 +5,12 @@ metadata:
namespace: kube-system namespace: kube-system
labels: labels:
component: kube-addon-manager component: kube-addon-manager
version: v4
spec: spec:
hostNetwork: true hostNetwork: true
containers: containers:
- name: kube-addon-manager - name: kube-addon-manager
# When updating version also bump it in cluster/images/hyperkube/static-pods/addon-manager.json # When updating version also bump it in cluster/images/hyperkube/static-pods/addon-manager.json
image: gcr.io/google-containers/kube-addon-manager:v5.2 image: gcr.io/google-containers/kube-addon-manager:v6.0-alpha.1
command: command:
- /bin/bash - /bin/bash
- -c - -c

View File

@ -134,6 +134,7 @@ spec:
k8s-app: addon-test k8s-app: addon-test
` `
// Wrong label case
var invalid_addon_controller_v1 = ` var invalid_addon_controller_v1 = `
apiVersion: v1 apiVersion: v1
kind: ReplicationController kind: ReplicationController
@ -163,6 +164,7 @@ spec:
protocol: TCP protocol: TCP
` `
// Wrong label case
var invalid_addon_service_v1 = ` var invalid_addon_service_v1 = `
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
@ -181,9 +183,31 @@ spec:
k8s-app: invalid-addon-test k8s-app: invalid-addon-test
` `
var addonTestPollInterval = 3 * time.Second // Wrong namespace case
var addonTestPollTimeout = 5 * time.Minute var invalid_addon_service_v2 = `
var defaultNsName = api.NamespaceDefault apiVersion: v1
kind: Service
metadata:
name: ivalid-addon-test-v2
namespace: %s
labels:
k8s-app: invalid-addon-test-v2
kubernetes.io/cluster-service: "true"
spec:
ports:
- port: 9377
protocol: TCP
targetPort: 9376
selector:
k8s-app: invalid-addon-test
`
const (
addonTestPollInterval = 3 * time.Second
addonTestPollTimeout = 5 * time.Minute
defaultNsName = api.NamespaceDefault
addonNsName = "kube-system"
)
type stringPair struct { type stringPair struct {
data, fileName string data, fileName string
@ -240,14 +264,16 @@ var _ = framework.KubeDescribe("Addon update", func() {
svcv1 := "addon-service-v1.yaml" svcv1 := "addon-service-v1.yaml"
svcv2 := "addon-service-v2.yaml" svcv2 := "addon-service-v2.yaml"
svcInvalid := "invalid-addon-service-v1.yaml" svcInvalid := "invalid-addon-service-v1.yaml"
svcInvalidv2 := "invalid-addon-service-v2.yaml"
var remoteFiles []stringPair = []stringPair{ var remoteFiles []stringPair = []stringPair{
{fmt.Sprintf(addon_controller_v1, defaultNsName), rcv1}, {fmt.Sprintf(addon_controller_v1, addonNsName), rcv1},
{fmt.Sprintf(addon_controller_v2, f.Namespace.Name), rcv2}, {fmt.Sprintf(addon_controller_v2, addonNsName), rcv2},
{fmt.Sprintf(addon_service_v1, f.Namespace.Name), svcv1}, {fmt.Sprintf(addon_service_v1, addonNsName), svcv1},
{fmt.Sprintf(addon_service_v2, f.Namespace.Name), svcv2}, {fmt.Sprintf(addon_service_v2, addonNsName), svcv2},
{fmt.Sprintf(invalid_addon_controller_v1, f.Namespace.Name), rcInvalid}, {fmt.Sprintf(invalid_addon_controller_v1, addonNsName), rcInvalid},
{fmt.Sprintf(invalid_addon_service_v1, defaultNsName), svcInvalid}, {fmt.Sprintf(invalid_addon_service_v1, addonNsName), svcInvalid},
{fmt.Sprintf(invalid_addon_service_v2, defaultNsName), svcInvalidv2},
} }
for _, p := range remoteFiles { for _, p := range remoteFiles {
@ -275,8 +301,8 @@ var _ = framework.KubeDescribe("Addon update", func() {
sshExecAndVerify(sshClient, fmt.Sprintf("sudo cp %s/%s %s/%s", temporaryRemotePath, rcv1, destinationDir, rcv1)) sshExecAndVerify(sshClient, fmt.Sprintf("sudo cp %s/%s %s/%s", temporaryRemotePath, rcv1, destinationDir, rcv1))
sshExecAndVerify(sshClient, fmt.Sprintf("sudo cp %s/%s %s/%s", temporaryRemotePath, svcv1, destinationDir, svcv1)) sshExecAndVerify(sshClient, fmt.Sprintf("sudo cp %s/%s %s/%s", temporaryRemotePath, svcv1, destinationDir, svcv1))
waitForServiceInAddonTest(f.ClientSet, f.Namespace.Name, "addon-test", true) waitForServiceInAddonTest(f.ClientSet, addonNsName, "addon-test", true)
waitForReplicationControllerInAddonTest(f.ClientSet, defaultNsName, "addon-test-v1", true) waitForReplicationControllerInAddonTest(f.ClientSet, addonNsName, "addon-test-v1", true)
By("update manifests") By("update manifests")
sshExecAndVerify(sshClient, fmt.Sprintf("sudo cp %s/%s %s/%s", temporaryRemotePath, rcv2, destinationDir, rcv2)) sshExecAndVerify(sshClient, fmt.Sprintf("sudo cp %s/%s %s/%s", temporaryRemotePath, rcv2, destinationDir, rcv2))
@ -289,27 +315,25 @@ var _ = framework.KubeDescribe("Addon update", func() {
* But it is ok - as long as we don't have rolling update, the result will be the same * But it is ok - as long as we don't have rolling update, the result will be the same
*/ */
waitForServiceInAddonTest(f.ClientSet, f.Namespace.Name, "addon-test-updated", true) waitForServiceInAddonTest(f.ClientSet, addonNsName, "addon-test-updated", true)
waitForReplicationControllerInAddonTest(f.ClientSet, f.Namespace.Name, "addon-test-v2", true) waitForReplicationControllerInAddonTest(f.ClientSet, addonNsName, "addon-test-v2", true)
waitForServiceInAddonTest(f.ClientSet, f.Namespace.Name, "addon-test", false) waitForServiceInAddonTest(f.ClientSet, addonNsName, "addon-test", false)
waitForReplicationControllerInAddonTest(f.ClientSet, defaultNsName, "addon-test-v1", false) waitForReplicationControllerInAddonTest(f.ClientSet, addonNsName, "addon-test-v1", false)
By("remove manifests") By("remove manifests")
sshExecAndVerify(sshClient, fmt.Sprintf("sudo rm %s/%s", destinationDir, rcv2)) sshExecAndVerify(sshClient, fmt.Sprintf("sudo rm %s/%s", destinationDir, rcv2))
sshExecAndVerify(sshClient, fmt.Sprintf("sudo rm %s/%s", destinationDir, svcv2)) sshExecAndVerify(sshClient, fmt.Sprintf("sudo rm %s/%s", destinationDir, svcv2))
waitForServiceInAddonTest(f.ClientSet, f.Namespace.Name, "addon-test-updated", false) waitForServiceInAddonTest(f.ClientSet, addonNsName, "addon-test-updated", false)
waitForReplicationControllerInAddonTest(f.ClientSet, f.Namespace.Name, "addon-test-v2", false) waitForReplicationControllerInAddonTest(f.ClientSet, addonNsName, "addon-test-v2", false)
By("verify invalid API addons weren't created") By("verify invalid API addons weren't created")
_, err = f.ClientSet.Core().ReplicationControllers(f.Namespace.Name).Get("invalid-addon-test-v1") _, err = f.ClientSet.Core().ReplicationControllers(addonNsName).Get("invalid-addon-test-v1")
Expect(err).To(HaveOccurred()) Expect(err).To(HaveOccurred())
_, err = f.ClientSet.Core().ReplicationControllers(defaultNsName).Get("invalid-addon-test-v1") _, err = f.ClientSet.Core().Services(addonNsName).Get("ivalid-addon-test")
Expect(err).To(HaveOccurred()) Expect(err).To(HaveOccurred())
_, err = f.ClientSet.Core().Services(f.Namespace.Name).Get("ivalid-addon-test") _, err = f.ClientSet.Core().Services(defaultNsName).Get("ivalid-addon-test-v2")
Expect(err).To(HaveOccurred())
_, err = f.ClientSet.Core().Services(defaultNsName).Get("ivalid-addon-test")
Expect(err).To(HaveOccurred()) Expect(err).To(HaveOccurred())
// invalid addons will be deleted by the deferred function // invalid addons will be deleted by the deferred function