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
16 changes: 12 additions & 4 deletions common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,18 @@ argo-healthcheck: ## Checks if all argo applications are synced

CHARTS=$(shell find . -type f -iname 'Chart.yaml' -exec dirname "{}" \; | grep -v examples | sed -e 's/.\///')
# Section related to tests and linting
TEST_OPTS= -f values-global.yaml --set global.repoURL="https://github.com/pattern-clone/mypattern" \
--set main.git.repoURL="https://github.com/pattern-clone/mypattern" --set main.git.revision=main --set global.pattern="mypattern" \
--set global.namespace="pattern-namespace" --set global.hubClusterDomain=apps.hub.example.com --set global.localClusterDomain=apps.region.example.com --set global.clusterDomain=region.example.com\
--set "clusterGroup.imperative.jobs[0].name"="test" --set "clusterGroup.imperative.jobs[0].playbook"="ansible/test.yml"
TEST_OPTS= -f values-global.yaml \
--set global.repoURL="https://github.com/pattern-clone/mypattern" \
--set main.git.repoURL="https://github.com/pattern-clone/mypattern" \
--set main.git.revision=main --set global.pattern="mypattern" \
--set global.namespace="pattern-namespace" \
--set global.hubClusterDomain=apps.hub.example.com \
--set global.localClusterDomain=apps.region.example.com \
--set global.clusterDomain=region.example.com \
--set global.clusterVersion="4.12" \
--set global.clusterPlatform=aws \
--set "clusterGroup.imperative.jobs[0].name"="test" \
--set "clusterGroup.imperative.jobs[0].playbook"="ansible/test.yml"
PATTERN_OPTS=-f common/examples/values-example.yaml
EXECUTABLES=git helm oc ansible

Expand Down
2 changes: 1 addition & 1 deletion common/clustergroup/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ description: A Helm chart to create per-clustergroup ArgoCD applications and any
keywords:
- pattern
name: clustergroup
version: 0.0.2
version: 0.0.3
17 changes: 13 additions & 4 deletions common/clustergroup/templates/plumbing/applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ spec:
ignoreMissingValueFiles: true
valueFiles:
{{- include "clustergroup.app.globalvalues.valuefiles" $ | nindent 12 }}
{{- range .extraValueFiles }}
- {{ . | quote }}
{{- range $valueFile := $.Values.clusterGroup.sharedValueFiles }}
- {{ tpl $valueFile $ | quote }}
{{- end }}
{{- range $valueFile := .extraValueFiles }}
- {{ tpl $valueFile $ | quote }}
{{- end }}
{{- if .useGeneratorValues }}
values: |-
Expand Down Expand Up @@ -147,8 +150,11 @@ spec:
ignoreMissingValueFiles: true
valueFiles:
{{- include "clustergroup.app.globalvalues.prefixedvaluefiles" $ | nindent 8 }}
{{- range $valueFile := $.Values.clusterGroup.sharedValueFiles }}
- {{ tpl $valueFile $ | quote }}
{{- end }}
{{- range $valueFile := .extraValueFiles }}
- {{ $valueFile | quote }}
- {{ tpl $valueFile $ | quote }}
{{- end }}
parameters:
{{- include "clustergroup.app.globalvalues.helmparameters" $ | nindent 8 }}
Expand Down Expand Up @@ -211,8 +217,11 @@ spec:
ignoreMissingValueFiles: true
valueFiles:
{{- include "clustergroup.app.globalvalues.valuefiles" $ | nindent 6 }}
{{- range $valueFile := $.Values.clusterGroup.sharedValueFiles }}
- {{ tpl $valueFile $ | quote }}
{{- end }}
{{- range $valueFile := .extraValueFiles }}
- {{ $valueFile | quote }}
- {{ tpl $valueFile $ | quote }}
{{- end }}
parameters:
{{- include "clustergroup.app.globalvalues.helmparameters" $ | nindent 8 }}
Expand Down
4 changes: 4 additions & 0 deletions common/clustergroup/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@
"type": "boolean",
"description": "If set to true the values is used to identify whether this is the hub cluster or an edge/spoke cluster configuration."
},
"sharedValueFiles": {
"type": "array",
"description": "Templated value file paths."
},
"namespaces": {
"type": "array",
"description": "This is the array of namespaces that the VP framework will create. In addition, operator groups will also be created for each namespace.",
Expand Down
2 changes: 2 additions & 0 deletions common/clustergroup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ global:
installPlanApproval: Automatic
applicationRetryLimit: 20


enabled: "all"

# Note that sometimes changing helm values might require a hard refresh (https://github.com/helm/helm/issues/3486)
clusterGroup:
name: example
isHubCluster: true
targetCluster: in-cluster
sharedValueFiles: []

imperative:
jobs: []
Expand Down
5 changes: 5 additions & 0 deletions common/examples/values-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ clusterGroup:
name: example
#insecureUnsealVaultInsideCluster: false
isHubCluster: true
sharedValueFiles:
- /values/{{ .Values.global.clusterPlatform }}.yaml
- /values/{{ .Values.global.clusterVersion }}.yaml

namespaces:
- open-cluster-management:
Expand Down Expand Up @@ -63,6 +66,8 @@ clusterGroup:
namespace: application-ci
project: datacenter
path: charts/datacenter/pipelines
extraValueFiles:
- /values/{{ .Values.global.clusterVersion }}/{{ .Values.global.clusterPlatform }}.yaml

imperative:
namespace: imperative
Expand Down
2 changes: 1 addition & 1 deletion common/golang-external-secrets/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A Helm chart to configure the golang-based external-secrets.
keywords:
- pattern
name: golang-external-secrets
version: 0.0.2
version: 0.0.3
dependencies:
- name: external-secrets
version: "0.9.5"
Expand Down
2 changes: 1 addition & 1 deletion common/tests/acm-industrial-edge-hub.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ spec:
- name: global.clusterVersion
value: '{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}'
- name: global.clusterPlatform
value:
value: aws
- name: clusterGroup.name
value: factory
- name: clusterGroup.isHubCluster
Expand Down
2 changes: 1 addition & 1 deletion common/tests/acm-medical-diagnosis-hub.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ spec:
- name: global.clusterVersion
value: '{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}'
- name: global.clusterPlatform
value:
value: aws
- name: clusterGroup.name
value: region-one
- name: clusterGroup.isHubCluster
Expand Down
4 changes: 2 additions & 2 deletions common/tests/acm-normal.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ spec:
- name: global.clusterVersion
value: '{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}'
- name: global.clusterPlatform
value:
value: aws
- name: clusterGroup.name
value: acm-edge
- name: clusterGroup.isHubCluster
Expand Down Expand Up @@ -722,7 +722,7 @@ spec:
- name: global.clusterVersion
value: '{{ printf "%d.%d" ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Major) ((semver (lookup "operator.openshift.io/v1" "OpenShiftControllerManager" "" "cluster").status.version).Minor) }}'
- name: global.clusterPlatform
value:
value: aws
- name: clusterGroup.name
value: acm-provision-edge
- name: clusterGroup.isHubCluster
Expand Down
13 changes: 10 additions & 3 deletions common/tests/clustergroup-industrial-edge-factory.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ data:
- manuela-factory-ml-workspace
projects:
- factory
sharedValueFiles: []
subscriptions:
- channel: stable
name: opendatahub-operator
Expand All @@ -136,6 +137,8 @@ data:
enabled: all
global:
clusterDomain: region.example.com
clusterPlatform: aws
clusterVersion: "4.12"
extraValueFiles: []
git:
account: hybrid-cloud-patterns
Expand Down Expand Up @@ -412,7 +415,11 @@ spec:
ignoreMissingValueFiles: true
valueFiles:
- "/values-global.yaml"
- "/values-factory.yaml"
- "/values-factory.yaml"
- "/values-aws.yaml"
- "/values-aws-4.12.yaml"
- "/values-aws-factory.yaml"
- "/values-4.12-factory.yaml"
parameters:
- name: global.repoURL
value: $ARGOCD_APP_SOURCE_REPO_URL
Expand All @@ -425,9 +432,9 @@ spec:
- name: global.clusterDomain
value: region.example.com
- name: global.clusterVersion
value: ""
value: "4.12"
- name: global.clusterPlatform
value: ""
value: "aws"
- name: global.hubClusterDomain
value: apps.hub.example.com
- name: global.localClusterDomain
Expand Down
73 changes: 52 additions & 21 deletions common/tests/clustergroup-industrial-edge-hub.expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ data:
- production-datalake
- golang-external-secrets
- vault
sharedValueFiles: []
subscriptions:
acm:
channel: release-2.6
Expand Down Expand Up @@ -297,6 +298,8 @@ data:
enabled: all
global:
clusterDomain: region.example.com
clusterPlatform: aws
clusterVersion: "4.12"
extraValueFiles: []
git:
account: hybrid-cloud-patterns
Expand Down Expand Up @@ -685,7 +688,11 @@ spec:
ignoreMissingValueFiles: true
valueFiles:
- "/values-global.yaml"
- "/values-datacenter.yaml"
- "/values-datacenter.yaml"
- "/values-aws.yaml"
- "/values-aws-4.12.yaml"
- "/values-aws-datacenter.yaml"
- "/values-4.12-datacenter.yaml"
parameters:
- name: global.repoURL
value: $ARGOCD_APP_SOURCE_REPO_URL
Expand All @@ -698,9 +705,9 @@ spec:
- name: global.clusterDomain
value: region.example.com
- name: global.clusterVersion
value: ""
value: "4.12"
- name: global.clusterPlatform
value: ""
value: "aws"
- name: global.hubClusterDomain
value: apps.hub.example.com
- name: global.localClusterDomain
Expand Down Expand Up @@ -742,7 +749,11 @@ spec:
ignoreMissingValueFiles: true
valueFiles:
- "/values-global.yaml"
- "/values-datacenter.yaml"
- "/values-datacenter.yaml"
- "/values-aws.yaml"
- "/values-aws-4.12.yaml"
- "/values-aws-datacenter.yaml"
- "/values-4.12-datacenter.yaml"
parameters:
- name: global.repoURL
value: $ARGOCD_APP_SOURCE_REPO_URL
Expand All @@ -755,9 +766,9 @@ spec:
- name: global.clusterDomain
value: region.example.com
- name: global.clusterVersion
value: ""
value: "4.12"
- name: global.clusterPlatform
value: ""
value: "aws"
- name: global.hubClusterDomain
value: apps.hub.example.com
- name: global.localClusterDomain
Expand Down Expand Up @@ -790,7 +801,11 @@ spec:
ignoreMissingValueFiles: true
valueFiles:
- "/values-global.yaml"
- "/values-datacenter.yaml"
- "/values-datacenter.yaml"
- "/values-aws.yaml"
- "/values-aws-4.12.yaml"
- "/values-aws-datacenter.yaml"
- "/values-4.12-datacenter.yaml"
parameters:
- name: global.repoURL
value: $ARGOCD_APP_SOURCE_REPO_URL
Expand All @@ -803,9 +818,9 @@ spec:
- name: global.clusterDomain
value: region.example.com
- name: global.clusterVersion
value: ""
value: "4.12"
- name: global.clusterPlatform
value: ""
value: "aws"
- name: global.hubClusterDomain
value: apps.hub.example.com
- name: global.localClusterDomain
Expand Down Expand Up @@ -838,7 +853,11 @@ spec:
ignoreMissingValueFiles: true
valueFiles:
- "/values-global.yaml"
- "/values-datacenter.yaml"
- "/values-datacenter.yaml"
- "/values-aws.yaml"
- "/values-aws-4.12.yaml"
- "/values-aws-datacenter.yaml"
- "/values-4.12-datacenter.yaml"
parameters:
- name: global.repoURL
value: $ARGOCD_APP_SOURCE_REPO_URL
Expand All @@ -851,9 +870,9 @@ spec:
- name: global.clusterDomain
value: region.example.com
- name: global.clusterVersion
value: ""
value: "4.12"
- name: global.clusterPlatform
value: ""
value: "aws"
- name: global.hubClusterDomain
value: apps.hub.example.com
- name: global.localClusterDomain
Expand Down Expand Up @@ -916,7 +935,11 @@ spec:
ignoreMissingValueFiles: true
valueFiles:
- "/values-global.yaml"
- "/values-datacenter.yaml"
- "/values-datacenter.yaml"
- "/values-aws.yaml"
- "/values-aws-4.12.yaml"
- "/values-aws-datacenter.yaml"
- "/values-4.12-datacenter.yaml"
parameters:
- name: global.repoURL
value: $ARGOCD_APP_SOURCE_REPO_URL
Expand All @@ -929,9 +952,9 @@ spec:
- name: global.clusterDomain
value: region.example.com
- name: global.clusterVersion
value: ""
value: "4.12"
- name: global.clusterPlatform
value: ""
value: "aws"
- name: global.hubClusterDomain
value: apps.hub.example.com
- name: global.localClusterDomain
Expand Down Expand Up @@ -964,7 +987,11 @@ spec:
ignoreMissingValueFiles: true
valueFiles:
- "/values-global.yaml"
- "/values-datacenter.yaml"
- "/values-datacenter.yaml"
- "/values-aws.yaml"
- "/values-aws-4.12.yaml"
- "/values-aws-datacenter.yaml"
- "/values-4.12-datacenter.yaml"
parameters:
- name: global.repoURL
value: $ARGOCD_APP_SOURCE_REPO_URL
Expand All @@ -977,9 +1004,9 @@ spec:
- name: global.clusterDomain
value: region.example.com
- name: global.clusterVersion
value: ""
value: "4.12"
- name: global.clusterPlatform
value: ""
value: "aws"
- name: global.hubClusterDomain
value: apps.hub.example.com
- name: global.localClusterDomain
Expand Down Expand Up @@ -1039,7 +1066,11 @@ spec:
ignoreMissingValueFiles: true
valueFiles:
- "/values-global.yaml"
- "/values-datacenter.yaml"
- "/values-datacenter.yaml"
- "/values-aws.yaml"
- "/values-aws-4.12.yaml"
- "/values-aws-datacenter.yaml"
- "/values-4.12-datacenter.yaml"
parameters:
- name: global.repoURL
value: $ARGOCD_APP_SOURCE_REPO_URL
Expand All @@ -1052,9 +1083,9 @@ spec:
- name: global.clusterDomain
value: region.example.com
- name: global.clusterVersion
value: ""
value: "4.12"
- name: global.clusterPlatform
value: ""
value: "aws"
- name: global.hubClusterDomain
value: apps.hub.example.com
- name: global.localClusterDomain
Expand Down
Loading