Skip to content

Commit 8ddc5fc

Browse files
Improve integration test reliability with version compatibility
- Use Kind node v1.29.2 for better Flux compatibility - Update Flux version to v2.3.0 (stable release) - Use --export flag to bypass Flux CLI verification hang - Add KIND_NODE_IMAGE environment variable - Update CI workflow with compatible versions - Improve documentation with troubleshooting guidance Co-authored-by: aleksanderaleksic <8734962+aleksanderaleksic@users.noreply.github.com>
1 parent 8c5e64f commit 8ddc5fc

3 files changed

Lines changed: 43 additions & 16 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,12 @@ jobs:
113113
uses: helm/kind-action@v1
114114
with:
115115
install_only: true
116+
version: v0.20.0
117+
node_image: kindest/node:v1.29.2
116118

117119
- name: Install Flux CLI
118120
run: |
119-
curl -sL https://github.com/fluxcd/flux2/releases/download/v2.4.0/flux_2.4.0_linux_amd64.tar.gz | tar xz -C /tmp
121+
curl -sL https://github.com/fluxcd/flux2/releases/download/v2.3.0/flux_2.3.0_linux_amd64.tar.gz | tar xz -C /tmp
120122
sudo mv /tmp/flux /usr/local/bin/flux
121123
chmod +x /usr/local/bin/flux
122124
flux --version
@@ -125,3 +127,5 @@ jobs:
125127
run: make integration-test
126128
env:
127129
TIMEOUT: 600
130+
KIND_NODE_IMAGE: kindest/node:v1.29.2
131+
FLUX_VERSION: v2.3.0

test/integration/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ SKIP_CLEANUP=true ./test/integration/run-integration-test.sh
5151
| Variable | Description | Default |
5252
|----------|-------------|---------|
5353
| `CLUSTER_NAME` | Name of the kind cluster to create | `flux-extension-test` |
54-
| `FLUX_VERSION` | Version of Flux CLI to install | `v2.4.0` |
54+
| `FLUX_VERSION` | Version of Flux CLI to install | `v2.3.0` |
55+
| `KIND_NODE_IMAGE` | Kind node image to use | `kindest/node:v1.29.2` |
5556
| `TIMEOUT` | Timeout in seconds for Kubernetes operations | `300` |
5657
| `SKIP_CLEANUP` | Keep cluster running after tests | `false` |
5758

@@ -191,13 +192,16 @@ If Flux fails to install:
191192
# Check Flux CLI version
192193
flux --version
193194

194-
# Try manual installation
195-
flux install --components=source-controller,notification-controller
195+
# Try with compatible Kubernetes version
196+
KIND_NODE_IMAGE=kindest/node:v1.29.2 ./test/integration/run-integration-test.sh
196197

197-
# Check installation status
198-
flux check
198+
# Or manually check pod status
199+
kubectl -n flux-system get pods
200+
kubectl -n flux-system logs deployment/source-controller
199201
```
200202

203+
**Note:** Flux v2.3.0 with Kind node v1.29.2 is the tested stable combination. Newer versions may have compatibility issues.
204+
201205
### Controller Not Starting
202206

203207
If the controller pod doesn't start:

test/integration/run-integration-test.sh

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ set -euo pipefail
77

88
# Configuration
99
CLUSTER_NAME="${CLUSTER_NAME:-flux-extension-test}"
10-
FLUX_VERSION="${FLUX_VERSION:-v2.4.0}"
10+
FLUX_VERSION="${FLUX_VERSION:-v2.3.0}"
11+
KIND_NODE_IMAGE="${KIND_NODE_IMAGE:-kindest/node:v1.29.2}"
1112
TIMEOUT="${TIMEOUT:-300}"
1213
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1314
REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
@@ -106,14 +107,14 @@ install_flux_cli() {
106107

107108
# Create kind cluster
108109
create_kind_cluster() {
109-
log_info "Creating kind cluster '${CLUSTER_NAME}'..."
110+
log_info "Creating kind cluster '${CLUSTER_NAME}' with image ${KIND_NODE_IMAGE}..."
110111

111112
if kind get clusters | grep -q "^${CLUSTER_NAME}$"; then
112113
log_warning "Cluster '${CLUSTER_NAME}' already exists, deleting it..."
113114
kind delete cluster --name "${CLUSTER_NAME}"
114115
fi
115116

116-
cat <<EOF | kind create cluster --name "${CLUSTER_NAME}" --config=-
117+
cat <<EOF | kind create cluster --name "${CLUSTER_NAME}" --image "${KIND_NODE_IMAGE}" --config=-
117118
kind: Cluster
118119
apiVersion: kind.x-k8s.io/v1alpha4
119120
nodes:
@@ -137,17 +138,35 @@ EOF
137138
install_flux() {
138139
log_info "Installing Flux components..."
139140

140-
# Bootstrap Flux without Git repository (standalone mode)
141-
flux install --components=source-controller,notification-controller
141+
# Generate Flux manifests and apply them directly (bypass verification)
142+
flux install \
143+
--components=source-controller,notification-controller \
144+
--network-policy=false \
145+
--toleration-keys=node-role.kubernetes.io/control-plane \
146+
--export | kubectl apply -f -
142147

143-
# Wait for Flux components to be ready
148+
# Give components time to start
149+
log_info "Waiting for deployments to be created..."
150+
sleep 20
151+
152+
# Wait for Flux deployments to be available
144153
log_info "Waiting for Flux components to be ready..."
145-
kubectl -n flux-system wait --for=condition=ready pod --all --timeout="${TIMEOUT}s"
154+
for deployment in source-controller notification-controller; do
155+
log_info "Waiting for $deployment..."
156+
kubectl -n flux-system wait deployment/$deployment \
157+
--for=condition=Available \
158+
--timeout="${TIMEOUT}s" || {
159+
log_error "$deployment failed to become available"
160+
kubectl -n flux-system describe deployment/$deployment
161+
kubectl -n flux-system logs deployment/$deployment --tail=50 || true
162+
return 1
163+
}
164+
done
146165

147-
# Verify Flux installation
148-
flux check
166+
# Verify pods are running
167+
kubectl -n flux-system get pods
149168

150-
log_info "Flux installed successfully"
169+
log_info "Flux installation complete"
151170
}
152171

153172
# Build and load controller image

0 commit comments

Comments
 (0)