Documentation ¶
Index ¶
- func AddTemplateFunc(name string, fn interface{}) error
- func AddTemplateFuncOrDie(name string, fn interface{})
- func LoadFilesRecursively(dir string, predicates ...FileInfoPredicate) (map[string][]byte, error)
- func OnlyYaml(_ string, info os.FileInfo) (bool, error)
- func SubstituteAndCopyFiles(assetInputDir, assetOutputDir, featureSet, clusterProfile string, ...) error
- type Asset
- type Assets
- type FileContentsPredicate
- type FileInfoPredicate
- type Permission
- type RenderedManifest
- type RenderedManifests
- func (renderedManifests RenderedManifests) GetManifest(gvk schema.GroupVersionKind, namespace, name string) (RenderedManifest, error)
- func (renderedManifests RenderedManifests) GetObject(gvk schema.GroupVersionKind, namespace, name string) (runtime.Object, error)
- func (renderedManifests RenderedManifests) ListManifestOfType(gvk schema.GroupVersionKind) []RenderedManifest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTemplateFunc ¶
func AddTemplateFuncOrDie ¶
func AddTemplateFuncOrDie(name string, fn interface{})
func LoadFilesRecursively ¶
func LoadFilesRecursively(dir string, predicates ...FileInfoPredicate) (map[string][]byte, error)
LoadFilesRecursively returns a map from relative path names to file content.
func SubstituteAndCopyFiles ¶
func SubstituteAndCopyFiles(assetInputDir, assetOutputDir, featureSet, clusterProfile string, templateData interface{}, additionalPredicates ...FileInfoPredicate) error
SubstituteAndCopyFiles read files from the input dir, selects some by predicate, transforms them, and writes the content to output dir.
Types ¶
type Asset ¶
type Asset struct { Name string FilePermission Permission Data []byte }
Asset defines a single static asset.
func MustCreateAssetFromTemplate ¶
MustCreateAssetFromTemplate process the given template using and return an asset.
type Assets ¶
type Assets []Asset
Assets is a list of assets.
func New ¶
func New(dir string, data interface{}, manifestPredicates []FileContentsPredicate, predicates ...FileInfoPredicate) (Assets, error)
New walks through a directory recursively and renders each file as asset. Only those files are rendered that make all predicates true.
func (Assets) WriteFiles ¶
WriteFiles writes the assets to specified path.
type FileContentsPredicate ¶
func BootstrapRequiredCRD ¶
func BootstrapRequiredCRD() FileContentsPredicate
BootstrapRequiredCRD returns a predicate for LoadFilesRecursively that filters manifests based on whether they are marked as being required for bootstrap or not.
func ClusterProfile ¶
func ClusterProfile(clusterProfile string) FileContentsPredicate
ClusterProfile returns a predicate for LoadFilesRecursively that filters manifests based on the specified FeatureSet.
func InstallerFeatureSet ¶
func InstallerFeatureSet(featureSet string) FileContentsPredicate
InstallerFeatureSet returns a predicate for LoadFilesRecursively that filters manifests based on the specified FeatureSet.
type Permission ¶
const ( PermissionDirectoryDefault Permission = 0755 PermissionFileDefault Permission = 0644 PermissionFileRestricted Permission = 0600 )
type RenderedManifest ¶
type RenderedManifest struct { OriginalFilename string Content []byte // contains filtered or unexported fields }
func (*RenderedManifest) GetDecodedObj ¶
func (c *RenderedManifest) GetDecodedObj() (runtime.Object, error)
type RenderedManifests ¶
type RenderedManifests []RenderedManifest
func (RenderedManifests) GetManifest ¶
func (renderedManifests RenderedManifests) GetManifest(gvk schema.GroupVersionKind, namespace, name string) (RenderedManifest, error)
func (RenderedManifests) GetObject ¶
func (renderedManifests RenderedManifests) GetObject(gvk schema.GroupVersionKind, namespace, name string) (runtime.Object, error)
func (RenderedManifests) ListManifestOfType ¶
func (renderedManifests RenderedManifests) ListManifestOfType(gvk schema.GroupVersionKind) []RenderedManifest