Documentation ¶
Index ¶
- Constants
- func LoadCRDFromFile(m *InMem, filepath string) (*v1beta1.CustomResourceDefinition, error)
- func LoadCSVFromFile(m *InMem, filepath string) (*v1alpha1.ClusterServiceVersion, error)
- type CRDKey
- type CSVAndChannelInfo
- type CSVMetadata
- type ConfigMapCatalogResourceLoader
- type DirectoryCatalogResourceLoader
- func (d *DirectoryCatalogResourceLoader) LoadCRDsWalkFunc(path string, f os.FileInfo, err error) error
- func (d *DirectoryCatalogResourceLoader) LoadCSVsWalkFunc(path string, f os.FileInfo, err error) error
- func (d *DirectoryCatalogResourceLoader) LoadCatalogResources(directory string) error
- func (d *DirectoryCatalogResourceLoader) LoadPackagesWalkFunc(path string, f os.FileInfo, err error) error
- type InMem
- func (m *InMem) AddOrReplaceService(csv v1alpha1.ClusterServiceVersion)
- func (m *InMem) AddPackageManifest(pkg PackageManifest) error
- func (m *InMem) AllPackages() map[string]PackageManifest
- func (m *InMem) FindCRDByKey(key CRDKey) (*v1beta1.CustomResourceDefinition, error)
- func (m *InMem) FindCSVByName(name string) (*v1alpha1.ClusterServiceVersion, error)
- func (m *InMem) FindCSVForPackageNameUnderChannel(packageName string, channelName string) (*v1alpha1.ClusterServiceVersion, error)
- func (m *InMem) FindReplacementCSVForName(name string) (*v1alpha1.ClusterServiceVersion, error)
- func (m *InMem) FindReplacementCSVForPackageNameUnderChannel(packageName string, channelName string, csvName string) (*v1alpha1.ClusterServiceVersion, error)
- func (m *InMem) ListLatestCSVsForCRD(key CRDKey) ([]CSVAndChannelInfo, error)
- func (m *InMem) ListServices() ([]v1alpha1.ClusterServiceVersion, error)
- func (m *InMem) SetCRDDefinition(crd v1beta1.CustomResourceDefinition) error
- type PackageChannel
- type PackageManifest
- type ResourceKey
- type Source
- type SourceRef
- type SubscriptionKey
Constants ¶
const ( ConfigMapCRDName = "customResourceDefinitions" ConfigMapCSVName = "clusterServiceVersions" ConfigMapPackageName = "packages" )
Variables ¶
This section is empty.
Functions ¶
func LoadCRDFromFile ¶
func LoadCRDFromFile(m *InMem, filepath string) (*v1beta1.CustomResourceDefinition, error)
LoadCRDFromFile is a utility function for loading the CRD schemas.
func LoadCSVFromFile ¶
func LoadCSVFromFile(m *InMem, filepath string) (*v1alpha1.ClusterServiceVersion, error)
LoadCSVFromFile is a utility function for loading CSV definitions
Types ¶
type CSVAndChannelInfo ¶
type CSVAndChannelInfo struct { // CSV is the CSV found. CSV *v1alpha1.ClusterServiceVersion // Channel is the channel that "contains" this CSV, as it is declared as part of the channel. Channel PackageChannel // IsDefaultChannel returns true iff the channel is the default channel for the package. IsDefaultChannel bool }
CSVAndChannelInfo holds information about a CSV and the channel in which it lives.
type CSVMetadata ¶
CSVMetadata holds the necessary information to locate a particular CSV in the catalog
type ConfigMapCatalogResourceLoader ¶
type ConfigMapCatalogResourceLoader struct {
// contains filtered or unexported fields
}
ConfigMapCatalogResourceLoader loads a ConfigMap of resources into the in-memory catalog
func NewConfigMapCatalogResourceLoader ¶
func NewConfigMapCatalogResourceLoader(namespace string, opClient operatorclient.ClientInterface) ConfigMapCatalogResourceLoader
func (*ConfigMapCatalogResourceLoader) LoadCatalogResources ¶
func (d *ConfigMapCatalogResourceLoader) LoadCatalogResources(catalog *InMem, configMapName string) error
func (*ConfigMapCatalogResourceLoader) LoadCatalogResourcesFromConfigMap ¶
func (d *ConfigMapCatalogResourceLoader) LoadCatalogResourcesFromConfigMap(catalog *InMem, cm *v1.ConfigMap) error
type DirectoryCatalogResourceLoader ¶
type DirectoryCatalogResourceLoader struct {
Catalog *InMem
}
DirectoryCatalogResourceLoader loads a directory of resources into the in-memory catalog files ending in `.crd.yaml` will be parsed as CRDs files ending in`.clusterserviceversion.yaml` will be parsed as CRDs
func (*DirectoryCatalogResourceLoader) LoadCRDsWalkFunc ¶
func (*DirectoryCatalogResourceLoader) LoadCSVsWalkFunc ¶
func (*DirectoryCatalogResourceLoader) LoadCatalogResources ¶
func (d *DirectoryCatalogResourceLoader) LoadCatalogResources(directory string) error
func (*DirectoryCatalogResourceLoader) LoadPackagesWalkFunc ¶
type InMem ¶
type InMem struct {
// contains filtered or unexported fields
}
func NewInMemoryFromConfigMap ¶
func NewInMemoryFromConfigMap(cmClient operatorclient.ClientInterface, namespace, cmName string) (*InMem, error)
func (*InMem) AddOrReplaceService ¶
func (m *InMem) AddOrReplaceService(csv v1alpha1.ClusterServiceVersion)
AddOrReplaceService registers service into the catalog, overwriting any existing values
func (*InMem) AddPackageManifest ¶
func (m *InMem) AddPackageManifest(pkg PackageManifest) error
addPackageManifest adds a new package manifest to the in memory catalog.
func (*InMem) AllPackages ¶
func (m *InMem) AllPackages() map[string]PackageManifest
AllPackages returns all package manifests in the catalog
func (*InMem) FindCRDByKey ¶
func (m *InMem) FindCRDByKey(key CRDKey) (*v1beta1.CustomResourceDefinition, error)
FindCRDByName looks up the full CustomResourceDefinition for the resource with the given name
func (*InMem) FindCSVByName ¶
func (m *InMem) FindCSVByName(name string) (*v1alpha1.ClusterServiceVersion, error)
FindCSVByName looks up the CSV with the given name.
func (*InMem) FindCSVForPackageNameUnderChannel ¶
func (m *InMem) FindCSVForPackageNameUnderChannel(packageName string, channelName string) (*v1alpha1.ClusterServiceVersion, error)
FindCSVForPackageNameUnderChannel finds the CSV referenced by the specified channel under the package with the specified name.
func (*InMem) FindReplacementCSVForName ¶
func (m *InMem) FindReplacementCSVForName(name string) (*v1alpha1.ClusterServiceVersion, error)
FindReplacementCSVForName looks up any CSV in the catalog that replaces the given CSV, if any.
func (*InMem) FindReplacementCSVForPackageNameUnderChannel ¶
func (m *InMem) FindReplacementCSVForPackageNameUnderChannel(packageName string, channelName string, csvName string) (*v1alpha1.ClusterServiceVersion, error)
FindReplacementCSVForPackageNameUnderChannel returns the CSV that replaces the CSV with the matching CSV name, within the package and channel specified.
func (*InMem) ListLatestCSVsForCRD ¶
func (m *InMem) ListLatestCSVsForCRD(key CRDKey) ([]CSVAndChannelInfo, error)
ListLatestCSVsForCRD lists the latests versions of the service that manages the given CRD.
func (*InMem) ListServices ¶
func (m *InMem) ListServices() ([]v1alpha1.ClusterServiceVersion, error)
ListServices lists all versions of the service in the catalog
func (*InMem) SetCRDDefinition ¶
func (m *InMem) SetCRDDefinition(crd v1beta1.CustomResourceDefinition) error
SetCRDDefinition sets the full resource definition of a CRD in the stored map only sets a new definition if one is not already set
type PackageChannel ¶
type PackageChannel struct { // Name is the name of the channel, e.g. `alpha` or `stable` Name string `json:"name"` // CurrentCSVName defines a reference to the CSV holding the version of this package currently // for the channel. CurrentCSVName string `json:"currentCSV"` }
PackageChannel defines a single channel under a package, pointing to a version of that package.
func (PackageChannel) IsDefaultChannel ¶
func (pc PackageChannel) IsDefaultChannel(pm PackageManifest) bool
IsDefaultChannel returns true if the PackageChennel is the default for the PackageManifest
type PackageManifest ¶
type PackageManifest struct { // PackageName is the name of the overall package, ala `etcd`. PackageName string `json:"packageName"` // Channels are the declared channels for the package, ala `stable` or `alpha`. Channels []PackageChannel `json:"channels"` // DefaultChannelName is, if specified, the name of the default channel for the package. The // default channel will be installed if no other channel is explicitly given. If the package // has a single channel, then that channel is implicitly the default. DefaultChannelName string `json:"defaultChannel"` }
PackageManifest holds information about a package, which is a reference to one (or more) channels under a single package.
func LoadPackageFromFile ¶
func LoadPackageFromFile(m *InMem, filepath string) (*PackageManifest, error)
LoadPackageFromFile is a utility function for loading Package definitions
func (PackageManifest) GetDefaultChannel ¶
func (m PackageManifest) GetDefaultChannel() string
GetDefaultChannel gets the default channel or returns the only one if there's only one. returns empty string if it can't determine the default
type ResourceKey ¶
ResourceKey contains metadata to uniquely identify a resource
type Source ¶
type Source interface { FindCSVForPackageNameUnderChannel(packageName string, channelName string) (*v1alpha1.ClusterServiceVersion, error) FindReplacementCSVForPackageNameUnderChannel(packageName string, channelName string, csvName string) (*v1alpha1.ClusterServiceVersion, error) AllPackages() map[string]PackageManifest // Deprecated: Switch to FindReplacementCSVForPackageNameUnderChannel when the caller has package and channel // information. FindReplacementCSVForName(name string) (*v1alpha1.ClusterServiceVersion, error) FindCSVByName(name string) (*v1alpha1.ClusterServiceVersion, error) ListServices() ([]v1alpha1.ClusterServiceVersion, error) FindCRDByKey(key CRDKey) (*v1beta1.CustomResourceDefinition, error) ListLatestCSVsForCRD(key CRDKey) ([]CSVAndChannelInfo, error) }
type SourceRef ¶
type SourceRef struct { SourceKey ResourceKey Source Source }
SourceRef associates a Source with it's SourceKey