packages

package
v0.8.0-pre.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const (
	APIVersion = "kudo.dev/v1beta1"
)

Variables

This section is empty.

Functions

func CreateTarball

func CreateTarball(fs afero.Fs, path string, destination string, overwrite bool) (target string, err error)

CreateTarball takes a path to operator files and creates a tgz of those files with the destination and name provided

func Untar

func Untar(fs afero.Fs, path string, r io.Reader) (err error)

Untar takes a destination path and a reader; a tar reader loops over the tarfile creating the file structure at 'path' along the way, and writing any files

Types

type Operator

type Operator struct {
	APIVersion        string                  `json:"apiVersion,omitempty"`
	Name              string                  `json:"name"`
	Description       string                  `json:"description,omitempty"`
	Version           string                  `json:"version"`
	AppVersion        string                  `json:"appVersion,omitempty"`
	KUDOVersion       string                  `json:"kudoVersion,omitempty"`
	KubernetesVersion string                  `json:"kubernetesVersion,omitempty"`
	Maintainers       []*v1beta1.Maintainer   `json:"maintainers,omitempty"`
	URL               string                  `json:"url,omitempty"`
	Tasks             []v1beta1.Task          `json:"tasks"`
	Plans             map[string]v1beta1.Plan `json:"plans"`
}

Operator is a representation of the KEP-9 Operator YAML

type Package

type Package interface {
	// transformed server view
	GetCRDs() (*Resources, error)
	// working with local package files
	GetPkgFiles() (*PackageFiles, error)
}

Package is an abstraction of the collection of files that makes up a package. It is anything we can retrieve the Resources from.

func NewFromBytes

func NewFromBytes(buf *bytes.Buffer) Package

NewFromBytes creates a package from a byte Buffer

func ReadPackage

func ReadPackage(fs afero.Fs, path string) (Package, error)

ReadPackage creates the implementation of the packages based on the path. The expectation is the packages is always local . The path can be relative or absolute location of the packages.

type PackageFiles

type PackageFiles struct {
	Templates map[string]string
	Operator  *Operator
	Params    Params
}

PackageFiles represents the raw operator package format the way it is found in the tgz packages

func FromFolder added in v0.8.0

func FromFolder(fs afero.Fs, packagePath string) (*PackageFiles, error)

FromFolder walks the path provided and returns CRD package files or an error

type PackageFilesDigest

type PackageFilesDigest struct {
	PkgFiles *PackageFiles
	Digest   string
}

PackageFilesDigest is a tuple of data used to return the package files AND the digest of a tarball

func GetFilesDigest

func GetFilesDigest(fs afero.Fs, paths []string) []*PackageFilesDigest

GetFilesDigest maps []string of paths to the [] Operators

type ParametersFile added in v0.8.0

type ParametersFile struct {
	APIVersion string              `json:"apiVersion,omitempty"`
	Params     []v1beta1.Parameter `json:"parameters"`
}

type Params added in v0.8.0

type Params []v1beta1.Parameter

func (Params) Len added in v0.8.0

func (p Params) Len() int

Len returns the number of params. This is needed to allow sorting of params.

func (Params) Less added in v0.8.0

func (p Params) Less(x, y int) bool

Less returns true if the name of a param a is less than the name of param b. This is needed to allow sorting of params.

func (Params) Swap added in v0.8.0

func (p Params) Swap(i, j int)

Swap swaps the position of two items in the params slice. This is needed to allow sorting of params.

type Resources added in v0.8.0

type Resources struct {
	Operator        *v1beta1.Operator
	OperatorVersion *v1beta1.OperatorVersion
	Instance        *v1beta1.Instance
}

Resources is collection of CRDs that are used when installing operator during installation, package format is converted to this structure

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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