Documentation
¶
Overview ¶
Package cmdutil contains shared Cobra command helpers.
Index ¶
Constants ¶
const VisibilityLevelsUnsupported = "the server does not support visibility levels yet"
VisibilityLevelsUnsupported explains a response without a visibility: the server predates the levels, so any level the CLI reported would be a guess.
Variables ¶
This section is empty.
Functions ¶
func HideDeprecatedAlias ¶
HideDeprecatedAlias hides cmd from help and prints warning before legacy paths run.
func ParseJSONObject ¶ added in v0.26.0
ParseJSONObject reads a flag value that carries a JSON object, either inline or as the path to a file holding it. subject names the flag in errors, so they read as "payload must be a JSON object" or "input must be a JSON object".
func VisibilityLevelsHint ¶ added in v0.42.0
func VisibilityLevelsHint(deps cliruntime.Deps) string
VisibilityLevelsHint follows a bare 400 for a request that sets a visibility level, which a server that predates the levels refuses as malformed.
Types ¶
type PrivateHint ¶ added in v0.42.0
type PrivateHint struct {
// Summary says who can call a private function of this kind.
Summary string
// Instruction introduces the commands Open returns.
Instruction string
// Open returns the command that lets signed-in users call the function.
Open func(name string) string
ConfigDeploy string
// ConfigFirst offers config deploy ahead of Open, for a kind whose Open
// command rebuilds the function.
ConfigFirst bool
// Declared is the level volcano-config.yaml declares for each function.
Declared map[string]string
}
PrivateHint is what a deploy prints about the new functions that came up private. A deploy does not apply the manifest's visibility, so a function the manifest gives another level is pointed at config deploy, and one the manifest keeps private gets no hint.
type VisibilityFlags ¶ added in v0.42.0
type VisibilityFlags struct {
// contains filtered or unexported fields
}
VisibilityFlags holds --visibility, its --public alias, and the retired --private.
func (*VisibilityFlags) Register ¶ added in v0.42.0
func (f *VisibilityFlags) Register(flags *pflag.FlagSet, usage string)
Register adds the flags. usage describes --visibility for the command.
func (*VisibilityFlags) Set ¶ added in v0.42.0
func (f *VisibilityFlags) Set() bool
Set reports whether any of the flags was given.
func (*VisibilityFlags) Visibility ¶ added in v0.42.0
func (f *VisibilityFlags) Visibility() (visibility apiclient.FunctionVisibility, ok bool, err error)
Visibility returns the level the flags select. ok is false when none was given.