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

[make] work around opm render bug when building for OLM #6545

Closed
jmazzitelli opened this issue Aug 31, 2023 · 2 comments · Fixed by #6546
Closed

[make] work around opm render bug when building for OLM #6545

jmazzitelli opened this issue Aug 31, 2023 · 2 comments · Fixed by #6546
Assignees
Labels
backlog Triaged Issue added to backlog bug Something isn't working

Comments

@jmazzitelli
Copy link
Collaborator

jmazzitelli commented Aug 31, 2023

There is a bug in opm render ... see operator-framework/operator-registry#935 and operator-framework/operator-registry#919 ... both myself and @ferhoyos hit this when running make olm-operator-create (really, the problem is in the target build-olm-index).

There is an interesting workaround as you see here which seems based on this simple workaround here.

I think we might be able to do something simpler, but the idea is we should tell opm render what its DOCKER_CONFIG is (don't rely on the default environment).

I think if DORP=podman (meaning you are relying on podman for the image registry access), then the Makefile should simply create a softlink to the podman auth.json to a file called config.json (which is docker's name, and apparently what opm render looks at) and just point opm to the podman directory. So something as simple as this should work:

ln $XDG_RUNTIME_DIR/containers/auth.json $XDG_RUNTIME_DIR/containers/config.json
export DOCKER_CONFIG="$XDG_RUNTIME_DIR/containers"
opm render ...
unset DOCKER_CONFIG

Alternatively, copy the auth.json to the build output directory and point DOCKER_CONFIG there.

@jmazzitelli jmazzitelli added the bug Something isn't working label Aug 31, 2023
@jmazzitelli jmazzitelli self-assigned this Aug 31, 2023
@jmazzitelli
Copy link
Collaborator Author

jmazzitelli commented Aug 31, 2023

Here is how I see the issue:

  1. Have at least one set of credentials in $HOME/.docker/config.json - if you do not, just do a docker login quay.io or docker login docker.io and make sure that file has some non-empty "auths" section.
  2. Log into an OpenShift cluster and do a "podman login" to the image registry (you can get that podman login command via make -e DORP=podman cluster-status -- look at the end of the output).
  3. Run make -e DORP=podman build-olm-index and see it fail with failed with status code [manifests v1.74.0]: 401 Unauthorized
  4. Now delete (or move it out of the way if you want to restore it later) the $HOME/.docker/config.json file and run the make command again. It should now succeed.

@jmazzitelli
Copy link
Collaborator Author

We will want to do a similar fix for the OSSMC make target that is similar: https://github.com/kiali/openshift-servicemesh-plugin/blob/main/make/Makefile.olm.mk#L69

jmazzitelli added a commit to jmazzitelli/openshift-servicemesh-plugin that referenced this issue Aug 31, 2023
part of: kiali/kiali#6545

This is the same solution that was added to the kiali/kiali repo: kiali/kiali#6546
@jshaughn jshaughn added the backlog Triaged Issue added to backlog label Aug 31, 2023
jmazzitelli added a commit to kiali/openshift-servicemesh-plugin that referenced this issue Sep 1, 2023
…201)

part of: kiali/kiali#6545

This is the same solution that was added to the kiali/kiali repo: kiali/kiali#6546
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Triaged Issue added to backlog bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

2 participants