-
Notifications
You must be signed in to change notification settings - Fork 164
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
Add in the initial configuration to add the image labels #1448
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ type builderBlder struct { | |
runImage string | ||
mixins []string | ||
os string | ||
additionalLabels map[string]string | ||
} | ||
|
||
func newBuilderBldr(kpackVersion string) *builderBlder { | ||
|
@@ -93,6 +94,10 @@ func (bb *builderBlder) AddGroup(buildpacks ...RemoteBuildpackRef) { | |
bb.order = append(bb.order, corev1alpha1.OrderEntry{Group: group}) | ||
} | ||
|
||
func (bb *builderBlder) AddAdditionalLabels(additionalLabels map[string]string) { | ||
bb.additionalLabels = additionalLabels | ||
} | ||
|
||
func (bb *builderBlder) WriteableImage() (v1.Image, error) { | ||
buildpacks := bb.buildpacks() | ||
|
||
|
@@ -151,6 +156,11 @@ func (bb *builderBlder) WriteableImage() (v1.Image, error) { | |
return nil, err | ||
} | ||
|
||
image, err = imagehelpers.SetStringLabels(image, bb.additionalLabels) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add an error check here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated! |
||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return imagehelpers.SetLabels(image, map[string]interface{}{ | ||
buildpackOrderLabel: bb.order, | ||
buildpackLayersLabel: buildpackLayerMetadata, | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you regenerate the CRDs as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just added a new commit.
Please let me know if you think it's not the right place