Documentation ¶
Index ¶
- Variables
- func GetOperatorVersionDependencies(fv *v1alpha1.OperatorVersion) ([]string, error)
- type Bundle
- type BundleVersion
- type BundleVersions
- type HTTPClient
- type IndexFile
- type Maintainer
- type Metadata
- type OperatorRepository
- type PackageCRDs
- type PackageFiles
- type Repository
- type RepositoryConfiguration
Constants ¶
This section is empty.
Variables ¶
var Default = &RepositoryConfiguration{
URL: "https://kudo-repository.storage.googleapis.com",
}
Default initialized repository.
Functions ¶
func GetOperatorVersionDependencies ¶ added in v0.3.0
func GetOperatorVersionDependencies(fv *v1alpha1.OperatorVersion) ([]string, error)
GetOperatorVersionDependencies helper method returns a slice of strings that contains the names of all dependency Operators
Types ¶
type Bundle ¶ added in v0.3.0
type Bundle interface {
GetCRDs() (*PackageCRDs, error)
}
Bundle is an abstraction of the collection of files that makes up a package. It is anything we can retrieve the PackageCRDs from.
func NewBundle ¶ added in v0.3.0
NewBundle creates the implementation of the bundle based on the path. The expectation is the bundle is always local . The path can be relative or absolute location of the bundle.
func NewBundleFromReader ¶ added in v0.3.0
NewBundleFromReader is a bundle from a reader. This should only be used when a file cache isn't used.
type BundleVersion ¶
type BundleVersion struct { *Metadata URLs []string `json:"urls"` Created time.Time `json:"created,omitempty"` Removed bool `json:"removed,omitempty"` Digest string `json:"digest,omitempty"` }
BundleVersion represents a operator entry in the IndexFile
type BundleVersions ¶
type BundleVersions []*BundleVersion
BundleVersions is a list of versioned bundle references. Implements a sorter on Version.
func (BundleVersions) Len ¶
func (b BundleVersions) Len() int
Len returns the length. this is needed to allow sorting of packages
func (BundleVersions) Less ¶
func (b BundleVersions) Less(x, y int) bool
Less returns true if the version of entry a is less than the version of entry b. this is needed to allow sorting of packages
func (BundleVersions) Swap ¶
func (b BundleVersions) Swap(i, j int)
Swap swaps the position of two items in the versions slice. this is needed to allow sorting of packages
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient is client used to communicate with KUDO repositories it enriches HTTP client with expected headers etc.
type IndexFile ¶
type IndexFile struct { APIVersion string `json:"apiVersion"` Entries map[string]BundleVersions `json:"entries"` }
IndexFile represents the index file in a operator repository
func (IndexFile) GetByName ¶
func (i IndexFile) GetByName(name string) (*BundleVersion, error)
GetByName returns operator of given name.
func (IndexFile) GetByNameAndVersion ¶
func (i IndexFile) GetByNameAndVersion(name, version string) (*BundleVersion, error)
GetByNameAndVersion returns the operator of given name and version.
type Maintainer ¶
type Maintainer struct { // Name is a user name or organization name. Name string `json:"name,omitempty"` // Email is an optional email address to contact the named maintainer. Email string `json:"email,omitempty"` // URL is an optional URL to an address for the named maintainer. URL string `json:"url,omitempty"` }
Maintainer describes a Operator maintainer.
type Metadata ¶
type Metadata struct { // Name is the name of the operator. Name string `json:"name,omitempty"` // Version is a A SemVer 2 conformant version string of the operator. Version string `protobuf:"bytes,4,opt,name=version" json:"version,omitempty"` // The URL to a relevant project page, git repo, or contact person. Home string `json:"home,omitempty"` // Source is the URL to the source code of this operator. Sources []string `json:"sources,omitempty"` // Description is a one-sentence description of the operator. Description string `json:"description,omitempty"` // Maintainers is a list of name and URL/email addresses of the maintainer(s). Maintainers []*Maintainer `json:"maintainers,omitempty"` // Deprecated reflects whether this operator is deprecated. Deprecated bool `json:"deprecated,omitempty"` }
Metadata for a Operator. This models the structure of a bundle.yaml file.
type OperatorRepository ¶ added in v0.3.0
type OperatorRepository struct { Config *RepositoryConfiguration Client HTTPClient }
OperatorRepository represents a operator repository
func NewOperatorRepository ¶ added in v0.3.0
func NewOperatorRepository(conf *RepositoryConfiguration) (*OperatorRepository, error)
NewOperatorRepository constructs OperatorRepository
func (*OperatorRepository) GetPackageBundle ¶ added in v0.3.0
func (r *OperatorRepository) GetPackageBundle(name string, version string) (Bundle, error)
GetPackageBundle provides an Bundle for a provided package name and optional version
func (*OperatorRepository) GetPackageReader ¶ added in v0.3.0
GetPackageReader provides an io.Reader for a provided package name and optional version
type PackageCRDs ¶ added in v0.3.0
type PackageCRDs struct { Operator *v1alpha1.Operator OperatorVersion *v1alpha1.OperatorVersion Instance *v1alpha1.Instance }
PackageCRDs is collection of CRDs that are used when installing operator during installation, package format is converted to this structure
type PackageFiles ¶ added in v0.3.0
type PackageFiles struct { Templates map[string]string Operator *bundle.Operator Params []v1alpha1.Parameter }
PackageFiles represents the raw operator package format the way it is found in the tgz package bundles
type Repository ¶ added in v0.3.0
type Repository interface { GetPackageReader(name string, version string) (io.Reader, error) GetPackageBundle(name string, version string) (Bundle, error) }
Repository is a abstraction for a service that can retrieve package bundles
type RepositoryConfiguration ¶
type RepositoryConfiguration struct {
URL string `json:"url"`
}
RepositoryConfiguration represents a collection of parameters for operator repository.