flags

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolVarWithViper

func BoolVarWithViper(cmd *cobra.Command, p *bool, viperPrefix, name string, value bool, usage string)

func Float64VarWithViper

func Float64VarWithViper(cmd *cobra.Command, p *float64, viperPrefix, name string, value float64, usage string)

func Int64VarWithViper

func Int64VarWithViper(cmd *cobra.Command, p *int64, viperPrefix, name string, value int64, usage string)

func IntVarWithViper

func IntVarWithViper(cmd *cobra.Command, p *int, viperPrefix, name string, value int, usage string)

func PersistentStringVarWithViper

func PersistentStringVarWithViper(cmd *cobra.Command, p *string, viperPrefix, name, value, usage string)

func StringMapVarWithViper added in v1.1.0

func StringMapVarWithViper(cmd *cobra.Command, p *map[string]string, viperPrefix, name string, value map[string]string, usage string)

func StringSliceVarWithViper

func StringSliceVarWithViper(cmd *cobra.Command, p *[]string, viperPrefix, name string, value []string, usage string)

func StringVarWithViper

func StringVarWithViper(cmd *cobra.Command, p *string, viperPrefix, name, value, usage string)

Types

type BaseOptions added in v1.1.0

type BaseOptions struct {
	InfraType string
}

func (*BaseOptions) AddFlags added in v1.1.0

func (o *BaseOptions) AddFlags(cmd *cobra.Command)

func (*BaseOptions) SetOptionsFromViper added in v1.1.0

func (o *BaseOptions) SetOptionsFromViper()

type BuildOptions

type BuildOptions struct {
	BaseOptions
	KubernetesClusterFlags
	S3Flags
	OpenStackFlags
	KubeVirtFlags

	Verbose                 bool
	BuildOS                 string
	ImagePrefix             string
	ImageRepo               string
	ImageRepoBranch         string
	ContainerdSHA256        string
	ContainerdVersion       string
	CrictlVersion           string
	CniVersion              string
	CniDebVersion           string
	KubeVersion             string
	KubeRpmVersion          string
	KubeDebVersion          string
	ExtraDebs               string
	AdditionalImages        []string
	AdditionalMetadata      map[string]string
	AddFalco                bool
	AddTrivy                bool
	AddGpuSupport           bool
	GpuVendor               string
	AMDVersion              string
	AMDDebVersion           string
	AMDUseCase              string
	NvidiaVersion           string
	NvidiaBucket            string
	NvidiaInstallerLocation string
	NvidiaTOKLocation       string
	NvidiaGriddFeatureType  int
}

func (*BuildOptions) AddFlags

func (o *BuildOptions) AddFlags(cmd *cobra.Command, imageBuilderRepo string)

func (*BuildOptions) SetOptionsFromViper

func (o *BuildOptions) SetOptionsFromViper()

type KubeVirtFlags added in v1.1.0

type KubeVirtFlags struct {
	QEMUFlags
	StoreInS3      bool
	ImageBucket    string
	ImageName      string
	ImageNamespace string
}

KubeVirtFlags are explicitly for QEMU image builds.

func (*KubeVirtFlags) AddFlags added in v1.1.0

func (k *KubeVirtFlags) AddFlags(cmd *cobra.Command, viperPrefix string)

func (*KubeVirtFlags) SetOptionsFromViper added in v1.1.0

func (k *KubeVirtFlags) SetOptionsFromViper()

SetOptionsFromViper configures additional options passed in via viper for the struct.

type KubernetesClusterFlags added in v1.1.0

type KubernetesClusterFlags struct {
	KubeconfigPath string
}

KubernetesClusterFlags are flags that can be used for the interaction with a kubernetes cluster.

func (*KubernetesClusterFlags) AddFlags added in v1.1.0

func (k *KubernetesClusterFlags) AddFlags(cmd *cobra.Command)

func (*KubernetesClusterFlags) SetOptionsFromViper added in v1.1.0

func (k *KubernetesClusterFlags) SetOptionsFromViper()

SetOptionsFromViper configures additional options passed in via viper for the struct.

type OpenStackCoreFlags

type OpenStackCoreFlags struct {
	CloudsPath string
	CloudName  string
}

OpenStackCoreFlags are the core requirements for any interaction with the openstack cloud.

func (*OpenStackCoreFlags) AddFlags

func (o *OpenStackCoreFlags) AddFlags(cmd *cobra.Command, viperPrefix string)

func (*OpenStackCoreFlags) SetOptionsFromViper

func (o *OpenStackCoreFlags) SetOptionsFromViper()

SetOptionsFromViper configures additional options passed in via viper for the struct.

type OpenStackFlags

type OpenStackFlags struct {
	OpenStackCoreFlags
	OpenStackInstanceFlags

	SourceImageID         string
	SSHPrivateKeyFile     string
	SSHKeypairName        string
	UseFloatingIP         bool
	FloatingIPNetworkName string
	SecurityGroup         string
	ImageVisibility       string
	ImageDiskFormat       string
	UseBlockStorageVolume string
	VolumeType            string
	VolumeSize            int
}

OpenStackFlags are explicitly for OpenStack based clouds and defines settings that pertain only to that cloud type.

func (*OpenStackFlags) AddFlags

func (q *OpenStackFlags) AddFlags(cmd *cobra.Command, viperPrefix string)

func (*OpenStackFlags) SetOptionsFromViper

func (q *OpenStackFlags) SetOptionsFromViper()

SetOptionsFromViper configures additional options passed in via viper for the struct.

type OpenStackInstanceFlags

type OpenStackInstanceFlags struct {
	AttachConfigDrive bool
	NetworkID         string
	FlavorName        string
}

OpenStackInstanceFlags are Additional flags that can would be required for other steps such as scan, sign and publish.

func (*OpenStackInstanceFlags) AddFlags

func (o *OpenStackInstanceFlags) AddFlags(cmd *cobra.Command, viperPrefix string)

func (*OpenStackInstanceFlags) SetOptionsFromViper

func (o *OpenStackInstanceFlags) SetOptionsFromViper()

SetOptionsFromViper configures additional options passed in via viper for the struct.

type QEMUFlags added in v1.1.0

type QEMUFlags struct {
	QemuBinary      string
	DiskSize        string
	OutputDirectory string
}

QEMUFlags are explicitly for QEMU image builds.

func (*QEMUFlags) AddFlags added in v1.1.0

func (q *QEMUFlags) AddFlags(cmd *cobra.Command, viperPrefix string)

func (*QEMUFlags) SetOptionsFromViper added in v1.1.0

func (q *QEMUFlags) SetOptionsFromViper()

SetOptionsFromViper configures additional options passed in via viper for the struct.

type S3Flags

type S3Flags struct {
	Endpoint  string
	AccessKey string
	SecretKey string
	Region    string
	IsCeph    bool
}

func (*S3Flags) AddFlags

func (o *S3Flags) AddFlags(cmd *cobra.Command)

func (*S3Flags) SetOptionsFromViper

func (o *S3Flags) SetOptionsFromViper()

type ScanMultipleOptions

type ScanMultipleOptions struct {
	ImageSearch string
	Concurrency int
}

func (*ScanMultipleOptions) AddFlags

func (o *ScanMultipleOptions) AddFlags(cmd *cobra.Command)

func (*ScanMultipleOptions) SetOptionsFromViper

func (o *ScanMultipleOptions) SetOptionsFromViper()

type ScanOptions

type ScanOptions struct {
	BaseOptions
	OpenStackFlags
	KubeVirtFlags
	S3Flags
	ScanSingleOptions
	ScanMultipleOptions

	AutoDeleteImage     bool
	SkipCVECheck        bool
	MaxSeverityScore    float64
	MaxSeverityType     string
	ScanBucket          string
	TrivyignorePath     string
	TrivyignoreFilename string
	TrivyignoreList     []string
}

func (*ScanOptions) AddFlags

func (o *ScanOptions) AddFlags(cmd *cobra.Command)

func (*ScanOptions) SetOptionsFromViper

func (o *ScanOptions) SetOptionsFromViper()

type ScanSingleOptions

type ScanSingleOptions struct {
	ImageID string
}

func (*ScanSingleOptions) AddFlags

func (o *ScanSingleOptions) AddFlags(cmd *cobra.Command)

func (*ScanSingleOptions) SetOptionsFromViper

func (o *ScanSingleOptions) SetOptionsFromViper()

type SignGenerateOptions

type SignGenerateOptions struct {
	Path string
}

SignGenerateOptions contains additional options for the 'generate' subcommand.

func (*SignGenerateOptions) AddFlags

func (o *SignGenerateOptions) AddFlags(cmd *cobra.Command)

AddFlags adds flags to the 'generate' subcommand and binds them to the 'generate' options.

func (*SignGenerateOptions) SetOptionsFromViper

func (o *SignGenerateOptions) SetOptionsFromViper()

SetOptionsFromViper configures options passed in via viper for the struct.

type SignOptions

type SignOptions struct {
	BaseOptions
	OpenStackCoreFlags
	SignGenerateOptions

	VaultURL        string
	VaultToken      string
	VaultMountPath  string
	VaultSecretPath string
	ImageID         string
	PrivateKey      string
	PublicKey       string
}

SignOptions contains options for the 'sign' command. These will be available to the subcommands and not configured directly for the sign command itself.

func (*SignOptions) AddFlags

func (o *SignOptions) AddFlags(cmd *cobra.Command)

AddFlags adds additional flags to the subcommands that call this.

func (*SignOptions) SetOptionsFromViper

func (o *SignOptions) SetOptionsFromViper()

SetOptionsFromViper configures additional options passed in via viper for the struct from any subcommands.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL