Skip to content
Draft
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This chart is used by the Validated Patterns to configure ACM and manage remote
| acm.mch_spec | object | `{}` | MultiClusterHub spec (empty by default) |
| acm.spokeGitops.channel | string | `"gitops-1.18"` | Default gitops channel to install on remote clusters |
| acm.spokeGitops.source | string | `"redhat-operators"` | |
| acm.spokeGitops.subscriptionNamespace | string | `"openshift-gitops-operator"` | Default namespace for the gitops subscription on remote clusters |
| 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 Down
2 changes: 1 addition & 1 deletion templates/policies/ocp-gitops-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
kind: Subscription
metadata:
name: openshift-gitops-operator
namespace: openshift-operators
namespace: {{- if and $.Values.acm.spokeGitops $.Values.acm.spokeGitops.subscriptionNamespace }} {{ $.Values.acm.spokeGitops.subscriptionNamespace }}{{- else }} openshift-gitops-operator{{- end }}
labels:
operators.coreos.com/openshift-gitops-operator.openshift-operators: ''
spec:
Expand Down
16 changes: 16 additions & 0 deletions tests/ocp_gitops_policy_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,22 @@ tests:
path: spec.policy-templates[0].objectDefinition.spec.object-templates[0].objectDefinition.spec.source
value: custom-operators

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


- it: Should use spokeGitops channel and source when both specified
values:
- ./clusterselector_values.yaml
Expand Down
3 changes: 2 additions & 1 deletion values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ acm:
source: redhat-operators
# -- Default gitops channel to install on remote clusters
channel: "gitops-1.18"

# -- Default namespace for the gitops subscription on remote clusters
subscriptionNamespace: openshift-gitops-operator

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