feat: kubesphere 4.0 (#6115)
* feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> * feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> --------- Signed-off-by: ci-bot <ci-bot@kubesphere.io> Co-authored-by: ks-ci-bot <ks-ci-bot@example.com> Co-authored-by: joyceliu <joyceliu@yunify.com>
This commit is contained in:
committed by
GitHub
parent
b5015ec7b9
commit
447a51f08b
10
vendor/k8s.io/kubectl/pkg/util/templates/templater.go
generated
vendored
10
vendor/k8s.io/kubectl/pkg/util/templates/templater.go
generated
vendored
@@ -126,6 +126,7 @@ func (templater *templater) templateFuncs(exposedFlags ...string) template.FuncM
|
||||
"isRootCmd": templater.isRootCmd,
|
||||
"optionsCmdFor": templater.optionsCmdFor,
|
||||
"usageLine": templater.usageLine,
|
||||
"reverseParentsNames": templater.reverseParentsNames,
|
||||
"exposed": func(c *cobra.Command) *flag.FlagSet {
|
||||
exposed := flag.NewFlagSet("exposed", flag.ContinueOnError)
|
||||
if len(exposedFlags) > 0 {
|
||||
@@ -172,6 +173,15 @@ func (t *templater) rootCmdName(c *cobra.Command) string {
|
||||
return t.rootCmd(c).CommandPath()
|
||||
}
|
||||
|
||||
func (t *templater) reverseParentsNames(c *cobra.Command) []string {
|
||||
reverseParentsNames := []string{}
|
||||
parents := t.parents(c)
|
||||
for i := len(parents) - 1; i >= 0; i-- {
|
||||
reverseParentsNames = append(reverseParentsNames, parents[i].Name())
|
||||
}
|
||||
return reverseParentsNames
|
||||
}
|
||||
|
||||
func (t *templater) isRootCmd(c *cobra.Command) bool {
|
||||
return t.rootCmd(c) == c
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user