Skip to content

Use kubectl api-resources for OLM check#131

Merged
mclasmeier merged 3 commits into
mainfrom
mc/better-olm-install-check
May 7, 2026
Merged

Use kubectl api-resources for OLM check#131
mclasmeier merged 3 commits into
mainfrom
mc/better-olm-install-check

Conversation

@mclasmeier
Copy link
Copy Markdown
Collaborator

@mclasmeier mclasmeier commented May 4, 2026

Takes care of an important TODO: Use kubectl api-resources to check if some APIs are actually usable.
Prerequisite for CI rollout.

Manual verification

Deployed operator with --olm with roxie:

[...]
00:02 Initiating deployment of Operator
00:02 🚀 Deploying Operator only...
00:06 🔄 Switching operator from non-OLM to OLM mode...
00:06 🧹 Tearing down operator deployed without OLM...
00:19   ⋯ Still waiting for namespace deletion... (11s elapsed)
00:24 Namespace rhacs-operator-system has been deleted
00:24 ✓ Non-OLM operator resources removed
00:24 🚀 Deploying operator via OLM...
00:24 Operator tag: 4.10.1
00:25 ✓ OLM detected in cluster
00:25 Index image: quay.io/rhacs-eng/stackrox-operator-index:v4.10.1
00:26 Creating CatalogSource...
00:28 ✓ CatalogSource created
00:28 Creating OperatorGroup...
00:30 ✓ OperatorGroup created
00:30 Creating Subscription...
00:31 ✓ Subscription created
00:31 ⏳ Waiting for InstallPlan to be created...
[...]

Note that it detected OLM on the cluster. And also:

❯ kc delete crd installplans.operators.coreos.com 
customresourcedefinition.apiextensions.k8s.io "installplans.operators.coreos.com" deleted

roxie on  mc/better-olm-install-check [$?] via 🐹 v1.26.2 on ☁️  mclasmei@redhat.com 
❯ ./roxie deploy operator -t 4.10.1 --olm                                    
00:00 Using kubeconfig /Users/mclasmeier/.kube/infra/kubeconfig
00:00 Running with a controlling terminal.
00:01 🚀 ACS Deployer initialized
00:01 roxctl version: 4.11.x-725-gf948ae4b42
00:01 Using main image tag from --tag flag: 4.10.1
00:01 Preparing and verifying Docker credentials...
00:01 REGISTRY_USERNAME/REGISTRY_PASSWORD unset. Trying to obtain Docker credentials from config file: /Users/mclasmeier/.docker/config.json
00:02 Successfully verified credentials for quay.io (repository: rhacs-eng/main)
00:02 Docker credentials verified successfully
00:02 Initiating deployment of Operator
00:02 🚀 Deploying Operator only...
00:06 🚀 Deploying operator via OLM...
00:06 Operator tag: 4.10.1
00:07 OLM is not properly installed: resource installplans.operators.coreos.com not served by the API server.
00:07 Please make sure that OLM is installed properly.
Error: deployment failed: failed to deploy operator via OLM: OLM resource installplans.operators.coreos.com not served by the API server
[...]

@mclasmeier mclasmeier added the ci-rollout Marks a PR to be a prerequisite for rolling out roxie in stackrox CI. label May 5, 2026
@mclasmeier mclasmeier marked this pull request as ready for review May 5, 2026 11:35
@mclasmeier mclasmeier requested review from porridge and vladbologa May 5, 2026 11:35
Comment thread internal/deployer/operator_olm.go Outdated
Comment thread internal/deployer/operator_olm.go Outdated
Moritz Clasmeier and others added 2 commits May 7, 2026 13:00
The kubectl api-resources command can fail for reasons other than OLM
not being installed. Logging stderr and wrapping the error helps users
diagnose the actual issue.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of returning on the first missing resource, collect all missing
ones and log each individually. The returned error gives a concise
summary without duplicating the per-resource details.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mclasmeier mclasmeier merged commit cd33f95 into main May 7, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-rollout Marks a PR to be a prerequisite for rolling out roxie in stackrox CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants