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

pack buildpack new --targets creates buildpack.toml with wrong field/table names for distro name/version #2120

Closed
edmorley opened this issue Apr 8, 2024 · 1 comment · Fixed by #2123
Assignees
Labels
help wanted Need some extra hands to get this done. status/ready Issue ready to be worked on. type/bug Issue that reports an unexpected behaviour.
Milestone

Comments

@edmorley
Copy link
Contributor

edmorley commented Apr 8, 2024

Summary

The pack buildpack new command has a --targets option that allows for pre-populating the [[targets]] table in the generated buildpack.toml file.

However, the command currently uses the wrong field and table names if a distro name/version is specified:

  • targets.distributions (instead of targets.distros)
  • versions of type array (instead of version of type string)

xref:

cc @natalieparellano


Reproduction

Steps
  1. pack buildpack new testcase-targets-distros --api 0.10 --targets "linux/amd64:ubuntu@123"
  2. cat testcase-targets-distros/buildpack.toml
Current behavior
# ...
[[targets]]
  os = "linux"
  arch = "amd64"

  [[targets.distributions]]
    name = "ubuntu"
    versions = ["123"]
Expected behavior
# ...
[[targets]]
  os = "linux"
  arch = "amd64"

  [[targets.distros]]
    name = "ubuntu"
    version = "123"

Environment

$ pack --version
0.33.2+git-f2cffc4.build-5562
@edmorley edmorley added status/triage Issue or PR that requires contributor attention. type/bug Issue that reports an unexpected behaviour. labels Apr 8, 2024
@jjbustamante jjbustamante added help wanted Need some extra hands to get this done. status/ready Issue ready to be worked on. and removed status/triage Issue or PR that requires contributor attention. labels Apr 8, 2024
natalieparellano added a commit that referenced this issue Apr 9, 2024
Signed-off-by: Natalie Arellano <narellano@vmware.com>
@natalieparellano
Copy link
Member

Thanks @edmorley - this should be simple enough to fix. I put up #2123 for now

@jjbustamante jjbustamante added this to the 0.34.0 milestone Apr 10, 2024
jjbustamante pushed a commit that referenced this issue Apr 26, 2024
Signed-off-by: Natalie Arellano <narellano@vmware.com>
Signed-off-by: Juan Bustamante <jbustamante@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Need some extra hands to get this done. status/ready Issue ready to be worked on. type/bug Issue that reports an unexpected behaviour.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants