Documentation
¶
Index ¶
- Variables
- func NewCompletionCmd() *cobra.Command
- func NewDockerCmd(rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command
- func NewKubernetesCmd(rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command
- func RootOptionsLevelValidation(level validator.StructLevel)
- func Start()
- type ConfigOptions
- type OutputOptions
- type RootCmd
- type RootOptions
Constants ¶
This section is empty.
Variables ¶
var Sensitive = []string{
"HOME",
}
Sensitive is a list of sensitive environment variable to replace into the help outputs.
Functions ¶
func NewDockerCmd ¶
func NewDockerCmd(rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command
NewDockerCmd creates the `driverkit docker` command.
func NewKubernetesCmd ¶
func NewKubernetesCmd(rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command
NewKubernetesCmd creates the `driverkit kubernetes` command.
func RootOptionsLevelValidation ¶
func RootOptionsLevelValidation(level validator.StructLevel)
RootOptionsLevelValidation validates KernelConfigData and Target at the same time.
It reports an error when `KernelConfigData` is empty and `Target` is `vanilla`.
Types ¶
type ConfigOptions ¶
type ConfigOptions struct {
ConfigFile string
LogLevel string `validate:"logrus" name:"log level" default:"info"`
Timeout int `validate:"number,min=30" default:"60" name:"timeout"`
ProxyURL string `validate:"omitempty,proxy" name:"proxy url"`
DryRun bool
// contains filtered or unexported fields
}
ConfigOptions represent the persistent configuration flags of driverkit.
func NewConfigOptions ¶
func NewConfigOptions() *ConfigOptions
NewConfigOptions creates an instance of ConfigOptions.
func (*ConfigOptions) Validate ¶
func (co *ConfigOptions) Validate() []error
Validate validates the ConfigOptions fields.
type OutputOptions ¶
type OutputOptions struct {
Module string `validate:"required_without=Probe,filepath,omitempty,endswith=.ko" name:"output module path"`
Probe string `validate:"required_without=Module,filepath,omitempty,endswith=.o" name:"output probe path"`
}
OutputOptions wraps the two drivers that driverkit builds.
type RootCmd ¶
type RootCmd struct {
// contains filtered or unexported fields
}
RootCmd wraps the main cobra.Command.
func (*RootCmd) StripSensitive ¶
func (r *RootCmd) StripSensitive()
StripSensitive removes sensistive info from default values printed into the help messages.
type RootOptions ¶
type RootOptions struct {
Architecture string `default:"x86_64" validate:"required,oneof=x86_64" name:"architecture"`
DriverVersion string `default:"dev" validate:"eq=dev|sha1|semver" name:"driver version"`
KernelVersion uint16 `default:"1" validate:"omitempty,number" name:"kernel version"`
KernelRelease string `validate:"required,ascii" name:"kernel release"`
Target string `validate:"required,target" name:"target"`
KernelConfigData string `validate:"omitempty,base64" name:"kernel config data"` // fixme > tag "name" does not seem to work when used at struct level, but works when used at inner level
Output OutputOptions
}
RootOptions ...
func (*RootOptions) Log ¶
func (ro *RootOptions) Log()
Log emits a log line containing the receiving RootOptions for debugging purposes.
Call it only after validation.
func (*RootOptions) Validate ¶
func (ro *RootOptions) Validate() []error
Validate validates the RootOptions fields.