summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2021-10-12 12:35:55 -0500
committerBrent Baude <bbaude@redhat.com>2021-10-12 12:38:15 -0500
commitab0e6630f526198cb1b13835830cf56016d8cd69 (patch)
treed8d4cc780830e11f7914bbb01aa3fd252f8340fa /libpod
parent2905bc351b6ba9d1565584cb7dfd07cc2522f5c5 (diff)
downloadpodman-ab0e6630f526198cb1b13835830cf56016d8cd69.tar.gz
podman-ab0e6630f526198cb1b13835830cf56016d8cd69.tar.bz2
podman-ab0e6630f526198cb1b13835830cf56016d8cd69.zip
No space in kube annotations for bind mounts
Kubernetes fails to deal with an annotation that has a space in it. Trim these strings to remove spaces. Fixes: #11929 Signed-off-by: Brent Baude <bbaude@redhat.com> [NO TESTS NEEDED]
Diffstat (limited to 'libpod')
-rw-r--r--libpod/kube.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpod/kube.go b/libpod/kube.go
index 816fe9cc3..eb7743886 100644
--- a/libpod/kube.go
+++ b/libpod/kube.go
@@ -246,7 +246,7 @@ func (p *Pod) podWithContainers(ctx context.Context, containers []*Container, po
return nil, err
}
for k, v := range annotations {
- podAnnotations[define.BindMountPrefix+k] = v
+ podAnnotations[define.BindMountPrefix+k] = strings.TrimSpace(v)
}
// Since port bindings for the pod are handled by the
// infra container, wipe them here.
@@ -366,7 +366,7 @@ func simplePodWithV1Containers(ctx context.Context, ctrs []*Container) (*v1.Pod,
return nil, err
}
for k, v := range annotations {
- kubeAnnotations[define.BindMountPrefix+k] = v
+ kubeAnnotations[define.BindMountPrefix+k] = strings.TrimSpace(v)
}
if isInit {
kubeInitCtrs = append(kubeInitCtrs, kubeCtr)