From 6dd2962090c9d8895d3ccc6d7585dc83c8e1d6bf Mon Sep 17 00:00:00 2001 From: Neil MacDougall Date: Wed, 30 Oct 2024 15:51:55 +0000 Subject: [PATCH] Ensure we don't lose values on edit of cluster scan resource (#12427) --- shell/edit/cis.cattle.io.clusterscan.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell/edit/cis.cattle.io.clusterscan.vue b/shell/edit/cis.cattle.io.clusterscan.vue index ff55cccb63d..1601d02d8da 100644 --- a/shell/edit/cis.cattle.io.clusterscan.vue +++ b/shell/edit/cis.cattle.io.clusterscan.vue @@ -12,7 +12,7 @@ import { allHash } from '@shell/utils/promise'; import { Checkbox } from '@components/Form/Checkbox'; import { RadioGroup } from '@components/Form/Radio'; import { get } from '@shell/utils/object'; -import { _VIEW, _CREATE, _EDIT } from '@shell/config/query-params'; +import { _VIEW, _CREATE } from '@shell/config/query-params'; import { isValidCron } from 'cron-validator'; import { fetchSpecsScheduledScanConfig } from '@shell/models/cis.cattle.io.clusterscan'; @@ -43,7 +43,8 @@ export default { // in the clusterscan edit/create views the "canBeScheduled" won't run properly await this.schema.fetchResourceFields(); - if (this.realMode === _CREATE || this.realMode === _EDIT) { + // Only initialize on create or if we don't have a spec object (added for resilience) + if (this.realMode === _CREATE || !this.value.spec) { const includeScheduling = this.value.canBeScheduled(); const spec = this.value.spec || {};