diff --git a/shell/edit/fleet.cattle.io.gitrepo.vue b/shell/edit/fleet.cattle.io.gitrepo.vue index d9116257144..451bca81d44 100644 --- a/shell/edit/fleet.cattle.io.gitrepo.vue +++ b/shell/edit/fleet.cattle.io.gitrepo.vue @@ -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(); }, @@ -145,6 +143,7 @@ export default { privateKey: null, tlsMode: null, caBundle: null, + correctDriftEnabled: false, targetAdvancedErrors: null, matchingClusters: null, ref, @@ -492,6 +491,12 @@ export default { } } }, + + onSave() { + this.value.spec['correctDrift'] = { enabled: this.correctDriftEnabled }; + + this.save(); + } } }; @@ -513,7 +518,7 @@ export default { class="wizard" @cancel="done" @error="e=>errors = e" - @finish="save" + @finish="onSave" >