Skip to content

Commit 58d8eff

Browse files
committed
feat: support OLM v1
1 parent ed45601 commit 58d8eff

2 files changed

Lines changed: 95 additions & 58 deletions

File tree

.github/workflows/test-setup-minikube.yml

Lines changed: 67 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
steps:
1717
- name: Checkout repository
1818
uses: actions/checkout@v4
19-
19+
2020
- name: Test basic Minikube setup
2121
id: test-basic
2222
uses: ./setup-minikube
23-
23+
2424
- name: Verify basic setup outputs
2525
run: |
2626
echo "Minikube status: ${{ steps.test-basic.outputs.minikube-status }}"
@@ -44,7 +44,7 @@ jobs:
4444
fi
4545
4646
echo "✅ Basic setup outputs verified"
47-
47+
4848
- name: Test kubectl functionality
4949
run: |
5050
# Test basic kubectl commands
@@ -59,7 +59,7 @@ jobs:
5959
fi
6060
6161
echo "✅ kubectl functionality test passed"
62-
62+
6363
- name: Test Minikube commands
6464
run: |
6565
# Test basic minikube commands
@@ -81,13 +81,13 @@ jobs:
8181
steps:
8282
- name: Checkout repository
8383
uses: actions/checkout@v4
84-
84+
8585
- name: Test Minikube setup with Ingress
8686
id: test-ingress
8787
uses: ./setup-minikube
8888
with:
8989
ingress-enable: 'true'
90-
90+
9191
- name: Verify Ingress is enabled
9292
run: |
9393
# Check if ingress addon is enabled
@@ -109,56 +109,63 @@ jobs:
109109
110110
echo "✅ Ingress setup test passed"
111111
112-
test-with-olm:
112+
test-with-olm-v0:
113113
runs-on: ubuntu-latest
114-
115114
steps:
115+
116116
- name: Checkout repository
117117
uses: actions/checkout@v4
118-
119-
- name: Test Minikube setup with OLM
118+
119+
- name: Test Minikube setup with OLM v0
120120
id: test-olm
121121
uses: ./setup-minikube
122122
with:
123123
olm-enable: 'true'
124-
olm-version: '0.32.0'
125-
124+
126125
- name: Verify OLM is installed
127126
run: |
128-
# Check if OLM namespaces exist
129-
if ! kubectl get namespace olm; then
130-
echo "❌ Error: OLM namespace does not exist"
131-
exit 1
132-
fi
133-
134-
if ! kubectl get namespace operators; then
135-
echo "❌ Error: operators namespace does not exist"
136-
exit 1
137-
fi
138-
139-
# Check if OLM pods are running
140-
kubectl get pods -n olm
141-
142-
# Check for key OLM components
143-
if ! kubectl get pods -n olm | grep -q "olm-operator"; then
144-
echo "❌ Error: olm-operator pod not found"
145-
exit 1
146-
fi
147-
148-
if ! kubectl get pods -n olm | grep -q "catalog-operator"; then
149-
echo "❌ Error: catalog-operator pod not found"
150-
exit 1
151-
fi
127+
# Check OLM v0 CRDs
128+
kubectl get crd catalogsources.operators.coreos.com || (echo "OLM v0 CRD not found." && exit 1)
129+
kubectl get crd subscriptions.operators.coreos.com || (echo "OLM v0 CRD not found." && exit 1)
152130
153-
echo "✅ OLM installation test passed"
131+
# Check OLM v0 pods (namespace independent)
132+
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)
133+
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)
134+
135+
echo "✅ OLM v0 installation test passed"
136+
137+
test-with-olm-v1:
138+
runs-on: ubuntu-latest
139+
140+
steps:
141+
- name: Checkout repository
142+
uses: actions/checkout@v4
143+
144+
- name: Test Minikube setup with OLM v1
145+
id: test-olm
146+
uses: ./setup-minikube
147+
with:
148+
olm-v1-enable: 'true'
149+
150+
- name: Verify OLM is installed
151+
run: |
152+
# Check OLM v1 CRDs
153+
kubectl get crd clustercatalogs.olm.operatorframework.io || (echo "OLM v1 CRD not found." && exit 1)
154+
kubectl get crd clusterextensions.olm.operatorframework.io || (echo "OLM v1 CRD not found." && exit 1)
155+
156+
# Check OLM v1 pods (namespace independent)
157+
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)
158+
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)
159+
160+
echo "✅ OLM v1 installation test passed"
154161
155162
test-custom-versions:
156163
runs-on: ubuntu-latest
157164

158165
steps:
159166
- name: Checkout repository
160167
uses: actions/checkout@v4
161-
168+
162169
- name: Test with custom versions
163170
id: test-custom
164171
uses: ./setup-minikube
@@ -167,7 +174,7 @@ jobs:
167174
kubernetes-version: 'v1.32.0'
168175
driver: 'docker'
169176
start-args: '--force --memory=2048'
170-
177+
171178
- name: Verify custom versions
172179
run: |
173180
# Check minikube version
@@ -189,17 +196,17 @@ jobs:
189196
steps:
190197
- name: Checkout repository
191198
uses: actions/checkout@v4
192-
199+
193200
- name: Test full setup with all features
194201
id: test-full
195202
uses: ./setup-minikube
196203
with:
197-
ingress-enable: 'true'
198-
olm-enable: 'true'
199-
olm-version: '0.32.0'
200204
minikube-version: 'v1.36.0'
201205
kubernetes-version: 'v1.33.3'
202-
206+
ingress-enable: 'true'
207+
olm-enable: 'true'
208+
olm-v1-enable: 'true'
209+
203210
- name: Verify full setup
204211
run: |
205212
echo "Full setup outputs:"
@@ -217,14 +224,20 @@ jobs:
217224
exit 1
218225
fi
219226
220-
# Verify OLM is installed
221-
if ! kubectl get namespace olm; then
222-
echo "❌ Error: OLM not installed in full setup"
223-
exit 1
224-
fi
227+
# Verify OLM v0 is installed
228+
kubectl get crd catalogsources.operators.coreos.com || (echo "OLM v0 CRD not found." && exit 1)
229+
kubectl get crd subscriptions.operators.coreos.com || (echo "OLM v0 CRD not found." && exit 1)
230+
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)
231+
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)
232+
233+
# Verify OLM v1 is installed
234+
kubectl get crd clustercatalogs.olm.operatorframework.io || (echo "OLM v1 CRD not found." && exit 1)
235+
kubectl get crd clusterextensions.olm.operatorframework.io || (echo "OLM v1 CRD not found." && exit 1)
236+
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)
237+
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)
225238
226239
echo "✅ Full setup test passed"
227-
240+
228241
- name: Test deployment to verify cluster functionality
229242
run: |
230243
# Deploy a simple test application
@@ -244,7 +257,7 @@ jobs:
244257
kubectl get services
245258
246259
echo "✅ Deployment test passed"
247-
260+
248261
- name: Test summary
249262
run: |
250263
echo "## Test Results 🧪" >> $GITHUB_STEP_SUMMARY
@@ -274,19 +287,20 @@ jobs:
274287
steps:
275288
- name: Checkout repository
276289
uses: actions/checkout@v4
277-
290+
278291
- name: Test with invalid OLM version (should handle gracefully)
279292
id: test-error
280293
continue-on-error: true
281294
uses: ./setup-minikube
282295
with:
283296
olm-enable: 'true'
284297
olm-version: '999.999.999'
285-
298+
286299
- name: Verify error handling
287300
run: |
288301
if [ "${{ steps.test-error.outcome }}" = "success" ]; then
289302
echo "⚠️ Warning: Action succeeded with invalid OLM version - this may be expected if it falls back gracefully"
303+
# TODO: This should probably fail.
290304
else
291305
echo "✅ Error handling test passed - action correctly failed or handled invalid OLM version"
292306
fi

setup-minikube/action.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,21 @@ inputs:
1111
required: false
1212
default: 'false'
1313
olm-enable:
14-
description: 'Install OLM'
14+
description: 'Install OLM v0'
1515
required: false
1616
default: 'false'
1717
olm-version:
18-
description: 'OLM version to install'
18+
description: 'OLM v0 version to install'
1919
required: false
2020
default: '0.32.0'
21+
olm-v1-enable:
22+
description: 'Install OLM v1'
23+
required: false
24+
default: 'false'
25+
olm-v1-version:
26+
description: 'OLM v1 version to install'
27+
required: false
28+
default: '1.3.0'
2129
minikube-version:
2230
description: 'Minikube version to use'
2331
required: false
@@ -78,7 +86,7 @@ runs:
7886
echo "🔍 Minikube status: ${MINIKUBE_STATUS}"
7987
8088
# Get Kubernetes version
81-
K8S_VERSION=$(kubectl version --short --client=false 2>/dev/null | grep "Server Version" | awk '{print $3}' || echo "unknown")
89+
K8S_VERSION=$(kubectl version 2>/dev/null | grep "Server Version" | awk '{print $3}' || echo "unknown")
8290
echo "kubernetes-version=${K8S_VERSION}" >> $GITHUB_OUTPUT
8391
echo "🔍 Kubernetes version: ${K8S_VERSION}"
8492
@@ -107,11 +115,11 @@ runs:
107115
108116
echo "✅ Ingress addon enabled"
109117
110-
- name: Install OLM
118+
- name: Install OLM v0
111119
if: inputs.olm-enable == 'true'
112120
shell: bash
113121
run: |
114-
echo "🚀 Installing OLM (Operator Lifecycle Manager)..."
122+
echo "🚀 Installing OLM (Operator Lifecycle Manager) v0..."
115123
echo "📦 OLM Version: ${{ inputs.olm-version }}"
116124
117125
# Download and install OLM
@@ -126,6 +134,21 @@ runs:
126134
127135
echo "✅ OLM installation completed"
128136
137+
- name: Install OLM v1
138+
if: inputs.olm-v1-enable == 'true'
139+
shell: bash
140+
run: |
141+
echo "🚀 Installing OLM (Operator Lifecycle Manager) v1..."
142+
echo "📦 OLM Version: ${{ inputs.olm-v1-version }}"
143+
144+
# Download and install OLM
145+
curl -L https://github.com/operator-framework/operator-controller/releases/download/v${{ inputs.olm-v1-version }}/install.sh -o install-olm.sh
146+
chmod +x install-olm.sh
147+
./install-olm.sh
148+
rm install-olm.sh
149+
150+
echo "✅ OLM installation completed"
151+
129152
- name: Setup Minikube tunnel
130153
shell: bash
131154
run: |

0 commit comments

Comments
 (0)