...

Package delete

Overview ▾

Package delete is a generated GoMock package.

Index ▾

type Client
type DeleteComponentClient
    func NewDeleteComponentClient(kubeClient kclient.ClientInterface, podmanClient podman.Client, execClient exec.Client, configAutomountClient configAutomount.Client) *DeleteComponentClient
    func (do *DeleteComponentClient) DeleteResources(resources []unstructured.Unstructured, wait bool) []unstructured.Unstructured
    func (do *DeleteComponentClient) ExecutePreStopEvents(ctx context.Context, devfileObj parser.DevfileObj, appName string, componentName string) error
    func (do *DeleteComponentClient) ListClusterResourcesToDelete(ctx context.Context, componentName string, namespace string, mode string) ([]unstructured.Unstructured, error)
    func (do DeleteComponentClient) ListClusterResourcesToDeleteFromDevfile(devfileObj parser.DevfileObj, appName string, componentName string, mode string) (isInnerLoopDeployed bool, resources []unstructured.Unstructured, err error)
    func (do *DeleteComponentClient) ListPodmanResourcesToDelete(appName string, componentName string, mode string) (isInnerLoopDeployed bool, pods []*corev1.Pod, err error)
type MockClient
    func NewMockClient(ctrl *gomock.Controller) *MockClient
    func (m *MockClient) DeleteResources(resources []unstructured.Unstructured, wait bool) []unstructured.Unstructured
    func (m *MockClient) EXPECT() *MockClientMockRecorder
    func (m *MockClient) ExecutePreStopEvents(ctx context.Context, devfileObj parser.DevfileObj, appName, componentName string) error
    func (m *MockClient) ListClusterResourcesToDelete(ctx context.Context, componentName, namespace, mode string) ([]unstructured.Unstructured, error)
    func (m *MockClient) ListClusterResourcesToDeleteFromDevfile(devfileObj parser.DevfileObj, appName, componentName, mode string) (bool, []unstructured.Unstructured, error)
    func (m *MockClient) ListPodmanResourcesToDelete(appName, componentName, mode string) (bool, []*v1.Pod, error)
type MockClientMockRecorder
    func (mr *MockClientMockRecorder) DeleteResources(resources, wait interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) ExecutePreStopEvents(ctx, devfileObj, appName, componentName interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) ListClusterResourcesToDelete(ctx, componentName, namespace, mode interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) ListClusterResourcesToDeleteFromDevfile(devfileObj, appName, componentName, mode interface{}) *gomock.Call
    func (mr *MockClientMockRecorder) ListPodmanResourcesToDelete(appName, componentName, mode interface{}) *gomock.Call

Package files

delete.go interface.go mock.go

type Client

type Client interface {
    // ListClusterResourcesToDelete lists Kubernetes resources from cluster in namespace for a given odo component.
    // The mode indicates which component to list, either Dev, Deploy or Any (using constant labels.Component*Mode).
    ListClusterResourcesToDelete(ctx context.Context, componentName string, namespace string, mode string) ([]unstructured.Unstructured, error)
    // DeleteResources deletes the unstructured resources and return the resources that failed to be deleted
    // set wait to true to wait for all the dependencies to be deleted
    DeleteResources(resources []unstructured.Unstructured, wait bool) []unstructured.Unstructured
    // ExecutePreStopEvents executes preStop events if any, as a precondition to deleting a devfile component deployment
    ExecutePreStopEvents(ctx context.Context, devfileObj parser.DevfileObj, appName string, componentName string) error
    // ListClusterResourcesToDeleteFromDevfile parses all the devfile components and returns a list of resources that are present on the cluster that can be deleted,
    // and a bool that indicates if the devfile component has been pushed to the innerloop.
    // The mode indicates which component to list, either Dev, Deploy or Any (using constant labels.Component*Mode).
    ListClusterResourcesToDeleteFromDevfile(devfileObj parser.DevfileObj, appName string, componentName string, mode string) (bool, []unstructured.Unstructured, error)
    // ListPodmanResourcesToDelete returns a list of resources that are present on podman in Dev mode that can be deleted for the given component/app,
    // and a bool that indicates if the devfile component has been pushed to the innerloop.
    // The mode indicates which component to list, either Dev, Deploy or Any (using constant labels.Component*Mode).
    ListPodmanResourcesToDelete(appName string, componentName string, mode string) (isInnerLoopDeployed bool, pods []*corev1.Pod, err error)
}

type DeleteComponentClient

type DeleteComponentClient struct {
    // contains filtered or unexported fields
}

func NewDeleteComponentClient

func NewDeleteComponentClient(
    kubeClient kclient.ClientInterface,
    podmanClient podman.Client,
    execClient exec.Client,
    configAutomountClient configAutomount.Client,
) *DeleteComponentClient

func (*DeleteComponentClient) DeleteResources

func (do *DeleteComponentClient) DeleteResources(resources []unstructured.Unstructured, wait bool) []unstructured.Unstructured

func (*DeleteComponentClient) ExecutePreStopEvents

func (do *DeleteComponentClient) ExecutePreStopEvents(ctx context.Context, devfileObj parser.DevfileObj, appName string, componentName string) error

ExecutePreStopEvents executes preStop events if any, as a precondition to deleting a devfile component deployment

func (*DeleteComponentClient) ListClusterResourcesToDelete

func (do *DeleteComponentClient) ListClusterResourcesToDelete(
    ctx context.Context,
    componentName string,
    namespace string,
    mode string,
) ([]unstructured.Unstructured, error)

ListClusterResourcesToDelete lists Kubernetes resources from cluster in namespace for a given odo component It only returns resources not owned by another resource of the component, letting the garbage collector do its job

func (DeleteComponentClient) ListClusterResourcesToDeleteFromDevfile

func (do DeleteComponentClient) ListClusterResourcesToDeleteFromDevfile(devfileObj parser.DevfileObj, appName string, componentName string, mode string) (isInnerLoopDeployed bool, resources []unstructured.Unstructured, err error)

ListResourcesToDeleteFromDevfile parses all the devfile components and returns a list of resources that are present on the cluster and can be deleted Returns a Warning if an error happens communicating with the cluster

func (*DeleteComponentClient) ListPodmanResourcesToDelete

func (do *DeleteComponentClient) ListPodmanResourcesToDelete(appName string, componentName string, mode string) (isInnerLoopDeployed bool, pods []*corev1.Pod, err error)

type MockClient

MockClient is a mock of Client interface.

type MockClient struct {
    // contains filtered or unexported fields
}

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) DeleteResources

func (m *MockClient) DeleteResources(resources []unstructured.Unstructured, wait bool) []unstructured.Unstructured

DeleteResources mocks base method.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) ExecutePreStopEvents

func (m *MockClient) ExecutePreStopEvents(ctx context.Context, devfileObj parser.DevfileObj, appName, componentName string) error

ExecutePreStopEvents mocks base method.

func (*MockClient) ListClusterResourcesToDelete

func (m *MockClient) ListClusterResourcesToDelete(ctx context.Context, componentName, namespace, mode string) ([]unstructured.Unstructured, error)

ListClusterResourcesToDelete mocks base method.

func (*MockClient) ListClusterResourcesToDeleteFromDevfile

func (m *MockClient) ListClusterResourcesToDeleteFromDevfile(devfileObj parser.DevfileObj, appName, componentName, mode string) (bool, []unstructured.Unstructured, error)

ListClusterResourcesToDeleteFromDevfile mocks base method.

func (*MockClient) ListPodmanResourcesToDelete

func (m *MockClient) ListPodmanResourcesToDelete(appName, componentName, mode string) (bool, []*v1.Pod, error)

ListPodmanResourcesToDelete mocks base method.

type MockClientMockRecorder

MockClientMockRecorder is the mock recorder for MockClient.

type MockClientMockRecorder struct {
    // contains filtered or unexported fields
}

func (*MockClientMockRecorder) DeleteResources

func (mr *MockClientMockRecorder) DeleteResources(resources, wait interface{}) *gomock.Call

DeleteResources indicates an expected call of DeleteResources.

func (*MockClientMockRecorder) ExecutePreStopEvents

func (mr *MockClientMockRecorder) ExecutePreStopEvents(ctx, devfileObj, appName, componentName interface{}) *gomock.Call

ExecutePreStopEvents indicates an expected call of ExecutePreStopEvents.

func (*MockClientMockRecorder) ListClusterResourcesToDelete

func (mr *MockClientMockRecorder) ListClusterResourcesToDelete(ctx, componentName, namespace, mode interface{}) *gomock.Call

ListClusterResourcesToDelete indicates an expected call of ListClusterResourcesToDelete.

func (*MockClientMockRecorder) ListClusterResourcesToDeleteFromDevfile

func (mr *MockClientMockRecorder) ListClusterResourcesToDeleteFromDevfile(devfileObj, appName, componentName, mode interface{}) *gomock.Call

ListClusterResourcesToDeleteFromDevfile indicates an expected call of ListClusterResourcesToDeleteFromDevfile.

func (*MockClientMockRecorder) ListPodmanResourcesToDelete

func (mr *MockClientMockRecorder) ListPodmanResourcesToDelete(appName, componentName, mode interface{}) *gomock.Call

ListPodmanResourcesToDelete indicates an expected call of ListPodmanResourcesToDelete.