Skip to content

Instantly share code, notes, and snippets.

@Elbehery
Last active June 8, 2026 06:03
Show Gist options
  • Select an option

  • Save Elbehery/c344d77b29500e3da576aba41111df54 to your computer and use it in GitHub Desktop.

Select an option

Save Elbehery/c344d77b29500e3da576aba41111df54 to your computer and use it in GitHub Desktop.
PM-Local-Debug

Problem 1

After successfully running task local-setup, running task local-setup:example-data:iterate failed with:

error validating data: failed to download openapi:
Get "http://localhost:8080/openapi/v2?timeout=32s": dial tcp [::1]:8080: connect: connection refused

Root Cause

The example-data:iterate task expects the KCP admin kubeconfig to be active (KUBECONFIG=$(pwd)/.secret/kcp/admin.kubeconfig), but in the new shell session this env var wasn't set. Without it, kubectl fell back to the default localhost:8080, which isn't where KCP listens (KCP is exposed on https://localhost:8443).

Fix

export KUBECONFIG=$(pwd)/.secret/kcp/admin.kubeconfig

Problem 2

Issue

Running the local setup with --prerelease failed with:

error: timed out waiting for the condition on platformmeshoperators/platform-mesh-operator

The PlatformMeshOperator CR was created but never became Ready, causing the wait in start.sh to time out almost immediately.

Root cause

The ocm-prerelease kustomize overlay includes ../../components/platform-mesh-operator, which applies the PlatformMeshOperator CR. This CR is a kro custom resource — kro can only reconcile it once the corresponding ResourceGraphDefinition (RGD) is installed and established.

The non-prerelease path in start.sh already handles this correctly: it applies the RGD and waits for it before the PlatformMeshOperator CR is ever created. The prerelease path (setup-prerelease.sh) applied the overlay directly without that step, so kro had no knowledge of the PlatformMeshOperator type and could not reconcile the CR.

kubectl apply -k $SCRIPT_DIR/../kustomize/base/rgd
kubectl wait --namespace default \
  --for=condition=Ready resourcegraphdefinition \
  --timeout=$KUBECTL_WAIT_TIMEOUT platform-mesh-operator

The prerelease path (setup-prerelease.sh) applied the overlay directly without first ensuring the RGD was ready, so kro had no knowledge of the PlatformMeshOperator type and could not reconcile the CR.

The bug was introduced in commit dc7fcfc8 (chore: ocm version upgrade #1160), which added ../../components/platform-mesh-operator to the prerelease overlay without mirroring the RGD setup step.

Fix

Apply and wait for the RGD in setup-prerelease.sh before applying the prerelease overlay:

kubectl apply -k $SCRIPT_DIR/../kustomize/base/rgd
kubectl wait --namespace default \
  --for=condition=Ready resourcegraphdefinition \
  --timeout=$KUBECTL_WAIT_TIMEOUT platform-mesh-operator

kubectl apply -k $SCRIPT_DIR/../kustomize/overlays/ocm-prerelease
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment