diff --git a/shared/gatekeeper-constraint.vue b/shared/gatekeeper-constraint.vue index 691f670c60..551a9c353d 100644 --- a/shared/gatekeeper-constraint.vue +++ b/shared/gatekeeper-constraint.vue @@ -62,13 +62,13 @@ export default { }); const localValue = Object.keys(this.value).length > 0 - ? this.value + ? { ...this.value } : { type: templateOptions[0].value, spec: { parameters: {}, match: { - kinds: [], + kinds: [{ apiGroups: [''] }], namespaces: [], excludedNamespaces: [], labelSelector: { matchExpressions: [] }, @@ -77,6 +77,10 @@ export default { } }; + localValue.spec.match.kinds = (localValue?.spec?.match?.kinds || []).length === 0 + ? [{ apiGroups: [''] }] + : localValue.spec.match.kinds; + const extraDetailColumns = [ { title: 'Template',