Skip to content

Commit 00db7c8

Browse files
author
Max Azatian
committed
fixes
1 parent 9e81510 commit 00db7c8

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

backend/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ WORKDIR /app
55
RUN apt-get update && apt-get upgrade -y liblzma-dev liblzma5 xz-utils && \
66
rm -rf /var/lib/apt/lists/*
77

8-
# Install kubectl (lightweight)
9-
RUN wget -q "https://dl.k8s.io/release/v1.28.0/bin/linux/amd64/kubectl" -O /usr/local/bin/kubectl && \
8+
# Install kubectl (latest stable version)
9+
RUN wget -q "https://dl.k8s.io/release/$(wget -qO- https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" -O /usr/local/bin/kubectl && \
1010
chmod +x /usr/local/bin/kubectl
1111

1212
# Install Python dependencies

cert-generator/setup-k8s.sh

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,38 @@ echo "Self-signed certificate created and copied."
112112
# --- Generate Kubeconfig ---
113113
if [ -d /backend ]; then
114114
echo "Ensuring kubeconfig is up to date"
115+
116+
# In CI without a real K8s cluster, create a dummy kubeconfig
117+
if [ "$CI" = "true" ] && ! kubectl cluster-info > /dev/null 2>&1; then
118+
echo "CI detected without K8s cluster - creating dummy kubeconfig for testing"
119+
cat > /backend/kubeconfig.yaml <<EOF
120+
apiVersion: v1
121+
kind: Config
122+
clusters:
123+
- name: docker-desktop
124+
cluster:
125+
server: https://127.0.0.1:6443
126+
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJkekNDQVIyZ0F3SUJBZ0lCQURBS0JnZ3Foa2pPUFFRREFqQWpNU0V3SHdZRFZRUUREQmhyTTNNdGMyVnkKZG1WeUxXTmhRREUyTnpjeU5UazVPVGN3SGhjTk1qSXhNakU1TVRVMU9UTTNXaGNOTXpJeE1qRTJNVFUxT1RNMwpXakFqTVNFd0h3WURWUVFEREJock0zTXRjMlZ5ZG1WeUxXTmhRREUyTnpjeU5UazVPVGN3V1RBVEJnY3Foa2pPClBRSUJCZ2dxaGtqT1BRTUJCd05DQUFSVnNKeWlqc3hJOGl6cGFQRVlIcEo0WGdFTG9xbVlLMXkwSytNMWlTMUwKa1d2d2JkcGZ0MXAwUFRLMTU0K2xia0JnbHVBdG9vSFJJUTg4MjZpcENLMDhvMEl3UURBT0JnTlZIUThCQWY4RQpCQU1DQXFRd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBZEJnTlZIUTRFRmdRVTlXRUpWNGcvWGh5YkpBWUhIQXVOCldJNnYvNll3Q2dZSUtvWkl6ajBFQXdJRFNBQXdSUUloQU1wNFRtakg5NWRYQnBGNmtCcFdKaWsxT3BYV0tMNzYKaHJKdVFYRXJJOGZlQWlBWk8rL2NsVklrd0Yvb0VuSEhZeHJCRGxHQzR2ekxIa2k2SFMvMUFCWkV3Zz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
127+
users:
128+
- name: integr8scode-sa
129+
user:
130+
token: "dummy-token-for-ci-testing"
131+
contexts:
132+
- name: integr8scode
133+
context:
134+
cluster: docker-desktop
135+
user: integr8scode-sa
136+
current-context: integr8scode
137+
EOF
138+
chmod 644 /backend/kubeconfig.yaml
139+
echo "Dummy kubeconfig.yaml created for CI testing."
140+
echo "Setup completed successfully."
141+
142+
# Create a setup-complete file to indicate success
143+
touch /backend/setup-complete || true
144+
exit 0
145+
fi
146+
115147
if ! kubectl config view --raw -o jsonpath='{.clusters[0].cluster.certificate-authority-data}' > /dev/null 2>&1; then
116148
echo "ERROR: kubectl is not configured to connect to a cluster."
117149
exit 1
@@ -187,4 +219,7 @@ EOF
187219
echo "kubeconfig.yaml successfully generated."
188220
fi
189221

190-
echo "Setup completed successfully."
222+
echo "Setup completed successfully."
223+
224+
# Create a setup-complete file to indicate success
225+
touch /backend/setup-complete || true

0 commit comments

Comments
 (0)