defaults

package
v0.0.0-...-cfb26ff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func GetDefaultConfig() map[string]bool

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

func IsDefaultSource(name string) bool

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL