|
| 1 | +<!-- |
| 2 | + Expects the following variables: |
| 3 | + podTemplateContainer |
| 4 | + imagesByDockerReference (optional) |
| 5 | + builds (optional) |
| 6 | + detailed (optional) |
| 7 | + labelPrefix (optional) |
| 8 | + --> |
| 9 | + |
| 10 | +<div class="pod-template"> |
| 11 | + <div class="component-label"><span ng-bind-template="{{labelPrefix}}:"></span> {{container.name}}</div> |
| 12 | + |
| 13 | + <div row ng-if="container.image" class="pod-template-image icon-row"> |
| 14 | + <div class="icon-wrap"> |
| 15 | + <span class="pficon pficon-image" aria-hidden="true"></span> |
| 16 | + </div> |
| 17 | + <div flex class="word-break"> |
| 18 | + <span class="pod-template-key">Image:</span> |
| 19 | + <span ng-if="!imagesByDockerReference[container.image]">{{container.image | imageStreamName}}</span> |
| 20 | + <span ng-if="imagesByDockerReference[container.image]"> |
| 21 | + <a ng-href="{{imagesByDockerReference[container.image].imageStreamName | navigateResourceURL : 'ImageStream' : imagesByDockerReference[container.image].imageStreamNamespace}}">{{container.image | imageStreamName}}</a> |
| 22 | + <span class="hash" title="{{imagesByDockerReference[container.image].metadata.name}}">{{imagesByDockerReference[container.image].metadata.name | stripSHAPrefix | limitTo: 7}}</span> |
| 23 | + <span ng-if="imagesByDockerReference[container.image].dockerImageMetadata.Size" class="small text-muted nowrap"> |
| 24 | + {{imagesByDockerReference[container.image].dockerImageMetadata.Size | humanizeSize}} |
| 25 | + </span> |
| 26 | + </span> |
| 27 | + </div> |
| 28 | + </div> |
| 29 | + |
| 30 | + <div ng-if="imagesByDockerReference && container.image && (image = imagesByDockerReference[container.image])" class="pod-template-build"> |
| 31 | + <div row class="icon-row" ng-if="build = (image | buildForImage : builds)"> |
| 32 | + <div class="icon-wrap"> |
| 33 | + <span class="fa fa-refresh" aria-hidden="true"></span> |
| 34 | + </div> |
| 35 | + <div flex class="word-break"> |
| 36 | + <span class="pod-template-key">Build:</span> |
| 37 | + <span ng-if="build | configURLForResource"> |
| 38 | + <a ng-href="{{build | configURLForResource}}">{{build | buildConfigForBuild}}</a>, |
| 39 | + </span> |
| 40 | + <a ng-href="{{build | navigateResourceURL}}"> |
| 41 | + <span ng-if="(build | annotation : 'buildNumber')">#{{build | annotation : 'buildNumber'}}</span> |
| 42 | + <span ng-if="!(build | annotation : 'buildNumber')">{{build.metadata.name}}</span> |
| 43 | + </a> |
| 44 | + </div> |
| 45 | + </div> |
| 46 | + <div row class="icon-row" ng-if="build.spec.source"> |
| 47 | + <div class="icon-wrap"> |
| 48 | + <span class="fa fa-code" aria-hidden="true"></span> |
| 49 | + </div> |
| 50 | + <div flex class="word-break"> |
| 51 | + <span class="pod-template-key">Source:</span> |
| 52 | + <span ng-switch="build.spec.source.type"> |
| 53 | + <span ng-switch-when="Git"> |
| 54 | + <span ng-if="build.spec.revision.git.commit"> |
| 55 | + {{build.spec.revision.git.message}} |
| 56 | + <osc-git-link |
| 57 | + class="hash" |
| 58 | + uri="build.spec.source.git.uri" |
| 59 | + ref="build.spec.revision.git.commit">{{build.spec.revision.git.commit | limitTo:7}}</osc-git-link> |
| 60 | + <span ng-if="detailed && build.spec.revision.git.author"> |
| 61 | + authored by {{build.spec.revision.git.author.name}} |
| 62 | + </span> |
| 63 | + </span> |
| 64 | + <span ng-if="!build.spec.revision.git.commit"> |
| 65 | + <osc-git-link uri="build.spec.source.git.uri">{{build.spec.source.git.uri}}</osc-git-link> |
| 66 | + </span> |
| 67 | + </span> |
| 68 | + <span ng-switch-default> |
| 69 | + {{build.spec.source.type || 'Unknown'}} |
| 70 | + </span> |
| 71 | + </span> |
| 72 | + </div> |
| 73 | + </div> |
| 74 | + </div> |
| 75 | + |
| 76 | + <div row ng-if="detailed && (container.command.length || container.args.length)" class="icon-row"> |
| 77 | + <div class="icon-wrap"> |
| 78 | + <span aria-hidden="true" class="fa fa-terminal"></span> |
| 79 | + </div> |
| 80 | + <div flex class="word-break"> |
| 81 | + <span class="pod-template-key"> |
| 82 | + Command: |
| 83 | + </span> |
| 84 | + <span> |
| 85 | + <code class="command"> |
| 86 | + <truncate-long-text |
| 87 | + content="container | entrypoint : imagesByDockerReference[container.image]" |
| 88 | + limit="80" |
| 89 | + newline-limit="1" |
| 90 | + expandable="true" |
| 91 | + use-word-boundary="false"> |
| 92 | + </truncate-long-text> |
| 93 | + </code> |
| 94 | + </span> |
| 95 | + </div> |
| 96 | + </div> |
| 97 | + |
| 98 | + <div row ng-if="container.ports.length > 0" class="pod-template-ports icon-row"> |
| 99 | + <div class="icon-wrap"> |
| 100 | + <span data-icon="" aria-hidden="true" style="font-size:16px;line-height:normal"></span> |
| 101 | + </div> |
| 102 | + <div flex class="word-break"> |
| 103 | + <span class="pod-template-key">Ports:</span> |
| 104 | + <span ng-repeat="port in container.ports | orderBy: 'containerPort' | limitToOrAll : detailed ? undefined : 1"> |
| 105 | + <span><span class="nowrap">{{port.containerPort}}/{{port.protocol}}</span> |
| 106 | + <span ng-if="port.name"> <span class="nowrap">({{port.name}})</span></span> |
| 107 | + <span ng-if="port.hostPort"> <span class="nowrap"><span class="port-icon">→</span> {{port.hostPort}}</span></span> |
| 108 | + </span> |
| 109 | + <span ng-if="!$last">, </span> |
| 110 | + </span> |
| 111 | + <span ng-if="!detailed && container.ports.length >= 2"> |
| 112 | + and {{container.ports.length - 1}} |
| 113 | + <span ng-if="container.ports.length > 2">others</span> |
| 114 | + <span ng-if="container.ports.length === 2">other</span> |
| 115 | + </span> |
| 116 | + </div> |
| 117 | + </div> |
| 118 | + |
| 119 | + <div row ng-if="detailed" ng-repeat="mount in container.volumeMounts" class="icon-row"> |
| 120 | + <div class="icon-wrap"> |
| 121 | + <span aria-hidden="true" class="fa fa-database"></span> |
| 122 | + </div> |
| 123 | + <div flex class="word-break"> |
| 124 | + <span class="pod-template-key">Mount:</span> |
| 125 | + <span> |
| 126 | + {{mount.name}}<span ng-if="mount.subPath">, subpath {{mount.subPath}}</span> → <span>{{mount.mountPath}}</span> |
| 127 | + <small class="text-muted">{{mount | volumeMountMode : podTemplate.spec.volumes}}</small> |
| 128 | + </span> |
| 129 | + </div> |
| 130 | + </div> |
| 131 | + |
| 132 | + <div row ng-if="detailed && (container.resources.requests.cpu || container.resources.limits.cpu)" class="icon-row"> |
| 133 | + <div class="icon-wrap"> |
| 134 | + <i class="fa fa-area-chart" aria-hidden="true"></i> |
| 135 | + </div> |
| 136 | + <div flex> |
| 137 | + <span class="pod-template-key">CPU:</span> |
| 138 | + <span ng-if="container.resources.requests.cpu && container.resources.limits.cpu"> |
| 139 | + {{container.resources.requests.cpu | usageWithUnits: 'cpu'}} to {{container.resources.limits.cpu | usageWithUnits: 'cpu'}} |
| 140 | + </span> |
| 141 | + <span ng-if="!container.resources.requests.cpu"> |
| 142 | + {{container.resources.limits.cpu | usageWithUnits: 'cpu'}} limit |
| 143 | + </span> |
| 144 | + <span ng-if="!container.resources.limits.cpu"> |
| 145 | + {{container.resources.requests.cpu | usageWithUnits: 'cpu'}} requested |
| 146 | + </span> |
| 147 | + </div> |
| 148 | + </div> |
| 149 | + |
| 150 | + <div row ng-if="detailed && (container.resources.requests.memory || container.resources.limits.memory)" class="icon-row"> |
| 151 | + <div class="icon-wrap"> |
| 152 | + <i class="fa fa-area-chart" aria-hidden="true"></i> |
| 153 | + </div> |
| 154 | + <div flex> |
| 155 | + <span class="pod-template-key">Memory:</span> |
| 156 | + <span ng-if="container.resources.requests.memory && container.resources.limits.memory"> |
| 157 | + {{container.resources.requests.memory | usageWithUnits: 'memory'}} to {{container.resources.limits.memory | usageWithUnits: 'memory'}} |
| 158 | + </span> |
| 159 | + <span ng-if="!container.resources.requests.memory"> |
| 160 | + {{container.resources.limits.memory | usageWithUnits: 'memory'}} limit |
| 161 | + </span> |
| 162 | + <span ng-if="!container.resources.limits.memory"> |
| 163 | + {{container.resources.requests.memory | usageWithUnits: 'memory'}} requested |
| 164 | + </span> |
| 165 | + </div> |
| 166 | + </div> |
| 167 | + |
| 168 | + <div row ng-if="detailed && container.readinessProbe" class="icon-row"> |
| 169 | + <div class="icon-wrap"> |
| 170 | + <i class="fa fa-medkit" aria-hidden="true"></i> |
| 171 | + </div> |
| 172 | + <div flex> |
| 173 | + <span class="pod-template-key">Readiness Probe:</span> |
| 174 | + <probe probe="container.readinessProbe"></probe> |
| 175 | + </div> |
| 176 | + </div> |
| 177 | + |
| 178 | + <div row ng-if="detailed && container.livenessProbe" class="icon-row"> |
| 179 | + <div class="icon-wrap"> |
| 180 | + <i class="fa fa-medkit" aria-hidden="true"></i> |
| 181 | + </div> |
| 182 | + <div flex> |
| 183 | + <span class="pod-template-key">Liveness Probe:</span> |
| 184 | + <probe probe="container.livenessProbe"></probe> |
| 185 | + </div> |
| 186 | + </div> |
| 187 | + |
| 188 | +</div> |
0 commit comments