Skip to content

[ARO-25617] Minifies shellscripts before putting them in ARM#4727

Merged
mociarain merged 3 commits intomasterfrom
hawkowl/arm-reduce-script-size
Mar 31, 2026
Merged

[ARO-25617] Minifies shellscripts before putting them in ARM#4727
mociarain merged 3 commits intomasterfrom
hawkowl/arm-reduce-script-size

Conversation

@hawkowl
Copy link
Copy Markdown
Collaborator

@hawkowl hawkowl commented Mar 31, 2026

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/v3 dependency (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.

Copy link
Copy Markdown
Collaborator

@mociarain mociarain left a comment

Choose a reason for hiding this comment

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

LGTM

@LiniSusan
Copy link
Copy Markdown
Collaborator

LGTM

@mociarain mociarain merged commit 0477343 into master Mar 31, 2026
34 checks passed
@mociarain mociarain deleted the hawkowl/arm-reduce-script-size branch March 31, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-small Size small skippy pull requests raised by member of Team Skippy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants