Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ description: A Helm chart to configure Advanced Cluster Manager for OpenShift.
keywords:
- pattern
name: acm
version: 0.1.12
version: 0.1.13
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# acm

![Version: 0.1.12](https://img.shields.io/badge/Version-0.1.12-informational?style=flat-square)
![Version: 0.1.13](https://img.shields.io/badge/Version-0.1.13-informational?style=flat-square)

A Helm chart to configure Advanced Cluster Manager for OpenShift.

Expand All @@ -11,6 +11,8 @@ This chart is used by the Validated Patterns to configure ACM and manage remote
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| acm.mce_operator | object | Uses the official redhat sources | Just used for IIB testing, drives the source and channel for the MCE subscription triggered by ACM |
| acm.spokeGitops.channel | string | `"gitops-1.18"` | Default gitops channel to install on remote clusters |
| acm.spokeGitops.source | string | `"redhat-operators"` | |
| clusterGroup | object | depends on the individual settings | Dictionary of all the clustergroups of the pattern |
| clusterGroup.managedClusterGroups | object | `{}` | The set of cluters managed by ACM which is running inside this clusterGroup |
| clusterGroup.subscriptions | object | `{"acm":{"source":"redhat-operators"}}` | Dictionary of subscriptions for this specific clusterGroup |
Expand All @@ -22,7 +24,8 @@ This chart is used by the Validated Patterns to configure ACM and manage remote
| global.repoURL | string | `"none"` | Repository URL pointing to the pattern |
| global.secretStore.backend | string | `"vault"` | |
| global.targetRevision | string | `"main"` | The branch or Git reference to use to deploy the pattern |
| main.gitops.channel | string | `"gitops-1.18"` | Default gitops channel to install on remote clusters |
| main | object | `{"gitops":{"channel":"gitops-1.18"}}` | Deprecated: Use acm.spokeGitops which takes precedence |
| main.gitops.channel | string | `"gitops-1.18"` | DEPRECATED: Default gitops channel to install on remote clusters (Use acm.spokeGitops.channel) |
| secretStore | object | depends on the individual settings | Default secretstore configuration variables |
| secretStore.name | string | `"vault-backend"` | Name of the clustersecretstore to be used for secrets |

Expand Down
4 changes: 2 additions & 2 deletions templates/policies/ocp-gitops-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ spec:
labels:
operators.coreos.com/openshift-gitops-operator.openshift-operators: ''
spec:
channel: {{ default "gitops-1.17" $.Values.main.gitops.channel }}
channel: {{- if and $.Values.acm.spokeGitops $.Values.acm.spokeGitops.channel }} {{ $.Values.acm.spokeGitops.channel }}{{- else if and $.Values.main $.Values.main.gitops $.Values.main.gitops.channel }} {{ $.Values.main.gitops.channel }}{{- else }} gitops-1.18{{- end }}
installPlanApproval: Automatic
name: openshift-gitops-operator
source: {{ default "redhat-operators" $.Values.main.gitops.operatorSource }}
source: {{- if and $.Values.acm.spokeGitops $.Values.acm.spokeGitops.source }} {{ $.Values.acm.spokeGitops.source }}{{- else if and $.Values.main $.Values.main.gitops $.Values.main.gitops.operatorSource }} {{ $.Values.main.gitops.operatorSource }}{{- else }} redhat-operators{{- end }}
sourceNamespace: openshift-marketplace
config:
env:
Expand Down
76 changes: 73 additions & 3 deletions tests/ocp_gitops_policy_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ tests:
- hasDocuments:
count: 6

- it: Should change the channel when specified
- it: Should change the channel when specified (legacy test updated to use spokeGitops)
values:
- ./clusterselector_values.yaml
set:
main:
gitops:
acm:
spokeGitops:
channel: gitops-9.9.9
asserts:
- documentSelector:
Expand All @@ -25,3 +25,73 @@ tests:
equal:
path: spec.policy-templates[0].objectDefinition.spec.object-templates[0].objectDefinition.spec.channel
value: gitops-9.9.9

- it: Should use spokeGitops channel when specified
values:
- ./clusterselector_values.yaml
set:
acm:
spokeGitops:
channel: gitops-2.0.0
asserts:
- documentSelector:
path: metadata.name
value: group-one-gitops-policy
equal:
path: spec.policy-templates[0].objectDefinition.spec.object-templates[0].objectDefinition.spec.channel
value: gitops-2.0.0

- it: Should use spokeGitops source when specified
values:
- ./clusterselector_values.yaml
set:
acm:
spokeGitops:
source: custom-operators
asserts:
- documentSelector:
path: metadata.name
value: group-one-gitops-policy
equal:
path: spec.policy-templates[0].objectDefinition.spec.object-templates[0].objectDefinition.spec.source
value: custom-operators

- it: Should use spokeGitops channel and source when both specified
values:
- ./clusterselector_values.yaml
set:
acm:
spokeGitops:
channel: gitops-2.1.0
source: my-custom-catalog
asserts:
- documentSelector:
path: metadata.name
value: group-one-gitops-policy
equal:
path: spec.policy-templates[0].objectDefinition.spec.object-templates[0].objectDefinition.spec.channel
value: gitops-2.1.0
- documentSelector:
path: metadata.name
value: group-one-gitops-policy
equal:
path: spec.policy-templates[0].objectDefinition.spec.object-templates[0].objectDefinition.spec.source
value: my-custom-catalog

- it: Should prioritize spokeGitops over main gitops settings
values:
- ./clusterselector_values.yaml
set:
main:
gitops:
channel: gitops-fallback
acm:
spokeGitops:
channel: gitops-priority
asserts:
- documentSelector:
path: metadata.name
value: group-one-gitops-policy
equal:
path: spec.policy-templates[0].objectDefinition.spec.object-templates[0].objectDefinition.spec.channel
value: gitops-priority
9 changes: 8 additions & 1 deletion values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -- Deprecated: Use acm.spokeGitops which takes precedence
main:
gitops:
# -- Default gitops channel to install on remote clusters
# -- DEPRECATED: Default gitops channel to install on remote clusters (Use acm.spokeGitops.channel)
channel: "gitops-1.18"

global:
Expand Down Expand Up @@ -64,6 +65,12 @@ acm:
source: redhat-operators
channel: null

# @default -- Uses the official redhat source and some default channel
spokeGitops:
source: redhat-operators
# -- Default gitops channel to install on remote clusters
channel: "gitops-1.18"


# -- Default secretstore configuration variables
# @default -- depends on the individual settings
Expand Down