diff --git a/assets/app/scripts/controllers/deployments.js b/assets/app/scripts/controllers/deployments.js index fbf1afcf7845..a71aa780e90f 100644 --- a/assets/app/scripts/controllers/deployments.js +++ b/assets/app/scripts/controllers/deployments.js @@ -10,8 +10,10 @@ angular.module('openshiftConsole') .controller('DeploymentsController', function ($scope, DataService, $filter, LabelFilter, Logger, ImageStreamResolver) { $scope.deployments = {}; - $scope.podTemplates = {}; $scope.unfilteredDeployments = {}; + $scope.deploymentConfigs = {}; + $scope.deploymentsByDeploymentConfig = {}; + $scope.podTemplates = {}; $scope.imageStreams = {}; $scope.imagesByDockerReference = {}; $scope.imageStreamImageRefByDockerReference = {}; // lets us determine if a particular container's docker image reference belongs to an imageStream @@ -36,9 +38,24 @@ angular.module('openshiftConsole') ImageStreamResolver.fetchReferencedImageStreamImages($scope.podTemplates, $scope.imagesByDockerReference, $scope.imageStreamImageRefByDockerReference, $scope); $scope.emptyMessage = "No deployments to show"; updateFilterWarning(); + + $scope.deploymentsByDeploymentConfig = {}; + angular.forEach($scope.deployments, function(deployment, deploymentName) { + var deploymentConfigName = $filter('annotation')(deployment, 'deploymentConfig'); + if (deploymentConfigName) { + $scope.deploymentsByDeploymentConfig[deploymentConfigName] = $scope.deploymentsByDeploymentConfig[deploymentConfigName] || {}; + $scope.deploymentsByDeploymentConfig[deploymentConfigName][deploymentName] = deployment; + } + }); + Logger.log("deployments (subscribe)", $scope.deployments); })); + watches.push(DataService.watch("deploymentConfigs", $scope, function(deploymentConfigs) { + $scope.deploymentConfigs = deploymentConfigs.by("metadata.name"); + Logger.log("deploymentConfigs (subscribe)", $scope.deploymentConfigs); + })); + // Sets up subscription for imageStreams watches.push(DataService.watch("imageStreams", $scope, function(imageStreams) { $scope.imageStreams = imageStreams.by("metadata.name"); diff --git a/assets/app/scripts/filters/util.js b/assets/app/scripts/filters/util.js index 327fb149d580..78543420cfd0 100644 --- a/assets/app/scripts/filters/util.js +++ b/assets/app/scripts/filters/util.js @@ -126,6 +126,8 @@ angular.module('openshiftConsole') return "http://docs.openshift.org/latest/dev_guide/builds.html#webhook-triggers"; case "start-build": return "http://docs.openshift.org/latest/dev_guide/builds.html#starting-a-build"; + case "deployment-operations": + return "http://docs.openshift.org/latest/cli_reference/basic_cli_operations.html#deployment-operations"; default: return "http://docs.openshift.org/latest/welcome/index.html"; } diff --git a/assets/app/views/deployments.html b/assets/app/views/deployments.html index d3563c98d347..5ce1fc8f107f 100644 --- a/assets/app/views/deployments.html +++ b/assets/app/views/deployments.html @@ -9,14 +9,210 @@

Deployments

{{emptyMessage}}
- -
-

{{deployment | annotation:'deploymentConfig'}} ({{deployment.metadata.name}})

-
Created:
-
Status: {{deployment | annotation:'deploymentStatus'}}
-
Version: {{deployment | annotation:'deploymentVersion'}}
-
Replicas: {{deployment.spec.replicas}}
- +
+ +
+
+

{{deploymentConfigName}}

+
+
+
Created:
+
+
+
+
Labels:
none
+
{{labelKey}}={{labelValue}},
+
+
+
Latest Version:
+
{{deploymentConfig.latestVersion}}
+
+
+
Strategy:
+
{{deploymentConfig.template.strategy.type}}
+
+ +
+

Template:

+
+
Selectors:
none
+
{{selectorLabel}}={{selectorValue}},
+
Replicas:
+
+ {{deploymentConfig.template.controllerTemplate.replicas}} +
+
+
+ +
+

Triggers:

+ + +
+
Manual (CLI): + + Learn more + +
+
+ osc deploy {{deploymentConfigName}} --latest -n {{project.metadata.name}} + +
+
+ +
+
+ + {{trigger.type}} + +
+
+
+
+ New image for: +
+
+ Image stream {{trigger.imageChangeParams.from | imageRepoReference : trigger.imageChangeParams.from.kind : trigger.imageChangeParams.tag}} +
+
+
+
+
+ +
Change of:
+
Config
+
+
+
+
+
+ +
+

+ {{deployment.metadata.name}} + (latest) +

+
+
Created:
+
+
+
+ +
Status:
+
+ {{deployment | annotation:'deploymentStatus'}} + + for + for + for + + + + + + +
+
+
+
+
Labels:
+
+ none + {{labelKey}}={{labelValue}}, +
+
+
+
Selectors:
+
+ none + {{labelKey}}={{labelValue}}, +
+
+
+
Replicas:
+
{{deployment.status.replicas}} current / {{deployment.spec.replicas}} desired
+
+
+
Pod Template:
+ +
+
+ + +
+
+
+ + +
+
+

+ {{deploymentConfigName}} + + + + +

+
+
+

+ {{deployment.metadata.name}} +

+
+
Created:
+
+
+ +
Status:
+
+ {{deployment | annotation:'deploymentStatus'}} + + for + for + for + + + + + + +
+
+
+
+
Labels:
+
+ none + {{labelKey}}={{labelValue}}, +
+
+
+
Selectors:
+
+ none + {{labelKey}}={{labelValue}}, +
+
+
+
Replicas:
+
{{deployment.status.replicas}} current / {{deployment.spec.replicas}} desired
+
+
+
Pod Template:
+ +
+
+
+
diff --git a/pkg/assets/bindata.go b/pkg/assets/bindata.go index 088c67892069..80b515356c38 100644 --- a/pkg/assets/bindata.go +++ b/pkg/assets/bindata.go @@ -16039,10 +16039,15 @@ type:"warning", details:"The active filters are hiding all deployments." }; } -a.deployments = {}, a.podTemplates = {}, a.unfilteredDeployments = {}, a.imageStreams = {}, a.imagesByDockerReference = {}, a.imageStreamImageRefByDockerReference = {}, a.builds = {}, a.labelSuggestions = {}, a.alerts = a.alerts || {}, a.emptyMessage = "Loading..."; +a.deployments = {}, a.unfilteredDeployments = {}, a.deploymentConfigs = {}, a.deploymentsByDeploymentConfig = {}, a.podTemplates = {}, a.imageStreams = {}, a.imagesByDockerReference = {}, a.imageStreamImageRefByDockerReference = {}, a.builds = {}, a.labelSuggestions = {}, a.alerts = a.alerts || {}, a.emptyMessage = "Loading..."; var i = []; i.push(b.watch("replicationcontrollers", a, function(b) { -a.unfilteredDeployments = b.by("metadata.name"), d.addLabelSuggestionsFromResources(a.unfilteredDeployments, a.labelSuggestions), d.setLabelSuggestions(a.labelSuggestions), a.deployments = d.getLabelSelector().select(a.unfilteredDeployments), g(), f.fetchReferencedImageStreamImages(a.podTemplates, a.imagesByDockerReference, a.imageStreamImageRefByDockerReference, a), a.emptyMessage = "No deployments to show", h(), e.log("deployments (subscribe)", a.deployments); +a.unfilteredDeployments = b.by("metadata.name"), d.addLabelSuggestionsFromResources(a.unfilteredDeployments, a.labelSuggestions), d.setLabelSuggestions(a.labelSuggestions), a.deployments = d.getLabelSelector().select(a.unfilteredDeployments), g(), f.fetchReferencedImageStreamImages(a.podTemplates, a.imagesByDockerReference, a.imageStreamImageRefByDockerReference, a), a.emptyMessage = "No deployments to show", h(), a.deploymentsByDeploymentConfig = {}, angular.forEach(a.deployments, function(b, d) { +var e = c("annotation")(b, "deploymentConfig"); +e && (a.deploymentsByDeploymentConfig[e] = a.deploymentsByDeploymentConfig[e] || {}, a.deploymentsByDeploymentConfig[e][d] = b); +}), e.log("deployments (subscribe)", a.deployments); +})), i.push(b.watch("deploymentConfigs", a, function(b) { +a.deploymentConfigs = b.by("metadata.name"), e.log("deploymentConfigs (subscribe)", a.deploymentConfigs); })), i.push(b.watch("imageStreams", a, function(b) { a.imageStreams = b.by("metadata.name"), f.buildDockerRefMapForImageStreams(a.imageStreams, a.imageStreamImageRefByDockerReference), f.fetchReferencedImageStreamImages(a.podTemplates, a.imagesByDockerReference, a.imageStreamImageRefByDockerReference, a), e.log("imageStreams (subscribe)", a.imageStreams); })), i.push(b.watch("builds", a, function(b) { @@ -17168,6 +17173,9 @@ return "http://docs.openshift.org/latest/dev_guide/builds.html#webhook-triggers" case "start-build": return "http://docs.openshift.org/latest/dev_guide/builds.html#starting-a-build"; +case "deployment-operations": +return "http://docs.openshift.org/latest/cli_reference/basic_cli_operations.html#deployment-operations"; + default: return "http://docs.openshift.org/latest/welcome/index.html"; } @@ -63896,15 +63904,194 @@ var _views_deployments_html = []byte(`
{{emptyMessage}}
-
-

{{deployment | annotation:'deploymentConfig'}} ({{deployment.metadata.name}})

-
Created:
-
Status: {{deployment | annotation:'deploymentStatus'}}
-
Version: {{deployment | annotation:'deploymentVersion'}}
-
Replicas: {{deployment.spec.replicas}}
+
+
+

{{deploymentConfigName}}

+
+
+
Created: +
+
+
+
Labels:
none +
{{labelKey}}={{labelValue}}, +
+
+
Latest Version: +
{{deploymentConfig.latestVersion}} +
+
+
Strategy: +
{{deploymentConfig.template.strategy.type}} +
+
+

Template:

+
+
Selectors:
none +
{{selectorLabel}}={{selectorValue}}, +
Replicas: +
+{{deploymentConfig.template.controllerTemplate.replicas}} + +
+
+
+

Triggers:

+ +
+
Manual (CLI): + +Learn more + + +
+osc deploy {{deploymentConfigName}} --latest -n {{project.metadata.name}} + + +
+
+
+ +{{trigger.type}} + +
+
+
+
+New image for: + +
+Image stream {{trigger.imageChangeParams.from | imageRepoReference : trigger.imageChangeParams.from.kind : trigger.imageChangeParams.tag}} + +
+
+
+
+ +
Change of: +
Config + + +
+
+
+
+

+{{deployment.metadata.name}} +(latest) +

+
+
Created: +
+
+
+ +
Status: +
+{{deployment | annotation:'deploymentStatus'}} + + for + for + for + + + + + + + + +
+
+
Labels: +
+none +{{labelKey}}={{labelValue}}, + +
+
+
Selectors: +
+none +{{labelKey}}={{labelValue}}, + +
+
+
Replicas: +
{{deployment.status.replicas}} current / {{deployment.spec.replicas}} desired +
+
+
Pod Template: + +
+
+ +
+
+
+ +
+
+

+{{deploymentConfigName}} + + + + +

+
+
+

+{{deployment.metadata.name}} +

+
+
Created: +
+
+ +
Status: +
+{{deployment | annotation:'deploymentStatus'}} + + for + for + for + + + + + + + + +
+
+
Labels: +
+none +{{labelKey}}={{labelValue}}, + +
+
+
Selectors: +
+none +{{labelKey}}={{labelValue}}, + +
+
+
Replicas: +
{{deployment.status.replicas}} current / {{deployment.spec.replicas}} desired +
+
+
Pod Template:
+
+
+
+
`)