Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control plane operator image lookup fails when trying to launch a custom hypershift-operator image interactively #5502

Open
maxcao13 opened this issue Jan 29, 2025 · 0 comments

Comments

@maxcao13
Copy link

maxcao13 commented Jan 29, 2025

OpenShift: 4.17.10
HyperShift binary: latest

Following the steps here: https://hypershift-docs.netlify.app/contribute/develop_in_cluster/#launch-a-custom-hypershift-operator-image-interactively runs in to an issue where if you don't specify a control plane operator image, the hypershift-operator will try and retrieve the image from it's own pod spec, and fail.

$ oc debug --namespace hypershift deployments/operator --image $(hack/publish-ocp.sh ./hypershift-operator) -- \
  /ko-app/hypershift-operator run \
  --oidc-storage-provider-s3-region $BUCKET_REGION \
  --oidc-storage-provider-s3-bucket-name $BUCKET_NAME \
  --oidc-storage-provider-s3-credentials /etc/oidc-storage-provider-s3-creds/credentials \
  --namespace hypershift \
  --pod-name operator-debug
{"level":"info","ts":"2025-01-29T18:44:32Z","logger":"setup","msg":"Starting hypershift-operator-manager","version":"openshift/hypershift: 6889612230b4caedddd1feb28fc783b72f03d99f. Latest supported OCP: 4.19.0"}
{"level":"info","ts":"2025-01-29T18:44:37Z","logger":"setup","msg":"objectkey","objectkey":{"name":"operator-debug","namespace":"hypershift"}}
failed to find operator image: failed to get operator pod hypershift/operator-debug: pods "operator-debug" not found

I'm not exactly sure why this doesn't fail regularly, but I assume this is because of the way the debug pod is named vs. the way a regular deployment pod is name:

deployment pod: operator-7bbf5b77c8-hk7t9
debug pod: operator-debug-84rjg

The debug pod does not have a pod template hash suffix, and I guess that makes this lookup fail?

me := &corev1.Pod{ObjectMeta: metav1.ObjectMeta{Namespace: opts.Namespace, Name: opts.PodName}}
if err := mgr.GetAPIReader().Get(ctx, crclient.ObjectKeyFromObject(me), me); err != nil {

A way to fix this is to just pass in the full pod name using downward API, but I wasn't sure if that would create other bugs:

operatorPodName := os.Getenv("MY_NAME")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant