Reduce wait times and fix indentations

This commit is contained in:
waseem
2019-07-03 22:17:36 +02:00
parent 362ea70e26
commit e06394c940
+21 -21
View File
@@ -185,8 +185,8 @@ func getPodTemplateSpecWithEnvVarSources(name string) v1.PodTemplateSpec {
Spec: v1.PodSpec{
Containers: []v1.Container{
{
Image: "tutum/hello-world",
Name: name,
Image: "tutum/hello-world",
Name: name,
EnvFrom: getEnvVarSources(name),
},
},
@@ -226,8 +226,8 @@ func getPodTemplateSpecWithInitContainer(name string) v1.PodTemplateSpec {
Spec: v1.PodSpec{
InitContainers: []v1.Container{
{
Image: "busybox",
Name: "busyBox",
Image: "busybox",
Name: "busyBox",
VolumeMounts: getVolumeMounts(name),
},
},
@@ -256,8 +256,8 @@ func getPodTemplateSpecWithInitContainerAndEnv(name string) v1.PodTemplateSpec {
Spec: v1.PodSpec{
InitContainers: []v1.Container{
{
Image: "busybox",
Name: "busyBox",
Image: "busybox",
Name: "busyBox",
EnvFrom: getEnvVarSources(name),
},
},
@@ -485,7 +485,7 @@ func CreateConfigMap(client kubernetes.Interface, namespace string, configmapNam
logrus.Infof("Creating configmap")
configmapClient := client.CoreV1().ConfigMaps(namespace)
_, err := configmapClient.Create(GetConfigmap(namespace, configmapName, data))
time.Sleep(10 * time.Second)
time.Sleep(3 * time.Second)
return configmapClient, err
}
@@ -494,7 +494,7 @@ func CreateSecret(client kubernetes.Interface, namespace string, secretName stri
logrus.Infof("Creating secret")
secretClient := client.CoreV1().Secrets(namespace)
_, err := secretClient.Create(GetSecret(namespace, secretName, data))
time.Sleep(10 * time.Second)
time.Sleep(3 * time.Second)
return secretClient, err
}
@@ -509,7 +509,7 @@ func CreateDeployment(client kubernetes.Interface, deploymentName string, namesp
deploymentObj = GetDeploymentWithEnvVars(namespace, deploymentName)
}
deployment, err := deploymentClient.Create(deploymentObj)
time.Sleep(10 * time.Second)
time.Sleep(3 * time.Second)
return deployment, err
}
@@ -519,12 +519,12 @@ func CreateDeploymentWithInitContainer(client kubernetes.Interface, deploymentNa
deploymentClient := client.ExtensionsV1beta1().Deployments(namespace)
var deploymentObj *v1beta1.Deployment
if volumeMount {
deploymentObj = GetDeploymentWithInitContainer(namespace, deploymentName)
deploymentObj = GetDeploymentWithInitContainer(namespace, deploymentName)
} else {
deploymentObj = GetDeploymentWithInitContainerAndEnv(namespace, deploymentName)
}
deployment, err := deploymentClient.Create(deploymentObj)
time.Sleep(10 * time.Second)
time.Sleep(3 * time.Second)
return deployment, err
}
@@ -534,7 +534,7 @@ func CreateDeploymentWithEnvVarSource(client kubernetes.Interface, deploymentNam
deploymentClient := client.ExtensionsV1beta1().Deployments(namespace)
deploymentObj := GetDeploymentWithEnvVarSources(namespace, deploymentName)
deployment, err := deploymentClient.Create(deploymentObj)
time.Sleep(10 * time.Second)
time.Sleep(3 * time.Second)
return deployment, err
}
@@ -549,7 +549,7 @@ func CreateDaemonSet(client kubernetes.Interface, daemonsetName string, namespac
daemonsetObj = GetDaemonSetWithEnvVars(namespace, daemonsetName)
}
daemonset, err := daemonsetClient.Create(daemonsetObj)
time.Sleep(10 * time.Second)
time.Sleep(3 * time.Second)
return daemonset, err
}
@@ -564,7 +564,7 @@ func CreateStatefulSet(client kubernetes.Interface, statefulsetName string, name
statefulsetObj = GetStatefulSetWithEnvVar(namespace, statefulsetName)
}
statefulset, err := statefulsetClient.Create(statefulsetObj)
time.Sleep(10 * time.Second)
time.Sleep(3 * time.Second)
return statefulset, err
}
@@ -572,7 +572,7 @@ func CreateStatefulSet(client kubernetes.Interface, statefulsetName string, name
func DeleteDeployment(client kubernetes.Interface, namespace string, deploymentName string) error {
logrus.Infof("Deleting Deployment")
deploymentError := client.ExtensionsV1beta1().Deployments(namespace).Delete(deploymentName, &metav1.DeleteOptions{})
time.Sleep(10 * time.Second)
time.Sleep(3 * time.Second)
return deploymentError
}
@@ -580,7 +580,7 @@ func DeleteDeployment(client kubernetes.Interface, namespace string, deploymentN
func DeleteDaemonSet(client kubernetes.Interface, namespace string, daemonsetName string) error {
logrus.Infof("Deleting DaemonSet %s", daemonsetName)
daemonsetError := client.ExtensionsV1beta1().DaemonSets(namespace).Delete(daemonsetName, &metav1.DeleteOptions{})
time.Sleep(10 * time.Second)
time.Sleep(3 * time.Second)
return daemonsetError
}
@@ -588,7 +588,7 @@ func DeleteDaemonSet(client kubernetes.Interface, namespace string, daemonsetNam
func DeleteStatefulSet(client kubernetes.Interface, namespace string, statefulsetName string) error {
logrus.Infof("Deleting StatefulSet %s", statefulsetName)
statefulsetError := client.AppsV1beta1().StatefulSets(namespace).Delete(statefulsetName, &metav1.DeleteOptions{})
time.Sleep(10 * time.Second)
time.Sleep(3 * time.Second)
return statefulsetError
}
@@ -602,7 +602,7 @@ func UpdateConfigMap(configmapClient core_v1.ConfigMapInterface, namespace strin
configmap = GetConfigmap(namespace, configmapName, data)
}
_, updateErr := configmapClient.Update(configmap)
time.Sleep(10 * time.Second)
time.Sleep(3 * time.Second)
return updateErr
}
@@ -616,7 +616,7 @@ func UpdateSecret(secretClient core_v1.SecretInterface, namespace string, secret
secret = GetSecret(namespace, secretName, data)
}
_, updateErr := secretClient.Update(secret)
time.Sleep(10 * time.Second)
time.Sleep(3 * time.Second)
return updateErr
}
@@ -624,7 +624,7 @@ func UpdateSecret(secretClient core_v1.SecretInterface, namespace string, secret
func DeleteConfigMap(client kubernetes.Interface, namespace string, configmapName string) error {
logrus.Infof("Deleting configmap %q.\n", configmapName)
err := client.CoreV1().ConfigMaps(namespace).Delete(configmapName, &metav1.DeleteOptions{})
time.Sleep(10 * time.Second)
time.Sleep(3 * time.Second)
return err
}
@@ -632,7 +632,7 @@ func DeleteConfigMap(client kubernetes.Interface, namespace string, configmapNam
func DeleteSecret(client kubernetes.Interface, namespace string, secretName string) error {
logrus.Infof("Deleting secret %q.\n", secretName)
err := client.CoreV1().Secrets(namespace).Delete(secretName, &metav1.DeleteOptions{})
time.Sleep(10 * time.Second)
time.Sleep(3 * time.Second)
return err
}