mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: update kubernetes and libraries to v1.22.0 version
Kubernetes v1.22 version has been released and this update ceph csi dependencies to use the same version. Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
e077c1fdf5
commit
aa698bc3e1
19
vendor/k8s.io/component-base/cli/flag/sectioned.go
generated
vendored
19
vendor/k8s.io/component-base/cli/flag/sectioned.go
generated
vendored
@ -22,9 +22,14 @@ import (
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
const (
|
||||
usageFmt = "Usage:\n %s\n"
|
||||
)
|
||||
|
||||
// NamedFlagSets stores named flag sets in the order of calling FlagSet.
|
||||
type NamedFlagSets struct {
|
||||
// Order is an ordered list of flag set names.
|
||||
@ -84,3 +89,17 @@ func PrintSections(w io.Writer, fss NamedFlagSets, cols int) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// SetUsageAndHelpFunc set both usage and help function.
|
||||
// Print the flag sets we need instead of all of them.
|
||||
func SetUsageAndHelpFunc(cmd *cobra.Command, fss NamedFlagSets, cols int) {
|
||||
cmd.SetUsageFunc(func(cmd *cobra.Command) error {
|
||||
fmt.Fprintf(cmd.OutOrStderr(), usageFmt, cmd.UseLine())
|
||||
PrintSections(cmd.OutOrStderr(), fss, cols)
|
||||
return nil
|
||||
})
|
||||
cmd.SetHelpFunc(func(cmd *cobra.Command, args []string) {
|
||||
fmt.Fprintf(cmd.OutOrStdout(), "%s\n\n"+usageFmt, cmd.Long, cmd.UseLine())
|
||||
PrintSections(cmd.OutOrStdout(), fss, cols)
|
||||
})
|
||||
}
|
||||
|
9
vendor/k8s.io/component-base/cli/flag/string_slice_flag.go
generated
vendored
9
vendor/k8s.io/component-base/cli/flag/string_slice_flag.go
generated
vendored
@ -18,6 +18,7 @@ package flag
|
||||
|
||||
import (
|
||||
goflag "flag"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/pflag"
|
||||
@ -45,9 +46,11 @@ func (s *StringSlice) String() string {
|
||||
}
|
||||
|
||||
func (s *StringSlice) Set(val string) error {
|
||||
if s.value == nil || !s.changed {
|
||||
v := make([]string, 0)
|
||||
s.value = &v
|
||||
if s.value == nil {
|
||||
return fmt.Errorf("no target (nil pointer to []string)")
|
||||
}
|
||||
if !s.changed {
|
||||
*s.value = make([]string, 0)
|
||||
}
|
||||
*s.value = append(*s.value, val)
|
||||
s.changed = true
|
||||
|
Reference in New Issue
Block a user