Documentation
¶
Index ¶
- Variables
- func NewCompletionCmd(_ *ConfigOptions, _ *RootOptions, _ *pflag.FlagSet) *cobra.Command
- func NewDockerCmd(configOpts *ConfigOptions, rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command
- func NewImagesCmd(configOpts *ConfigOptions, rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command
- func NewKubernetesCmd(configOpts *ConfigOptions, rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command
- func NewKubernetesInClusterCmd(configOpts *ConfigOptions, rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command
- func NewLocalCmd(configOpts *ConfigOptions, rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command
- func RootOptionsLevelValidation(level validator.StructLevel)
- func Start()
- type ConfigOptions
- type KubeOptions
- type OutputOptions
- type Registry
- type RepoOptions
- 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 NewCompletionCmd ¶
func NewCompletionCmd(_ *ConfigOptions, _ *RootOptions, _ *pflag.FlagSet) *cobra.Command
NewCompletionCmd ...
func NewDockerCmd ¶
func NewDockerCmd(configOpts *ConfigOptions, rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command
NewDockerCmd creates the `driverkit docker` command.
func NewImagesCmd ¶
func NewImagesCmd(configOpts *ConfigOptions, rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command
NewImagesCmd creates the `driverkit images` command.
func NewKubernetesCmd ¶
func NewKubernetesCmd(configOpts *ConfigOptions, rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command
NewKubernetesCmd creates the `driverkit kubernetes` command.
func NewKubernetesInClusterCmd ¶
func NewKubernetesInClusterCmd(configOpts *ConfigOptions, rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command
NewKubernetesInClusterCmd creates the `driverkit kubernetes` command.
func NewLocalCmd ¶
func NewLocalCmd(configOpts *ConfigOptions, rootOpts *RootOptions, rootFlags *pflag.FlagSet) *cobra.Command
NewLocalCmd creates the `driverkit local` 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 { Timeout int `validate:"number,min=30" default:"120" name:"timeout"` ProxyURL string `validate:"omitempty,proxy" name:"proxy url"` // Printer used by all commands to output messages. Printer *output.Printer // contains filtered or unexported fields }
ConfigOptions represent the persistent configuration flags of driverkit.
func NewConfigOptions ¶
func NewConfigOptions() (*ConfigOptions, error)
NewConfigOptions creates an instance of ConfigOptions.
func (*ConfigOptions) AddFlags ¶
func (co *ConfigOptions) AddFlags(flags *pflag.FlagSet)
AddFlags registers the common flags.
func (*ConfigOptions) Init ¶
func (co *ConfigOptions) Init() bool
Init reads in config file and ENV variables if set.
type KubeOptions ¶
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.
func (*OutputOptions) HasOutputs ¶
func (oo *OutputOptions) HasOutputs() bool
type Registry ¶
type Registry struct { Name string `validate:"required_with=Username Password" name:"registry name"` Username string `validate:"required_with=Registry Password" name:"registry username"` Password string `validate:"required_with=Username Registry" name:"registry password"` PlainHTTP bool `default:"false" name:"registry plain http"` }
type RepoOptions ¶
type RootCmd ¶
type RootCmd struct {
// contains filtered or unexported fields
}
RootCmd wraps the main cobra.Command.
func NewRootCmd ¶
func NewRootCmd(configOpts *ConfigOptions, rootOpts *RootOptions) *RootCmd
NewRootCmd instantiates the root 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 `validate:"required,architecture" name:"architecture"` DriverVersion string `default:"master" validate:"eq=master|sha1|semver" name:"driver version"` KernelVersion string `default:"1" validate:"omitempty" name:"kernel version"` ModuleDriverName string `default:"diginfra" validate:"max=60" name:"kernel module driver name"` ModuleDeviceName string `default:"diginfra" validate:"excludes=/,max=255" name:"kernel module device name"` 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 BuilderImage string `validate:"omitempty,imagename" name:"builder image"` BuilderRepos []string `` /* 200-byte string literal not displayed */ GCCVersion string `validate:"omitempty,semvertolerant" name:"gcc version"` KernelUrls []string `name:"kernel header urls"` Repo RepoOptions Output OutputOptions Registry Registry }
RootOptions ...
func (*RootOptions) AddFlags ¶
func (ro *RootOptions) AddFlags(flags *pflag.FlagSet, targets []string)
func (*RootOptions) Log ¶
func (ro *RootOptions) Log(printer *output.Printer)
Log emits a log line containing the receiving RootOptions for debugging purposes.
Call it only after validation.
func (*RootOptions) ToBuild ¶
func (ro *RootOptions) ToBuild(printer *output.Printer) *builder.Build
func (*RootOptions) Validate ¶
func (ro *RootOptions) Validate() []error
Validate validates the RootOptions fields.