Add CreatedByLabelKey to make sure that preload side car will be target of deletion

pull/10454/head
Kent Iso 2021-02-14 00:15:19 +09:00
parent e3cd93aa1a
commit fd58d0fc90
1 changed files with 1 additions and 1 deletions

View File

@ -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 {