Skip to content

Commit

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

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

@jwforres PTAL
  • Loading branch information
openshift-merge-robot committed Oct 17, 2017
2 parents aeaf248 + 80b9671 commit de72b67
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 !_.get(envFromEntry, 'configMapRef.name') && !_.get(envFromEntry, 'secretRef.name');
});
});
},

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 !_.get(e, "configMapRef.name") && !_.get(e, "secretRef.name");
});
});
},
copyAndNormalize: function(e) {
Expand Down

0 comments on commit de72b67

Please sign in to comment.