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

bake: keep target inheritance #914

Merged
merged 1 commit into from
Jan 14, 2022

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Jan 11, 2022

fixes #912

After first pass inheritance is lost for the next targets in a group.

Signed-off-by: CrazyMax crazy-max@users.noreply.github.com

@crazy-max crazy-max marked this pull request as draft January 11, 2022 23:39
@crazy-max crazy-max marked this pull request as ready for review January 11, 2022 23:43
bake/bake.go Outdated Show resolved Hide resolved
@crazy-max crazy-max marked this pull request as draft January 12, 2022 06:37
@crazy-max crazy-max marked this pull request as ready for review January 12, 2022 08:10
bake/bake.go Outdated Show resolved Hide resolved
Copy link
Contributor

@errordeveloper errordeveloper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one minor nit, I think it'd help to improve readability :)

@crazy-max crazy-max force-pushed the fix-target-inherit branch 6 times, most recently from 363d1e5 to af84988 Compare January 13, 2022 09:28
return nil, nil
func (c Config) target(name string, visited map[string]*Target, overrides map[string]map[string]Override) (*Target, error) {
if t, ok := visited[name]; ok {
return t, nil
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to block the key with nil value here. Otherwise, it goes to an infinite loop.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch yes

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@tonistiigi tonistiigi merged commit 14b38a9 into docker:master Jan 14, 2022
@crazy-max crazy-max deleted the fix-target-inherit branch January 14, 2022 07:06
@crazy-max crazy-max added this to the v0.8.0 milestone Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nested inherits only affects first target
3 participants