products

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Reconcile(ctx context.Context, installation *integreatlyv1alpha1.RHMI, product *integreatlyv1alpha1.RHMIProductStatus, serverClient k8sclient.Client) (newPhase integreatlyv1alpha1.StatusPhase, err error)
	GetPreflightObject(ns string) runtime.Object
}

func NewReconciler

func NewReconciler(product integreatlyv1alpha1.ProductName, rc *rest.Config, configManager config.ConfigReadWriter, installation *integreatlyv1alpha1.RHMI, mgr manager.Manager) (reconciler Interface, err error)

type InterfaceMock

type InterfaceMock struct {
	// GetPreflightObjectFunc mocks the GetPreflightObject method.
	GetPreflightObjectFunc func(ns string) runtime.Object

	// ReconcileFunc mocks the Reconcile method.
	ReconcileFunc func(ctx context.Context, installation *v1alpha1.RHMI, product *v1alpha1.RHMIProductStatus, serverClient client.Client) (v1alpha1.StatusPhase, error)
	// contains filtered or unexported fields
}

InterfaceMock is a mock implementation of Interface.

    func TestSomethingThatUsesInterface(t *testing.T) {

        // make and configure a mocked Interface
        mockedInterface := &InterfaceMock{
            GetPreflightObjectFunc: func(ns string) runtime.Object {
	               panic("mock out the GetPreflightObject method")
            },
            ReconcileFunc: func(ctx context.Context, installation *v1alpha1.RHMI, product *v1alpha1.RHMIProductStatus, serverClient client.Client) (v1alpha1.StatusPhase, error) {
	               panic("mock out the Reconcile method")
            },
        }

        // use mockedInterface in code that requires Interface
        // and then make assertions.

    }

func (*InterfaceMock) GetPreflightObject

func (mock *InterfaceMock) GetPreflightObject(ns string) runtime.Object

GetPreflightObject calls GetPreflightObjectFunc.

func (*InterfaceMock) GetPreflightObjectCalls

func (mock *InterfaceMock) GetPreflightObjectCalls() []struct {
	Ns string
}

GetPreflightObjectCalls gets all the calls that were made to GetPreflightObject. Check the length with:

len(mockedInterface.GetPreflightObjectCalls())

func (*InterfaceMock) Reconcile

func (mock *InterfaceMock) Reconcile(ctx context.Context, installation *v1alpha1.RHMI, product *v1alpha1.RHMIProductStatus, serverClient client.Client) (v1alpha1.StatusPhase, error)

Reconcile calls ReconcileFunc.

func (*InterfaceMock) ReconcileCalls

func (mock *InterfaceMock) ReconcileCalls() []struct {
	Ctx          context.Context
	Installation *v1alpha1.RHMI
	Product      *v1alpha1.RHMIProductStatus
	ServerClient client.Client
}

ReconcileCalls gets all the calls that were made to Reconcile. Check the length with:

len(mockedInterface.ReconcileCalls())

type NoOp

type NoOp struct {
}

func (*NoOp) GetPreflightObject

func (n *NoOp) GetPreflightObject(ns string) runtime.Object

Jump to

Keyboard shortcuts

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