Fix CSI node bind mount and publish to correct image registry.
Use k8s mount-utils for bind mounts so the pod target directory is created before mounting, and push CI images to ghcr.io/kubelancloud/kks-csi-plugin to match the deployed chart. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -107,9 +107,15 @@ func cleanupMountPoint(target string, mounter *mount.SafeFormatAndMount) error {
|
||||
}
|
||||
|
||||
func bindMount(source, target string) error {
|
||||
out, err := exec.Command("mount", "--bind", source, target).CombinedOutput()
|
||||
if err != nil {
|
||||
return fmt.Errorf("bind mount %s -> %s: %w: %s", source, target, err, strings.TrimSpace(string(out)))
|
||||
if !isMounted(source) {
|
||||
return fmt.Errorf("staging path %s is not mounted", source)
|
||||
}
|
||||
if isMounted(target) {
|
||||
return nil
|
||||
}
|
||||
mounter := mount.New("")
|
||||
if err := mounter.Mount(source, target, "", []string{"bind"}); err != nil {
|
||||
return fmt.Errorf("bind mount %s -> %s: %w", source, target, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user