Skip to content

Commit

Permalink
Merge pull request #2276 from spadgett/stage-fix-edit-env
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue.

[stage] Bug 1502914 - Compact empty envFrom entries

Don't include empty `envFrom` entries when updating environment variables. This causes a validation failure.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1502914

Backport of #2275 to stage branch.
  • Loading branch information
openshift-merge-robot committed Oct 17, 2017
2 parents 7c6ac2a + 1a73226 commit b4a2a49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/scripts/services/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ angular.module("openshiftConsole")
var containers = getContainers(object);
_.each(containers, function(container) {
container.env = keyValueEditorUtils.compactEntries(container.env);
container.envFrom = _.reject(container.envFrom, function(envFromEntry) {
return !envFromEntry.configMapRef && !envFromEntry.secretRef;
});
});
},

Expand Down
4 changes: 3 additions & 1 deletion dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3917,7 +3917,9 @@ e.env = e.env || [], e.envFrom = e.envFrom || [];
compact: function(e) {
var a = n(e);
_.each(a, function(e) {
e.env = t.compactEntries(e.env);
e.env = t.compactEntries(e.env), e.envFrom = _.reject(e.envFrom, function(e) {
return !e.configMapRef && !e.secretRef;
});
});
},
copyAndNormalize: function(e) {
Expand Down

0 comments on commit b4a2a49

Please sign in to comment.