Documentation ¶
Index ¶
- Constants
- Variables
- func BuildError(op string) error
- func BuildName(config Config) string
- func EnrichKubernetesFullVersion(config Config, userDefinedKubernetesVersion string) error
- func GenPackerVars(config Config, extraVarsPath string) ([]byte, error)
- func InitConfigError(op string, err error) error
- func MergeAmazonUserArgs(config Config, amazonArgs *AmazonArgs) error
- func MergeAzureUserArgs(config Config, azureArgs *AzureArgs) error
- func MergeGCPUserArgs(config Config, gcpArgs *GCPArgs) error
- func MergeMapsOverwrite(orig map[string]interface{}, maps ...map[string]interface{}) error
- func MergeUserArgs(config Config, userArgs UserArgs) error
- func NewRunOptions(flags RootFlags) appansible.RunOptions
- func Provision(inventory string, flags ProvisionFlags) error
- func Validate(flags ValidateFlags) error
- type AmazonArgs
- type ArtifactUploader
- type ArtifactsCmdFlags
- type AzureArgs
- type AzureCloudEndpoint
- type AzureCloudFlag
- type BuildOptions
- type Builder
- type ClusterArgs
- type Config
- func (config Config) AddBuildNameExtra(base string) string
- func (config Config) Delete(path string) error
- func (config Config) Get(path string) string
- func (config Config) GetSliceWithError(path string) ([]string, error)
- func (config Config) GetWithEnvironment(path string, environmentVariable string) (string, error)
- func (config Config) GetWithError(path string) (string, error)
- func (config Config) Set(path string, value interface{}) error
- func (config Config) SetAllowEmpty(path string, value interface{}) error
- type GCPArgs
- type InitOptions
- type ProvisionFlags
- type RootFlags
- type RootFlagsCommon
- type UserArgs
- type ValidateFlags
Constants ¶
View Source
const ( AnsibleExtraVarsKey = "ansible_extra_vars" BuildNameKey = "build_name" BuildNameExtraKey = "build_name_extra" BuildTypeAmazon = "amazon" BuildTypeAzure = "azure" BuildTypeGCP = "gcp" CommonConfigDefaultPath = "./images/common.yaml" ContainerdVersionKey = "containerd_version" DefaultBuildName = "provision_build" GPUTypesKey = "/gpu/types" GPUNvidiaVersion = "/nvidia_driver_version" KubernetesVersionKey = "kubernetes_version" KubernetesFullVersionKey = "kubernetes_full_version" KubernetesBuildMetadataKey = "kubernetes_build_metadata" PackerAMIGroupsPath = "/packer/ami_groups" PackerAMIRegionsPath = "/packer/ami_regions" PackerAMIUsersPath = "/packer/ami_users" PackerBuilderRegionPath = "/packer/aws_region" PackerBuilderTypePath = "/packer_builder_type" PackerFilterNamePath = "/packer/ami_filter_name" PackerFilterOwnerPath = "/packer/ami_filter_owners" PackerInstanceTypePath = "/packer/aws_instance_type" PackerSourceAMIPath = "/packer/source_ami" PackerAzureClientIDPath = "/packer/client_id" PackerAzureDistributionVersionPath = "/packer/distribution_version" PackerAzureInstanceType = "/packer/vm_size" PackerAzureGalleryLocations = "/packer/gallery_image_locations" PackerAzureGalleryImageNamePath = "/packer/gallery_image_name" PackerAzureGalleryImageOfferPath = "/packer/gallery_image_offer" PackerAzureGalleryImagePublisherPath = "/packer/gallery_image_publisher" PackerAzureGalleryImageSKU = "/packer/gallery_image_sku" PackerAzureLocation = "/packer/location" PackerAzureGalleryNamePath = "/packer/gallery_name" PackerAzureResourceGroupNamePath = "/packer/resource_group_name" PackerAzureSubscriptionIDPath = "/packer/subscription_id" PackerAzureTenantIDPath = "/packer/tenant_id" PackerAzureCloudEndpointPath = "/packer/cloud_environment_name" PackerGCPProjectIDPath = "/packer/project_id" PackerGCPNetworkPath = "/packer/network" PackerGCPRegionPath = "/packer/region" PackerGPUPath = "/packer/gpu" PackerGPUTypes = "/packer/gpu_types" PackerGPUNvidiaVersion = "/packer/gpu_nvidia_version" AzureClientIDEnvVariable = "AZURE_CLIENT_ID" //nolint:gosec // environment var set by user AzureClientSecretEnvVariable = "AZURE_CLIENT_SECRET" AzureSubscriptionIDEnvVariable = "AZURE_SUBSCRIPTION_ID" AzureTenantIDEnvVariable = "AZURE_TENANT_ID" //nolint:gosec // environment var set by user GCPCredentialEnvVariable = "GOOGLE_APPLICATION_CREDENTIALS" OutputDir = "./work" )
Variables ¶
View Source
var ( ErrInitConfig = errors.New("init configuration failure") ErrBuild = errors.New("build failure") ErrKubernetesVersionMissing = errors.New("necessary kubernetes_version key missing") ErrPathNotString = errors.New("path value is not a string") ErrPathNotSlice = errors.New("path value is not a slice") ErrConfigRequired = errors.New("config value is required") )
errors.
View Source
var AnsibleRunsDirectory = "ansible-runs"
Functions ¶
func BuildError ¶
func EnrichKubernetesFullVersion ¶
enrichKubernetesFullVersion will enrich the kubernetes semver with build metadata added in via overrides. A common example is the fips override, which adds +fips.buildnumber to the version.
func InitConfigError ¶
func MergeAmazonUserArgs ¶
func MergeAmazonUserArgs(config Config, amazonArgs *AmazonArgs) error
func MergeAzureUserArgs ¶
func MergeGCPUserArgs ¶
func MergeMapsOverwrite ¶
recursively merges maps into orig, orig is modified.
func MergeUserArgs ¶
func NewRunOptions ¶
func NewRunOptions(flags RootFlags) appansible.RunOptions
func Provision ¶
func Provision(inventory string, flags ProvisionFlags) error
func Validate ¶
func Validate(flags ValidateFlags) error
Types ¶
type AmazonArgs ¶
type AmazonArgs struct { // AMI options SourceAMI string `json:"source_ami"` AMIFilterName string `json:"ami_filter_name"` AMIFilterOwner string `json:"ami_filter_owner"` AWSBuilderRegion string `json:"aws_region"` AMIRegions []string `json:"ami_regions"` AWSInstanceType string `json:"aws_instance_type"` AMIUsers []string `json:"ami_users"` AMIGroups []string `json:"ami_groups"` }
type ArtifactUploader ¶
type ArtifactUploader struct {
// contains filtered or unexported fields
}
func NewArtifactUploader ¶
func NewArtifactUploader(buildName string) (*ArtifactUploader, error)
func (*ArtifactUploader) UploadArtifacts ¶
func (a *ArtifactUploader) UploadArtifacts(artifactFlags ArtifactsCmdFlags) error
type ArtifactsCmdFlags ¶
type AzureArgs ¶
type AzureArgs struct { ClientID string InstanceType string GalleryImageLocations []string GalleryImageName string GalleryImageOffer string GalleryImagePublisher string GalleryImageSKU string GalleryName string Location string ResourceGroupName string SubscriptionID string TenantID string CloudEndpoint *AzureCloudFlag }
type AzureCloudEndpoint ¶
type AzureCloudEndpoint string
var ( AzureCloudEndpointChina AzureCloudEndpoint = "China" AzureCloudEndpointPublic AzureCloudEndpoint = "Public" AzureCloudEndpointGovernment AzureCloudEndpoint = "USGovernment" )
func ListAzureEndpoints ¶
func ListAzureEndpoints() []AzureCloudEndpoint
type AzureCloudFlag ¶
type AzureCloudFlag struct {
Endpoint AzureCloudEndpoint
}
func (*AzureCloudFlag) Set ¶
func (a *AzureCloudFlag) Set(s string) error
func (*AzureCloudFlag) String ¶
func (a *AzureCloudFlag) String() string
func (*AzureCloudFlag) Type ¶
func (a *AzureCloudFlag) Type() string
type BuildOptions ¶
type BuildOptions struct { PackerPath string PackerBuildFlags packer.BuildFlags CustomManifestPath string DryRun bool }
type Builder ¶
type Builder struct{}
func (*Builder) InitConfig ¶
func (b *Builder) InitConfig(initOptions InitOptions) (string, error)
type ClusterArgs ¶
type Config ¶
type Config map[string]interface{}
func (Config) AddBuildNameExtra ¶
func (Config) GetSliceWithError ¶
func (Config) GetWithEnvironment ¶
func (Config) SetAllowEmpty ¶
type InitOptions ¶
type InitOptions struct { CommonConfigPath string Image string Overrides []string UserArgs UserArgs // ExtraVarsOnly is true when only ansible variables should only ansible variables // should be generated. Omitting packer variables. This is useful for working with // preprovisioned infrastructure ExtraVarsOnly bool }
type ProvisionFlags ¶
type RootFlags ¶
type RootFlags struct { Verbosity logging.Verbosity RootFlagsCommon }
type RootFlagsCommon ¶
type RootFlagsCommon struct {
Color bool
}
type UserArgs ¶
type UserArgs struct { ClusterArgs Amazon *AmazonArgs Azure *AzureArgs GCP *GCPArgs // ExtraVars provided to ansible ExtraVars []string }
Click to show internal directories.
Click to hide internal directories.