From fd58d0fc90717eab49000c21791a6db0902c011c Mon Sep 17 00:00:00 2001 From: Kent Iso Date: Sun, 14 Feb 2021 00:15:19 +0900 Subject: [PATCH] Add CreatedByLabelKey to make sure that preload side car will be target of deletion --- pkg/drivers/kic/oci/volumes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/drivers/kic/oci/volumes.go b/pkg/drivers/kic/oci/volumes.go index d6698f3a92..0a330c1684 100644 --- a/pkg/drivers/kic/oci/volumes.go +++ b/pkg/drivers/kic/oci/volumes.go @@ -153,7 +153,7 @@ func createVolume(ociBin string, profile string, nodeName string) error { // prepareVolumeSideCar will copy the initial content of the mount point by starting a temporary container to check the expected content func prepareVolumeSideCar(ociBin string, imageName string, nodeName string) error { - cmdArgs := []string{"run", "--rm", "--name", fmt.Sprintf("%s-preload-sidecar", nodeName), "--entrypoint", "/usr/bin/test"} + cmdArgs := []string{"run", "--rm", "--name", fmt.Sprintf("%s-preload-sidecar", nodeName), "--entrypoint", "--label", fmt.Sprintf("%s=%s", CreatedByLabelKey, "true"), "/usr/bin/test"} cmdArgs = append(cmdArgs, "-v", fmt.Sprintf("%s:/var", nodeName), imageName, "-d", "/var/lib") cmd := exec.Command(ociBin, cmdArgs...) if _, err := runCmd(cmd); err != nil {