Documentation
¶
Index ¶
- func BuildDatabase(manifestPath, databasePath string) error
- func BuildLayer(directory string) (string, error)
- func NewBundleProcessor() (*bundleProcessor, error)
- func NewDbLoader(dbName string, logger *logrus.Entry) (*dbLoader, error)
- func NewFlattenedProcessor() (*flattenedProcessor, error)
- func NewFormatChecker() *formatChecker
- func NewManifestDecoder(logger *log.Entry) (*manifestDecoder, error)
- type AppregistryBuildOption
- func WithAppRegistryEndpoint(s string) AppregistryBuildOption
- func WithAppRegistryOrg(s string) AppregistryBuildOption
- func WithAppender(a ImageAppender) AppregistryBuildOption
- func WithAuthToken(s string) AppregistryBuildOption
- func WithCacheDir(s string) AppregistryBuildOption
- func WithClient(c apprclient.Client) AppregistryBuildOption
- func WithDatabasePath(s string) AppregistryBuildOption
- func WithFrom(s string) AppregistryBuildOption
- func WithTo(s string) AppregistryBuildOption
- type AppregistryBuildOptions
- type AppregistryImageBuilder
- type AppregistryLoader
- type CRDKey
- type ClusterServiceVersion
- type CustomResourceDefinition
- type ImageAppendFunc
- type ImageAppender
- type Input
- type ManifestDownloader
- type ManifestYAMLParser
- type OperatorSourceSpecifier
- type Package
- type PackageChannel
- type PackageManifest
- type Processor
- type RawOperatorManifestData
- type RegistryImageBuilder
- type Source
- type StructuredOperatorManifestData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDatabase ¶ added in v1.5.0
func BuildLayer ¶ added in v1.5.0
func NewBundleProcessor ¶ added in v1.1.1
func NewBundleProcessor() (*bundleProcessor, error)
NewBundleProcessor is a bundleProcessor constructor
func NewDbLoader ¶ added in v1.1.1
func NewFlattenedProcessor ¶ added in v1.1.1
func NewFlattenedProcessor() (*flattenedProcessor, error)
func NewFormatChecker ¶ added in v1.1.1
func NewFormatChecker() *formatChecker
func NewManifestDecoder ¶ added in v1.1.1
Types ¶
type AppregistryBuildOption ¶ added in v1.5.0
type AppregistryBuildOption func(*AppregistryBuildOptions)
func WithAppRegistryEndpoint ¶ added in v1.5.0
func WithAppRegistryEndpoint(s string) AppregistryBuildOption
func WithAppRegistryOrg ¶ added in v1.5.0
func WithAppRegistryOrg(s string) AppregistryBuildOption
func WithAppender ¶ added in v1.5.0
func WithAppender(a ImageAppender) AppregistryBuildOption
func WithAuthToken ¶ added in v1.5.0
func WithAuthToken(s string) AppregistryBuildOption
func WithCacheDir ¶ added in v1.5.0
func WithCacheDir(s string) AppregistryBuildOption
func WithClient ¶ added in v1.5.4
func WithClient(c apprclient.Client) AppregistryBuildOption
func WithDatabasePath ¶ added in v1.5.0
func WithDatabasePath(s string) AppregistryBuildOption
func WithFrom ¶ added in v1.5.0
func WithFrom(s string) AppregistryBuildOption
func WithTo ¶ added in v1.5.0
func WithTo(s string) AppregistryBuildOption
type AppregistryBuildOptions ¶ added in v1.5.0
type AppregistryBuildOptions struct { Appender ImageAppender From, To string AuthToken string AppRegistryEndpoint string AppRegistryOrg string DatabasePath string CacheDir string // derived CleanOutput bool ManifestDir string DatabaseDir string Client apprclient.Client }
func DefaultAppregistryBuildOptions ¶ added in v1.5.0
func DefaultAppregistryBuildOptions() *AppregistryBuildOptions
func (*AppregistryBuildOptions) Apply ¶ added in v1.5.0
func (c *AppregistryBuildOptions) Apply(options []AppregistryBuildOption)
Apply sequentially applies the given options to the config.
func (*AppregistryBuildOptions) Complete ¶ added in v1.5.0
func (o *AppregistryBuildOptions) Complete() error
func (*AppregistryBuildOptions) ToOption ¶ added in v1.5.0
func (c *AppregistryBuildOptions) ToOption() AppregistryBuildOption
ToOption converts an AppregistryBuildOptions object into a function that applies its current configuration to another AppregistryBuildOptions instance
func (*AppregistryBuildOptions) Validate ¶ added in v1.5.0
func (o *AppregistryBuildOptions) Validate() error
type AppregistryImageBuilder ¶ added in v1.5.0
type AppregistryImageBuilder struct { Appender ImageAppender // options From, To string AuthToken string AppRegistryEndpoint string AppRegistryOrg string DatabasePath string CacheDir string // derived CleanOutput bool ManifestDir string DatabaseDir string // contains filtered or unexported fields }
func NewAppregistryImageBuilder ¶ added in v1.5.0
func NewAppregistryImageBuilder(options ...AppregistryBuildOption) (*AppregistryImageBuilder, error)
func (*AppregistryImageBuilder) Build ¶ added in v1.5.0
func (b *AppregistryImageBuilder) Build() error
type AppregistryLoader ¶
type AppregistryLoader struct {
// contains filtered or unexported fields
}
func NewLoader ¶
func NewLoader(kubeconfig string, dbName string, downloadPath string, logger *logrus.Entry) (*AppregistryLoader, error)
NewLoader returns a new instance of AppregistryLoader.
kubeconfig specifies the location of kube configuration file. dbName specifies the database name to be used for sqlite. downloadPath specifies the folder where the downloaded nested bundle(s) will be stored.
type CRDKey ¶
type CRDKey struct { Kind string `json:"kind"` Name string `json:"name"` Version string `json:"version"` }
CRDKey contains metadata needed to uniquely identify a CRD.
OLM uses CRDKey to uniquely identify a CustomResourceDefinition object. We are following the same pattern to be consistent.
func (CRDKey) String ¶
String returns a string representation of this CRDKey object with Kind, Name and Version concatenated.
CRDKey is used as the key to map of CustomResourceDefinition object(s). This function ensures that Kind, Name and Version are taken into account to compute the key associated with a CustomResourceDefinition object.
type ClusterServiceVersion ¶
type ClusterServiceVersion struct { // Type metadata. metav1.TypeMeta `json:",inline"` // Object metadata. metav1.ObjectMeta `json:"metadata"` // Spec is the raw representation of the 'spec' element of // ClusterServiceVersion object. Since we are // not interested in the content of spec we are not parsing it. Spec json.RawMessage `json:"spec"` }
ClusterServiceVersion is a structured representation of cluster service version object(s) specified inside the 'clusterServiceVersions' section of an operator manifest.
func (*ClusterServiceVersion) GetCustomResourceDefintions ¶
func (csv *ClusterServiceVersion) GetCustomResourceDefintions() (owned []*CRDKey, required []*CRDKey, err error)
GetCustomResourceDefintions returns a list of owned and required CustomResourceDefinition object(s) specified inside the 'customresourcedefinitions' section of a ClusterServiceVersion 'spec'.
owned represents the list of CRD(s) managed by this ClusterServiceVersion object. required represents the list of CRD(s) that this ClusterServiceVersion object depends on.
If owned or required is not defined in the spec then an empty list is returned respectively.
func (*ClusterServiceVersion) GetReplaces ¶
func (csv *ClusterServiceVersion) GetReplaces() (string, error)
GetReplaces returns the name of the older ClusterServiceVersion object that is replaced by this ClusterServiceVersion object.
If not defined, the function returns an empty string.
type CustomResourceDefinition ¶
type CustomResourceDefinition struct {
v1beta1.CustomResourceDefinition `json:",inline"`
}
CustomResourceDefinition is a structured representation of custom resource definition(s) specified in `customResourceDefinitions` section of an operator manifest.
func (*CustomResourceDefinition) Key ¶
func (crd *CustomResourceDefinition) Key() CRDKey
Key returns an instance of CRDKey which uniquely identifies a given CustomResourceDefinition object.
type ImageAppendFunc ¶ added in v1.5.0
func (ImageAppendFunc) Append ¶ added in v1.5.0
func (f ImageAppendFunc) Append(from, to, layer string) error
type ImageAppender ¶ added in v1.5.0
type Input ¶
type Input struct { // Sources is the set of remote operator source(s) specified where operator // manifest(s) are located. Sources []*Source // Packages is the set of package name(s) specified. Packages []*Package }
func (*Input) IsGoodToProceed ¶ added in v1.1.1
func (*Input) PackagesToMap ¶
type ManifestDownloader ¶ added in v1.5.0
type ManifestDownloader interface { // DownloadManifests downloads the manifests in a namespace into a local directory DownloadManifests(directory, namespace string) error }
ManifestDownloader is an interface that is implemented by structs that implement the DownloadManifests method.
func NewManifestDownloader ¶ added in v1.5.0
func NewManifestDownloader(client apprclient.Client) ManifestDownloader
NewDownloader is a constructor for the Downloader interface
type ManifestYAMLParser ¶
type ManifestYAMLParser interface { // Unmarshal unmarshals raw operator manifest YAML into structured // representation. // // The function accepts raw yaml specified in rawYAML and converts it into // an instance of StructuredOperatorManifestData. Unmarshal(rawYAML []byte) (marshaled *StructuredOperatorManifestData, err error) // Marshal marshals a structured representation of an operator manifest into // raw YAML representation so that it can be used to create a configMap // object for a catalog source in OLM. // // The function accepts a structured representation of operator manifest(s) // specified in marshaled and returns a raw yaml representation of it. Marshal(bundle *StructuredOperatorManifestData) (*RawOperatorManifestData, error) MarshalCSV(csv *ClusterServiceVersion) (string, error) MarshalCRD(crd *CustomResourceDefinition) (string, error) MarshalPackage(pkg *PackageManifest) (string, error) }
ManifestYAMLParser is an interface that is responsible for marshaling raw operator manifest into structured representation and vice versa.
type OperatorSourceSpecifier ¶ added in v1.1.1
OperatorSourceSpecifier interface provides capability to have different ways of specifying operator source via command line flags. This helps us maintain backward compatability.
type Package ¶ added in v1.5.8
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.
The following type has been directly copied as is from OLM. See https://github.com/operator-framework/operator-lifecycle-manager/blob/724b209ccfff33b6208cc5d05283800d6661d441/pkg/controller/registry/types.go#L105.
We use it to unmarshal 'packages/package/channels' element of an operator manifest.
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.
The following type has been copied as is from OLM. See https://github.com/operator-framework/operator-lifecycle-manager/blob/724b209ccfff33b6208cc5d05283800d6661d441/pkg/controller/registry/types.go#L78:6.
We use it to unmarshal 'packages' element of an operator manifest.
type Processor ¶ added in v1.1.1
type Processor interface {
Process(header *tar.Header, manifestName, workingDirectory string, reader io.Reader) (done bool, err error)
}
Processor is an interface that wraps the Process method.
Process is called by tar walker to notify of an element just discovered.
if done is set to true then tar walker will exit from the walk loop. Otherwise, it will continue
type RawOperatorManifestData ¶
type RawOperatorManifestData struct { // CustomResourceDefinitions is the set of custom resource definition(s) // associated with this package manifest. CustomResourceDefinitions string `yaml:"customResourceDefinitions"` // ClusterServiceVersions is the set of cluster service version(s) // associated with this package manifest. ClusterServiceVersions string `yaml:"clusterServiceVersions"` // Packages is the set of package(s) associated with this operator manifest. Packages string `yaml:"packages"` }
RawOperatorManifestData encapsulates the list of CRD(s), CSV(s) and package(s) associated with a set of manifest(s).
type RegistryImageBuilder ¶ added in v1.5.0
type RegistryImageBuilder interface {
Build() error
}
type Source ¶ added in v1.1.1
type Source struct { // Endpoint points to the base URL of remote AppRegistry server. Endpoint string // RegistryNamespace is the namespace in remote registry where the operator // metadata is located. RegistryNamespace string // Secret is the kubernetes secret object that contains the authorization // token that can be used to access private repositories. Secret types.NamespacedName }
func (*Source) IsSecretSpecified ¶ added in v1.1.1
type StructuredOperatorManifestData ¶
type StructuredOperatorManifestData struct { // CustomResourceDefinitions is the list of custom resource definition(s) // associated with this operator manifest. CustomResourceDefinitions []CustomResourceDefinition `json:"customResourceDefinitions"` // ClusterServiceVersions is the list of cluster service version(s) //associated with this operators manifest. ClusterServiceVersions []ClusterServiceVersion `json:"clusterServiceVersions"` // Packages is the list of package(s) associated with this operator manifest. Packages []PackageManifest `json:"packages"` }
StructuredOperatorManifestData is a structured representation of operator manifest(s). An operator manifest is a YAML document with the following sections: - customResourceDefinitions - clusterServiceVersions - packages
An operator manifest is unmarshaled into this type so that we can perform certain operations like, but not limited to:
- Construct a new operator manifest object to be used by a CatalogSourceConfig by combining a set of existing operator manifest(s).
- Construct a new operator manifest object by extracting a certain operator/package from a a given operator manifest.