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

[improvement] Add env var toggle for gzip compression of cloud-init user data #531

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

AshleyDumaine
Copy link
Member

@AshleyDumaine AshleyDumaine commented Oct 3, 2024

NOTE: Using this toggle requires using OS images with an updated cloud-init version (>24.3.1)

What this PR does / why we need it: This adds support for gzipping the userData before base64 encoding it so we can fit more configuration into cloud-init.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 19.44444% with 29 lines in your changes missing coverage. Please review.

Project coverage is 64.59%. Comparing base (4a9c8bf) to head (c4b48fa).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
controller/linodemachine_controller_helpers.go 23.07% 18 Missing and 2 partials ⚠️
cmd/main.go 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #531      +/-   ##
==========================================
- Coverage   64.85%   64.59%   -0.27%     
==========================================
  Files          79       79              
  Lines        5663     5689      +26     
==========================================
+ Hits         3673     3675       +2     
- Misses       1717     1740      +23     
- Partials      273      274       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -160,39 +168,6 @@ func TestSetUserData(t *testing.T) {
}}, nil)
},
},
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

fwiw I think this is still a valid test case, I hope we don't hit it often but userdata can be too large still

Copy link
Member Author

Choose a reason for hiding this comment

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

fair, just need to figure out how to make data that gzips to more than 16kB

Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe we could decrease the limit for the sake of the test to validate a smaller gzip gets rejected? not sure if that would require too much refactoring to handle

@AshleyDumaine AshleyDumaine force-pushed the cloud-init-gzip-support branch 2 times, most recently from a1974cd to a6fb807 Compare October 4, 2024 14:28
@eljohnson92 eljohnson92 changed the title [improvement] gzip cloud-init user data (requires >24.3.1) [improvement] gzip cloud-init user data (requires CloutInit >24.3.1) Oct 7, 2024
@AshleyDumaine AshleyDumaine changed the title [improvement] gzip cloud-init user data (requires CloutInit >24.3.1) [improvement] gzip cloud-init user data Oct 7, 2024
@AshleyDumaine AshleyDumaine force-pushed the cloud-init-gzip-support branch 2 times, most recently from 7bf629a to 9eccd2b Compare October 17, 2024 16:43
@AshleyDumaine AshleyDumaine changed the title [improvement] gzip cloud-init user data [improvement] Add env var toggle for gzip compression of cloud-init user data Oct 17, 2024
@AshleyDumaine AshleyDumaine marked this pull request as ready for review October 17, 2024 17:28
@AshleyDumaine AshleyDumaine force-pushed the cloud-init-gzip-support branch 3 times, most recently from ab2fc37 to af47b96 Compare October 30, 2024 19:20
@AshleyDumaine AshleyDumaine merged commit daadff7 into main Nov 12, 2024
11 of 13 checks passed
@AshleyDumaine AshleyDumaine deleted the cloud-init-gzip-support branch November 12, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants