diff --git a/app/scripts/controllers/addConfigVolume.js b/app/scripts/controllers/addConfigVolume.js index c385172be1..f4ec77e91e 100644 --- a/app/scripts/controllers/addConfigVolume.js +++ b/app/scripts/controllers/addConfigVolume.js @@ -96,7 +96,6 @@ angular.module('openshiftConsole') var generateName = $filter('generateName'); var displayError = function(errorMessage, errorDetails) { - $scope.disableInputs = true; $scope.alerts['attach-persistent-volume-claim'] = { type: "error", message: errorMessage, @@ -225,7 +224,11 @@ angular.module('openshiftConsole') $window.history.back(); }, function(result) { - displayError("An error occurred attaching the persistent volume claim to the " + $filter('humanizeKind')($routeParams.kind) + ".", getErrorDetails(result)); + $scope.disableInputs = false; + var humanizeKind = $filter('humanizeKind'); + var sourceKind = humanizeKind(source.kind); + var targetKind = humanizeKind($routeParams.kind); + displayError("An error occurred attaching the " + sourceKind + " to the " + targetKind + ".", getErrorDetails(result)); } ); }; diff --git a/app/scripts/controllers/attachPVC.js b/app/scripts/controllers/attachPVC.js index 9352e2bf44..41fa3cdc97 100644 --- a/app/scripts/controllers/attachPVC.js +++ b/app/scripts/controllers/attachPVC.js @@ -168,6 +168,7 @@ angular.module('openshiftConsole') }, function(result) { displayError("An error occurred attaching the persistent volume claim to the " + $filter('humanizeKind')($routeParams.kind) + ".", getErrorDetails(result)); + $scope.disableInputs = false; } ); } diff --git a/app/views/add-config-volume.html b/app/views/add-config-volume.html index caeea99252..38347b29cc 100644 --- a/app/views/add-config-volume.html +++ b/app/views/add-config-volume.html @@ -136,6 +136,14 @@

Keys and Paths

+ Keys and Paths type="text" name="path-{{$id}}" ng-model="item.path" + ng-pattern="/^(?!\/)(?!\.\.(\/|$))(?!.*\/\.\.(\/|$)).*$/" required osc-unique="itemPaths" placeholder="example: config/app.properties" autocorrect="off" autocapitalize="off" spellcheck="false"> +
+ + Path must be a relative path. It cannot start with / or + contain .. path elements. + +
Paths must be unique. diff --git a/app/views/attach-pvc.html b/app/views/attach-pvc.html index adebebd00f..6cbd395600 100644 --- a/app/views/attach-pvc.html +++ b/app/views/attach-pvc.html @@ -114,6 +114,11 @@

Volume

+ Volume name="volumeName" ng-model="attach.volumeName" osc-unique="existingVolumeNames" + ng-pattern="/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/" + maxlength="63" placeholder="(generated if empty)" autocorrect="off" autocapitalize="off" @@ -129,11 +136,22 @@

Volume

Unique name used to identify this volume. If not specified, a volume name is generated.
-
-
- - Volume name already exists. Please choose another name. - +
+ + Volume names may only contain lower-case letters, numbers, and dashes. + They may not start or end with a dash. + +
+
+ + Volume names cannot be longer than 63 characters. + +
+
+ + Volume name already exists. Please choose another name. + +
diff --git a/dist/scripts/scripts.js b/dist/scripts/scripts.js index 17fcaefd6b..ffb852d2b9 100644 --- a/dist/scripts/scripts.js +++ b/dist/scripts/scripts.js @@ -8197,8 +8197,8 @@ a.volumeMounts || (a.volumeMounts = []), a.volumeMounts.push(b); var r = j.createVolume(p, i); f.spec.volumes || (f.spec.volumes = []), f.spec.volumes.push(r), c.alerts = {}, g.update(l, e.metadata.name, c.attach.resource, h).then(function() { d.history.back(); -}, function(c) { -n("An error occurred attaching the persistent volume claim to the " + a("humanizeKind")(b.kind) + ".", k(c)); +}, function(d) { +n("An error occurred attaching the persistent volume claim to the " + a("humanizeKind")(b.kind) + ".", k(d)), c.disableInputs = !1; }); } }; @@ -8239,7 +8239,7 @@ c.attach.items.splice(a, 1), o(); }, i.get(b.project).then(_.spread(function(e, h) { c.project = e; var i = a("orderByDisplayName"), k = a("getErrorDetails"), m = a("generateName"), n = function(a, b) { -c.disableInputs = !0, c.alerts["attach-persistent-volume-claim"] = { +c.alerts["attach-persistent-volume-claim"] = { type:"error", message:a, details:b @@ -8308,8 +8308,10 @@ items:r } i.spec.volumes = i.spec.volumes || [], i.spec.volumes.push(s), c.alerts = {}, c.disableInputs = !0, g.update(l, e.metadata.name, c.targetObject, h).then(function() { d.history.back(); -}, function(c) { -n("An error occurred attaching the persistent volume claim to the " + a("humanizeKind")(b.kind) + ".", k(c)); +}, function(d) { +c.disableInputs = !1; +var e = a("humanizeKind"), g = e(f.kind), h = e(b.kind); +n("An error occurred attaching the " + g + " to the " + h + ".", k(d)); }); } }; diff --git a/dist/scripts/templates.js b/dist/scripts/templates.js index 60cb1b2602..360ba346f2 100644 --- a/dist/scripts/templates.js +++ b/dist/scripts/templates.js @@ -1028,7 +1028,13 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "
\n" + "
\n" + "\n" + - "\n" + + "\n" + + "\n" + + "
\n" + + "\n" + + "Path must be a relative path. It cannot start with / or contain .. path elements.\n" + + "\n" + + "
\n" + "
\n" + "\n" + "Paths must be unique.\n" + @@ -1165,16 +1171,27 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "
\n" + "
\n" + "\n" + - "\n" + + "\n" + + "\n" + "
\n" + "Unique name used to identify this volume. If not specified, a volume name is generated.\n" + "
\n" + + "
\n" + + "\n" + + "Volume names may only contain lower-case letters, numbers, and dashes. They may not start or end with a dash.\n" + + "\n" + + "
\n" + + "
\n" + + "\n" + + "Volume names cannot be longer than 63 characters.\n" + + "\n" + "
\n" + "
\n" + "\n" + "Volume name already exists. Please choose another name.\n" + "\n" + "
\n" + + "
\n" + "\n" + "
1\">\n" + "
\n" +