Visitar URL original
chore: move updatecli manifest validate out of experimental by olblak · Pull Request #10586 · updatecli/updatecli · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions cmd/manifest_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

"github.com/spf13/cobra"

"github.com/updatecli/updatecli/pkg/core/cmdoptions"
"github.com/updatecli/updatecli/pkg/core/config"
"github.com/updatecli/updatecli/pkg/core/engine/manifest"
)
Expand All @@ -18,20 +17,13 @@ var (

manifestValidateCmd = &cobra.Command{
Use: "validate",
Short: "**Experimental** validate manifest(s) against the Updatecli schema",
Long: `**Experimental** validate reports the manifest keys that do not match the
Updatecli schema, such as a misspelled one, which Updatecli would otherwise silently
ignore.
Short: "validate manifest(s) against the Updatecli schema",
Long: `validate reports the manifest keys that do not match the Updatecli schema,
such as a misspelled one, which Updatecli would otherwise silently ignore.

A deprecated keyword, or a key Updatecli cannot check reliably, is reported as a warning
and does not fail the command unless '--strict' is specified.`,
Run: func(cmd *cobra.Command, args []string) {
// TODO: To be removed once not experimental anymore
if !cmdoptions.Experimental {
logrus.Warningf("The 'manifest validate' command is experimental, please use the '--experimental' flag to enable it")
os.Exit(1)
}

e.Options.Manifests = append(e.Options.Manifests, manifest.Manifest{
Manifests: manifestFiles,
Values: valuesFiles,
Expand Down
2 changes: 1 addition & 1 deletion e2e/scripts/test_manifest_validate.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ set -eux
## In order for the Updatecli manifest to work, we must be at the root of the git repository
pushd "$VENOM_VAR_rootpath"

"$VENOM_VAR_binpath/updatecli" manifest validate --experimental --config e2e/updatecli.d/deprecated.d/
"$VENOM_VAR_binpath/updatecli" manifest validate --config e2e/updatecli.d/deprecated.d/
2 changes: 1 addition & 1 deletion e2e/scripts/test_manifest_validate_invalid.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -ux
## In order for the Updatecli manifest to work, we must be at the root of the git repository
pushd "$VENOM_VAR_rootpath" || exit 1

"$VENOM_VAR_binpath/updatecli" manifest validate --experimental --config e2e/updatecli.d/invalid.d/
"$VENOM_VAR_binpath/updatecli" manifest validate --config e2e/updatecli.d/invalid.d/

if [[ $? -eq 0 ]]; then
echo "ERROR: the invalid manifest should have been rejected"
Expand Down
Loading