-
Notifications
You must be signed in to change notification settings - Fork 62
feat: support --version flag in lib/**/init.sh scripts #35
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
Merged
+674
−92
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
aafd97a
feat: support --version flag in lib/**/init.sh scripts
sinduri-g 43ac8b3
feat(28): add pinned version flags to all init.sh calls and CI lint c…
sinduri-g 64c516e
Merge branch 'main' into feat/28-version-flag-init-scripts
sinduri-g f50815b
fix: use ARGOCD_VERSION placeholder in kustomization.yaml and fix lin…
sinduri-g 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
12 changes: 9 additions & 3 deletions
12
.devcontainer/01-echoes-lost-in-orbit_beginner/post-create.sh
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 |
|---|---|---|
| @@ -1,6 +1,12 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| lib/shared/init.sh | ||
| lib/kubernetes/init.sh | ||
| lib/argocd/init.sh --read-only | ||
| lib/shared/init.sh --version v0.17.0 # https://github.com/charmbracelet/gum/releases | ||
| # kind: https://github.com/kubernetes-sigs/kind/releases | kubectl: https://dl.k8s.io | kubens: https://github.com/ahmetb/kubectx/releases | k9s: https://github.com/derailed/k9s/releases | helm: https://github.com/helm/helm/releases | ||
| lib/kubernetes/init.sh \ | ||
| --kind-version v0.30.0 \ | ||
| --kubectl-version v1.34.1 \ | ||
| --kubens-version v0.9.5 \ | ||
| --k9s-version v0.50.16 \ | ||
| --helm-version v4.0.1 | ||
| lib/argocd/init.sh --read-only --version v3.2.0 # https://github.com/argoproj/argo-cd/releases |
18 changes: 12 additions & 6 deletions
18
.devcontainer/01-echoes-lost-in-orbit_expert/post-create.sh
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 |
|---|---|---|
| @@ -1,9 +1,15 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| lib/shared/init.sh | ||
| lib/kubernetes/init.sh | ||
| lib/argocd/init.sh --read-only | ||
| lib/argo-rollouts/init.sh | ||
| lib/prometheus/init.sh | ||
| lib/jaeger/init.sh | ||
| lib/shared/init.sh --version v0.17.0 # https://github.com/charmbracelet/gum/releases | ||
| # kind: https://github.com/kubernetes-sigs/kind/releases | kubectl: https://dl.k8s.io | kubens: https://github.com/ahmetb/kubectx/releases | k9s: https://github.com/derailed/k9s/releases | helm: https://github.com/helm/helm/releases | ||
| lib/kubernetes/init.sh \ | ||
| --kind-version v0.30.0 \ | ||
| --kubectl-version v1.34.1 \ | ||
| --kubens-version v0.9.5 \ | ||
| --k9s-version v0.50.16 \ | ||
| --helm-version v4.0.1 | ||
| lib/argocd/init.sh --read-only --version v3.2.0 # https://github.com/argoproj/argo-cd/releases | ||
| lib/argo-rollouts/init.sh --version v1.8.3 # https://github.com/argoproj/argo-rollouts/releases | ||
| lib/prometheus/init.sh --version 29.1.0 # https://artifacthub.io/packages/helm/prometheus-community/prometheus | ||
| lib/jaeger/init.sh --version 4.1.5 # https://artifacthub.io/packages/helm/jaegertracing/jaeger |
18 changes: 12 additions & 6 deletions
18
.devcontainer/01-echoes-lost-in-orbit_intermediate/post-create.sh
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 |
|---|---|---|
| @@ -1,9 +1,15 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| lib/shared/init.sh | ||
| lib/kubernetes/init.sh | ||
| lib/argocd/init.sh --read-only | ||
| lib/argo-rollouts/init.sh | ||
| lib/kube-state-metrics/init.sh | ||
| lib/prometheus/init.sh | ||
| lib/shared/init.sh --version v0.17.0 # https://github.com/charmbracelet/gum/releases | ||
| # kind: https://github.com/kubernetes-sigs/kind/releases | kubectl: https://dl.k8s.io | kubens: https://github.com/ahmetb/kubectx/releases | k9s: https://github.com/derailed/k9s/releases | helm: https://github.com/helm/helm/releases | ||
| lib/kubernetes/init.sh \ | ||
| --kind-version v0.30.0 \ | ||
| --kubectl-version v1.34.1 \ | ||
| --kubens-version v0.9.5 \ | ||
| --k9s-version v0.50.16 \ | ||
| --helm-version v4.0.1 | ||
| lib/argocd/init.sh --read-only --version v3.2.0 # https://github.com/argoproj/argo-cd/releases | ||
| lib/argo-rollouts/init.sh --version v1.8.3 # https://github.com/argoproj/argo-rollouts/releases | ||
| lib/kube-state-metrics/init.sh --version 7.0.0 # https://artifacthub.io/packages/helm/prometheus-community/kube-state-metrics | ||
| lib/prometheus/init.sh --version 29.1.0 # https://artifacthub.io/packages/helm/prometheus-community/prometheus |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # This check exists to catch missing --version flags at PR time rather than when a | ||
| # contributor's Codespace silently fails to start. Failing fast here gives a much | ||
| # better experience than debugging a broken environment after the fact. | ||
| name: Lint init script versions | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - '.devcontainer/**/post-create.sh' | ||
| - 'lib/**/init.sh' | ||
|
|
||
| jobs: | ||
| check-versions-pinned: | ||
| name: All init.sh calls have pinned versions | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Check that every init.sh call has a version flag | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| failed=0 | ||
|
|
||
| while IFS= read -r file; do | ||
| while IFS= read -r line; do | ||
| # Skip blank lines, comments, and lines that don't reference an init script | ||
| [[ "$line" =~ ^[[:space:]]*# ]] && continue | ||
| [[ "$line" =~ init\.sh ]] || continue | ||
|
|
||
|
|
||
| # Skip continuation lines (they carry the version flags for kubernetes/init.sh) | ||
| [[ "$line" == *\\ ]] && continue | ||
| [[ "$line" =~ ^[[:space:]]+-- ]] && continue | ||
|
|
||
| # The line calls an init script — check it carries a version flag | ||
| if ! grep -qE '(--version|--kind-version|--kubectl-version|--kubens-version|--k9s-version|--helm-version)' <<< "$line"; then | ||
| echo "ERROR: $file: missing version flag on: $line" | ||
| failed=1 | ||
| fi | ||
| done < "$file" | ||
| done < <(find .devcontainer -name 'post-create.sh') | ||
|
|
||
| if [[ $failed -eq 1 ]]; then | ||
| echo "" | ||
| echo "Every lib/**/init.sh call must pass a pinned --version flag." | ||
| echo "Run the script with --help to see available flags." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "✅ All init.sh calls have pinned version flags." | ||
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.
Uh oh!
There was an error while loading. Please reload this page.