Skip to content

Commit 8c9e1d0

Browse files
authored
Merge pull request #1837 from yiannistri/52286-capi-ns
fix: Change `capi-system` namespace to `cattle-capi-system`
2 parents f5678d1 + a35bb42 commit 8c9e1d0

File tree

9 files changed

+108
-70
lines changed

9 files changed

+108
-70
lines changed

.github/scripts/fetch-core-capi.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# script-specific variables
44
CAPI_VERSION="${CAPI_VERSION:-latest}"
55
CAPI_RELEASE_URL="${CAPI_RELEASE_URL:-https://github.com/rancher-sandbox/cluster-api/releases/${CAPI_VERSION}/core-components.yaml}"
6-
CORE_CAPI_NAMESPACE="${CORE_CAPI_NAMESPACE:-capi-system}"
6+
CORE_CAPI_NAMESPACE="${CORE_CAPI_NAMESPACE:-cattle-capi-system}"
77
OUTPUT_DIR="${OUTPUT_DIR:-/tmp}"
88
OUTPUT_FILE="${OUTPUT_FILE:-core-provider-configmap.yaml}"
99
MANAGED_BY_LABEL="managed-by.turtles.cattle.io"
@@ -38,6 +38,9 @@ kubectl operator preload --core cluster-api:${CORE_CAPI_NAMESPACE} -u ${CAPI_REL
3838
sed -i '/{{[^-]/d' ${OUTPUT_DIR}/${OUTPUT_FILE}
3939
# label as managed by turtles for easier filtering
4040
sed -i -r 's/^(\s*)(provider\.cluster\.x-k8s\.io\/version:.*)/\1\2\n\1'"${MANAGED_BY_LABEL}"': "true"/' ${OUTPUT_DIR}/${OUTPUT_FILE}
41+
# change namespace from capi-system to cattle-capi-system
42+
sed -i 's/: capi-system/: cattle-capi-system/g' ${OUTPUT_DIR}/${OUTPUT_FILE}
43+
sed -i 's/.capi-system.svc/.cattle-capi-system.svc/g' ${OUTPUT_DIR}/${OUTPUT_FILE}
4144

4245
# embed this in Turtles chart
4346
mv ${OUTPUT_DIR}/${OUTPUT_FILE} ./charts/rancher-turtles/templates/${OUTPUT_FILE}

.github/workflows/test_chart.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ jobs:
9292
run: helm install rancher-turtles out/charts/rancher-turtles/ -n cattle-turtles-system --create-namespace --wait --debug
9393

9494
- name: Wait for core provider rollout
95-
run: sleep 30 && kubectl rollout status deployment capi-controller-manager -n capi-system --timeout=10m
95+
run: sleep 30 && kubectl rollout status deployment capi-controller-manager -n cattle-capi-system --timeout=10m
9696
- name: Check capi-controller-manager image
9797
run: |
98-
IMAGE=$(kubectl get deployment capi-controller-manager -n capi-system -o jsonpath='{.spec.template.spec.containers[0].image}')
98+
IMAGE=$(kubectl get deployment capi-controller-manager -n cattle-capi-system -o jsonpath='{.spec.template.spec.containers[0].image}')
9999
if [[ "$IMAGE" != registry.suse.com/rancher/cluster-api-controller* ]]; then
100100
echo "capi-controller-manager does not use registry.suse.com/rancher/cluster-api-controller based image"
101101
exit 1
@@ -161,11 +161,11 @@ jobs:
161161
run: helm install rancher-turtles out/charts/rancher-turtles/ -n cattle-turtles-system --create-namespace --wait --debug
162162

163163
- name: Wait for core provider rollout
164-
run: sleep 30 && kubectl rollout status deployment capi-controller-manager -n capi-system --timeout=10m
164+
run: sleep 30 && kubectl rollout status deployment capi-controller-manager -n cattle-capi-system --timeout=10m
165165

166166
- name: Check capi-controller-manager image is from kubernetes-sigs (community)
167167
run: |
168-
IMAGE=$(kubectl get deployment capi-controller-manager -n capi-system -o jsonpath='{.spec.template.spec.containers[0].image}')
168+
IMAGE=$(kubectl get deployment capi-controller-manager -n cattle-capi-system -o jsonpath='{.spec.template.spec.containers[0].image}')
169169
if [[ "$IMAGE" != registry.k8s.io/cluster-api/cluster-api-controller* ]]; then
170170
echo "capi-controller-manager does not use registry.k8s.io/cluster-api/cluster-api-controller based image"
171171
exit 1

0 commit comments

Comments
 (0)