@@ -8406,30 +8406,32 @@ name: t.name,
8406
8406
kind: t.kind,
8407
8407
namespace: t.project,
8408
8408
subpage: "Add Storage"
8409
- }), d.get(t.project).then(_.spread(function(r, d) {
8409
+ }), n.pvcVersion = r.getPreferredVersion("persistentvolumeclaims");
8410
+ var v = r.getPreferredVersion("resourcequotas"), y = r.getPreferredVersion("appliedclusterresourcequotas");
8411
+ d.get(t.project).then(_.spread(function(r, d) {
8410
8412
if (n.project = r, o.canI(h, "update", t.project)) {
8411
- var m = e("orderByDisplayName"), f = e("getErrorDetails"), v = e("generateName"), y = function(e, t) {
8413
+ var m = e("orderByDisplayName"), f = e("getErrorDetails"), b = e("generateName"), C = function(e, t) {
8412
8414
n.disableInputs = !0, u.addNotification({
8413
8415
id: "attach-pvc-error",
8414
8416
type: "error",
8415
8417
message: e,
8416
8418
details: t
8417
8419
});
8418
- }, b = function() {
8420
+ }, S = function() {
8419
8421
u.hideNotification("attach-pvc-error");
8420
8422
};
8421
- n.$on("$destroy", b );
8422
- var C = function() {
8423
+ n.$on("$destroy", S );
8424
+ var w = function() {
8423
8425
a.history.back();
8424
8426
};
8425
- n.cancel = C ;
8426
- var S = function(e) {
8427
+ n.cancel = w ;
8428
+ var k = function(e) {
8427
8429
return n.attach.allContainers || n.attach.containers[e.name];
8428
- }, w = function() {
8430
+ }, j = function() {
8429
8431
var e = _.get(n, "attach.resource.spec.template");
8430
- n.existingMountPaths = p.getMountPaths(e, S );
8432
+ n.existingMountPaths = p.getMountPaths(e, k );
8431
8433
};
8432
- n.$watchGroup([ "attach.resource", "attach.allContainers" ], w ), n.$watch("attach.containers", w , !0);
8434
+ n.$watchGroup([ "attach.resource", "attach.allContainers" ], j ), n.$watch("attach.containers", j , !0);
8433
8435
s.get(h, t.name, d).then(function(e) {
8434
8436
n.attach.resource = e, n.breadcrumbs = i.getBreadcrumbs({
8435
8437
object: e,
@@ -8439,23 +8441,23 @@ subpage: "Add Storage"
8439
8441
var t = _.get(e, "spec.template");
8440
8442
n.existingVolumeNames = p.getVolumeNames(t);
8441
8443
}, function(e) {
8442
- y (t.name + " could not be loaded.", f(e));
8443
- }), s.list("persistentvolumeclaims" , d).then(function(e) {
8444
+ C (t.name + " could not be loaded.", f(e));
8445
+ }), s.list(n.pvcVersion , d).then(function(e) {
8444
8446
n.pvcs = m(e.by("metadata.name")), _.isEmpty(n.pvcs) || n.attach.persistentVolumeClaim || (n.attach.persistentVolumeClaim = _.head(n.pvcs));
8445
- }), s.list("resourcequotas" , {
8447
+ }), s.list(v , {
8446
8448
namespace: n.projectName
8447
8449
}, function(e) {
8448
8450
n.quotas = e.by("metadata.name"), n.outOfClaims = c.isAnyStorageQuotaExceeded(n.quotas, n.clusterQuotas);
8449
- }), s.list("appliedclusterresourcequotas" , {
8451
+ }), s.list(y , {
8450
8452
namespace: n.projectName
8451
8453
}, function(e) {
8452
8454
n.clusterQuotas = e.by("metadata.name"), n.outOfClaims = c.isAnyStorageQuotaExceeded(n.quotas, n.clusterQuotas);
8453
8455
}), n.attachPVC = function() {
8454
- if (n.disableInputs = !0, b (), n.attachPVCForm.$valid) {
8455
- n.attach.volumeName || (n.attach.volumeName = v ("volume-"));
8456
+ if (n.disableInputs = !0, S (), n.attachPVCForm.$valid) {
8457
+ n.attach.volumeName || (n.attach.volumeName = b ("volume-"));
8456
8458
var e = n.attach.resource, a = _.get(e, "spec.template"), r = n.attach.persistentVolumeClaim, o = n.attach.volumeName, i = n.attach.mountPath, c = n.attach.subPath, l = n.attach.readOnly;
8457
8459
i && angular.forEach(a.spec.containers, function(e) {
8458
- if (S (e)) {
8460
+ if (k (e)) {
8459
8461
var t = p.createVolumeMount(o, i, c, l);
8460
8462
e.volumeMounts || (e.volumeMounts = []), e.volumeMounts.push(t);
8461
8463
}
@@ -8467,9 +8469,9 @@ i || (e = "No mount path was provided. The volume reference was added to the con
8467
8469
type: "success",
8468
8470
message: "Persistent volume claim " + r.metadata.name + " added to " + g(t.kind) + " " + t.name + ".",
8469
8471
details: e
8470
- }), C ();
8472
+ }), w ();
8471
8473
}, function(e) {
8472
- y ("An error occurred attaching the persistent volume claim to the " + g(t.kind) + ".", f(e)), n.disableInputs = !1;
8474
+ C ("An error occurred attaching the persistent volume claim to the " + g(t.kind) + ".", f(e)), n.disableInputs = !1;
8473
8475
});
8474
8476
}
8475
8477
};
0 commit comments