Skip to content

Commit 8a35b55

Browse files
Update addConfigVolume controller
1 parent 1b695d8 commit 8a35b55

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

app/scripts/controllers/addConfigVolume.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ angular.module('openshiftConsole')
137137
}
138138
);
139139

140-
DataService.list("configmaps", context, null, { errorNotification: false }).then(function(configMapData) {
140+
DataService.list(APIService.getPreferredVersion('configmaps'), context, null, { errorNotification: false }).then(function(configMapData) {
141141
$scope.configMaps = orderByDisplayName(configMapData.by("metadata.name"));
142142
}, function(e) {
143143
if (e.code === 403) {
@@ -148,7 +148,7 @@ angular.module('openshiftConsole')
148148
displayError('Could not load config maps', getErrorDetails(e));
149149
});
150150

151-
DataService.list("secrets", context, null, { errorNotification: false }).then(function(secretData) {
151+
DataService.list(APIService.getPreferredVersion('secrets'), context, null, { errorNotification: false }).then(function(secretData) {
152152
$scope.secrets = orderByDisplayName(secretData.by("metadata.name"));
153153
}, function(e) {
154154
if (e.code === 403) {

dist/scripts/scripts.js

+22-22
Original file line numberDiff line numberDiff line change
@@ -8324,7 +8324,7 @@ a.attach.items.push({}), v();
83248324
a.attach.items.splice(e, 1), v();
83258325
}, d.get(n.project).then(_.spread(function(t, r) {
83268326
if (a.project = t, i.canI(g, "update", n.project)) {
8327-
var o = e("orderByDisplayName"), d = e("getErrorDetails"), p = e("generateName");
8327+
var d = e("orderByDisplayName"), p = e("getErrorDetails"), f = e("generateName");
83288328
c.get(g, n.name, r, {
83298329
errorNotification: !1
83308330
}).then(function(e) {
@@ -8335,64 +8335,64 @@ subpage: "Add Config Files"
83358335
});
83368336
}, function(e) {
83378337
a.error = e;
8338-
}), c.list("configmaps", r, null, {
8338+
}), c.list(o.getPreferredVersion("configmaps"), r, null, {
83398339
errorNotification: !1
83408340
}).then(function(e) {
8341-
a.configMaps = o(e.by("metadata.name"));
8341+
a.configMaps = d(e.by("metadata.name"));
83428342
}, function(e) {
8343-
403 !== e.code ? b("Could not load config maps", d(e)) : a.configMaps = [];
8344-
}), c.list("secrets", r, null, {
8343+
403 !== e.code ? b("Could not load config maps", p(e)) : a.configMaps = [];
8344+
}), c.list(o.getPreferredVersion("secrets"), r, null, {
83458345
errorNotification: !1
83468346
}).then(function(e) {
8347-
a.secrets = o(e.by("metadata.name"));
8347+
a.secrets = d(e.by("metadata.name"));
83488348
}, function(e) {
8349-
403 !== e.code ? b("Could not load secrets", d(e)) : a.secrets = [];
8349+
403 !== e.code ? b("Could not load secrets", p(e)) : a.secrets = [];
83508350
});
8351-
var f = function(e) {
8351+
var v = function(e) {
83528352
return a.attach.allContainers || a.attach.containers[e.name];
8353-
}, v = function() {
8353+
}, S = function() {
83548354
var e = _.get(a, "targetObject.spec.template");
8355-
a.existingMountPaths = m.getMountPaths(e, f);
8355+
a.existingMountPaths = m.getMountPaths(e, v);
83568356
};
8357-
a.$watchGroup([ "targetObject", "attach.allContainers" ], v), a.$watch("attach.containers", v, !0);
8357+
a.$watchGroup([ "targetObject", "attach.allContainers" ], S), a.$watch("attach.containers", S, !0);
83588358
a.$watch("attach.items", function() {
83598359
var e = _.map(a.attach.items, "path");
83608360
a.itemPaths = _.compact(e);
83618361
}, !0), a.addVolume = function() {
83628362
if (!a.forms.addConfigVolumeForm.$invalid) {
8363-
var t = a.targetObject, o = _.get(a, "attach.source"), i = _.get(t, "spec.template"), s = p("volume-"), l = {
8363+
var t = a.targetObject, o = _.get(a, "attach.source"), i = _.get(t, "spec.template"), s = f("volume-"), l = {
83648364
name: s,
83658365
mountPath: _.get(a, "attach.mountPath")
83668366
};
83678367
"Secret" === o.kind && (l.readOnly = !0), _.each(i.spec.containers, function(e) {
8368-
f(e) && (e.volumeMounts = e.volumeMounts || [], e.volumeMounts.push(l));
8368+
v(e) && (e.volumeMounts = e.volumeMounts || [], e.volumeMounts.push(l));
83698369
});
8370-
var m, h = {
8370+
var d, m = {
83718371
name: s
83728372
};
8373-
switch (a.attach.pickKeys && (m = a.attach.items), o.kind) {
8373+
switch (a.attach.pickKeys && (d = a.attach.items), o.kind) {
83748374
case "ConfigMap":
8375-
h.configMap = {
8375+
m.configMap = {
83768376
name: o.metadata.name,
8377-
items: m
8377+
items: d
83788378
};
83798379
break;
83808380

83818381
case "Secret":
8382-
h.secret = {
8382+
m.secret = {
83838383
secretName: o.metadata.name,
8384-
items: m
8384+
items: d
83858385
};
83868386
}
8387-
i.spec.volumes = i.spec.volumes || [], i.spec.volumes.push(h), a.disableInputs = !0, C();
8388-
var v = e("humanizeKind"), S = v(o.kind), w = v(n.kind);
8387+
i.spec.volumes = i.spec.volumes || [], i.spec.volumes.push(m), a.disableInputs = !0, C();
8388+
var h = e("humanizeKind"), S = h(o.kind), w = h(n.kind);
83898389
c.update(g, t.metadata.name, a.targetObject, r).then(function() {
83908390
u.addNotification({
83918391
type: "success",
83928392
message: "Successfully added " + S + " " + o.metadata.name + " to " + w + " " + n.name + "."
83938393
}), y();
83948394
}, function(e) {
8395-
a.disableInputs = !1, b("An error occurred attaching the " + S + " to the " + w + ".", d(e));
8395+
a.disableInputs = !1, b("An error occurred attaching the " + S + " to the " + w + ".", p(e));
83968396
});
83978397
}
83988398
};

0 commit comments

Comments
 (0)