Skip to content

Commit 5c600e1

Browse files
benzekrimahafrancoisferrand
authored andcommitted
fixup post reviews
1 parent acebd94 commit 5c600e1

File tree

6 files changed

+27
-25
lines changed

6 files changed

+27
-25
lines changed

.github/workflows/end2end.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ jobs:
165165
steps:
166166
- name: Checkout
167167
uses: actions/checkout@v4
168-
- name: remove existing tar file
169-
run: make remove-tar
170-
working-directory: ./solution-base/mongodb
171168
- name: fetch mongo charts
172169
run: make fetch-mongodb-sharded
173170
working-directory: ./solution-base/mongodb
171+
- name: remove configsrv file
172+
run: rm -vf charts/mongodb-sharded/templates/config-server/config-server-service.yaml || echo "Failed to remove"
173+
working-directory: ./solution-base/mongodb
174174
- name: apply patches to charts
175175
run: make patch
176176
working-directory: ./solution-base/mongodb

solution-base/mongodb/Makefile

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,21 @@ CHART_REPO:="https://charts.bitnami.com/bitnami"
55
CHART_MONGO_SHARDED_VERSION:="7.9.1"
66

77
PATCH_DIR:="${ROOT_DIR}/patches"
8-
PATCH_FILES:=$(shell ls ${PATCH_DIR}/* | grep -v mongodb-sharded-add-configsvr-service-file.patch)
8+
PATCH_FILES:=$(shell ls -d ${PATCH_DIR}/*)
99
HELM=helm
1010

11-
.PHONY: fetch patch remove-tar
11+
.PHONY: fetch patch
1212

1313
fetch-mongodb-sharded:
14+
@rm -rf ${CHART_DIR}
1415
@${HELM} fetch mongodb-sharded \
1516
--repo ${CHART_REPO} \
1617
--version ${CHART_MONGO_SHARDED_VERSION} \
1718
--untar \
1819
--untardir ${CHART_DIR}
1920

2021
patch:
21-
@if [ -z "${PATCH_FILES}" ]; then \
22-
echo "No patch files found in ${PATCH_DIR}"; \
23-
exit 1; \
24-
fi
25-
@echo "Checking patches..."
26-
@for patch in ${PATCH_FILES}; do \
27-
echo "Checking $$patch"; \
28-
git apply --check "$$patch" || { echo "Patch check failed for $$patch"; exit 1; }; \
29-
done
30-
@echo "Applying patches..."
3122
@for patch in ${PATCH_FILES}; do \
3223
echo "Applying $$patch"; \
33-
git apply "$$patch" || { echo "Patch apply failed for $$patch"; exit 1; }; \
24+
git apply "$$patch"; \
3425
done
35-
@echo "Patches applied successfully"
36-
37-
remove-tar:
38-
@rm -rf ${CHART_DIR}/mongodb-sharded-${CHART_MONGO_SHARDED_VERSION}.tgz

solution-base/mongodb/charts/mongodb-sharded/templates/config-server/config-server-service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ spec:
4343
{{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }}
4444
{{- end }}
4545
selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
46-
app.kubernetes.io/component: configsvr
46+
app.kubernetes.io/component: configsvr
4747
sessionAffinity: {{ default "None" .Values.service.sessionAffinity }}

solution-base/mongodb/patches/mongodb-sharded-add-configsvr-service-file.patch

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
diff --git a/solution-base/mongodb/charts/mongodb-sharded/templates/config-server/config-server-service.yaml b/solution-base/mongodb/charts/mongodb-sharded/templates/config-server/config-server-service.yaml
22
new file mode 100644
3-
index fad94092..825b0161 100644
3+
index 00000000..fad94092
44
--- /dev/null
55
+++ b/solution-base/mongodb/charts/mongodb-sharded/templates/config-server/config-server-service.yaml
6-
@@ -0,0 +1,41 @@
6+
@@ -0,0 +1,47 @@
77
+apiVersion: v1
88
+kind: Service
99
+metadata:
@@ -40,7 +40,6 @@ index fad94092..825b0161 100644
4040
+ {{- else if eq .Values.service.type "ClusterIP" }}
4141
+ nodePort: null
4242
+ {{- end }}
43-
+ {{- end }}
4443
+ {{- if .Values.metrics.enabled }}
4544
+ - name: metrics
4645
+ port: 9216
@@ -51,4 +50,4 @@ index fad94092..825b0161 100644
5150
+ {{- end }}
5251
+ selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
5352
+ app.kubernetes.io/component: configsvr
54-
+ sessionAffinity: {{ default "None" .Values.service.sessionAffinity }}
53+
+ sessionAffinity: {{ default "None" .Values.service.sessionAffinity }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
diff --git a/solution-base/mongodb/charts/mongodb-sharded/files/docker-entrypoint-initdb.d/create-app-user-sharded.sh b/solution-base/mongodb/charts/mongodb-sharded/files/docker-entrypoint-initdb.d/create-app-user-sharded.sh
2+
new file mode 120000
3+
index 00000000..61f367cb
4+
--- /dev/null
5+
+++ b/solution-base/mongodb/charts/mongodb-sharded/files/docker-entrypoint-initdb.d/create-app-user-sharded.sh
6+
@@ -0,0 +1 @@
7+
+../../../../scripts/create-app-user.sh
8+
\ No newline at end of file
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
diff --git a/solution-base/mongodb/charts/mongodb-sharded/files/docker-entrypoint-initdb.d/set-default-write-concern-majority-sharded.sh b/solution-base/mongodb/charts/mongodb-sharded/files/docker-entrypoint-initdb.d/set-default-write-concern-majority-sharded.sh
2+
new file mode 120000
3+
index 00000000..9d7ca4a1
4+
--- /dev/null
5+
+++ b/solution-base/mongodb/charts/mongodb-sharded/files/docker-entrypoint-initdb.d/set-default-write-concern-majority-sharded.sh
6+
@@ -0,0 +1 @@
7+
+../../../../scripts/set-default-write-concern-majority.sh
8+
\ No newline at end of file

0 commit comments

Comments
 (0)