From 797c038d4dd7d995fd68fa85253a02526a6ec175 Mon Sep 17 00:00:00 2001 From: Cody Jackson Date: Thu, 26 Mar 2020 13:27:05 -0700 Subject: [PATCH] Adding ApiGroups to Constraints by default rancher/dashboard#387 --- shared/gatekeeper-constraint.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shared/gatekeeper-constraint.vue b/shared/gatekeeper-constraint.vue index 71289ac802..ee673179cf 100644 --- a/shared/gatekeeper-constraint.vue +++ b/shared/gatekeeper-constraint.vue @@ -55,13 +55,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: [] }, @@ -70,6 +70,10 @@ export default { } }; + localValue.spec.match.kinds = (localValue?.spec?.match?.kinds || []).length === 0 + ? [{ apiGroups: [''] }] + : localValue.spec.match.kinds; + const extraDetailColumns = [ { title: 'Template',