diff --git a/app/scripts/directives/addSecretToApplication.js b/app/scripts/directives/addSecretToApplication.js index 57b0d6fb6d..2d8f384c52 100644 --- a/app/scripts/directives/addSecretToApplication.js +++ b/app/scripts/directives/addSecretToApplication.js @@ -93,6 +93,10 @@ }); }; + var isContainerSelected = function(container) { + return ctrl.attachAllContainers || ctrl.attachContainers[container.name]; + }; + ctrl.$postLink = function() { $scope.$watch(function() { return ctrl.application; @@ -100,6 +104,7 @@ // Look at the existing mount paths so that we can warn if the new value is not unique. var podTemplate = _.get(ctrl.application, 'spec.template'); ctrl.existingMountPaths = StorageService.getMountPaths(podTemplate); + ctrl.attachAllContainers = true; }); }; @@ -119,8 +124,10 @@ // For each container, add the new volume mount. _.each(podTemplate.spec.containers, function(container) { - container.envFrom = container.envFrom || []; - container.envFrom.push(newEnvFrom); + if (isContainerSelected(container)) { + container.envFrom = container.envFrom || []; + container.envFrom.push(newEnvFrom); + } }); } else { var generateName = $filter('generateName'); @@ -133,8 +140,10 @@ // For each selected container, add the new volume mount. _.each(podTemplate.spec.containers, function(container) { - container.volumeMounts = container.volumeMounts || []; - container.volumeMounts.push(newVolumeMount); + if (isContainerSelected(container)) { + container.volumeMounts = container.volumeMounts || []; + container.volumeMounts.push(newVolumeMount); + } }); var newVolume = { diff --git a/app/styles/_secrets.less b/app/styles/_secrets.less index a8db01980f..d05c85412d 100644 --- a/app/styles/_secrets.less +++ b/app/styles/_secrets.less @@ -3,6 +3,17 @@ max-width: 600px; } + .container-options { + margin-left: 20px; + .select-container { + max-height: 200px; + overflow-y: auto; + .checkbox:first-of-type { + margin-top: 0; + } + } + } + .dialog-title { border-bottom: 1px solid @color-pf-black-300; diff --git a/app/views/directives/add-secret-to-application.html b/app/views/directives/add-secret-to-application.html index 86471fb899..f632b27090 100644 --- a/app/views/directives/add-secret-to-application.html +++ b/app/views/directives/add-secret-to-application.html @@ -70,6 +70,23 @@

Add to Application

+ Containers: +
+
+ The secret will be added to all containers. You can + select specific containers + instead. +
+
+ + + +
+
\n" + "\n" + + " 1\">Containers:\n" + + "
\n" + + "
\n" + + "The secret will be added to all containers. You can\n" + + "select specific containers\n" + + "instead.\n" + + "
\n" + + "
\n" + + "\n" + + "\n" + + "\n" + + "
\n" + + "
\n" + "
\n" + "