Skip to content

feat: support --version flag in lib/**/init.sh scripts#35

Merged
sinduri-g merged 4 commits into
mainfrom
feat/28-version-flag-init-scripts
Apr 15, 2026
Merged

feat: support --version flag in lib/**/init.sh scripts#35
sinduri-g merged 4 commits into
mainfrom
feat/28-version-flag-init-scripts

Conversation

@sinduri-g
Copy link
Copy Markdown
Contributor

@sinduri-g sinduri-g commented Apr 7, 2026

Add a --version flag to all 13 lib/**/init.sh scripts so adventures can pin specific tool versions without modifying shared scripts.

  • Refactor for-loop arg parsing to while/shift to support value-bearing flags
  • Each script defaults to its previously hardcoded version (backward-compatible)
  • kubernetes/init.sh uses per-tool flags (--kind-version, --kubectl-version, etc.)
  • prometheus/init.sh applies mode-specific defaults (operator: 82.1.1, standalone: latest)
  • otel-collector/init.sh accepts --version for API consistency with a stderr warning
  • Fix pre-existing unquoted variable in argocd/init.sh (shellcheck SC2086)
  • Update new-adventure.sh template and contributing docs with --version examples

Closes #28

What does this PR do?

Closes #

Type of PR

  • 💡 Adventure Idea
  • 🗺️ New Adventure Level
  • 📖 Solution Walkthrough
  • 🐛 Bug fix / 📝 Documentation improvement / Other

📝 Other

  • Commits are focused and minimal
  • Documentation updated if needed

Add a --version flag to all 13 lib/**/init.sh scripts so adventures can
pin specific tool versions without modifying shared scripts.

- Refactor for-loop arg parsing to while/shift to support value-bearing flags
- Each script defaults to its previously hardcoded version (backward-compatible)
- kubernetes/init.sh uses per-tool flags (--kind-version, --kubectl-version, etc.)
- prometheus/init.sh applies mode-specific defaults (operator: 82.1.1, standalone: latest)
- otel-collector/init.sh accepts --version for API consistency with a stderr warning
- Fix pre-existing unquoted variable in argocd/init.sh (shellcheck SC2086)
- Update new-adventure.sh template and contributing docs with --version examples

Closes #28

Signed-off-by: Sinduri Guntupalli <sinduri.guntupalli@dynatrace.com>
@sinduri-g sinduri-g requested a review from a team as a code owner April 7, 2026 11:04
@sinduri-g sinduri-g requested a review from KatharinaSick April 7, 2026 11:06
Copy link
Copy Markdown
Contributor

@KatharinaSick KatharinaSick left a comment

Choose a reason for hiding this comment

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

Good work! Thanks a lot! 😊

Comment thread lib/gcp-api-mock/init.sh Outdated
Comment thread lib/prometheus/init.sh Outdated
@sinduri-g sinduri-g requested a review from KatharinaSick April 14, 2026 09:19
KatharinaSick
KatharinaSick previously approved these changes Apr 14, 2026
Copy link
Copy Markdown
Contributor

@KatharinaSick KatharinaSick left a comment

Choose a reason for hiding this comment

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

Thank you! Both are just suggestions but also happy to merge as is 😊

Comment thread .github/workflows/lint-init-versions.yaml
Comment thread lib/argocd/manifests/kustomization.yaml Outdated
…t CI regex

- Replace hardcoded v3.2.0 with ARGOCD_VERSION placeholder in argocd
  kustomization.yaml resource URL so applying the manifests directly
  without going through init.sh fails intentionally
- Update sed pattern in argocd/init.sh from v[^/]* to [^/]* to match
  the placeholder string correctly
- Fix continuation-line skip in lint-init-versions.yaml: replace broken
  ERE regex with glob pattern *\ which correctly identifies backslash
  continuation lines in multi-line kubernetes/init.sh calls
- Add explanatory comment to lint-init-versions.yaml explaining why the
  check exists alongside runtime --version validation

Signed-off-by: Sinduri Guntupalli <sinduri.guntupalli@dynatrace.com>
Copy link
Copy Markdown
Contributor

@KatharinaSick KatharinaSick left a comment

Choose a reason for hiding this comment

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

Looks great - thank you! 😊

@sinduri-g sinduri-g merged commit 1327a05 into main Apr 15, 2026
3 checks passed
@sinduri-g sinduri-g deleted the feat/28-version-flag-init-scripts branch April 15, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support --version flag in lib/**/init.sh scripts

2 participants