Skip to content

Conversation

jjbustamante
Copy link
Member

@jjbustamante jjbustamante commented Jan 24, 2024

Summary

This PR adds a new --label flag to the pack builder create command

Output

Before

The flag didn't exist before

After

New flag will look like this, when running pack builder create --help

Flags:
  -l, --label stringToString        Labels to add to the builder image, in the form of '<name>=<value>' (default [])

Running a local builder creation like

> out/pack builder create cnbs/local-builder:jammy --config builder.toml --label "foo=bar"
# then we inspect the labels
>  docker inspect cnbs/local-builder:jammy | jq '.[] | .Config.Labels' | jq .

output

{
  "foo": "bar",
  "io.buildpacks.base.distro.name": "ubuntu",
  "io.buildpacks.base.distro.version": "\"22.04\"",
  "io.buildpacks.builder.metadata": "...."
}

As we can see the label "foo=bar" was set to the builder image

Documentation

  • Should this change be documented?
    • Yes, see #__
    • No

Related

Resolves #2033

@github-actions github-actions bot added this to the 0.33.0 milestone Jan 24, 2024
@github-actions github-actions bot added the type/enhancement Issue that requests a new feature or improvement. label Jan 24, 2024
@jjbustamante jjbustamante force-pushed the enhancement/jjbustamante/issue-2033 branch from fd8c921 to ff33cae Compare January 24, 2024 16:28
@jjbustamante jjbustamante force-pushed the enhancement/jjbustamante/issue-2033 branch from ff33cae to bdc66d2 Compare January 24, 2024 16:35
Copy link

codecov bot commented Jan 24, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (c6dd3ce) 79.63% compared to head (bdc66d2) 79.63%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2034      +/-   ##
==========================================
+ Coverage   79.63%   79.63%   +0.01%     
==========================================
  Files         176      176              
  Lines       13199    13214      +15     
==========================================
+ Hits        10510    10522      +12     
- Misses       2020     2022       +2     
- Partials      669      670       +1     
Flag Coverage Δ
os_linux 78.54% <80.00%> (-0.02%) ⬇️
os_macos 76.39% <80.00%> (+0.01%) ⬆️
os_windows 79.02% <80.00%> (+0.01%) ⬆️
unit 79.63% <80.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@jjbustamante jjbustamante marked this pull request as ready for review January 24, 2024 17:15
@jjbustamante jjbustamante requested review from a team as code owners January 24, 2024 17:15
@jjbustamante
Copy link
Member Author

@matejvasek could you take a look at the binaries

@natalieparellano could you give me a review here?

@matejvasek
Copy link
Contributor

@jjbustamante I do not use this as a binary but rather as a library. Regardless this PR seems to work for me.

@jjbustamante jjbustamante merged commit 1d3718b into main Jan 26, 2024
@jjbustamante jjbustamante deleted the enhancement/jjbustamante/issue-2033 branch January 26, 2024 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to add image labels to buildpacks during pack builder create
3 participants