From 4d902021bb3c55bc212cbb3e2443b6552400622f Mon Sep 17 00:00:00 2001 From: Dmitriy Matrenichev Date: Sun, 13 Oct 2024 02:54:56 +0300 Subject: [PATCH] fix: do not use pflag csv comma reader for config-patch Modules pflag and cobra use csv.Reader for `StringSliceVar` method. This doesn't work well with JSON, and we do not need this at all. Drop it. Fixes #9493 Signed-off-by: Dmitriy Matrenichev --- cmd/talosctl/cmd/talos/apply-config.go | 2 +- website/content/v1.9/reference/cli.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/talosctl/cmd/talos/apply-config.go b/cmd/talosctl/cmd/talos/apply-config.go index bae23bfa60..efea8b3fcf 100644 --- a/cmd/talosctl/cmd/talos/apply-config.go +++ b/cmd/talosctl/cmd/talos/apply-config.go @@ -162,7 +162,7 @@ func init() { applyConfigCmd.Flags().BoolVarP(&applyConfigCmdFlags.insecure, "insecure", "i", false, "apply the config using the insecure (encrypted with no auth) maintenance service") applyConfigCmd.Flags().BoolVar(&applyConfigCmdFlags.dryRun, "dry-run", false, "check how the config change will be applied in dry-run mode") applyConfigCmd.Flags().StringSliceVar(&applyConfigCmdFlags.certFingerprints, "cert-fingerprint", nil, "list of server certificate fingeprints to accept (defaults to no check)") - applyConfigCmd.Flags().StringSliceVarP(&applyConfigCmdFlags.patches, "config-patch", "p", nil, "the list of config patches to apply to the local config file before sending it to the node") + applyConfigCmd.Flags().StringArrayVarP(&applyConfigCmdFlags.patches, "config-patch", "p", nil, "the list of config patches to apply to the local config file before sending it to the node") applyConfigCmd.Flags().DurationVar(&applyConfigCmdFlags.configTryTimeout, "timeout", constants.ConfigTryTimeout, "the config will be rolled back after specified timeout (if try mode is selected)") helpers.AddModeFlags(&applyConfigCmdFlags.Mode, applyConfigCmd) addCommand(applyConfigCmd) diff --git a/website/content/v1.9/reference/cli.md b/website/content/v1.9/reference/cli.md index 7cc0fe4ab0..ec51ebacc0 100644 --- a/website/content/v1.9/reference/cli.md +++ b/website/content/v1.9/reference/cli.md @@ -17,7 +17,7 @@ talosctl apply-config [flags] ``` --cert-fingerprint strings list of server certificate fingeprints to accept (defaults to no check) - -p, --config-patch strings the list of config patches to apply to the local config file before sending it to the node + -p, --config-patch stringArray the list of config patches to apply to the local config file before sending it to the node --dry-run check how the config change will be applied in dry-run mode -f, --file string the filename of the updated configuration -h, --help help for apply-config