spf13/pflag: replace deprecated ParseErrorsWhitelist

Use ParseErrorsAllowlist instead, should still work the exact same.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2025-09-04 14:04:47 +02:00
parent ca9c8d104e
commit c2506656c4
5 changed files with 5 additions and 5 deletions

View File

@ -254,7 +254,7 @@ func composeMain(cmd *cobra.Command, args []string) error {
// after `podman compose [ARGS]` are passed to the compose provider.
// For now, we only look for the --help flag.
fs := pflag.NewFlagSet("args", pflag.ContinueOnError)
fs.ParseErrorsWhitelist.UnknownFlags = true
fs.ParseErrorsAllowlist.UnknownFlags = true
fs.SetInterspersed(false)
fs.BoolP("help", "h", false, "")
if err := fs.Parse(args); err != nil {

View File

@ -70,7 +70,7 @@ func containersConfModules() ([]string, error) {
var modules []string
fs := pflag.NewFlagSet("module", pflag.ContinueOnError)
fs.ParseErrorsWhitelist.UnknownFlags = true
fs.ParseErrorsAllowlist.UnknownFlags = true
fs.Usage = func() {}
fs.SetInterspersed(false)
fs.StringArrayVar(&modules, "module", nil, "")

View File

@ -36,7 +36,7 @@ func IsRemote() bool {
remote = true
}
fs := pflag.NewFlagSet("remote", pflag.ContinueOnError)
fs.ParseErrorsWhitelist.UnknownFlags = true
fs.ParseErrorsAllowlist.UnknownFlags = true
fs.Usage = func() {}
fs.SetInterspersed(false)
fs.BoolVarP(&remoteFromCLI.Value, "remote", "r", remote, "")

View File

@ -358,7 +358,7 @@ func executeContainerTemplate(info *containerInfo, options entities.GenerateSyst
remainingCmd := info.CreateCommand[index:]
// Presence check for certain flags/options.
fs := pflag.NewFlagSet("args", pflag.ContinueOnError)
fs.ParseErrorsWhitelist.UnknownFlags = true
fs.ParseErrorsAllowlist.UnknownFlags = true
fs.Usage = func() {}
fs.SetInterspersed(false)
fs.BoolP("detach", "d", false, "")

View File

@ -339,7 +339,7 @@ func executePodTemplate(info *podInfo, options entities.GenerateSystemdOptions)
// Presence check for certain flags/options.
fs := pflag.NewFlagSet("args", pflag.ContinueOnError)
fs.ParseErrorsWhitelist.UnknownFlags = true
fs.ParseErrorsAllowlist.UnknownFlags = true
fs.Usage = func() {}
fs.SetInterspersed(false)
fs.String("name", "", "")