Skip to content

Commit 4dbc2b4

Browse files
committed
Init Containers Template Updates
Pod Template updates
1 parent 8d5352b commit 4dbc2b4

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

app/scripts/directives/resources.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,7 @@ angular.module('openshiftConsole')
6969
// Optional URL for setting health checks on the resource when missing.
7070
addHealthCheckUrl: '@?'
7171
},
72-
templateUrl: 'views/_pod-template.html',
73-
link: function(scope) {
74-
scope.containers = _.get(scope.podTemplate, 'spec.containers', []);
75-
scope.initContainers = _.get(scope.podTemplate, 'spec.initContainers', []);
76-
}
72+
templateUrl: 'views/_pod-template.html'
7773
};
7874
})
7975
.directive('podTemplateContainer', function() {

app/views/_pod-template.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ <h3>Template</h3>
1212
<!-- Prompt to add health checks if missing. -->
1313
<div ng-if="detailed && addHealthCheckUrl && !(podTemplate | hasHealthChecks)" class="alert alert-info">
1414
<span class="pficon pficon-info" aria-hidden="true"></span>
15-
<span ng-if="initContainers.length === 1">This container has no health checks</span>
16-
<span ng-if="initContainers.length > 1">Not all containers have health checks</span>
15+
<span ng-if="podTemplate.spec.initContainers.length === 1">This container has no health checks</span>
16+
<span ng-if="podTemplate.spec.initContainers.length > 1">Not all containers have health checks</span>
1717
to ensure your application is running correctly.
1818
<a ng-href="{{addHealthCheckUrl}}" class="nowrap">Add Health Checks</a>
1919
</div>
@@ -22,7 +22,7 @@ <h3>Template</h3>
2222
<h4>Init Containers</h4>
2323

2424
<div class="pod-template-container">
25-
<div class="pod-template-block" ng-repeat="container in initContainers">
25+
<div class="pod-template-block" ng-repeat="container in podTemplate.spec.initContainers">
2626

2727
<pod-template-container
2828
pod-template-container="container"
@@ -45,7 +45,7 @@ <h4>Init Containers</h4>
4545
<h4>Containers</h4>
4646

4747
<div class="pod-template-container">
48-
<div class="pod-template-block" ng-repeat="container in containers">
48+
<div class="pod-template-block" ng-repeat="container in podTemplate.spec.containers">
4949

5050
<pod-template-container
5151
pod-template-container="container"
@@ -57,7 +57,7 @@ <h4>Containers</h4>
5757
extension-point
5858
extension-name="container-links"
5959
extension-types="link dom"
60-
extension-args="[container, containers]"></div>
60+
extension-args="[container, podTemplate]"></div>
6161

6262
</div>
6363
</div>

0 commit comments

Comments
 (0)