-
Notifications
You must be signed in to change notification settings - Fork 9
Edition gate #117
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
Open
briiians
wants to merge
12
commits into
main
Choose a base branch
from
edition-gate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Edition gate #117
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7ed0fd0
tests: use go-yq instead of python-yq
gquintard 3e658fe
Add malloc stevedore
audunmg 8dec954
Unify the enterprise and open source helmcharts. Adds a global.editio…
briiians a2f6446
Wire publish-community.sh into CI for the varnish-cache chart build
briiians be055ea
Use realpath instead of cd/pwd in publish script
briiians 9ca97e0
Collapse nested edition guards into single if-and conditions
briiians 7dbc3a1
Merge consecutive enterprise edition checks into one block
briiians 42a7d2e
Simplify mse bool assignment to direct expression
briiians 343300a
Remove unreachable mse4 community check
briiians 7448f5b
Switch publish script from python-yq to go-yq to preserve comments
briiians b139711
Allow overriding the yq binary via the YQ env variable
briiians 7a7308f
Fix malloc DaemonSet tests to use go-yq compatible syntax
briiians File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| #!/bin/sh | ||
| # Builds the varnish-cache community chart from the varnish-enterprise source. | ||
| # | ||
| # The enterprise chart is the single source of truth. This script transforms it | ||
| # into the community chart by switching the edition, changing the default image, | ||
| # and stripping enterprise-only values so they never appear in the published chart. | ||
| # | ||
| # Usage: | ||
| # ./ci/publish-community.sh <oss-version> [output-dir] | ||
| # | ||
| # oss-version: the Varnish Cache release to target, e.g. "9.0.3" | ||
| # This sets Chart.yaml appVersion and the default image tag. | ||
| # output-dir: defaults to ./dist/varnish-cache | ||
| # | ||
| # Requires yq (https://github.com/mikefarah/yq) and helm. | ||
|
|
||
| set -e | ||
|
|
||
| if [ -z "$1" ]; then | ||
| echo "Usage: $0 <oss-version> [output-dir]" >&2 | ||
| echo " e.g. $0 9.0.3" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| OSS_VERSION="$1" | ||
| REPO_ROOT="$(realpath "$(dirname "$0")/..")" | ||
| SRC="$REPO_ROOT/varnish-enterprise" | ||
| OUT="${2:-$REPO_ROOT/dist/varnish-cache}" | ||
|
|
||
| # Allow the caller to override which yq binary to use via YQ=/path/to/yq. | ||
| # This is needed in CI where python-yq and go-yq may both be present. | ||
| YQ="${YQ:-yq}" | ||
|
|
||
| if ! command -v "$YQ" > /dev/null 2>&1; then | ||
| echo "Error: yq is required (https://github.com/mikefarah/yq)" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! command -v helm > /dev/null 2>&1; then | ||
| echo "Error: helm is required" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Building community chart from $SRC -> $OUT (Varnish Cache $OSS_VERSION)" | ||
|
|
||
| rm -rf "$OUT" | ||
| mkdir -p "$(dirname "$OUT")" | ||
| cp -r "$SRC" "$OUT" | ||
|
|
||
| # Patch Chart.yaml: rename, update description, and set the OSS appVersion. | ||
| # OSS_VERSION is passed via the environment so yq can reference it with strenv(). | ||
| OSS_VERSION="$OSS_VERSION" "$YQ" -i ' | ||
| .name = "varnish-cache" | | ||
| .description = "Varnish Cache Helm Chart" | | ||
| .appVersion = strenv(OSS_VERSION) | ||
| ' "$OUT/Chart.yaml" | ||
|
|
||
| # Switch edition and image defaults, enable malloc, strip enterprise-only sections. | ||
| # go-yq preserves comments on sections that are not deleted. | ||
| "$YQ" -i ' | ||
| .global.edition = "community" | | ||
| .server.image.repository = "docker.io/varnish" | | ||
| .server.malloc.enabled = true | | ||
| del(.server.mse) | | ||
| del(.server.mse4) | | ||
| del(.server.agent) | | ||
| del(.server.initAgent) | | ||
| del(.server.otel) | | ||
| del(.server.baseUrl) | | ||
| del(.server.licenseSecret) | | ||
| del(.cluster) | | ||
| del(.natsServer) | ||
| ' "$OUT/values.yaml" | ||
|
|
||
| helm lint "$OUT" | ||
|
|
||
| echo "Community chart written to $OUT" | ||
| echo " appVersion: $OSS_VERSION (default image: docker.io/varnish:$OSS_VERSION)" | ||
| echo "To package: helm package $OUT --destination ./dist/packages" | ||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
github actionsshould call this somewhere?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed with 3d0cdef