[ARO-25617] Minifies shellscripts before putting them in ARM#4727
Merged
[ARO-25617] Minifies shellscripts before putting them in ARM#4727
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces shell script minification in the deployment template generator to reduce the size of VMSS Custom Script Extension payloads and avoid hitting the ~81KB limit in ARM custom scripts.
Changes:
- Added a generator helper to parse and minify the composed VMSS bootstrap shell script before embedding it into ARM template expressions.
- Switched RP and Gateway VMSS template generation to use the new minification helper.
- Updated the checked-in gateway production template output and added the
mvdan.cc/sh/v3dependency (plus related module sum updates).
Reviewed changes
Copilot reviewed 4 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/deploy/generator/resources_rp.go | Uses the new startup script creation/minification helper for RP VMSS CSE script generation. |
| pkg/deploy/generator/resources_gateway.go | Uses the new startup script creation/minification helper for Gateway VMSS CSE script generation. |
| pkg/deploy/generator/generators.go | Adds createStartupScript which minifies shell scripts using mvdan.cc/sh and enforces a size cap. |
| pkg/deploy/assets/gateway-production.json | Regenerated output reflecting the minified embedded startup script. |
| go.mod | Adds mvdan.cc/sh/v3 and updates indirect deps. |
| go.sum | Records checksums for the new/updated module dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue this PR addresses:
Fixes https://redhat.atlassian.net/browse/ARO-25617
What this PR does / why we need it:
Minifies the shell scripts when generating them so that we don't hit the 81k-ish limit in custom scripts.
Test plan for issue:
Running in INT
Is there any documentation that needs to be updated for this PR?
N/A
How do you know this will function as expected in production?
Testing in INT