Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 67 additions & 53 deletions .github/workflows/test-setup-minikube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Test basic Minikube setup
id: test-basic
uses: ./setup-minikube

- name: Verify basic setup outputs
run: |
echo "Minikube status: ${{ steps.test-basic.outputs.minikube-status }}"
Expand All @@ -44,7 +44,7 @@ jobs:
fi

echo "✅ Basic setup outputs verified"

- name: Test kubectl functionality
run: |
# Test basic kubectl commands
Expand All @@ -59,7 +59,7 @@ jobs:
fi

echo "✅ kubectl functionality test passed"

- name: Test Minikube commands
run: |
# Test basic minikube commands
Expand All @@ -81,13 +81,13 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Test Minikube setup with Ingress
id: test-ingress
uses: ./setup-minikube
with:
ingress-enable: 'true'

- name: Verify Ingress is enabled
run: |
# Check if ingress addon is enabled
Expand All @@ -109,56 +109,63 @@ jobs:

echo "✅ Ingress setup test passed"

test-with-olm:
test-with-olm-v0:
runs-on: ubuntu-latest

steps:

- name: Checkout repository
uses: actions/checkout@v4
- name: Test Minikube setup with OLM

- name: Test Minikube setup with OLM v0
id: test-olm
uses: ./setup-minikube
with:
olm-enable: 'true'
olm-version: '0.32.0'


- name: Verify OLM is installed
run: |
# Check if OLM namespaces exist
if ! kubectl get namespace olm; then
echo "❌ Error: OLM namespace does not exist"
exit 1
fi

if ! kubectl get namespace operators; then
echo "❌ Error: operators namespace does not exist"
exit 1
fi

# Check if OLM pods are running
kubectl get pods -n olm

# Check for key OLM components
if ! kubectl get pods -n olm | grep -q "olm-operator"; then
echo "❌ Error: olm-operator pod not found"
exit 1
fi

if ! kubectl get pods -n olm | grep -q "catalog-operator"; then
echo "❌ Error: catalog-operator pod not found"
exit 1
fi
# Check OLM v0 CRDs
kubectl get crd catalogsources.operators.coreos.com || (echo "OLM v0 CRD not found." && exit 1)
kubectl get crd subscriptions.operators.coreos.com || (echo "OLM v0 CRD not found." && exit 1)

echo "✅ OLM installation test passed"
# Check OLM v0 pods (namespace independent)
kubectl -A -l=app=olm-operator get pods --no-headers 2>&1 | awk '$4!="Running"{exit 1}' || (echo "OLM v0 pod not running." && exit 1)
kubectl -A -l=app=catalog-operator get pods --no-headers 2>&1 | awk '$4!="Running"{exit 1}' || (echo "OLM v0 pod not running." && exit 1)

echo "✅ OLM v0 installation test passed"

test-with-olm-v1:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Test Minikube setup with OLM v1
id: test-olm
uses: ./setup-minikube
with:
olm-v1-enable: 'true'

- name: Verify OLM is installed
run: |
# Check OLM v1 CRDs
kubectl get crd clustercatalogs.olm.operatorframework.io || (echo "OLM v1 CRD not found." && exit 1)
kubectl get crd clusterextensions.olm.operatorframework.io || (echo "OLM v1 CRD not found." && exit 1)

# Check OLM v1 pods (namespace independent)
kubectl -A -l=control-plane=operator-controller-controller-manager get pods --no-headers 2>&1 | awk '$4!="Running"{exit 1}' || (echo "OLM v1 pod not running." && exit 1)
kubectl -A -l=control-plane=catalogd-controller-manager get pods --no-headers 2>&1 | awk '$4!="Running"{exit 1}' || (echo "OLM v1 pod not running." && exit 1)

echo "✅ OLM v1 installation test passed"

test-custom-versions:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Test with custom versions
id: test-custom
uses: ./setup-minikube
Expand All @@ -167,7 +174,7 @@ jobs:
kubernetes-version: 'v1.32.0'
driver: 'docker'
start-args: '--force --memory=2048'

- name: Verify custom versions
run: |
# Check minikube version
Expand All @@ -189,17 +196,17 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Test full setup with all features
id: test-full
uses: ./setup-minikube
with:
ingress-enable: 'true'
olm-enable: 'true'
olm-version: '0.32.0'
minikube-version: 'v1.36.0'
kubernetes-version: 'v1.33.3'

ingress-enable: 'true'
olm-enable: 'true'
olm-v1-enable: 'true'

- name: Verify full setup
run: |
echo "Full setup outputs:"
Expand All @@ -217,14 +224,20 @@ jobs:
exit 1
fi

# Verify OLM is installed
if ! kubectl get namespace olm; then
echo "❌ Error: OLM not installed in full setup"
exit 1
fi
# Verify OLM v0 is installed
kubectl get crd catalogsources.operators.coreos.com || (echo "OLM v0 CRD not found." && exit 1)
kubectl get crd subscriptions.operators.coreos.com || (echo "OLM v0 CRD not found." && exit 1)
kubectl -A -l=app=olm-operator get pods --no-headers 2>&1 | awk '$4!="Running"{exit 1}' || (echo "OLM v0 pod not running." && exit 1)
kubectl -A -l=app=catalog-operator get pods --no-headers 2>&1 | awk '$4!="Running"{exit 1}' || (echo "OLM v0 pod not running." && exit 1)

# Verify OLM v1 is installed
kubectl get crd clustercatalogs.olm.operatorframework.io || (echo "OLM v1 CRD not found." && exit 1)
kubectl get crd clusterextensions.olm.operatorframework.io || (echo "OLM v1 CRD not found." && exit 1)
kubectl -A -l=control-plane=operator-controller-controller-manager get pods --no-headers 2>&1 | awk '$4!="Running"{exit 1}' || (echo "OLM v1 pod not running." && exit 1)
kubectl -A -l=control-plane=catalogd-controller-manager get pods --no-headers 2>&1 | awk '$4!="Running"{exit 1}' || (echo "OLM v1 pod not running." && exit 1)

echo "✅ Full setup test passed"

- name: Test deployment to verify cluster functionality
run: |
# Deploy a simple test application
Expand All @@ -244,7 +257,7 @@ jobs:
kubectl get services

echo "✅ Deployment test passed"

- name: Test summary
run: |
echo "## Test Results 🧪" >> $GITHUB_STEP_SUMMARY
Expand Down Expand Up @@ -274,19 +287,20 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Test with invalid OLM version (should handle gracefully)
id: test-error
continue-on-error: true
uses: ./setup-minikube
with:
olm-enable: 'true'
olm-version: '999.999.999'

- name: Verify error handling
run: |
if [ "${{ steps.test-error.outcome }}" = "success" ]; then
echo "⚠️ Warning: Action succeeded with invalid OLM version - this may be expected if it falls back gracefully"
# TODO: This should probably fail.
else
echo "✅ Error handling test passed - action correctly failed or handled invalid OLM version"
fi
Expand Down
43 changes: 30 additions & 13 deletions setup-minikube/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@ inputs:
required: false
default: 'false'
olm-enable:
description: 'Install OLM'
description: 'Install OLM v0'
required: false
default: 'false'
olm-version:
description: 'OLM version to install'
description: 'OLM v0 version to install'
required: false
default: '0.32.0'
olm-v1-enable:
description: 'Install OLM v1'
required: false
default: 'false'
olm-v1-version:
description: 'OLM v1 version to install'
required: false
default: '1.3.0'
minikube-version:
description: 'Minikube version to use'
required: false
Expand Down Expand Up @@ -78,7 +86,7 @@ runs:
echo "🔍 Minikube status: ${MINIKUBE_STATUS}"

# Get Kubernetes version
K8S_VERSION=$(kubectl version --short --client=false 2>/dev/null | grep "Server Version" | awk '{print $3}' || echo "unknown")
K8S_VERSION=$(kubectl version 2>/dev/null | grep "Server Version" | awk '{print $3}' || echo "unknown")
echo "kubernetes-version=${K8S_VERSION}" >> $GITHUB_OUTPUT
echo "🔍 Kubernetes version: ${K8S_VERSION}"

Expand All @@ -97,21 +105,15 @@ runs:
shell: bash
run: |
echo "🚀 Enabling Ingress addon..."
minikube addons enable ingress

echo "⏳ Waiting for Ingress controller to be ready..."
kubectl wait --namespace ingress-nginx \
--for=condition=ready pod \
--selector=app.kubernetes.io/component=controller \
--timeout=300s || echo "⚠️ Ingress controller may not be fully ready"

# This sometimes fails - leaving the debug in place in case that happens again.
minikube --alsologtostderr --v=2 addons enable ingress
echo "✅ Ingress addon enabled"

- name: Install OLM
- name: Install OLM v0
if: inputs.olm-enable == 'true'
shell: bash
run: |
echo "🚀 Installing OLM (Operator Lifecycle Manager)..."
echo "🚀 Installing OLM (Operator Lifecycle Manager) v0..."
echo "📦 OLM Version: ${{ inputs.olm-version }}"

# Download and install OLM
Expand All @@ -126,6 +128,21 @@ runs:

echo "✅ OLM installation completed"

- name: Install OLM v1
if: inputs.olm-v1-enable == 'true'
shell: bash
run: |
echo "🚀 Installing OLM (Operator Lifecycle Manager) v1..."
echo "📦 OLM Version: ${{ inputs.olm-v1-version }}"

# Download and install OLM
curl -L https://github.com/operator-framework/operator-controller/releases/download/v${{ inputs.olm-v1-version }}/install.sh -o install-olm.sh
chmod +x install-olm.sh
./install-olm.sh
rm install-olm.sh

echo "✅ OLM installation completed"

- name: Setup Minikube tunnel
shell: bash
run: |
Expand Down
Loading