Skip to content

Commit 4b2c864

Browse files
authored
Merge pull request #118 from mhjacks/main
Branch v1.4 to-be
2 parents 198e792 + c85b811 commit 4b2c864

File tree

114 files changed

+13883
-1509
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+13883
-1509
lines changed

Diff for: Changes.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@
4343
* Update platform level override using new templated valuefile name feature in common
4444
* Skip multicloud gateway (noobaa) installation in ODF by default
4545

46-
## Changes in main (July 25, 2024)
46+
## Changes for v1.4 (July 29, 2024)
4747

4848
* Introduce clean-golden-images job to imperative. This is a workaround for a bug in CNV 4.15/ODF 4.15 where if the default StorageClass is not the same as the default virtualization storage class, CNV cannot properly provision datavolumes.
4949
* Default storageclass for edge-gitops-vms to "ocs-storagecluster-ceph-rbd-virtualization", available since ODF 4.14.
5050
* Use api_version for Route queries when discovering credentials for AAP instance.
51+
* Update common.
52+
* Update deploy_kubevirt_worker.yml Ansible playbook to copy securityGroups and blockDevices config from first machineSet. Tag naming schemes changed from OCP 4.15 to 4.16; this method ensures forward and backward compatibility.

Diff for: ansible/deploy_kubevirt_worker.yml

+3-10
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
gather_facts: false
88
vars:
99
kubeconfig: "{{ lookup('env', 'KUBECONFIG') }}"
10-
machineset_blockdevices:
11-
- ebs:
12-
iops: 0
13-
volumeSize: 120
14-
volumeType: gp2
1510
machineset_instance_type: m5.metal
1611
machineset_machine_role: worker
1712
machineset_machine_type: worker
@@ -47,6 +42,8 @@
4742
machineset_ami_id: "{{ cluster_machinesets.resources[0].spec.template.spec.providerSpec.value.ami.id }}"
4843
machineset_subnet: "{{ cluster_machinesets.resources[0].spec.template.spec.providerSpec.value.subnet.filters[0]['values'][0] }}"
4944
machineset_tags: "{{ cluster_machinesets.resources[0].spec.template.spec.providerSpec.value.tags }}"
45+
machineset_blockdevices: "{{ cluster_machinesets.resources[0].spec.template.spec.providerSpec.value.blockDevices }}"
46+
machineset_securitygroups: "{{ cluster_machinesets.resources[0].spec.template.spec.providerSpec.value.securityGroups }}"
5047
machineset_zone: "{{ cluster_machinesets.resources[0].spec.template.spec.providerSpec.value.placement.availabilityZone }}"
5148
infrastructure_name: "{{ cluster_info.resources[0].status.infrastructureName }}"
5249
infrastructure_region: "{{ cluster_info.resources[0].status.platformStatus.aws.region }}"
@@ -97,11 +94,7 @@
9794
placement:
9895
availabilityZone: "{{ machineset_zone }}"
9996
region: "{{ infrastructure_region }}"
100-
securityGroups:
101-
- filters:
102-
- name: tag:Name
103-
values:
104-
- "{{ infrastructure_name }}-worker-sg"
97+
securityGroups: {{ machineset_securitygroups }}
10598
subnet:
10699
filters:
107100
- name: tag:Name

Diff for: charts/hub/edge-gitops-vms/templates/job-waitForMetalNode.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
while [ 1 ];
1919
do
2020
nodes=$(oc get machineset -n openshift-machine-api -l 'edge-gitops-role=kubevirt-worker' -o jsonpath='{.items[*].status.availableReplicas}')
21-
if [ "$nodes" -ge "1" ]; then
21+
if [ "0$nodes" -ge "1" ]; then
2222
echo "Node is ready, exiting"
2323
exit 0
2424
fi

Diff for: common/.github/workflows/chart-branches.yml

+5-15
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ jobs:
4949
5050
acm:
5151
needs: changes
52-
if: |
53-
${{ needs.changes.outputs.acm == 'true' }} &&
54-
github.repository == 'validatedpatterns/common'
52+
if: ${{ (needs.changes.outputs.acm == 'true') && (github.repository == 'validatedpatterns/common') }}
5553
uses: validatedpatterns/common/.github/workflows/chart-split.yml@main
5654
permissions:
5755
actions: write
@@ -63,9 +61,7 @@ jobs:
6361

6462
golang-external-secrets:
6563
needs: changes
66-
if: |
67-
${{ needs.changes.outputs.golang-external-secrets == 'true' }} &&
68-
github.repository == 'validatedpatterns/common'
64+
if: ${{ (needs.changes.outputs.golang-external-secrets == 'true') && (github.repository == 'validatedpatterns/common') }}
6965
uses: validatedpatterns/common/.github/workflows/chart-split.yml@main
7066
permissions:
7167
actions: write
@@ -77,9 +73,7 @@ jobs:
7773

7874
hashicorp-vault:
7975
needs: changes
80-
if: |
81-
${{ needs.changes.outputs.hashicorp-vault == 'true' }} &&
82-
github.repository == 'validatedpatterns/common'
76+
if: ${{ (needs.changes.outputs.hashicorp-vault == 'true') && (github.repository == 'validatedpatterns/common') }}
8377
uses: validatedpatterns/common/.github/workflows/chart-split.yml@main
8478
permissions:
8579
actions: write
@@ -91,9 +85,7 @@ jobs:
9185

9286
letsencrypt:
9387
needs: changes
94-
if: |
95-
${{ needs.changes.outputs.letsencrypt == 'true' }} &&
96-
github.repository == 'validatedpatterns/common'
88+
if: ${{ (needs.changes.outputs.letsencrypt == 'true') && (github.repository == 'validatedpatterns/common') }}
9789
uses: validatedpatterns/common/.github/workflows/chart-split.yml@main
9890
permissions:
9991
actions: write
@@ -105,9 +97,7 @@ jobs:
10597

10698
clustergroup:
10799
needs: changes
108-
if: |
109-
${{ needs.changes.outputs.clustergroup == 'true' }} &&
110-
github.repository == 'validatedpatterns/common'
100+
if: ${{ (needs.changes.outputs.clustergroup == 'true') && (github.repository == 'validatedpatterns/common') }}
111101
uses: validatedpatterns/common/.github/workflows/chart-split.yml@main
112102
permissions:
113103
actions: write

Diff for: common/.github/workflows/chart-split.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ jobs:
3131
set -e
3232
N="${{ inputs.chart_name }}"
3333
B="${N}-main-single-chart"
34+
GITIMG="quay.io/hybridcloudpatterns/gitsubtree-container:2.40.1"
35+
sudo apt-get update -y && sudo apt-get install -y podman
36+
echo "Running subtree split for ${B}"
37+
podman pull "${GITIMG}"
3438
git push origin -d "${B}" || /bin/true
35-
git subtree split -P "${N}" -b "${B}"
36-
git push -f -u origin "${B}"
39+
# Git subtree got broken on recent versions of git hence this container
40+
podman run --net=host --rm -t -v .:/git "${GITIMG}" subtree split -P "${N}" -b "${B}"
3741
#git clone https://validatedpatterns:${GITHUB_TOKEN}@github.com/validatedpatterns/common.git -b "acm-main-single-chart" --single-branch
3842
git push --force https://validatedpatterns:"${GITHUB_TOKEN}"@github.com/${{ inputs.target_repository }}.git "${B}:main"

Diff for: common/.github/workflows/linter.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Setup helm
3737
uses: azure/setup-helm@v4
3838
with:
39-
version: 'v3.13.2'
39+
version: 'v3.14.0'
4040

4141

4242
################################

Diff for: common/.github/workflows/superlinter.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,19 @@ jobs:
2121
# Run Linter against code base #
2222
################################
2323
- name: Lint Code Base
24-
uses: github/super-linter/slim@v5
24+
uses: github/super-linter/slim@v6
2525
env:
2626
VALIDATE_ALL_CODEBASE: true
2727
DEFAULT_BRANCH: main
2828
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929
# These are the validation we disable atm
3030
VALIDATE_ANSIBLE: false
3131
VALIDATE_BASH: false
32+
VALIDATE_CHECKOV: false
3233
VALIDATE_JSCPD: false
3334
VALIDATE_KUBERNETES_KUBECONFORM: false
35+
VALIDATE_PYTHON_PYLINT: false
36+
VALIDATE_SHELL_SHFMT: false
3437
VALIDATE_YAML: false
3538
# VALIDATE_DOCKERFILE_HADOLINT: false
3639
# VALIDATE_MARKDOWN: false

Diff for: common/Makefile

+7-4
Original file line numberDiff line numberDiff line change
@@ -230,17 +230,20 @@ kubeconform: ## run helm kubeconform
230230
super-linter: ## Runs super linter locally
231231
rm -rf .mypy_cache
232232
podman run -e RUN_LOCAL=true -e USE_FIND_ALGORITHM=true \
233+
-e VALIDATE_ANSIBLE=false \
233234
-e VALIDATE_BASH=false \
235+
-e VALIDATE_CHECKOV=false \
236+
-e VALIDATE_DOCKERFILE_HADOLINT=false \
234237
-e VALIDATE_JSCPD=false \
235238
-e VALIDATE_KUBERNETES_KUBECONFORM=false \
236-
-e VALIDATE_YAML=false \
237-
-e VALIDATE_ANSIBLE=false \
238-
-e VALIDATE_DOCKERFILE_HADOLINT=false \
239+
-e VALIDATE_PYTHON_PYLINT=false \
240+
-e VALIDATE_SHELL_SHFMT=false \
239241
-e VALIDATE_TEKTON=false \
242+
-e VALIDATE_YAML=false \
240243
$(DISABLE_LINTERS) \
241244
-v $(PWD):/tmp/lint:rw,z \
242245
-w /tmp/lint \
243-
docker.io/github/super-linter:slim-v5
246+
ghcr.io/super-linter/super-linter:slim-v6
244247

245248
.PHONY: ansible-lint
246249
ansible-lint: ## run ansible lint on ansible/ folder

Diff for: common/acm/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ description: A Helm chart to configure Advanced Cluster Manager for OpenShift.
33
keywords:
44
- pattern
55
name: acm
6-
version: 0.0.1
6+
version: 0.1.0

Diff for: common/acm/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Validated Patterns ACM chart
2+
3+
This chart is used to set up ACM in [Validated Patterns](https://validatedpatterns.io)
4+
5+
Please send PRs [here](https://github.com/validatedpatterns/common)

Diff for: common/acm/templates/_helpers.tpl

+44
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,47 @@ Default always defined valueFiles to be included when pushing the cluster wide a
1111
# hub's cluster version, whereas we want to include the spoke cluster version
1212
- '/values-{{ `{{ printf "%d.%d" ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Major) ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Minor) }}` }}.yaml'
1313
{{- end }} {{- /*acm.app.policies.valuefiles */}}
14+
15+
{{- define "acm.app.policies.multisourcevaluefiles" -}}
16+
- "$patternref/values-global.yaml"
17+
- "$patternref/values-{{ .name }}.yaml"
18+
- '$patternref/values-{{ `{{ (lookup "config.openshift.io/v1" "Infrastructure" "" "cluster").spec.platformSpec.type }}` }}.yaml'
19+
- '$patternref/values-{{ `{{ (lookup "config.openshift.io/v1" "Infrastructure" "" "cluster").spec.platformSpec.type }}` }}-{{ `{{ printf "%d.%d" ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Major) ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Minor) }}` }}.yaml'
20+
- '$patternref/values-{{ `{{ (lookup "config.openshift.io/v1" "Infrastructure" "" "cluster").spec.platformSpec.type }}` }}-{{ .name }}.yaml'
21+
# We cannot use $.Values.global.clusterVersion because that gets resolved to the
22+
# hub's cluster version, whereas we want to include the spoke cluster version
23+
- '$patternref/values-{{ `{{ printf "%d.%d" ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Major) ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Minor) }}` }}.yaml'
24+
{{- end }} {{- /*acm.app.policies.multisourcevaluefiles */}}
25+
26+
{{- define "acm.app.policies.helmparameters" -}}
27+
- name: global.repoURL
28+
value: {{ $.Values.global.repoURL }}
29+
- name: global.targetRevision
30+
value: {{ $.Values.global.targetRevision }}
31+
- name: global.namespace
32+
value: $ARGOCD_APP_NAMESPACE
33+
- name: global.pattern
34+
value: {{ $.Values.global.pattern }}
35+
- name: global.hubClusterDomain
36+
value: {{ $.Values.global.hubClusterDomain }}
37+
- name: global.localClusterDomain
38+
value: '{{ `{{ (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain }}` }}'
39+
- name: global.clusterDomain
40+
value: '{{ `{{ (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain | replace "apps." "" }}` }}'
41+
- name: global.clusterVersion
42+
value: '{{ `{{ printf "%d.%d" ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Major) ((semver (index (lookup "config.openshift.io/v1" "ClusterVersion" "" "version").status.history 0).version).Minor) }}` }}'
43+
- name: global.localClusterName
44+
value: '{{ `{{ (split "." (lookup "config.openshift.io/v1" "Ingress" "" "cluster").spec.domain)._1 }}` }}'
45+
- name: global.clusterPlatform
46+
value: {{ $.Values.global.clusterPlatform }}
47+
- name: global.multiSourceSupport
48+
value: {{ $.Values.global.multiSourceSupport | quote }}
49+
- name: global.multiSourceRepoUrl
50+
value: {{ $.Values.global.multiSourceRepoUrl }}
51+
- name: global.multiSourceTargetRevision
52+
value: {{ $.Values.global.multiSourceTargetRevision }}
53+
- name: global.privateRepo
54+
value: {{ $.Values.global.privateRepo | quote }}
55+
- name: global.experimentalCapabilities
56+
value: {{ $.Values.global.experimentalCapabilities }}
57+
{{- end }} {{- /*acm.app.policies.helmparameters */}}

0 commit comments

Comments
 (0)