Skip to content

Commit

Permalink
fix(workload): fix current active container can not be watched
Browse files Browse the repository at this point in the history
  • Loading branch information
ly5156 committed Jan 7, 2025
1 parent c69995d commit 2d7ef73
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions shell/edit/workload/mixins/workload.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ export default {
}
}

this.selectContainer(container);
if (this.realMode === _CLONE && this.value.type === WORKLOAD_TYPES.JOB) {
this.cleanUpClonedJobData();
}
Expand Down Expand Up @@ -320,13 +319,11 @@ export default {
podFsGroup: podTemplateSpec.securityContext?.fsGroup,
savePvcHookName: 'savePvcHook',
tabWeightMap: TAB_WEIGHT_MAP,
fvFormRuleSets: [{
path: 'image', rootObject: this.container, rules: ['required'], translationKey: 'workload.container.image'
}],
fvReportedValidationPaths: ['spec'],
isNamespaceNew: false,
allPods: [],
idKey: ID_KEY,
fvFormRuleSets: [],
fvReportedValidationPaths: ['spec'],
isNamespaceNew: false,
allPods: [],
idKey: ID_KEY,

systemGpuManagementSchedulerName: '',
hamiResourceLimtsOptions: []
Expand Down Expand Up @@ -730,6 +727,15 @@ export default {
if (this.harbor.imageTag) {
this.container.imageTag = this.harbor.imageTag;
}
},

container: {
handler(c) {
this.fvFormRuleSets = [{
path: 'image', rootObject: c, rules: ['required'], translationKey: 'workload.container.image'
}];
},
immediate: true
}
},

Expand All @@ -739,6 +745,8 @@ export default {

this.registerAfterHook(this.saveService, 'saveService');
this.initStaticPod(this.podTemplateSpec, this.podAnnotations);

this.selectContainer(this.container);
},

methods: {
Expand Down

0 comments on commit 2d7ef73

Please sign in to comment.