fixing upgrading tab

This commit is contained in:
Nancy Butler 2020-09-16 14:10:00 -07:00
parent 142a189ae9
commit 2cfc90ca63
4 changed files with 185 additions and 37 deletions

View File

@ -1509,8 +1509,8 @@ workload:
minReadySeconds:
label: Minimum Ready
tip: The minimum duration a pod should be ready without containers crashing for it to be considered available.
partition:
label: Partition
podManagementPolicy:
label: Pod Management Policy
progressDeadlineSeconds:
label: Progress Deadline
tip: The minimum duration to wait for a deployment to progress before marking it failed.

View File

@ -7,6 +7,15 @@ import { _VIEW } from '@/config/query-params';
export default {
components: { KeyValue, Tag },
props: {
value: {
type: Object,
default: () => {
return {};
}
}
},
data() {
return { annotationsVisible: false, view: _VIEW };
},
@ -88,9 +97,9 @@ export default {
<div class="detail-top row" :class="{empty: isEmpty}">
<div v-if="hasLeft" class="col left" :class="leftSpan">
<div v-for="detail in details" :key="detail.label || detail.slotName">
<div class="label">
<span class="label">
{{ detail.label }}:
</div>
</span>
<component
:is="detail.formatter"
v-if="detail.formatter"

View File

@ -208,20 +208,21 @@ export default {
/>
</div>
</div>
<template v-if="strategy === 'RollingUpdate'">
<div v-if="isStatefulSet" class="row mb-20">
<div class="col span-6">
<UnitInput v-model="partition" :suffix="partition == 1 ? 'Pod' : 'Pods'" :label="t('workload.upgrading.partition.label')" :mode="mode">
<div v-if="isStatefulSet" class="row mb-20">
<div class="col span-6">
<RadioGroup v-model="value.podManagementPolicy" :label="t('workload.upgrading.podManagementPolicy.label')" :options="['OrderedReady', 'Parallel']" />
<!-- <UnitInput v-model="partition" :suffix="partition == 1 ? 'Pod' : 'Pods'" :label="t('workload.upgrading.partition.label')" :mode="mode">
<template #label>
<label :style="{'color':'var(--input-label)'}">
{{ t('workload.upgrading.partition.label') }}
<i v-tooltip="t('workload.upgrading.partition.tip')" class="icon icon-info" style="font-size: 14px" />
</label>
</template>
</UnitInput>
</div>
</UnitInput> -->
</div>
<div v-else-if="isDeployment || isDaemonSet" class="row mb-20">
</div>
<template v-if="strategy === 'RollingUpdate'">
<div v-if="isDeployment || isDaemonSet" class="row mb-20">
<div v-if="isDeployment" class="col span-6">
<InputWithSelect
:text-value="maxSurge"

View File

@ -38,33 +38,171 @@ export default {
},
details() {
return [
{
label: 'Image',
content: this.container.image
},
{
label: 'Type',
content: this._type ? this._type : this.type
},
{
label: 'Config Scale',
content: this.spec?.replicas,
let out;
const type = this._type ? this._type : this.type;
},
{
label: 'Ready Scale',
content: this.status?.readyReplicas,
},
/**
* TODO: Pod Restarts will require more changes to get working but since workloads is being rewritten those
* changes can be done at that time if this is still needed.
* {
* label: 'Pod Restarts',
* content: this.podRestarts,
* }
*/
];
switch (type) {
case WORKLOAD_TYPES.DEPLOYMENT:
out = [
{
label: 'Type',
content: this._type ? this._type : this.type
},
{
label: 'Replicas',
content: this?.spec?.replicas
},
{
label: 'Available',
content: this?.status?.availableReplicas,
},
{
label: 'Unavailable',
content: this?.status?.unavailableReplicas,
},
{
label: 'Ready',
content: this?.status?.readyReplicas,
},
{
label: 'Updated',
content: this?.status?.updatedReplicas,
},
];
break;
case WORKLOAD_TYPES.STATEFUL_SET:
out = [
{
label: 'Type',
content: this._type ? this._type : this.type
},
{
label: 'Replicas',
content: this?.spec?.replicas
},
{
label: 'Services',
content: this?.spec?.serviceName
},
];
break;
case WORKLOAD_TYPES.DAEMON_SET:
out = [
{
label: 'Type',
content: this._type ? this._type : this.type
},
{
label: 'Number',
content: this.status.currentNumberScheduled / this.status.desiredNumberScheduled
},
{
label: 'Available',
content: this.status.numberAvailable
},
{
label: 'Unavailable',
content: this.status.numberUnavailable
},
{
label: 'Ready',
content: this.status.numberReady
},
{
label: 'Updated',
content: this.status.numberUpdated
},
];
break;
case WORKLOAD_TYPES.REPLICA_SET:
out = [
{
label: 'Type',
content: this._type ? this._type : this.type
},
{
label: 'Available',
content: this?.status?.availableReplicas,
},
{
label: 'Fully Labeled',
content: this?.status?.fullyLabeledReplicas,
},
];
break;
case WORKLOAD_TYPES.JOB:
out = [
{
label: 'Type',
content: this._type ? this._type : this.type
},
{
label: 'Succeeded',
content: this?.status?.succeeded,
},
{
label: 'Failed',
content: this?.status?.failed,
},
{
label: 'Start Time',
content: this?.status?.startTime,
formatter: 'LiveDate'
},
{
label: 'Completion Time',
content: this?.status?.completionTime,
formatter: 'LiveDate'
},
];
break;
case WORKLOAD_TYPES.CRON_JOB:
out = [
{
label: 'Type',
content: this._type ? this._type : this.type
},
{
label: 'Last Scheduled Time',
content: this?.status?.lastScheduleTime,
formatter: 'LiveDate'
},
];
break;
default:
out = [
{
label: 'Image',
content: this.container.image
},
{
label: 'Type',
content: this._type ? this._type : this.type
},
{
label: 'Config Scale',
content: this.spec?.replicas,
},
{
label: 'Ready Scale',
content: this.status?.readyReplicas,
},
/**
* TODO: Pod Restarts will require more changes to get working but since workloads is being rewritten those
* changes can be done at that time if this is still needed.
* {
* label: 'Pod Restarts',
* content: this.podRestarts,
* }
*/
];
}
return out;
},
redeploy() {