Add e2e aggregator test.

What this PR does / why we need it:
This adds an e2e test for aggregation based on the sample-apiserver.
Currently is uses a sample-apiserver built as of 1.7.
This should ensure that the aggregation system works end-to-end.
It will also help detect if we break "old" extension api servers.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes
fixes #43714
Fixed bazel for the change.
Fixed # of args issue from govet.
Added code to test dynamic.Client.
This commit is contained in:
Walter Fender
2017-07-31 15:43:20 -07:00
parent 89cd583ec3
commit cb28f0f34f
5 changed files with 516 additions and 4 deletions

View File

@@ -175,8 +175,8 @@ func WaitForDeploymentRevisionAndImage(c clientset.Interface, ns, deploymentName
logf(reason)
return false, nil
}
if deployment.Spec.Template.Spec.Containers[0].Image != image {
reason = fmt.Sprintf("Deployment %q doesn't have the required image set", deployment.Name)
if !containsImage(deployment.Spec.Template.Spec.Containers, image) {
reason = fmt.Sprintf("Deployment %q doesn't have the required image %s set", deployment.Name, image)
logf(reason)
return false, nil
}
@@ -185,8 +185,8 @@ func WaitForDeploymentRevisionAndImage(c clientset.Interface, ns, deploymentName
logf(reason)
return false, nil
}
if newRS.Spec.Template.Spec.Containers[0].Image != image {
reason = fmt.Sprintf("New replica set %q doesn't have the required image set", newRS.Name)
if !containsImage(newRS.Spec.Template.Spec.Containers, image) {
reason = fmt.Sprintf("New replica set %q doesn't have the required image %s.", newRS.Name, image)
logf(reason)
return false, nil
}
@@ -204,3 +204,12 @@ func WaitForDeploymentRevisionAndImage(c clientset.Interface, ns, deploymentName
}
return nil
}
func containsImage(containers []v1.Container, imageName string) bool {
for _, container := range containers {
if container.Image == imageName {
return true
}
}
return false
}