-
Notifications
You must be signed in to change notification settings - Fork 22
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
The value of PLUGIN_PUBLISH_REPOSITORY
is not getting used in make plugin-publish-packages
#212
Comments
Thanks for the report @praveenrewar. Can you confirm that you set that variable properly? |
Thank you for the response @marckhouzam! $ export PLUGIN_PUBLISH_REPOSITORY=localhost:8080/test/v1/tanzu-cli/plugins
$ echo $PLUGIN_PUBLISH_REPOSITORY
localhost:8080/test/v1/tanzu-cli/plugins
$ curl http://localhost:8080/v2/_catalog
{"repositories":["plugins/darwin/amd64/hello-world","plugins/darwin/amd64/package","test/v1/tanzu-cli/plugins/plugin-inventory","test/v1/tanzu-cli/plugins/vmware/tzcli/darwin/amd64/kubernetes/hello-world","test/v1/tanzu-cli/plugins/vmware/tzcli/darwin/amd64/kubernetes/package"]} After this when I try to publish the plugin, I get the same error. |
Here's an interesting observation, if I try to use the kubectl port-forward --namespace kube-system service/registry 5001:80 then for some reason the value of the environment variable is getting used, but since nothing is running on 8080, it still gives the connection refused error. Error: unable to publish plugin (name:hello-world, target:kubernetes, os:linux, arch:amd64, version:v0.0.1): output: imgpkg: Error: Error while preparing a transport to talk with the registry:
Unable to create round tripper:
Get "https://localhost:8080/v2/": dial tcp [::1]:8080: connect: connection refused; Get "http://localhost:8080/v2/": dial tcp [::1]:8080: connect: connection refused
: exit status 1
2023-04-13T18:27:30+05:30 [x] : unable to publish plugin (name:hello-world, target:kubernetes, os:linux, arch:amd64, version:v0.0.1): output: imgpkg: Error: Error while preparing a transport to talk with the registry:
Unable to create round tripper:
Get "https://localhost:8080/v2/": dial tcp [::1]:8080: connect: connection refused; Get "http://localhost:8080/v2/": dial tcp [::1]:8080: connect: connection refused
: exit status 1
make: *** [plugin-publish-packages] Error 1 I might be doing something wrong, but I am not sure what. |
Here is how I am trying to reproduce.
In shell 2:
Back to shell 1:
Do you see something different than in your case? |
I have followed similar steps, I even tried deleting my existing minikube cluster. But seeing your output made me realised that the push is happening twice. Once to the temp registry, and then once again to the repository provided by using the environment variable, and for me it's failing in the first step itself. I should have shared the complete output, my bad. I will try to figure out why this is happening but if you have any pointers for me, do let me know. make plugin-publish-packages
docker stop temp-package-registry && docker rm -v temp-package-registry || true
Error response from daemon: No such container: temp-package-registry
docker run -d -p 5001:5000 --name temp-package-registry mirror.gcr.io/library/registry:2
Unable to find image 'mirror.gcr.io/library/registry:2' locally
2: Pulling from library/registry
91d30c5bc195: Pull complete
65d52c8ad3c4: Pull complete
54f80cd081c9: Pull complete
ca8951d7f653: Pull complete
5ee46e9ce9b6: Pull complete
Digest: sha256:8c51be2f669c82da8015017ff1eae5e5155fcf707ba914c5c7b798fbeb03b50c
Status: Downloaded newer image for mirror.gcr.io/library/registry:2
ad4ff4d66541185a538411b8b13eb829e60a4e71f5c1d2c319416fdd9984b39a
tanzu builder plugin build-package \
--binary-artifacts /Users/prewar/Workspace/praveenrewar/hello-world-plugin/artifacts/plugins \
--package-artifacts /Users/prewar/Workspace/praveenrewar/hello-world-plugin/artifacts/packages \
--oci-registry localhost:5001
2023-04-13T18:44:43+05:30 [i] Using plugin binary artifacts from "/Users/prewar/Workspace/praveenrewar/hello-world-plugin/artifacts/plugins"
2023-04-13T18:44:43+05:30 [i] Generating plugin package for 'plugin:hello-world' 'target:kubernetes' 'os:linux' 'arch:amd64' 'version:v0.0.1'
Error: unable to push package to temporary registry for plugin: hello-world, target: kubernetes, os: linux, arch: amd64, version: v0.0.1: output: imgpkg: Error: Writing 'localhost:5001/plugins/linux/amd64/hello-world:v0.0.1':
Error while preparing a transport to talk with the registry:
Unable to create round tripper:
Get "https://localhost:5001/v2/": dial tcp [::1]:5001: connect: connection refused; Get "http://localhost:5001/v2/": dial tcp [::1]:5001: connect: connection refused
: exit status 1
2023-04-13T18:44:43+05:30 [x] : unable to push package to temporary registry for plugin: hello-world, target: kubernetes, os: linux, arch: amd64, version: v0.0.1: output: imgpkg: Error: Writing 'localhost:5001/plugins/linux/amd64/hello-world:v0.0.1':
Error while preparing a transport to talk with the registry:
Unable to create round tripper:
Get "https://localhost:5001/v2/": dial tcp [::1]:5001: connect: connection refused; Get "http://localhost:5001/v2/": dial tcp [::1]:5001: connect: connection refused
: exit status 1
make: *** [plugin-build-packages] Error 1 |
It seems we still are tied to the 5001 registry a little but it should not prevent you from using minikube. We'll look into cleaning that better. Now I see the "Linux" error in your output that you reported in #213 . |
I think the issue is that I use the docker daemon that comes with minikube by using $ kubectl port-forward --namespace kube-system service/registry 5001:80
$ kubectl port-forward --namespace kube-system service/registry 8080:80 So running the above two commands in different terminals worked for me. We can close this issue now, but I think that the ideal behaviour should be that when the environment variable is provided, the temp-registry shouldn't be used |
Bug description
I am trying to follow the plugin implementation guide to build and publish a plugin.
I have setup a local registry using minikube and set the value of
PLUGIN_PUBLISH_REPOSITORY
tolocalhost:8080/test/v1/tanzu-cli/plugins
When I try to publish the plugin using
make plugin-publish-packages
I get the following error.Expected behavior
The value from the env variable should have been used to publish the plugin.
Steps to reproduce the bug / Relevant debug output
I am following the plugin implementation guide and used the following commands to setup a registry.
Output of
tanzu version
Environment where the bug was observed (cloud, OS, etc)
The text was updated successfully, but these errors were encountered: