From 811f4f13beb8437f225559c8a05aa55ca7f97b86 Mon Sep 17 00:00:00 2001 From: stewartshea Date: Tue, 30 Jun 2026 22:15:01 -0400 Subject: [PATCH] Fix resource type definition in GCP Bucket generation rules and update documentation on runwhen-local limitations Updated the resource type in the GCP Bucket generation rules from `buckets.storage.gcp.upbound.io` to `bucket.storage.gcp.upbound.io` for consistency with the preferred API version. Additionally, enhanced the documentation in `08-current-limitations.md` to clarify the current state of custom-resource discovery in runwhen-local, addressing two specific issues encountered during validation. This change ensures accurate resource type definitions and improves clarity on limitations affecting cluster-scoped CRDs. --- .../gcp-bucket-crossplane-health.yaml | 2 +- docs/08-current-limitations.md | 30 ++++++++++++++----- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/codebundles/gcp-bucket-crossplane-health/.runwhen/generation-rules/gcp-bucket-crossplane-health.yaml b/codebundles/gcp-bucket-crossplane-health/.runwhen/generation-rules/gcp-bucket-crossplane-health.yaml index 4b4b1e0..2b36af0 100644 --- a/codebundles/gcp-bucket-crossplane-health/.runwhen/generation-rules/gcp-bucket-crossplane-health.yaml +++ b/codebundles/gcp-bucket-crossplane-health/.runwhen/generation-rules/gcp-bucket-crossplane-health.yaml @@ -12,7 +12,7 @@ spec: # Pin an explicit version like `buckets.storage.gcp.upbound.io/v1beta1` # if you need schema stability across CRD upgrades. - resourceTypes: - - buckets.storage.gcp.upbound.io + - bucket.storage.gcp.upbound.io matchRules: # Match every Bucket by name. Swap this regex to scope by naming # convention (for example `^prod-.*` to only cover prod buckets) or diff --git a/docs/08-current-limitations.md b/docs/08-current-limitations.md index 2b09141..246ad50 100644 --- a/docs/08-current-limitations.md +++ b/docs/08-current-limitations.md @@ -2,14 +2,28 @@ ## What you'll learn here -Two upstream limitations in `runwhen-local` (verified against image -`runwhen-local:0.11.0` and the tip of the `main` branch) that block a -"generation-rule only" example targeting **cluster-scoped** Crossplane -CRDs like GCP Buckets. These are honest observations from the live -validation run we performed during iteration 1 — they are not blockers -for teaching the pattern, but they are blockers for observing generated -SLXs in the RunWhen UI. This chapter lists the issues, the workaround -we already applied, and the fixes still owing. +Custom-resource discovery in `runwhen-local` **works today** for the +common case — every existing generation rule in `rw-cli-codecollection` +that targets a CRD (Flux HelmRelease, cert-manager Certificate, +Prometheus, ArgoCD Application, Crunchy/Zalando Postgres, etc.) +discovers and renders SLXs correctly. Iteration 1's validation, however, +surfaced two narrow, conditional issues in the current code path +(verified against image `runwhen-local:0.11.0` and the tip of `main`) +that together prevent this specific example from rendering SLXs today: + +1. A `NameError` triggered only when a generation rule pins a version + (e.g. `plural.group/v1beta1`). Existing rules that omit the version + are unaffected — that's why nothing broke before. +2. A namespaced-only listing call for CRDs, which returns 404 for + **cluster-scoped** CRDs. Every existing CRD referenced by + `rw-cli-codecollection` is namespaced, so this had no prior surface. + Crossplane managed resources like `buckets.storage.gcp.upbound.io` + are the first cluster-scoped CRDs the pattern has been used against. + +Both are small, contained fixes. The larger "generation-rule only" +pattern this codecollection is teaching is otherwise fully working — +the workspace-builder clones the private CC, loads the generation +rule, and attempts discovery correctly. ## Issue #1 — `KubernetesResourceTypeSpec` `NameError` when a resource type is version-pinned