From 5c6869f7ff03486c0a2e9fe0e448591b27c01f39 Mon Sep 17 00:00:00 2001 From: Andrej Petras Date: Mon, 22 Apr 2024 12:10:28 +0200 Subject: [PATCH] feat: add slot resource --- templates/operator-slot.yaml | 18 ++++++++++++++++++ tests/slots.yaml | 15 +++++++++++++++ values.yaml | 17 +++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 templates/operator-slot.yaml create mode 100644 tests/slots.yaml diff --git a/templates/operator-slot.yaml b/templates/operator-slot.yaml new file mode 100644 index 0000000..e33e913 --- /dev/null +++ b/templates/operator-slot.yaml @@ -0,0 +1,18 @@ +{{ if .Values.operator.slot.enabled }} +{{- range $item_name, $item_spec := .Values.operator.slot.specs }} +--- +apiVersion: onecx.tkit.org/v1 +kind: Slot +metadata: + name: {{ include "app-angular.fullname" $ }}-{{ $item_name }} + labels: + app: {{ include "app-angular.fullname" $ }} +{{ include "app-angular.labels.common" $ | indent 4 }} +spec: + productName: {{ $item_spec.productName | default (include "app-angular.product.name" $) }} + appId: {{ $item_spec.appId | default (include "app-angular.id" $) }} + name: {{ $item_spec.name | default $item_name }} + description: {{ $item_spec.description | default $.Values.operator.slot.spec.description }} + deprecated: {{ $item_spec.deprecated | default $.Values.operator.slot.spec.deprecated }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/tests/slots.yaml b/tests/slots.yaml new file mode 100644 index 0000000..8d4fe4c --- /dev/null +++ b/tests/slots.yaml @@ -0,0 +1,15 @@ +operator: + slot: + enabled: true + specs: + menu: + name: "menu" + horizontal: + name: "horizontalMenu" + headerRight: + name: "headerRight" + subHeader: + name: "subHeader" + spec: + description: "OneCX Product Store UI 2" + deprecated: false \ No newline at end of file diff --git a/values.yaml b/values.yaml index 80c0a18..6995af4 100644 --- a/values.yaml +++ b/values.yaml @@ -149,6 +149,23 @@ operator: # action: description permissions: + # slot + slot: + # enable or disable configuration for operator + enabled: false + + # map of of mfe spec ( see spec ) + specs: + + # definnition and default values for the list of spec 'specs' + spec: + # name of the slot ( ref. id to sour code of the app) + name: + # deprecated true | false + deprecated: false + # description text + description: change-me + # microfrontend microfrontend: # enable or disable configuration for operator