Documentation ¶
Index ¶
- Constants
- func GenerateRegistryConfigMapFromManifest(manifestPackageName string) (map[string]string, error)
- func GetCurrentCSVFromManifest(packageYaml string) (string, error)
- func GetFilesFromManifestAsStringList(dir string, regex string, packageYaml string) (string, error)
- func GetManifestDirEnvVar() string
- func ProcessYamlFile(path string, stringList *strings.Builder) error
- func ReadAndFormatManifestYamlFile(path string) (string, error)
- type Manager
- func (m *Manager) GetSubscriptionInstallPlans(ctx context.Context, serverClient k8sclient.Client, subName, ns string) (*coreosv1alpha1.InstallPlanList, *coreosv1alpha1.Subscription, error)
- func (m *Manager) InstallOperator(ctx context.Context, serverClient k8sclient.Client, owner ownerutil.Owner, ...) error
- type MarketplaceInterface
- type MarketplaceInterfaceMock
- func (mock *MarketplaceInterfaceMock) GetSubscriptionInstallPlans(ctx context.Context, serverClient client.Client, subName string, ns string) (*v1alpha1.InstallPlanList, *v1alpha1.Subscription, error)
- func (mock *MarketplaceInterfaceMock) GetSubscriptionInstallPlansCalls() []struct{ ... }
- func (mock *MarketplaceInterfaceMock) InstallOperator(ctx context.Context, serverClient client.Client, owner ownerutil.Owner, ...) error
- func (mock *MarketplaceInterfaceMock) InstallOperatorCalls() []struct{ ... }
- type Target
Constants ¶
const ( IntegreatlyChannel = "rhmi" CatalogSourceName = "rhmi-registry-cs" OperatorGroupName = "rhmi-registry-og" Publisher = "RHMI" )
Variables ¶
This section is empty.
Functions ¶
func GenerateRegistryConfigMapFromManifest ¶
Generates ConfigMap equivalent from a manifest package
func GetCurrentCSVFromManifest ¶
Gets the version number from the package yaml string
func GetFilesFromManifestAsStringList ¶
Get manifest files from a directory recursively matching a regex and return as a yaml string list
func GetManifestDirEnvVar ¶
func GetManifestDirEnvVar() string
Get the manifest directory for when running locally vs when in container image
func ReadAndFormatManifestYamlFile ¶
Process each line of files from manifest for correct yaml format to use in config map
Types ¶
type Manager ¶
type Manager struct{}
func NewManager ¶
func NewManager() *Manager
func (*Manager) GetSubscriptionInstallPlans ¶
func (m *Manager) GetSubscriptionInstallPlans(ctx context.Context, serverClient k8sclient.Client, subName, ns string) (*coreosv1alpha1.InstallPlanList, *coreosv1alpha1.Subscription, error)
type MarketplaceInterface ¶
type MarketplaceInterface interface { InstallOperator(ctx context.Context, serverClient k8sclient.Client, owner ownerutil.Owner, t Target, operatorGroupNamespaces []string, approvalStrategy coreosv1alpha1.Approval) error GetSubscriptionInstallPlans(ctx context.Context, serverClient k8sclient.Client, subName, ns string) (*coreosv1alpha1.InstallPlanList, *coreosv1alpha1.Subscription, error) }
type MarketplaceInterfaceMock ¶
type MarketplaceInterfaceMock struct { // GetSubscriptionInstallPlansFunc mocks the GetSubscriptionInstallPlans method. GetSubscriptionInstallPlansFunc func(ctx context.Context, serverClient client.Client, subName string, ns string) (*v1alpha1.InstallPlanList, *v1alpha1.Subscription, error) // InstallOperatorFunc mocks the InstallOperator method. InstallOperatorFunc func(ctx context.Context, serverClient client.Client, owner ownerutil.Owner, t Target, operatorGroupNamespaces []string, approvalStrategy v1alpha1.Approval) error // contains filtered or unexported fields }
MarketplaceInterfaceMock is a mock implementation of MarketplaceInterface.
func TestSomethingThatUsesMarketplaceInterface(t *testing.T) { // make and configure a mocked MarketplaceInterface mockedMarketplaceInterface := &MarketplaceInterfaceMock{ GetSubscriptionInstallPlansFunc: func(ctx context.Context, serverClient client.Client, subName string, ns string) (*v1alpha1.InstallPlanList, *v1alpha1.Subscription, error) { panic("mock out the GetSubscriptionInstallPlans method") }, InstallOperatorFunc: func(ctx context.Context, serverClient client.Client, owner ownerutil.Owner, t Target, operatorGroupNamespaces []string, approvalStrategy v1alpha1.Approval) error { panic("mock out the InstallOperator method") }, } // use mockedMarketplaceInterface in code that requires MarketplaceInterface // and then make assertions. }
func (*MarketplaceInterfaceMock) GetSubscriptionInstallPlans ¶
func (mock *MarketplaceInterfaceMock) GetSubscriptionInstallPlans(ctx context.Context, serverClient client.Client, subName string, ns string) (*v1alpha1.InstallPlanList, *v1alpha1.Subscription, error)
GetSubscriptionInstallPlans calls GetSubscriptionInstallPlansFunc.
func (*MarketplaceInterfaceMock) GetSubscriptionInstallPlansCalls ¶
func (mock *MarketplaceInterfaceMock) GetSubscriptionInstallPlansCalls() []struct { Ctx context.Context ServerClient client.Client SubName string Ns string }
GetSubscriptionInstallPlansCalls gets all the calls that were made to GetSubscriptionInstallPlans. Check the length with:
len(mockedMarketplaceInterface.GetSubscriptionInstallPlansCalls())
func (*MarketplaceInterfaceMock) InstallOperator ¶
func (mock *MarketplaceInterfaceMock) InstallOperator(ctx context.Context, serverClient client.Client, owner ownerutil.Owner, t Target, operatorGroupNamespaces []string, approvalStrategy v1alpha1.Approval) error
InstallOperator calls InstallOperatorFunc.
func (*MarketplaceInterfaceMock) InstallOperatorCalls ¶
func (mock *MarketplaceInterfaceMock) InstallOperatorCalls() []struct { Ctx context.Context ServerClient client.Client Owner ownerutil.Owner T Target OperatorGroupNamespaces []string ApprovalStrategy v1alpha1.Approval }
InstallOperatorCalls gets all the calls that were made to InstallOperator. Check the length with:
len(mockedMarketplaceInterface.InstallOperatorCalls())