@@ -8677,22 +8677,24 @@ kubernetes: n.VERSION.kubernetes
8677
8677
};
8678
8678
} ]), angular.module("openshiftConsole").controller("CommandLineController", [ "$scope", "DataService", "AuthService", "Constants", function(e, t, n, a) {
8679
8679
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());
8680
- } ]), 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) {
8681
- n.projectName = t.project, n.accessModes = "ReadWriteOnce", n.claim = {}, n.breadcrumbs = [ {
8680
+ } ]), 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) {
8681
+ n.projectName = t.project, n.accessModes = "ReadWriteOnce", n.claim = {};
8682
+ var p = r.getPreferredVersion("persistentvolumeclaims");
8683
+ n.breadcrumbs = [ {
8682
8684
title: "Storage",
8683
8685
link: "project/" + n.projectName + "/browse/storage"
8684
8686
}, {
8685
8687
title: "Create Storage"
8686
8688
} ];
8687
- var d = function() {
8688
- c .hideNotification("create-pvc-error");
8689
+ var m = function() {
8690
+ l .hideNotification("create-pvc-error");
8689
8691
};
8690
- n.$on("$destroy", d );
8691
- var p = function() {
8692
+ n.$on("$destroy", m );
8693
+ var f = function() {
8692
8694
a.history.back();
8693
8695
};
8694
- n.cancel = p, l .get(t.project).then(_.spread(function(a, r ) {
8695
- function l () {
8696
+ n.cancel = f, u .get(t.project).then(_.spread(function(a, o ) {
8697
+ function u () {
8696
8698
var e = {
8697
8699
kind: "PersistentVolumeClaim",
8698
8700
apiVersion: "v1",
@@ -8710,30 +8712,30 @@ requests: {}
8710
8712
e.spec.accessModes = [ n.claim.accessModes || "ReadWriteOnce" ];
8711
8713
var t = n.claim.unit || "Mi";
8712
8714
if (e.spec.resources.requests.storage = n.claim.amount + t, n.claim.selectedLabels) {
8713
- var a = u .mapEntries(u .compactEntries(n.claim.selectedLabels));
8715
+ var a = d .mapEntries(d .compactEntries(n.claim.selectedLabels));
8714
8716
_.isEmpty(a) || _.set(e, "spec.selector.matchLabels", a);
8715
8717
}
8716
8718
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;
8717
8719
}
8718
- n.project = a, o .canI("persistentvolumeclaims" , "create", t.project) ? n.createPersistentVolumeClaim = function() {
8719
- if (d (), n.createPersistentVolumeClaimForm.$valid) {
8720
+ n.project = a, i .canI(p , "create", t.project) ? n.createPersistentVolumeClaim = function() {
8721
+ if (m (), n.createPersistentVolumeClaimForm.$valid) {
8720
8722
n.disableInputs = !0;
8721
- var t = l( );
8722
- i .create("persistentvolumeclaims" , null, t, r ).then(function(e) {
8723
- c .addNotification({
8723
+ var t = u(), a = r.objectToResourceGroupVersion(t );
8724
+ s .create(a , null, t, o ).then(function(e) {
8725
+ l .addNotification({
8724
8726
type: "success",
8725
8727
message: "Persistent volume claim " + e.metadata.name + " successfully created."
8726
- }), p ();
8728
+ }), f ();
8727
8729
}, function(t) {
8728
- n.disableInputs = !1, c .addNotification({
8730
+ n.disableInputs = !1, l .addNotification({
8729
8731
id: "create-pvc-error",
8730
8732
type: "error",
8731
8733
message: "An error occurred requesting storage.",
8732
8734
details: e("getErrorDetails")(t)
8733
8735
});
8734
8736
});
8735
8737
}
8736
- } : s .toErrorPage("You do not have authority to create persistent volume claims in project " + t.project + ".", "access_denied");
8738
+ } : c .toErrorPage("You do not have authority to create persistent volume claims in project " + t.project + ".", "access_denied");
8737
8739
}));
8738
8740
} ]), angular.module("openshiftConsole").directive("buildClose", [ "$window", function(e) {
8739
8741
var t = function(e) {
0 commit comments