Skip to content
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

[liqoctl] fix help commands templating #2986

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

claudiolor
Copy link
Contributor

Description

This PR fixes the templating of the liqoctl help messages. Some of the commands templates were not filled, as in the example below:

Generate the Tenant resource to be applied on the remote provider cluster.

This commands generates a Tenant filled with all the authentication parameters needed to authenticate with the remote cluster.
It signs the nonce provided by the remote cluster and generates the CSR.
The Nonce can be provided as a flag or it can be retrieved from the secret in the tenant namespace (if existing).

Examples:
  $ {{ .Executable }} generate tenant --remote-cluster-id remote-cluster-id

This PR fixes this issue by wrapping the Cobra AddCommand function, so that when the wrapper function is called, the help messages templates are automatically filled.

For some liqoctl commands, the templating was not applied, causing the
help message to have some "{{ .Executable }}" which were not replaced.
This patch fixes this issue by patching each of the added command by
applying the template.
@github-actions github-actions bot added fix Fixes a bug in the codebase. chore Miscellaneous tasks that don't modify application logic (e.g., updating dependencies or build tasks) labels Mar 10, 2025
@adamjensenbot
Copy link
Collaborator

Hi @claudiolor. Thanks for your PR!

I am @adamjensenbot.
You can interact with me issuing a slash command in the first line of a comment.
Currently, I understand the following commands:

  • /rebase: Rebase this PR onto the master branch (You can add the option test=true to launch the tests
    when the rebase operation is completed)
  • /merge: Merge this PR into the master branch
  • /build Build Liqo components
  • /test Launch the E2E and Unit tests
  • /hold, /unhold Add/remove the hold label to prevent merging with /merge

Make sure this PR appears in the liqo changelog, adding one of the following labels:

  • feat: 🚀 New Feature
  • fix: 🐛 Bug Fix
  • refactor: 🧹 Code Refactoring
  • docs: 📝 Documentation
  • style: 💄 Code Style
  • perf: 🐎 Performance Improvement
  • test: ✅ Tests
  • chore: 🚚 Dependencies Management
  • build: 📦 Builds Management
  • ci: 👷 CI/CD
  • revert: ⏪ Reverts Previous Changes

This patch introduces a wrapper for the Cobra AddCommand function to
avoid manual templating of the commands help messages. By calling the
wrapper the template is automatically applied to all the help messages.
@claudiolor claudiolor force-pushed the clo/liqoctl-fix-help branch from 7faecce to 859329f Compare March 10, 2025 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Miscellaneous tasks that don't modify application logic (e.g., updating dependencies or build tasks) fix Fixes a bug in the codebase. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants