Documentation
¶
Index ¶
- Variables
- func AreCatsrcSpecsEqual(spec1 *olmv1alpha1.CatalogSourceSpec, spec2 *olmv1alpha1.CatalogSourceSpec) bool
- 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() 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 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 ¶
func PopulateGlobals() error
PopulateGlobals populates the global definitions and default config. If Dir is blank, the global definitions and config will be initialized but empty.
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