vmware-tanzu / tanzu-framework

Tanzu Framework provides a set of building blocks to build atop of the Tanzu platform and leverages Carvel packaging and plugins to provide users with a much stronger, more integrated experience than the loose coupling and stand-alone commands of the previous generation of tools.
Apache License 2.0
196 stars 193 forks source link

Builder Plugin: Directory structure mismatch between `compile` and `publish` sub-commands #1418

Open giri-varma opened 2 years ago

giri-varma commented 2 years ago

Bug description The directory structure expected by tanzu builder publish is different from the default output of tanzu build cli compile.
Sample structure after compile:

artifacts
├── foo
│   ├── plugin.yaml
│   └── v0.1.1
│       ├── tanzu-foo-darwin_amd64
│       ├── tanzu-foo-linux_amd64
│       └── tanzu-foo-windows_amd64.exe
└── bar
    ├── plugin.yaml
    └── v0.1.1
        ├── tanzu-bar-darwin_amd64
        ├── tanzu-bar-linux_amd64
        └── tanzu-bar-windows_amd64.exe

Sample structure expected by publish:

artifacts
├── darwin
│   └── amd64
│       └── cli
│           ├── foo
│           │   ├── plugin.yaml
│           │   └── v0.1.1
│           │       └── tanzu-foo-darwin_amd64
│           └── bar
│               ├── plugin.yaml
│               └── v0.1.1
│                   └── tanzu-bar-darwin_amd64
├── linux
│   └── amd64
│       └── cli
│           ├── foo
│           │   ├── plugin.yaml
│           │   └── v0.1.1
│           │       └── tanzu-foo-linux_amd64
│           └── bar
│               ├── plugin.yaml
│               └── v0.1.1
│                   └── tanzu-bar-linux_amd64
└── windows
    └── amd64
        └── cli
            ├── foo
            │   ├── plugin.yaml
            │   └── v0.1.1
            │       └── tanzu-foo-linux_amd64
            └── bar
                ├── plugin.yaml
                └── v0.1.1
                    └── tanzu-bar-linux_amd64

Affected product area (please put an X in all that apply)

Expected behavior Even though we can change the compile arguments to generate the expected directory structure, it is not obvious to new users. It would be ideal to have the same structure between the two commands for easier plugin development.

Version (include the SHA if the version is not obvious) 2ab0e419bdbd4b82a5c9e47a917cc170ab35313a

Relevant Debug Output (Logs, manifests, etc)

Publishing plugins: foo bar
tanzu builder publish --type local --plugins "foo bar" --version v0.1.1 --local-output-discovery-dir "./discovery" --local-output-distribution-dir "./distribution" --input-artifact-dir "./artifacts"
Error: unable to find plugin artifact directory for plugin:'foo' os:'darwin', arch:'amd64' [directory: 'artifacts/darwin/amd64/cli/foo']
hinyinlam commented 2 years ago

As a author of tanzu harbor plugin, this is a blocker for releasing an OCI image for the plugin using tanzu plugin source add command