Skip to content

Commit 857cfa5

Browse files
author
OpenShift Bot
authored
Merge pull request #14744 from mfojtik/ensure-no-whitespace
Merged by openshift-bot
2 parents 7461c10 + 9cfb037 commit 857cfa5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/deploy/util/util.go

+7
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,13 @@ func MakeDeploymentV1(config *deployapi.DeploymentConfig, codec runtime.Codec) (
345345
return nil, fmt.Errorf("couldn't clone podSpec: %v", err)
346346
}
347347

348+
// Fix trailing and leading whitespace in the image field
349+
// This is needed to sanitize old deployment configs where spaces were permitted but
350+
// kubernetes 3.7 (#47491) tightened the validation of container image fields.
351+
for i := range podSpec.Containers {
352+
podSpec.Containers[i].Image = strings.TrimSpace(podSpec.Containers[i].Image)
353+
}
354+
348355
controllerLabels := make(labels.Set)
349356
for k, v := range config.Labels {
350357
controllerLabels[k] = v

0 commit comments

Comments
 (0)