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

Override post-processor config on the fly #8592

Merged
merged 1 commit into from
Jan 14, 2020
Merged

Override post-processor config on the fly #8592

merged 1 commit into from
Jan 14, 2020

Conversation

sylviamoss
Copy link
Contributor

@sylviamoss sylviamoss commented Jan 10, 2020

To keep the PostPorcessor struct consistent with the others, the configuration override logic was moved from Configure to PostProcess. This way, the Config struct will remain the same all the time and it will be overwritten on the fly whenever it is necessary.

Closes #8585

@sylviamoss sylviamoss requested a review from a team as a code owner January 10, 2020 14:31
@sylviamoss sylviamoss changed the title Override post-processor config when processing Override post-processor config on the fly Jan 10, 2020
@@ -246,6 +229,17 @@ func (p *PostProcessor) configureSingle(c *Config, raws ...interface{}) error {
return nil
}

func (p *PostProcessor) specificConfig(name string) (Config, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is in a new method to allow me to test it

@sylviamoss sylviamoss added this to the 1.5.2 milestone Jan 10, 2020
Copy link
Contributor

@azr azr left a comment

Choose a reason for hiding this comment

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

Super nice one; this LGTM.

Looking a bit in the past, I see that configs map[string]*Config was introduced in 5e2f08d for overrides; but it's the only place it was done like this and I think overriding will work the same with this change.

We still have to think about overriding in HCL2; I think the features of HCL2 will allow to not have to do this.

@sylviamoss sylviamoss merged commit 06a26e7 into master Jan 14, 2020
@sylviamoss sylviamoss deleted the fix_8585 branch January 14, 2020 10:13
@ghost
Copy link

ghost commented Apr 1, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vagrant post-processor literally has "panic" placeholder in Packer 1.5.x in HCL2 mode
2 participants