loader

package
v0.0.0-...-c510420 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultChannelDir is the default name of the directory containing
	// channel and packages files.
	DefaultChannelDir = "channels"
	// DefaultChannelName is the default name of a channel.
	DefaultChannelName = "stable"
)

Variables

This section is empty.

Functions

func DeepCopy

func DeepCopy(fs1, fs2 filesys.FileSystem) error

DeepCopy performs a deep copy of the FileSystem from fs1 to fs2.

func LoadManifests

func LoadManifests(fs *ManifestFileSystem, baseDir string, channel *loaders.Channel) error

LoadManifests takes a filesystem, a base directory path that contains the manifests and a Channel, and loads the manifests into the filesystem. The copied package manifests are copied at the root of the filesystem in a directory named the same as the package name. These manifests are not versioned. Example filesystem structure once the manifests are loaded:

/ |-- guestbook | |-- role.yaml | |-- service_account.yaml | |-- registry

|-- db.yaml
|-- frontend.yaml

func LoadPackages

func LoadPackages(fs *ManifestFileSystem, baseDir string, channel string) error

LoadPackages takes a filesystem, a base directory path and a channel name, and loads the versioned packages specified in the channel into the filesystem. The channel is based on a Channel type defined in the kubebuilder-declarative-pattern addon loaders package. Example channel:

manifests:

  • name: guestbook version: 0.1.0
  • name: registry version: 0.3.0

Types

type ManifestFileSystem

type ManifestFileSystem struct {
	filesys.FileSystem
}

ManifestFileSystem is a wrapper around the kustomize filesys.Filesystem with methods to copy all the files and directories of a manifest directory. This can be backed by a disk or an in-memory filesystem.

func NewLoadedManifestFileSystem

func NewLoadedManifestFileSystem(baseDir string, channel string) (*ManifestFileSystem, error)

NewLoadedManifestFileSystem creates and returns a new ManifestFileSystem, loaded with the manifests.

func (*ManifestFileSystem) Copy

func (mfs *ManifestFileSystem) Copy(srcFile, dstFile string) (err error)

Copy reads a file from disk and copies it into manifest filesystem.

func (*ManifestFileSystem) CopyDirectory

func (mfs *ManifestFileSystem) CopyDirectory(srcDir, dest string) error

CopyDirectory recursively copies directory content from disk filesystem to the manifest filesystem.

func (*ManifestFileSystem) CreateIfNotExists

func (mfs *ManifestFileSystem) CreateIfNotExists(dir string) error

CreateIfNotExists creates a path if not exists.

Jump to

Keyboard shortcuts

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