Skip to content

Commit

Permalink
Merge pull request #13029 from torchiaf/13026-gitrepo-config
Browse files Browse the repository at this point in the history
Handle correctDrift:enabled undefined value
  • Loading branch information
torchiaf authored Jan 21, 2025
2 parents c0c63e4 + d17abad commit 2ec0204
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions shell/edit/fleet.cattle.io.gitrepo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ export default {
this.tlsMode = tls;
if (this.value.spec.correctDrift === undefined) {
this.value.spec['correctDrift'] = { enabled: false };
}
this.correctDriftEnabled = this.value.spec?.correctDrift?.enabled || false;
this.updateTargets();
},
Expand Down Expand Up @@ -143,6 +141,7 @@ export default {
privateKey: null,
tlsMode: null,
caBundle: null,
correctDriftEnabled: false,
targetAdvancedErrors: null,
matchingClusters: null,
ref,
Expand Down Expand Up @@ -496,6 +495,12 @@ export default {
}
}
},
onSave() {
this.value.spec['correctDrift'] = { enabled: this.correctDriftEnabled };
this.save();
}
}
};
</script>
Expand All @@ -516,7 +521,7 @@ export default {
class="wizard"
@cancel="done"
@error="e=>errors = e"
@finish="save"
@finish="onSave"
>
<template #noticeBanner>
<Banner
Expand Down Expand Up @@ -651,7 +656,7 @@ export default {
<h2 v-t="'fleet.gitRepo.resources.label'" />
<div class="resource-handling">
<Checkbox
v-model:value="value.spec.correctDrift.enabled"
v-model:value="correctDriftEnabled"
:tooltip="t('fleet.gitRepo.resources.correctDriftBanner')"
data-testid="GitRepo-correctDrift-checkbox"
class="check"
Expand Down

0 comments on commit 2ec0204

Please sign in to comment.