-
Notifications
You must be signed in to change notification settings - Fork 232
Init Containers #1560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Init Containers #1560
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<!-- | ||
Expects the following variables: | ||
containerStatuses | ||
onDebugTerminal (optional) | ||
detailed (optional) | ||
--> | ||
|
||
<div ng-if="detailed && pod.status.initContainerStatuses.length"> | ||
<h4 class="mar-bottom-xl" row ng-if="initContainersTerminated"> | ||
<span><i class="fa fa-check text-success"></i></span> | ||
<span flex> | ||
<ng-pluralize count="pod.status.initContainerStatuses.length" | ||
when="{'1': ' Init container {{pod.status.initContainerStatuses[0].name}}','other': ' {} init containers'}"> | ||
</ng-pluralize> | ||
completed successfully | ||
</span> | ||
<span ng-if="initContainersTerminated"> | ||
<a class="page-header-link" href="" ng-click="toggleInitContainer()"> | ||
<span ng-if="!expandInitContainers">Show</span> | ||
<span ng-if="expandInitContainers">Hide</span> | ||
Details | ||
</a> | ||
</span> | ||
</h4> | ||
|
||
<div class="animate-if" | ||
ng-if="expandInitContainers" | ||
ng-repeat="containerStatus in pod.status.initContainerStatuses track by containerStatus.name" > | ||
<h4 class="component-label">Init container {{containerStatus.name}}</h4> | ||
|
||
<dl class="dl-horizontal left"> | ||
<dt>State:</dt> | ||
<dd> | ||
<kubernetes-object-describe-container-state container-state="containerStatus.state"></kubernetes-object-describe-container-state> | ||
</dd> | ||
<dt ng-if="!(containerStatus.lastState | isEmptyObj)">Last State</dt> | ||
<dd ng-if="!(containerStatus.lastState | isEmptyObj)"> | ||
<kubernetes-object-describe-container-state container-state="containerStatus.lastState"></kubernetes-object-describe-container-state> | ||
</dd> | ||
<dt>Ready:</dt> | ||
<dd>{{containerStatus.ready}}</dd> | ||
<dt>Restart Count:</dt> | ||
<dd>{{containerStatus.restartCount}}</dd> | ||
</dl> | ||
</div> | ||
</div> | ||
|
||
<div ng-repeat="containerStatus in pod.status.containerStatuses track by containerStatus.name" > | ||
<h4>Container {{containerStatus.name}}</h4> | ||
|
||
<dl class="dl-horizontal left"> | ||
<dt>State:</dt> | ||
<dd> | ||
<kubernetes-object-describe-container-state container-state="containerStatus.state"></kubernetes-object-describe-container-state> | ||
</dd> | ||
<dt ng-if="!(containerStatus.lastState | isEmptyObj)">Last State</dt> | ||
<dd ng-if="!(containerStatus.lastState | isEmptyObj)"> | ||
<kubernetes-object-describe-container-state container-state="containerStatus.lastState"></kubernetes-object-describe-container-state> | ||
</dd> | ||
<dt>Ready:</dt> | ||
<dd>{{containerStatus.ready}}</dd> | ||
<dt>Restart Count:</dt> | ||
<dd>{{containerStatus.restartCount}}</dd> | ||
|
||
<div ng-if="hasDebugTerminal && showDebugAction(containerStatus) && ('pods' | canI : 'create')" class="debug-pod-action"> | ||
<a href="" ng-click="debugTerminal(containerStatus.name)" role="button">Debug in Terminal</a> | ||
</div> | ||
</dl> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
<!-- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above re:scope. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Caught |
||
Expects the following variables: | ||
podTemplateContainer | ||
imagesByDockerReference (optional) | ||
builds (optional) | ||
detailed (optional) | ||
labelPrefix (optional) | ||
--> | ||
|
||
<div class="pod-template"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just confirming the view content was moved, but otherwise is unchanged? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, close, the template is almost a one to one, added in |
||
<div class="component-label"><span ng-bind-template="{{labelPrefix||'Container'}}:"></span> {{container.name}}</div> | ||
|
||
<div row ng-if="container.image" class="pod-template-image icon-row"> | ||
<div class="icon-wrap"> | ||
<span class="pficon pficon-image" aria-hidden="true"></span> | ||
</div> | ||
<div flex class="word-break"> | ||
<span class="pod-template-key">Image:</span> | ||
<span ng-if="!imagesByDockerReference[container.image]">{{container.image | imageStreamName}}</span> | ||
<span ng-if="imagesByDockerReference[container.image]"> | ||
<a ng-href="{{imagesByDockerReference[container.image].imageStreamName | navigateResourceURL : 'ImageStream' : imagesByDockerReference[container.image].imageStreamNamespace}}">{{container.image | imageStreamName}}</a> | ||
<span class="hash" title="{{imagesByDockerReference[container.image].metadata.name}}">{{imagesByDockerReference[container.image].metadata.name | stripSHAPrefix | limitTo: 7}}</span> | ||
<span ng-if="imagesByDockerReference[container.image].dockerImageMetadata.Size" class="small text-muted nowrap"> | ||
{{imagesByDockerReference[container.image].dockerImageMetadata.Size | humanizeSize}} | ||
</span> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<div ng-if="imagesByDockerReference && container.image && (image = imagesByDockerReference[container.image])" class="pod-template-build"> | ||
<div row class="icon-row" ng-if="build = (image | buildForImage : builds)"> | ||
<div class="icon-wrap"> | ||
<span class="fa fa-refresh" aria-hidden="true"></span> | ||
</div> | ||
<div flex class="word-break"> | ||
<span class="pod-template-key">Build:</span> | ||
<span ng-if="build | configURLForResource"> | ||
<a ng-href="{{build | configURLForResource}}">{{build | buildConfigForBuild}}</a>, | ||
</span> | ||
<a ng-href="{{build | navigateResourceURL}}"> | ||
<span ng-if="(build | annotation : 'buildNumber')">#{{build | annotation : 'buildNumber'}}</span> | ||
<span ng-if="!(build | annotation : 'buildNumber')">{{build.metadata.name}}</span> | ||
</a> | ||
</div> | ||
</div> | ||
<div row class="icon-row" ng-if="build.spec.source"> | ||
<div class="icon-wrap"> | ||
<span class="fa fa-code" aria-hidden="true"></span> | ||
</div> | ||
<div flex class="word-break"> | ||
<span class="pod-template-key">Source:</span> | ||
<span ng-switch="build.spec.source.type"> | ||
<span ng-switch-when="Git"> | ||
<span ng-if="build.spec.revision.git.commit"> | ||
{{build.spec.revision.git.message}} | ||
<osc-git-link | ||
class="hash" | ||
uri="build.spec.source.git.uri" | ||
ref="build.spec.revision.git.commit">{{build.spec.revision.git.commit | limitTo:7}}</osc-git-link> | ||
<span ng-if="detailed && build.spec.revision.git.author"> | ||
authored by {{build.spec.revision.git.author.name}} | ||
</span> | ||
</span> | ||
<span ng-if="!build.spec.revision.git.commit"> | ||
<osc-git-link uri="build.spec.source.git.uri">{{build.spec.source.git.uri}}</osc-git-link> | ||
</span> | ||
</span> | ||
<span ng-switch-default> | ||
{{build.spec.source.type || 'Unknown'}} | ||
</span> | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div row ng-if="detailed && (container.command.length || container.args.length)" class="icon-row"> | ||
<div class="icon-wrap"> | ||
<span aria-hidden="true" class="fa fa-terminal"></span> | ||
</div> | ||
<div flex class="word-break"> | ||
<span class="pod-template-key"> | ||
Command: | ||
</span> | ||
<span> | ||
<code class="command"> | ||
<truncate-long-text | ||
content="container | entrypoint : imagesByDockerReference[container.image]" | ||
limit="80" | ||
newline-limit="1" | ||
expandable="true" | ||
use-word-boundary="false"> | ||
</truncate-long-text> | ||
</code> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<div row ng-if="container.ports.length > 0" class="pod-template-ports icon-row"> | ||
<div class="icon-wrap"> | ||
<span data-icon="" aria-hidden="true" style="font-size:16px;line-height:normal"></span> | ||
</div> | ||
<div flex class="word-break"> | ||
<span class="pod-template-key">Ports:</span> | ||
<span ng-repeat="port in container.ports | orderBy: 'containerPort' | limitToOrAll : detailed ? undefined : 1"> | ||
<span class="nowrap">{{port.containerPort}}/{{port.protocol}}</span><span ng-if="port.name"><span class="nowrap"> ({{port.name}})</span></span><span ng-if="port.hostPort"><span class="nowrap"><span class="port-icon"> →</span> {{port.hostPort}}</span></span><span ng-if="!$last">, </span> | ||
</span> | ||
<span ng-if="!detailed && container.ports.length >= 2"> | ||
and {{container.ports.length - 1}} | ||
<span ng-if="container.ports.length > 2">others</span> | ||
<span ng-if="container.ports.length === 2">other</span> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<div row ng-if="detailed" ng-repeat="mount in container.volumeMounts" class="icon-row"> | ||
<div class="icon-wrap"> | ||
<span aria-hidden="true" class="fa fa-database"></span> | ||
</div> | ||
<div flex class="word-break"> | ||
<span class="pod-template-key">Mount:</span> | ||
<span> | ||
{{mount.name}}<span ng-if="mount.subPath">, subpath {{mount.subPath}}</span> → <span>{{mount.mountPath}}</span> | ||
<small class="text-muted">{{mount | volumeMountMode : podTemplate.spec.volumes}}</small> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<div row ng-if="detailed && (container.resources.requests.cpu || container.resources.limits.cpu)" class="icon-row"> | ||
<div class="icon-wrap"> | ||
<i class="fa fa-area-chart" aria-hidden="true"></i> | ||
</div> | ||
<div flex> | ||
<span class="pod-template-key">CPU:</span> | ||
<span ng-if="container.resources.requests.cpu && container.resources.limits.cpu"> | ||
{{container.resources.requests.cpu | usageWithUnits: 'cpu'}} to {{container.resources.limits.cpu | usageWithUnits: 'cpu'}} | ||
</span> | ||
<span ng-if="!container.resources.requests.cpu"> | ||
{{container.resources.limits.cpu | usageWithUnits: 'cpu'}} limit | ||
</span> | ||
<span ng-if="!container.resources.limits.cpu"> | ||
{{container.resources.requests.cpu | usageWithUnits: 'cpu'}} requested | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<div row ng-if="detailed && (container.resources.requests.memory || container.resources.limits.memory)" class="icon-row"> | ||
<div class="icon-wrap"> | ||
<i class="fa fa-area-chart" aria-hidden="true"></i> | ||
</div> | ||
<div flex> | ||
<span class="pod-template-key">Memory:</span> | ||
<span ng-if="container.resources.requests.memory && container.resources.limits.memory"> | ||
{{container.resources.requests.memory | usageWithUnits: 'memory'}} to {{container.resources.limits.memory | usageWithUnits: 'memory'}} | ||
</span> | ||
<span ng-if="!container.resources.requests.memory"> | ||
{{container.resources.limits.memory | usageWithUnits: 'memory'}} limit | ||
</span> | ||
<span ng-if="!container.resources.limits.memory"> | ||
{{container.resources.requests.memory | usageWithUnits: 'memory'}} requested | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<div row ng-if="detailed && container.readinessProbe" class="icon-row"> | ||
<div class="icon-wrap"> | ||
<i class="fa fa-medkit" aria-hidden="true"></i> | ||
</div> | ||
<div flex> | ||
<span class="pod-template-key">Readiness Probe:</span> | ||
<probe probe="container.readinessProbe"></probe> | ||
</div> | ||
</div> | ||
|
||
<div row ng-if="detailed && container.livenessProbe" class="icon-row"> | ||
<div class="icon-wrap"> | ||
<i class="fa fa-medkit" aria-hidden="true"></i> | ||
</div> | ||
<div flex> | ||
<span class="pod-template-key">Liveness Probe:</span> | ||
<probe probe="container.livenessProbe"></probe> | ||
</div> | ||
</div> | ||
|
||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious about these comments here, these variables are not in the directive scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caught
podStatus
earlier, should be updated now... if we're going for only listing values/properties/variables used in the templates can adjust accordingly