Skip to content

Commit 4e42979

Browse files
author
Rodrigo Valin
authored
CLOUDP-101992: Adds helm chart as submodule (mongodb#745)
1 parent ae1ca8f commit 4e42979

18 files changed

+32
-717
lines changed

Diff for: .action_templates/steps/checkout-fork.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
with:
77
ref: ${{github.event.pull_request.head.ref}}
88
repository: ${{github.event.pull_request.head.repo.full_name}}
9+
submodules: true

Diff for: .action_templates/steps/checkout.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
- name: Checkout Code
22
uses: actions/checkout@v2
3+
with:
4+
submodules: true

Diff for: .github/workflows/e2e-dispatch.yml

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ jobs:
5050
# template: .action_templates/steps/checkout.yaml
5151
- name: Checkout Code
5252
uses: actions/checkout@v2
53+
with:
54+
submodules: true
5355
# template: .action_templates/steps/setup-and-install-python.yaml
5456
- name: Setup Python
5557
uses: actions/setup-python@v2
@@ -84,6 +86,8 @@ jobs:
8486
# template: .action_templates/steps/checkout.yaml
8587
- name: Checkout Code
8688
uses: actions/checkout@v2
89+
with:
90+
submodules: true
8791
# template: .action_templates/steps/setup-and-install-python.yaml
8892
- name: Setup Python
8993
uses: actions/setup-python@v2

Diff for: .github/workflows/e2e-fork.yml

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
with:
5454
ref: ${{github.event.pull_request.head.ref}}
5555
repository: ${{github.event.pull_request.head.repo.full_name}}
56+
submodules: true
5657
# template: .action_templates/steps/setup-and-install-python.yaml
5758
- name: Setup Python
5859
uses: actions/setup-python@v2
@@ -186,6 +187,7 @@ jobs:
186187
with:
187188
ref: ${{github.event.pull_request.head.ref}}
188189
repository: ${{github.event.pull_request.head.repo.full_name}}
190+
submodules: true
189191
# template: .action_templates/steps/set-run-status.yaml
190192
- name: Set default run status
191193
run: echo "::set-output name=last_run_status::pending" > last_run_status

Diff for: .github/workflows/e2e.yml

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ jobs:
5858
# template: .action_templates/steps/checkout.yaml
5959
- name: Checkout Code
6060
uses: actions/checkout@v2
61+
with:
62+
submodules: true
6163
# template: .action_templates/steps/setup-and-install-python.yaml
6264
- name: Setup Python
6365
uses: actions/setup-python@v2
@@ -188,6 +190,8 @@ jobs:
188190
# template: .action_templates/steps/checkout.yaml
189191
- name: Checkout Code
190192
uses: actions/checkout@v2
193+
with:
194+
submodules: true
191195
# template: .action_templates/steps/set-run-status.yaml
192196
- name: Set default run status
193197
run: echo "::set-output name=last_run_status::pending" > last_run_status

Diff for: .github/workflows/main.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
##########################
3838
- name: Checkout Code
3939
uses: actions/checkout@v2
40+
with:
41+
# Make sure we also get the helm-charts submodule!
42+
submodules: true
4043

4144
- name: Install missing python packages
4245
run: sudo apt-get install -y --no-install-recommends python3-venv python3-setuptools
@@ -68,6 +71,5 @@ jobs:
6871
VALIDATE_YAML: true
6972
VALIDATE_PYTHON: true
7073
VALIDATE_BASH: true
71-
FILTER_REGEX_EXCLUDE: "/helm-chart/templates/*"
74+
FILTER_REGEX_EXCLUDE: "/helm-charts/charts/community-operator/templates/*"
7275
# VALIDATE_GO: true This is currently broken: https://github.com/github/super-linter/issues/143
73-
...

Diff for: .gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "helm-charts"]
2+
path = helm-charts
3+
url = [email protected]:mongodb/helm-charts.git

Diff for: Makefile

+9-7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ READINESS_PROBE_IMG := $(shell jq -r .readiness_probe_image < ~/.community-opera
99
REGISTRY := $(shell jq -r .repo_url < ~/.community-operator-dev/config.json)
1010
AGENT_IMAGE_NAME := $(shell jq -r .agent_image_ubuntu < ~/.community-operator-dev/config.json)
1111

12+
HELM_CHART ?= ./helm-charts/charts/community-operator
13+
1214
STRING_SET_VALUES := --set namespace=$(NAMESPACE),versionUpgradeHook.name=$(UPGRADE_HOOK_IMG),readinessProbe.name=$(READINESS_PROBE_IMG),registry.operator=$(REPO_URL),operator.operatorImageName=$(OPERATOR_IMAGE),operator.version=latest,registry.agent=$(REGISTRY),registry.versionUpgradeHook=$(REGISTRY),registry.readinessProbe=$(REGISTRY),registry.operator=$(REGISTRY),versionUpgradeHook.version=latest,readinessProbe.version=latest,agent.version=latest,agent.name=$(AGENT_IMAGE_NAME)
1315

1416
DOCKERFILE ?= operator
@@ -50,14 +52,14 @@ install-crd:
5052
kubectl apply -f config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml
5153

5254
install-chart:
53-
$(HELM) upgrade --install $(STRING_SET_VALUES) $(RELEASE_NAME_HELM) helm-chart
55+
$(HELM) upgrade --install $(STRING_SET_VALUES) $(RELEASE_NAME_HELM) $(HELM_CHART)
5456

5557
install-chart-with-tls-enabled:
56-
$(HELM) upgrade --install --set createResource=true $(STRING_SET_VALUES) $(RELEASE_NAME_HELM) helm-chart
58+
$(HELM) upgrade --install --set createResource=true $(STRING_SET_VALUES) $(RELEASE_NAME_HELM) $(HELM_CHART)
5759

5860
install-rbac:
59-
$(HELM) template $(STRING_SET_VALUES) -s templates/database_roles.yaml helm-chart | kubectl apply -f -
60-
$(HELM) template $(STRING_SET_VALUES) -s templates/operator_roles.yaml helm-chart | kubectl apply -f -
61+
$(HELM) template $(STRING_SET_VALUES) -s templates/database_roles.yaml $(HELM_CHART) | kubectl apply -f -
62+
$(HELM) template $(STRING_SET_VALUES) -s templates/operator_roles.yaml $(HELM_CHART) | kubectl apply -f -
6163

6264
uninstall-crd:
6365
kubectl delete crd mongodbcommunity.mongodbcommunity.mongodb.com
@@ -66,8 +68,8 @@ uninstall-chart:
6668
$(HELM) uninstall $(RELEASE_NAME_HELM) -n $(NAMESPACE)
6769

6870
uninstall-rbac:
69-
$(HELM) template $(STRING_SET_VALUES) -s templates/database_roles.yaml helm-chart | kubectl delete -f -
70-
$(HELM) template $(STRING_SET_VALUES) -s templates/operator_roles.yaml helm-chart | kubectl delete -f -
71+
$(HELM) template $(STRING_SET_VALUES) -s templates/database_roles.yaml $(HELM_CHART) | kubectl delete -f -
72+
$(HELM) template $(STRING_SET_VALUES) -s templates/operator_roles.yaml $(HELM_CHART) | kubectl delete -f -
7173

7274

7375
# Uninstall CRDs from a cluster
@@ -82,7 +84,7 @@ undeploy: uninstall-chart uninstall-crd
8284
# Generate manifests e.g. CRD, RBAC etc.
8385
manifests: controller-gen
8486
$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./..." output:crd:artifacts:config=config/crd/bases
85-
cp config/crd/bases/* helm-chart/crds
87+
cp config/crd/bases/* $(HELM_CHART)/crds
8688

8789
# Run go fmt against code
8890
fmt:

Diff for: helm-chart/Chart.yaml

-14
This file was deleted.

0 commit comments

Comments
 (0)