Allow namespaces to be between 2 and 255 characters in length
[Delivers #137924329]
This commit is contained in:
parent
e2748fccd9
commit
7c7a07fb5a
8 changed files with 43 additions and 39 deletions
|
@ -10,7 +10,7 @@ angular.module('quay').directive('namespaceInput', function () {
|
|||
restrict: 'C',
|
||||
scope: {
|
||||
'binding': '=binding',
|
||||
'isBackIncompat': '=isBackIncompat',
|
||||
'backIncompatMessage': '=backIncompatMessage',
|
||||
'hasExternalError': '=?hasExternalError',
|
||||
|
||||
'namespaceTitle': '@namespaceTitle',
|
||||
|
@ -21,11 +21,17 @@ angular.module('quay').directive('namespaceInput', function () {
|
|||
|
||||
$scope.$watch('binding', function(binding) {
|
||||
if (!binding) {
|
||||
$scope.isBackIncompat = false;
|
||||
$scope.backIncompatMessage = null;
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.isBackIncompat = (binding.indexOf('-') > 0 || binding.indexOf('.') > 0);
|
||||
if (binding.indexOf('-') > 0 || binding.indexOf('.') > 0) {
|
||||
$scope.backIncompatMessage = 'Namespaces with dashes or dots are only compatible with Docker 1.9+';
|
||||
} else if (binding.length < 4 || binding.length > 30) {
|
||||
$scope.backIncompatMessage = 'Namespaces less than 4 or more than 30 characters are only compatible with Docker 1.6+';
|
||||
} else {
|
||||
$scope.backIncompatMessage = null;
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
|
Reference in a new issue