Skip to content

Commit

Permalink
Ensure we don't lose values on edit of cluster scan resource (#12427)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac authored Oct 30, 2024
1 parent e2731eb commit 6dd2962
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions shell/edit/cis.cattle.io.clusterscan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 || {};
Expand Down

0 comments on commit 6dd2962

Please sign in to comment.