Documentation
¶
Index ¶
- Variables
- func AreCatsrcSpecsEqual(spec1 *olmv1alpha1.CatalogSourceSpec, spec2 *olmv1alpha1.CatalogSourceSpec) bool
- func GetCatalogSourceImageTagOverride(versionString string) (string, error)
- func GetDefaultConfig() map[string]bool
- func GetGlobalCatalogSourceDefinitions() map[string]olmv1alpha1.CatalogSource
- func GetGlobals() (map[string]olmv1alpha1.CatalogSource, map[string]bool)
- func IsDefaultSource(name string) bool
- func PopulateGlobals(imageTagOverride string) error
- type Defaults
Constants ¶
This section is empty.
Variables ¶
var ( // Dir is the directory where the default CatalogSources definitions are // placed on disk. It will be empty if defaults are not required. Dir string )
Functions ¶
func AreCatsrcSpecsEqual ¶
func AreCatsrcSpecsEqual(spec1 *olmv1alpha1.CatalogSourceSpec, spec2 *olmv1alpha1.CatalogSourceSpec) bool
AreCatsrcSpecsEqual returns true if the Specs it receives are the same. Otherwise, the function returns false.
The function performs a case insensitive comparison of corresponding attributes.
If either of the Specs received is nil, then the function returns false.
func GetCatalogSourceImageTagOverride ¶
GetCatalogSourceImageTagOverride returns a tag of the form `v<major>.<minor>` where <major> and <minor> are the major and minor version parts of the semver argument provided through versionString, provided the version string has a major version of 4. This is used for determining what image tag to use on a default CatalogSource based on the OCP version of the cluster it is running on, given the 5.0 catalogsources will be shipped to both 4.23 and 5.0 clusters. This may be removed in 5.1+
func GetDefaultConfig ¶
GetDefaultConfig returns the global OperatorHub configuration
func GetGlobalCatalogSourceDefinitions ¶
func GetGlobalCatalogSourceDefinitions() map[string]olmv1alpha1.CatalogSource
GetGlobalCatalogSourceDefinitions returns the global CatalogSource definitions
func GetGlobals ¶
func GetGlobals() (map[string]olmv1alpha1.CatalogSource, map[string]bool)
GetGlobals returns the global CatalogSource definitions and the default config
func IsDefaultSource ¶
IsDefaultSource returns true if the given name is one of the default CatalogSources
func PopulateGlobals ¶
PopulateGlobals populates the global definitions and default config. If Dir is blank, the global definitions and config will be initialized but empty. imageTagOverride updates the image tags for the default catalogSources with the given non-empty tag.
Types ¶
type Defaults ¶
type Defaults interface {
EnsureAll(ctx context.Context, client wrapper.Client) map[string]error
Ensure(ctx context.Context, client wrapper.Client, sourceName string) error
}
Defaults is the interface that can be used to ensure the default set of CatalogSource resources are always present on cluster.
func New ¶
func New(catsrcDefinitions map[string]olmv1alpha1.CatalogSource, config map[string]bool) Defaults
New returns an instance of defaults