@@ -8707,27 +8707,18 @@ kubernetes: n.VERSION.kubernetes
8707
8707
};
8708
8708
} ]), angular.module("openshiftConsole").controller("CommandLineController", [ "$scope", "DataService", "AuthService", "Constants", function(e, t, n, a) {
8709
8709
n.withUser(), e.cliDownloadURL = a.CLI, e.cliDownloadURLPresent = e.cliDownloadURL && !_.isEmpty(e.cliDownloadURL), e.loginBaseURL = t.openshiftAPIBaseUrl(), a.DISABLE_COPY_LOGIN_COMMAND || (e.sessionToken = n.UserStore().getToken());
8710
- } ]), angular.module("openshiftConsole").controller("CreatePersistentVolumeClaimController", [ "$filter", "$routeParams", "$scope", "$window", "ApplicationGenerator", "AuthorizationService", "DataService", "Navigate", "NotificationsService", "ProjectsService", "keyValueEditorUtils", function(e, t, n, a, r, o, i, s, c, l, u) {
8710
+ } ]), angular.module("openshiftConsole").controller("CreatePersistentVolumeClaimController", [ "$filter", "$routeParams", "$scope", "$window", "APIService", " ApplicationGenerator", "AuthorizationService", "DataService", "Navigate", "NotificationsService", "ProjectsService", "keyValueEditorUtils", function(e, t, n, a, r, o, i, s, c, l, u, d ) {
8711
8711
n.projectName = t.project, n.accessModes = "ReadWriteOnce", n.claim = {}, n.breadcrumbs = [ {
8712
8712
title: "Storage",
8713
8713
link: "project/" + n.projectName + "/browse/storage"
8714
8714
}, {
8715
8715
title: "Create Storage"
8716
8716
} ];
8717
- var d = function() {
8718
- c.hideNotification("create-pvc-error");
8719
- };
8720
- n.$on("$destroy", d);
8721
- var p = function() {
8722
- a.history.back();
8723
- };
8724
- n.cancel = p, l.get(t.project).then(_.spread(function(a, r) {
8725
- function l() {
8726
- var e = {
8717
+ var p = {
8727
8718
kind: "PersistentVolumeClaim",
8728
8719
apiVersion: "v1",
8729
8720
metadata: {
8730
- name: n.claim.name ,
8721
+ name: void 0 ,
8731
8722
labels: {},
8732
8723
annotations: {}
8733
8724
},
@@ -8736,34 +8727,43 @@ resources: {
8736
8727
requests: {}
8737
8728
}
8738
8729
}
8730
+ }, m = r.objectToResourceGroupVersion(p), f = function() {
8731
+ l.hideNotification("create-pvc-error");
8739
8732
};
8740
- e.spec.accessModes = [ n.claim.accessModes || "ReadWriteOnce" ];
8733
+ n.$on("$destroy", f);
8734
+ var g = function() {
8735
+ a.history.back();
8736
+ };
8737
+ n.cancel = g, u.get(t.project).then(_.spread(function(a, r) {
8738
+ function o() {
8739
+ var e = angular.copy(p);
8740
+ e.metadata.name = n.claim.name, e.spec.accessModes = [ n.claim.accessModes || "ReadWriteOnce" ];
8741
8741
var t = n.claim.unit || "Mi";
8742
8742
if (e.spec.resources.requests.storage = n.claim.amount + t, n.claim.selectedLabels) {
8743
- var a = u .mapEntries(u .compactEntries(n.claim.selectedLabels));
8743
+ var a = d .mapEntries(d .compactEntries(n.claim.selectedLabels));
8744
8744
_.isEmpty(a) || _.set(e, "spec.selector.matchLabels", a);
8745
8745
}
8746
8746
return n.claim.storageClass && "No Storage Class" !== n.claim.storageClass.metadata.name && (e.metadata.annotations["volume.beta.kubernetes.io/storage-class"] = n.claim.storageClass.metadata.name), e;
8747
8747
}
8748
- n.project = a, o .canI("persistentvolumeclaims" , "create", t.project) ? n.createPersistentVolumeClaim = function() {
8749
- if (d (), n.createPersistentVolumeClaimForm.$valid) {
8748
+ n.project = a, i .canI(m , "create", t.project) ? n.createPersistentVolumeClaim = function() {
8749
+ if (f (), n.createPersistentVolumeClaimForm.$valid) {
8750
8750
n.disableInputs = !0;
8751
- var t = l ();
8752
- i .create("persistentvolumeclaims" , null, t, r).then(function(e) {
8753
- c .addNotification({
8751
+ var t = o ();
8752
+ s .create(m , null, t, r).then(function(e) {
8753
+ l .addNotification({
8754
8754
type: "success",
8755
8755
message: "Persistent volume claim " + e.metadata.name + " successfully created."
8756
- }), p ();
8756
+ }), g ();
8757
8757
}, function(t) {
8758
- n.disableInputs = !1, c .addNotification({
8758
+ n.disableInputs = !1, l .addNotification({
8759
8759
id: "create-pvc-error",
8760
8760
type: "error",
8761
8761
message: "An error occurred requesting storage.",
8762
8762
details: e("getErrorDetails")(t)
8763
8763
});
8764
8764
});
8765
8765
}
8766
- } : s .toErrorPage("You do not have authority to create persistent volume claims in project " + t.project + ".", "access_denied");
8766
+ } : c .toErrorPage("You do not have authority to create persistent volume claims in project " + t.project + ".", "access_denied");
8767
8767
}));
8768
8768
} ]), angular.module("openshiftConsole").directive("buildClose", [ "$window", function(e) {
8769
8769
var t = function(e) {
0 commit comments