Skip to content

Commit

Permalink
Merge pull request rancher#12998 from ly5156/workload_data_method
Browse files Browse the repository at this point in the history
chore(workload): disable access to unreturned data attributes in data method
  • Loading branch information
rak-phillip authored Jan 13, 2025
2 parents babdcee + 3ef4c72 commit 0c6eb64
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions shell/edit/workload/mixins/workload.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ export default {
}
}

this.selectContainer(container);
if (this.realMode === _CLONE && this.value.type === WORKLOAD_TYPES.JOB) {
this.cleanUpClonedJobData();
}
Expand Down Expand Up @@ -280,12 +279,10 @@ 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,
idKey: ID_KEY
fvFormRuleSets: [],
fvReportedValidationPaths: ['spec'],
isNamespaceNew: false,
idKey: ID_KEY
};
},

Expand Down Expand Up @@ -605,13 +602,24 @@ export default {
this.value['type'] = neu;
delete this.value.apiVersion;
},

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

created() {
this.registerBeforeHook(this.saveWorkload, 'willSaveWorkload');
this.registerBeforeHook(this.getPorts, 'getPorts');

this.registerAfterHook(this.saveService, 'saveService');

this.selectContainer(this.container);
},

methods: {
Expand Down

0 comments on commit 0c6eb64

Please sign in to comment.