diff --git a/charts/olm-operator-installer/Chart.yaml b/charts/olm-operator-installer/Chart.yaml index 38d92b9..ba8927c 100644 --- a/charts/olm-operator-installer/Chart.yaml +++ b/charts/olm-operator-installer/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 +version: 0.1.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/olm-operator-installer/README.md b/charts/olm-operator-installer/README.md index 3b10a1a..1b4f8d9 100644 --- a/charts/olm-operator-installer/README.md +++ b/charts/olm-operator-installer/README.md @@ -40,6 +40,10 @@ operatorGroup: # operator group name name: cert-manager-operator + ########################################################### + # You may enable selector or targetNamespace but not both # + ########################################################### + selector: # do not set selector matchLabels if false enabled: false @@ -48,6 +52,15 @@ operatorGroup: - name: olm-operator-installer/managed-by value: "{{ .Values.subscription.name }}" + targetNamespaces: + # do not set target namespaces if false + enabled: false + # A list of namespaces names to watch + # namespaces should be created before the operator deployment otherwise the operator + # could report errors on trying to access the namespace resources + name: + - my-example-namespaces + subscription: # subscription name name: cert-manager-operator-sub diff --git a/charts/olm-operator-installer/examples/amq-broker-operator.yaml b/charts/olm-operator-installer/examples/amq-broker-operator.yaml index e0798b1..c73402a 100644 --- a/charts/olm-operator-installer/examples/amq-broker-operator.yaml +++ b/charts/olm-operator-installer/examples/amq-broker-operator.yaml @@ -14,6 +14,10 @@ operatorGroup: # operator group name name: amq-broker-operator + ########################################################### + # You may enable selector or targetNamespace but not both # + ########################################################### + selector: # do not set selector matchLabels if false enabled: true @@ -22,6 +26,15 @@ operatorGroup: - name: olm-operator-installer/managed-by value: "{{ .Values.subscription.name }}" + targetNamespaces: + # do not set target namespaces if false + enabled: false + # A list of namespaces names to watch + # namespaces should be created before the operator deployment otherwise the operator + # could report errors on trying to access the namespace resources + names: + - my-example-namespaces + subscription: # subscription name name: amq-broker-operator-olm-sub diff --git a/charts/olm-operator-installer/templates/OperatorGroup.yaml b/charts/olm-operator-installer/templates/OperatorGroup.yaml index 35373bc..5fe4337 100644 --- a/charts/olm-operator-installer/templates/OperatorGroup.yaml +++ b/charts/olm-operator-installer/templates/OperatorGroup.yaml @@ -5,12 +5,18 @@ metadata: name: {{ .Values.operatorGroup.name }} namespace: {{ .Values.namespace.name }} spec: -{{- if .Values.operatorGroup.selector.enabled }} + {{- if .Values.operatorGroup.selector.enabled }} selector: matchLabels: {{- range .Values.operatorGroup.selector.matchLabels }} {{ .name }}: {{ tpl .value $ }} {{- end }} -{{- end }} + {{- end }} + {{- if .Values.operatorGroup.targetNamespaces.enabled }} + targetNamespaces: + {{- range .Values.operatorGroup.targetNamespaces.names }} + - {{ . }} + {{- end }} + {{- end }} {{- end }} diff --git a/charts/olm-operator-installer/values.yaml b/charts/olm-operator-installer/values.yaml index dc22a20..c7cdaec 100644 --- a/charts/olm-operator-installer/values.yaml +++ b/charts/olm-operator-installer/values.yaml @@ -12,6 +12,10 @@ operatorGroup: # operator group name name: cert-manager-operator + ########################################################### + # You may enable selector or targetNamespace but not both # + ########################################################### + selector: # do not set selector matchLabels if false enabled: false @@ -20,6 +24,15 @@ operatorGroup: - name: olm-operator-installer/managed-by value: "{{ .Values.subscription.name }}" + targetNamespaces: + # do not set target namespaces if false + enabled: false + # A list of namespaces names to watch + # namespaces should be created before the operator deployment otherwise the operator + # could report errors on trying to access the namespace resources + names: + - my-example-namespaces + subscription: # subscription name name: cert-manager-operator-sub