Documentation
¶
Overview ¶
Package generate provides the "generate" command.
Index ¶
- func DefaultImageDigestUpdater(flags *Flags) (generate.IImageDigestUpdater, error)
- func DefaultImageFormatter(flags *Flags) (generate.IImageFormatter, error)
- func DefaultImageParser(flags *Flags) (generate.IImageParser, error)
- func DefaultPathCollector(flags *Flags) (generate.IPathCollector, error)
- func NewGenerateCmd() (*cobra.Command, error)
- func SetupGenerator(flags *Flags) (generate.IGenerator, error)
- type Flags
- type FlagsWithSharedNames
- type FlagsWithSharedValues
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultImageDigestUpdater ¶
func DefaultImageDigestUpdater( flags *Flags, ) (generate.IImageDigestUpdater, error)
DefaultImageDigestUpdater creates an IImageDigestUpdater that works with Dockerfiles, Composefiles, and Kubernetesfiles.
If all "ExcludePaths" are true or any of the three's flags, are nil, an error is returned.
func DefaultImageFormatter ¶
func DefaultImageFormatter(flags *Flags) (generate.IImageFormatter, error)
DefaultImageFormatter creates an IImageFormatter that works with Dockerfiles, Composefiles, and Kubernetesfiles.
ImageFormatters are set according to the flag, "ExcludePaths". If all "ExcludePaths" are true or any of the three's flags, are nil, an error is returned.
func DefaultImageParser ¶
func DefaultImageParser(flags *Flags) (generate.IImageParser, error)
DefaultImageParser creates an IImageParser that works with Dockerfiles, Composefiles, and Kubernetesfiles.
ImageParsers are set according to the flag, "ExcludePaths". If all "ExcludePaths" are true or any of the three's flags, are nil, an error is returned.
func DefaultPathCollector ¶
func DefaultPathCollector(flags *Flags) (generate.IPathCollector, error)
DefaultPathCollector creates an IPathCollector that works with Dockerfiles, Composefiles, and Kubernetesfiles.
For all three, respectively, the defaults are ["Dockerfile"], ["compose.yml", "compose.yaml", "docker-compose.yml", "docker-compose.yaml"], and ["deployment.yml", "deployment.yaml", "pod.yml", "pod.yaml", "job.yml", "job.yaml"].
PathCollectors are set according to the flag, "ExcludePaths". If all "ExcludePaths" are true or any of the three's flags, are nil, an error is returned.
func NewGenerateCmd ¶
NewGenerateCmd creates the command 'generate' used in 'docker lock generate'.
func SetupGenerator ¶
func SetupGenerator( flags *Flags, ) (generate.IGenerator, error)
SetupGenerator creates a Generator configured for docker-lock's cli.
Types ¶
type Flags ¶
type Flags struct {
DockerfileFlags *FlagsWithSharedNames
ComposefileFlags *FlagsWithSharedNames
KubernetesfileFlags *FlagsWithSharedNames
}
Flags holds all command line options for Dockerfiles, Composefiles, and Kubernetesfiles.
func NewFlags ¶
func NewFlags( baseDir string, lockfileName string, ignoreMissingDigests bool, updateExistingDigests bool, dockerfilePaths []string, composefilePaths []string, kubernetesfilePaths []string, dockerfileGlobs []string, composefileGlobs []string, kubernetesfileGlobs []string, dockerfileRecursive bool, composefileRecursive bool, kubernetesfileRecursive bool, dockerfileExcludeAll bool, composefileExcludeAll bool, kubernetesfileExcludeAll bool, ) (*Flags, error)
NewFlags returns Flags for Dockerfiles, Composefiles, and Kubernetesfiles, subject to the validation logic in NewFlagsWithSharedNames and NewFlagsWithSharedValues.
type FlagsWithSharedNames ¶
type FlagsWithSharedNames struct {
}
FlagsWithSharedNames represents flags whose values differ for Dockerfiles, Composefiles, and Kubernetesfiles.
func NewFlagsWithSharedNames ¶
func NewFlagsWithSharedNames( baseDir string, manualPaths []string, globs []string, recursive bool, excludePaths bool, ) (*FlagsWithSharedNames, error)
NewFlagsWithSharedNames returns Flags whose values differ between Dockerfiles, Composefiles, and Kubernetesfiles, after validating its fields.
baseDir must be the current working directory or a sub directory.
manualPaths and globs must be in the current working directory or in a sub directory.
Absolute paths are not supported.
type FlagsWithSharedValues ¶
type FlagsWithSharedValues struct {
}
FlagsWithSharedValues represents flags whose values are the same for Dockerfiles, Composefiles and Kubernetesfiles.
func NewFlagsWithSharedValues ¶
func NewFlagsWithSharedValues( baseDir string, lockfileName string, ignoreMissingDigests bool, updateExistingDigests bool, ) (*FlagsWithSharedValues, error)
NewFlagsWithSharedValues returns Flags that are shared among Dockerfiles, Composefiles, and Kubernetesfiles, after validating its fields.
baseDir must be the current working directory or a sub directory. Absolute paths are not supported.
lockfileName may not contain slashes.