Skip to content

Commit

Permalink
Merge pull request #14744 from mfojtik/ensure-no-whitespace
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Jun 21, 2017
2 parents 7461c10 + 9cfb037 commit 857cfa5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/deploy/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,13 @@ func MakeDeploymentV1(config *deployapi.DeploymentConfig, codec runtime.Codec) (
return nil, fmt.Errorf("couldn't clone podSpec: %v", err)
}

// Fix trailing and leading whitespace in the image field
// This is needed to sanitize old deployment configs where spaces were permitted but
// kubernetes 3.7 (#47491) tightened the validation of container image fields.
for i := range podSpec.Containers {
podSpec.Containers[i].Image = strings.TrimSpace(podSpec.Containers[i].Image)
}

controllerLabels := make(labels.Set)
for k, v := range config.Labels {
controllerLabels[k] = v
Expand Down

0 comments on commit 857cfa5

Please sign in to comment.