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 inventory-plugin-add errors with MANIFEST_UNKNOWN: manifest unknown; map[Tag:v0.0.1] #213

Open
praveenrewar opened this issue Apr 13, 2023 · 3 comments
Labels
kind/bug PR/issue related to a bug

Comments

@praveenrewar
Copy link

Bug description
I am following the plugin implementation guideline to build and publish a plugin.

I am successfully able to plugnlish the plugin using make plugin-publish-packages and the initialisation of the empty sqlite database also works fine (for the first time), but when I try to add the plugin entry, I get an error.

make inventory-plugin-add
tanzu builder inventory plugin add \
		--repository localhost:5001/test/v1/tanzu-cli/plugins \
		--plugin-inventory-image-tag latest \
		--publisher tzcli \
		--vendor vmware \
		--manifest /Users/prewar/Workspace/praveenrewar/hello-world-plugin/artifacts/packages/plugin_manifest.yaml
2023-04-13T12:27:46+05:30 [i] pulling plugin inventory database from: "localhost:5001/test/v1/tanzu-cli/plugins/plugin-inventory:latest"
2023-04-13T12:27:47+05:30 [i] validating plugin 'hello-world_kubernetes_linux_amd64_v0.0.1'
Error: error while updating plugin inventory database: error while getting plugin binary digest from the image "localhost:5001/test/v1/tanzu-cli/plugins/vmware/tzcli/linux/amd64/kubernetes/hello-world:v0.0.1": unable to find image at "localhost:5001/test/v1/tanzu-cli/plugins/vmware/tzcli/linux/amd64/kubernetes/hello-world:v0.0.1": output: imgpkg: Error: Fetching image:
  GET http://localhost:5001/v2/test/v1/tanzu-cli/plugins/vmware/tzcli/linux/amd64/kubernetes/hello-world/manifests/v0.0.1:
    MANIFEST_UNKNOWN: manifest unknown; map[Tag:v0.0.1]
: exit status 1
2023-04-13T12:27:47+05:30 [x] : error while updating plugin inventory database: error while getting plugin binary digest from the image "localhost:5001/test/v1/tanzu-cli/plugins/vmware/tzcli/linux/amd64/kubernetes/hello-world:v0.0.1": unable to find image at "localhost:5001/test/v1/tanzu-cli/plugins/vmware/tzcli/linux/amd64/kubernetes/hello-world:v0.0.1": output: imgpkg: Error: Fetching image:
  GET http://localhost:5001/v2/test/v1/tanzu-cli/plugins/vmware/tzcli/linux/amd64/kubernetes/hello-world/manifests/v0.0.1:
    MANIFEST_UNKNOWN: manifest unknown; map[Tag:v0.0.1]
: exit status 1
make: *** [inventory-plugin-add] Error 1

Expected behavior
make inventory-plugin-add should successfully add the plugin entry to the inventory.

Steps to reproduce the bug / Relevant debug output
https://github.com/vmware-tanzu/tanzu-cli/blob/main/docs/plugindev/README.md

Output of tanzu version

version: v0.90.0-alpha.0
buildDate: 2023-04-08
sha: 198b3730

Environment where the bug was observed (cloud, OS, etc)

@praveenrewar praveenrewar added kind/bug PR/issue related to a bug needs-triage labels Apr 13, 2023
@praveenrewar
Copy link
Author

I tried to use imgpkg directly and I am able to see the plugin there

imgpkg copy -i localhost:5001/test/v1/tanzu-cli/plugins/vmware/tzcli/darwin/amd64/kubernetes/hello-world:v0.0.1 --to-tar abc.tar

@marckhouzam
Copy link
Contributor

Thanks for the report @praveenrewar.
I can reproduce this. The problem seems to be that make inventory-plugin-add tries to add the plugin for all OS-es (Linux, Darwin and Windows) but that we have only built the plugin for the local OS in our current situation.

We need to fix things for this situation.
In the mean time, you can use make plugin-build-and-publish-packages which will build the plugin for all OS-es and then publish successfully. Then make inventory-init followed by make inventory-plugin-add will succeed.

@praveenrewar
Copy link
Author

The problem seems to be that make inventory-plugin-add tries to add the plugin for all OS-es (Linux, Darwin and Windows) but that we have only built the plugin for the local OS in our current situation.

Ah, that makes sense.

Thank you so much for the workaround @marckhouzam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug PR/issue related to a bug
Projects
None yet
Development

No branches or pull requests

3 participants
@marckhouzam @praveenrewar and others