mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Merge pull request #68023 from wongma7/emptydir-wrapper
Automatic merge from submit-queue (batch tested with PRs 68161, 68023, 67909, 67955, 67731). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md. Replace git volume with configmap in emptydir wrapper conflict test **What this PR does / why we need it**: GitRepoVolumeSource is deprecated, use a ConfigMap instead. (This test is part of the conformance suite, so it would be good to allow downstreams to disable/not support gitRepo) **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
commit
7052a51082
@ -76,10 +76,22 @@ var _ = utils.SIGDescribe("EmptyDir wrapper volumes", func() {
|
|||||||
framework.Failf("unable to create test secret %s: %v", secret.Name, err)
|
framework.Failf("unable to create test secret %s: %v", secret.Name, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
gitVolumeName := "git-volume"
|
configMapVolumeName := "configmap-volume"
|
||||||
gitVolumeMountPath := "/etc/git-volume"
|
configMapVolumeMountPath := "/etc/configmap-volume"
|
||||||
gitURL, gitRepo, gitCleanup := createGitServer(f)
|
|
||||||
defer gitCleanup()
|
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{
|
pod := &v1.Pod{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -96,11 +108,12 @@ var _ = utils.SIGDescribe("EmptyDir wrapper volumes", func() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: gitVolumeName,
|
Name: configMapVolumeName,
|
||||||
VolumeSource: v1.VolumeSource{
|
VolumeSource: v1.VolumeSource{
|
||||||
GitRepo: &v1.GitRepoVolumeSource{
|
ConfigMap: &v1.ConfigMapVolumeSource{
|
||||||
Repository: gitURL,
|
LocalObjectReference: v1.LocalObjectReference{
|
||||||
Directory: gitRepo,
|
Name: name,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -116,8 +129,8 @@ var _ = utils.SIGDescribe("EmptyDir wrapper volumes", func() {
|
|||||||
ReadOnly: true,
|
ReadOnly: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: gitVolumeName,
|
Name: configMapVolumeName,
|
||||||
MountPath: gitVolumeMountPath,
|
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 {
|
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)
|
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 {
|
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)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user