You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 21, 2023. It is now read-only.
The CLI framework Cobra does not validate flags that are marked as required before the function PreRunE is called.
This is a known issue spf13/cobra#655 and this behavior change has not been merged since 2018 spf13/cobra#700.
However, the Keptn CLI assumes in some commands that the flags are already validated when PreRunE is called.
For example, keptn onboard service has --project and --chart as required flags. Furthermore, in the PreRunE function of the onboard service command checks are executed for validating the provided chart.
If now a user executes keptn onboard service carts without specifying a chart, the user gets the error message Error: Provided Helm chart does not exist.
The correct error message would however be Error: required flag(s) "project", "chart" not set.
Tasks:
Investigate all CLI commands whether PreRunE uses a required flag. If so and if possible, move the functionality of PreRunE into RunE