asset

package
v0.9.0-master.0...-3485fdd Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 7 Imported by: 683

Documentation

Overview

Package asset defines the asset dependencies and implements the graph engine.

Index

Constants

View Source
const (
	// ClusterCreationError is the error when terraform fails, implying infrastructure failures
	ClusterCreationError = "failed to create cluster"
	// InstallConfigError wraps all configuration errors in one single error
	InstallConfigError = "failed to create install config"
)

Variables

This section is empty.

Functions

func DeleteAssetFromDisk added in v0.12.0

func DeleteAssetFromDisk(asset WritableAsset, directory string) error

DeleteAssetFromDisk removes all the files for asset from disk. this is function is not safe for calling concurrently on the same directory.

func PersistToFile added in v0.2.0

func PersistToFile(asset WritableAsset, directory string) error

PersistToFile writes all of the files of the specified asset into the specified directory.

func SortFiles added in v0.12.0

func SortFiles(files []*File)

SortFiles sorts the specified files by file name.

Types

type Asset

type Asset interface {
	// Dependencies returns the assets upon which this asset directly depends.
	Dependencies() []Asset

	// Generate generates this asset given the states of its parent assets.
	Generate(Parents) error

	// Name returns the human-friendly name of the asset.
	Name() string
}

Asset used to install OpenShift.

type Content

type Content struct {
	Name string // the path on disk for this content.
	Data []byte
}

Content is a generated portion of an Asset.

type File added in v0.2.0

type File struct {
	// Filename is the name of the file.
	Filename string
	// Data is the contents of the file.
	Data []byte
}

File is a file for an Asset.

type FileFetcher added in v0.3.0

type FileFetcher interface {
	// FetchByName returns the file with the given name.
	FetchByName(string) (*File, error)
	// FetchByPattern returns the files whose name match the given glob.
	FetchByPattern(pattern string) ([]*File, error)
}

FileFetcher fetches the asset files from disk.

type FileWriter

type FileWriter interface {
	PersistToFile(directory string) error
}

FileWriter interface is used to write all the files in the specified location

func NewDefaultFileWriter

func NewDefaultFileWriter(a WritableAsset) FileWriter

NewDefaultFileWriter create a new adapter to expose the default implementation as a FileWriter

type Parents added in v0.2.0

type Parents map[reflect.Type]Asset

Parents is the collection of assets upon which another asset is directly dependent.

func (Parents) Add added in v0.2.0

func (p Parents) Add(assets ...Asset)

Add adds the specified assets to the parents collection.

func (Parents) Get added in v0.2.0

func (p Parents) Get(assets ...Asset)

Get populates the state of the specified assets with the state stored in the parents collection.

type State

type State struct {
	Contents []Content
}

State is the state of an Asset.

func (*State) PersistToFile

func (s *State) PersistToFile(directory string) error

PersistToFile persists the data in the State to files. Each Content entry that has a non-empty Name will be persisted to a file with that name.

type Store

type Store interface {
	// Fetch retrieves the state of the given asset, generating it and its
	// dependencies if necessary. When purging consumed assets, none of the
	// assets in assetsToPreserve will be purged.
	Fetch(assetToFetch Asset, assetsToPreserve ...WritableAsset) error

	// Destroy removes the asset from all its internal state and also from
	// disk if possible.
	Destroy(Asset) error

	// DestroyState removes everything from the internal state and the internal
	// state file
	DestroyState() error

	// Load retrieves the state of the given asset but does not generate it if it
	// does not exist and instead will return nil if not found.
	Load(Asset) (Asset, error)
}

Store is a store for the states of assets.

type WritableAsset added in v0.2.0

type WritableAsset interface {
	Asset

	// Files returns the files to write.
	Files() []*File

	// Load returns the on-disk asset if it exists.
	// The asset object should be changed only when it's loaded successfully.
	Load(FileFetcher) (found bool, err error)
}

WritableAsset is an Asset that has files that can be written to disk. It can also be loaded from disk.

Directories

Path Synopsis
Package cluster contains asset targets that generates the terraform file, prepare the infra, and bootstrap the cluster.
Package cluster contains asset targets that generates the terraform file, prepare the infra, and bootstrap the cluster.
aws
Package aws extracts AWS metadata from install configurations.
Package aws extracts AWS metadata from install configurations.
azure
Package azure extracts AZURE metadata from install configurations.
Package azure extracts AZURE metadata from install configurations.
baremetal
Package baremetal extracts bare metal metadata from install configurations.
Package baremetal extracts bare metal metadata from install configurations.
gcp
Package gcp extracts GCP metadata from install configurations.
Package gcp extracts GCP metadata from install configurations.
ibmcloud
Package ibmcloud extracts IBM Cloud metadata from install configurations.
Package ibmcloud extracts IBM Cloud metadata from install configurations.
libvirt
Package libvirt extracts libvirt metadata from install configurations.
Package libvirt extracts libvirt metadata from install configurations.
openstack
Package openstack extracts OpenStack metadata from install configurations.
Package openstack extracts OpenStack metadata from install configurations.
ovirt
Package ovirt extracts ovirt metadata from install configurations.
Package ovirt extracts ovirt metadata from install configurations.
powervs
Package powervs extracts Power VS metadata from install configurations.
Package powervs extracts Power VS metadata from install configurations.
Package installconfig generates the install config assets based on its dependencies.
Package installconfig generates the install config assets based on its dependencies.
aws
Package aws collects AWS-specific configuration.
Package aws collects AWS-specific configuration.
aws/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
azure/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
baremetal
Package baremetal collects bare metal specific configuration.
Package baremetal collects bare metal specific configuration.
gcp
gcp/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
ibmcloud/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
libvirt
Package libvirt collects libvirt-specific configuration.
Package libvirt collects libvirt-specific configuration.
nutanix
Package nutanix collects Nutanix-specific configuration.
Package nutanix collects Nutanix-specific configuration.
openstack
Package openstack collects OpenStack-specific configuration.
Package openstack collects OpenStack-specific configuration.
powervs/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
vsphere
Package vsphere collects vSphere-specific configuration.
Package vsphere collects vSphere-specific configuration.
vsphere/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
Package kubeconfig defines and generates the kubeconfig assets.
Package kubeconfig defines and generates the kubeconfig assets.
Package machines is responsible for creating Machine objects for machinepools.
Package machines is responsible for creating Machine objects for machinepools.
alibabacloud
Package alibabacloud generates Machine objects for alibabacloud.
Package alibabacloud generates Machine objects for alibabacloud.
aws
Package aws generates Machine objects for aws.
Package aws generates Machine objects for aws.
azure
Package azure generates Machine objects for azure.
Package azure generates Machine objects for azure.
baremetal
Package baremetal generates Machine objects for bare metal.
Package baremetal generates Machine objects for bare metal.
gcp
Package gcp generates Machine objects for gcp.
Package gcp generates Machine objects for gcp.
libvirt
Package libvirt generates Machine objects for libvirt.
Package libvirt generates Machine objects for libvirt.
nutanix
Package nutanix generates Machine objects for nutanix.
Package nutanix generates Machine objects for nutanix.
openstack
Package openstack generates Machine objects for openstack.
Package openstack generates Machine objects for openstack.
ovirt
Package ovirt generates Machine objects for ovirt.
Package ovirt generates Machine objects for ovirt.
powervs
Package powervs generates Machine objects for powerVS.
Package powervs generates Machine objects for powerVS.
vsphere
Package vsphere generates Machine objects for vsphere.
Package vsphere generates Machine objects for vsphere.
Package manifests deals with creating manifests for all manifests to be installed for the cluster
Package manifests deals with creating manifests for all manifests to be installed for the cluster
aws
gcp
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
aws
gcp
Package rhcos contains assets for RHCOS.
Package rhcos contains assets for RHCOS.
Package templates deals with creating template assets that will be used by other assets
Package templates deals with creating template assets that will be used by other assets
Package tls defines and generates the tls assets based on its dependencies.
Package tls defines and generates the tls assets based on its dependencies.

Jump to

Keyboard shortcuts

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