Skip to content

Commit

Permalink
Bug 1502914 - Compact empty envFrom entries
Browse files Browse the repository at this point in the history
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
  • Loading branch information
spadgett committed Oct 17, 2017
1 parent 77ce2ce commit 753195b
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 @@ -3953,7 +3953,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 753195b

Please sign in to comment.