зеркало из https://github.com/Azure/acs-engine.git
re-use ILB test deployment (#4147)
This commit is contained in:
Родитель
62d0d298f9
Коммит
a6916f6f9a
|
@ -81,6 +81,16 @@ func CreateLinuxDeploy(image, name, namespace, miscOpts string) (*Deployment, er
|
|||
return d, nil
|
||||
}
|
||||
|
||||
// CreateLinuxDeployIfNotExist first checks if a deployment already exists, and return it if so
|
||||
// If not, we call CreateLinuxDeploy
|
||||
func CreateLinuxDeployIfNotExist(image, name, namespace, miscOpts string) (*Deployment, error) {
|
||||
deployment, err := Get(name, namespace)
|
||||
if err != nil {
|
||||
return CreateLinuxDeploy(image, name, namespace, miscOpts)
|
||||
}
|
||||
return deployment, nil
|
||||
}
|
||||
|
||||
// RunLinuxDeploy will create a deployment that runs a bash command in a pod
|
||||
// --overrides=' "spec":{"template":{"spec": {"nodeSelector":{"beta.kubernetes.io/os":"linux"}}}}}'
|
||||
func RunLinuxDeploy(image, name, namespace, command string, replicas int) (*Deployment, error) {
|
||||
|
|
|
@ -729,8 +729,8 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
|
|||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
By("Ensuring the ILB IP is assigned to the service")
|
||||
curlDeploymentName := fmt.Sprintf("long-running-pod-%s-%v", cfg.Name, r.Intn(99999))
|
||||
curlDeploy, err := deployment.CreateLinuxDeploy("library/nginx:latest", curlDeploymentName, "default", "")
|
||||
curlDeploymentName := fmt.Sprintf("ilb-test-deployment-%s", cfg.Name)
|
||||
curlDeploy, err := deployment.CreateLinuxDeployIfNotExist("library/nginx:latest", curlDeploymentName, "default", "")
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
running, err := pod.WaitOnReady(curlDeploymentName, "default", 3, 30*time.Second, cfg.Timeout)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
|
Загрузка…
Ссылка в новой задаче