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

sources: update to handlebars v4 #1707

Merged
merged 1 commit into from Aug 11, 2021

Conversation

tjkirch
Copy link
Contributor

@tjkirch tjkirch commented Aug 10, 2021

Description of changes:

I left handlebars out of #1683 because there were fairly substantial changes required. The relevant change in handlebars is this which means Empty lines around block helpers are now stripped. Essentially, before, we had to use ~ in many places to remove whitespace before/after {{}} blocks, even where they're not required in "standard" mustache. There were several issues with the initial upstream change, so we had to wait for the 4.1 release for fixes.

So, you'll see a lot of ~ removal in the diff. The only significant change in templates is the else clause added to the proxy-env configuration. handlebars v4 (in strict mode) no longer allows each if the referenced variable is missing, unless there's an else. Everywhere else, we have each in a conditional that checks that the referenced variable is populated. (Outside of templates, they changed an error variant name, but that's it.)

The only place I left the ~ is in kubernetes-ca-crt files, since I think they would be invalid with any whitespace, and we wouldn't have any other data in those files anyway.

Testing done:

Unit tests pass. k8s and ecs AMIs are healthy.

There's a lot of potential for small changes in behavior here, so I made a little pipeline to confirm there were no changes in rendered output. I modified thar-be-settings to save rendered files locally and not restart services, which wouldn't exist on my laptop. I created a default data store, rendered before and after, and diffed the directories. I then set clusters of settings, going through all k8s settings, registry mirrors, and proxy settings, to cover everything affected in the templated files. I set settings.kubernetes.authentication-mode to aws and tls and checked both, since they cause different branches in templates. No differences.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Copy link
Contributor

@etungsten etungsten left a comment

Choose a reason for hiding this comment

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

🪒

Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

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

🐝

@tjkirch tjkirch merged commit 42c9954 into bottlerocket-os:develop Aug 11, 2021
@tjkirch tjkirch deleted the handlebars4 branch August 11, 2021 20:16
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.

None yet

4 participants