Documentation ¶
Index ¶
- Constants
- func ChangeWorkingDirectory(cmd *cobra.Command, path string) error
- func InjectManagerIfNecessary(cmd *cobra.Command, globalOptions options.GlobalOptionsGetter) error
- func ManagerFromContext(ctx context.Context) manager.Manager
- func NewContextWithManager(parent context.Context, mgr manager.Manager) context.Context
- func SetLogger(cmd *cobra.Command, verbosity uint32) logr.Logger
- func SwitchToRootIfNecessary(cmd *cobra.Command) (bool, error)
Constants ¶
View Source
const ( // AnnotationRunAsRoot 标记需要以 root 用户运行的注解 AnnotationRunAsRoot = "run-as-root" // AnnotationRequireManager 标记需要 manager.Manager 的注解 AnnotationRequireManager = "require-manager" // AnnotationValueTrue 表示逻辑“真”的注解值 AnnotationValueTrue = "true" )
Variables ¶
This section is empty.
Functions ¶
func ChangeWorkingDirectory ¶
ChangeWorkingDirectory 切换命令工作目录
func InjectManagerIfNecessary ¶
func InjectManagerIfNecessary(cmd *cobra.Command, globalOptions options.GlobalOptionsGetter) error
InjectManagerIfNecessary 如果需要的话注入 manager.Manager
func ManagerFromContext ¶
ManagerFromContext 从上下文获取 manager.Manager
func NewContextWithManager ¶
NewContextWithManager 将 mgr 注入到上下文中
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.