Documentation ¶
Index ¶
- func PopulateRegistryFromFiles(r Registry, files []string) error
- type AutogenSpec
- type BaseResource
- type DeploymentManagerAutogenTemplate
- type DeploymentManagerTemplate
- type GceImage
- type Image
- type Metadata
- type PackageInfo
- type PackerGceImageBuilder
- type Reference
- type Registry
- type Resource
- type TypeMeta
- type Unstructured
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PopulateRegistryFromFiles ¶
PopulateRegistryFromFiles registers resources declared in list of files
Types ¶
type AutogenSpec ¶
type AutogenSpec struct { // Deployment Spec is documented in https://github.com/GoogleCloudPlatform/marketplace-tools/docs/autogen-reference.md DeploymentSpec map[string]interface{} `yaml:"deploymentSpec"` PackageInfo PackageInfo `yaml:"packageInfo"` }
AutogenSpec is defines the spec used for auto-generating deployment packages.
type BaseResource ¶
BaseResource contains fields should be present in all Resources. This struct should be embedded in types implementing the resource interface.
func (*BaseResource) GetDependencies ¶
func (rs *BaseResource) GetDependencies() (r []Reference)
GetDependencies returns the dependencies for the BaseResource
func (*BaseResource) GetReference ¶
func (rs *BaseResource) GetReference() Reference
GetReference computes the reference to the Resource.
type DeploymentManagerAutogenTemplate ¶
type DeploymentManagerAutogenTemplate struct { BaseResource Spec AutogenSpec // contains filtered or unexported fields }
DeploymentManagerAutogenTemplate generates a deployment manager template given an autogen.yaml file.
type DeploymentManagerTemplate ¶
type DeploymentManagerTemplate struct { BaseResource DeploymentManagerRef Reference // Uploads to gcs if file path prefixed with "gs://". Otherwise will // zip to given local file path. ZipFilePath string }
DeploymentManagerTemplate saves a referenced Deployment Manager template to GCS or the local filesystem
func (*DeploymentManagerTemplate) Apply ¶
func (dm *DeploymentManagerTemplate) Apply(registry Registry, dryRun bool) error
Apply uploads a Deployment Manager template to GCS.
func (*DeploymentManagerTemplate) GetDependencies ¶
func (dm *DeploymentManagerTemplate) GetDependencies() (r []Reference)
GetDependencies returns dependencies for DeploymentManagerTemplate
type GceImage ¶
type GceImage struct { BaseResource // References another GCE Image resource ImageRef Reference // References a builder resource which handles the actual creation // of the GCE Image BuilderRef Reference Image Image }
GceImage represents a Google Compute Engine image. One of BuilderRef or ImageRef must be specified
type Image ¶
type Image struct { ProjectID string `json:"projectId"` NamePartsSeparator string NameParts []string }
Image defines the location of the GCE Image when published
type PackageInfo ¶
type PackageInfo struct { // Version of combined software components Version string // Name and version of OS OsInfo component `yaml:"osInfo"` // Names and versions of software components Components []component }
PackageInfo describes the software packaged in a deployable solution. PackageInfo is metadata displayed on the VM solution details page in the GCP marketplace console.
type PackerGceImageBuilder ¶
type PackerGceImageBuilder struct { BaseResource Builder struct { Script struct { File string } } Tests []struct { Name string Script struct { File string } } }
PackerGceImageBuilder uses Packer to create a GCEImage when applied
type Reference ¶
Reference allows a Resource to reference another Resource as part of its specification. The combination of Group, Kind, Name MUST be unique for all applied resources.
type Registry ¶
type Registry interface { RegisterResource(resource Resource, workingDirectory string) GetExecutor() exec.Interface GetResource(reference Reference) Resource ResolveFilePath(rs Resource, path string) (string, error) Apply(dryRun bool) error Test(dryRun bool) error }
Registry stores references to all resources and can apply all resources in the registry
func NewRegistry ¶
NewRegistry creates a registry that stores references to all resources
type Resource ¶
type Resource interface { Apply(registry Registry, dryRun bool) error Test(registry Registry, dryRun bool) error GetReference() Reference GetDependencies() []Reference }
Resource represents a KRM resource that can be applied
func UnstructuredToResource ¶
func UnstructuredToResource(obj Unstructured) (Resource, error)
UnstructuredToResource converts Unstructured to a specific type implementing the Resource interface, using the TypeMeta from the Unstructured object.
type TypeMeta ¶
TypeMeta describes an individual KRM resource with strings representing the type of the object and its API schema version.
type Unstructured ¶
type Unstructured map[string]interface{}
Unstructured is used to unmarshal json/yaml KRM Resources and extract the TypeMeta, such that the KRM Resource can be unmarshalled to a specific type implementing the Resource interface.