Replace git volume with configmap in emptydir wrapper conflict test

pull/8/head
Matthew Wong 2018-08-29 14:12:14 -04:00
parent da62c170f7
commit e497ea90a8
1 changed files with 29 additions and 12 deletions

View File

@ -76,10 +76,22 @@ var _ = utils.SIGDescribe("EmptyDir wrapper volumes", func() {
framework.Failf("unable to create test secret %s: %v", secret.Name, err)
}
gitVolumeName := "git-volume"
gitVolumeMountPath := "/etc/git-volume"
gitURL, gitRepo, gitCleanup := createGitServer(f)
defer gitCleanup()
configMapVolumeName := "configmap-volume"
configMapVolumeMountPath := "/etc/configmap-volume"
configMap := &v1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Namespace: f.Namespace.Name,
Name: name,
},
BinaryData: map[string][]byte{
"data-1": []byte("value-1\n"),
},
}
if configMap, err = f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Create(configMap); err != nil {
framework.Failf("unable to create test configMap %s: %v", configMap.Name, err)
}
pod := &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
@ -96,11 +108,12 @@ var _ = utils.SIGDescribe("EmptyDir wrapper volumes", func() {
},
},
{
Name: gitVolumeName,
Name: configMapVolumeName,
VolumeSource: v1.VolumeSource{
GitRepo: &v1.GitRepoVolumeSource{
Repository: gitURL,
Directory: gitRepo,
ConfigMap: &v1.ConfigMapVolumeSource{
LocalObjectReference: v1.LocalObjectReference{
Name: name,
},
},
},
},
@ -116,8 +129,8 @@ var _ = utils.SIGDescribe("EmptyDir wrapper volumes", func() {
ReadOnly: true,
},
{
Name: gitVolumeName,
MountPath: gitVolumeMountPath,
Name: configMapVolumeName,
MountPath: configMapVolumeMountPath,
},
},
},
@ -131,9 +144,13 @@ var _ = utils.SIGDescribe("EmptyDir wrapper volumes", func() {
if err := f.ClientSet.CoreV1().Secrets(f.Namespace.Name).Delete(secret.Name, nil); err != nil {
framework.Failf("unable to delete secret %v: %v", secret.Name, err)
}
By("Cleaning up the git vol pod")
By("Cleaning up the configmap")
if err := f.ClientSet.CoreV1().ConfigMaps(f.Namespace.Name).Delete(configMap.Name, nil); err != nil {
framework.Failf("unable to delete configmap %v: %v", configMap.Name, err)
}
By("Cleaning up the pod")
if err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).Delete(pod.Name, metav1.NewDeleteOptions(0)); err != nil {
framework.Failf("unable to delete git vol pod %v: %v", pod.Name, err)
framework.Failf("unable to delete pod %v: %v", pod.Name, err)
}
}()
})