1 package delete 2 3 import ( 4 "context" 5 6 "github.com/devfile/library/v2/pkg/devfile/parser" 7 corev1 "k8s.io/api/core/v1" 8 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" 9 ) 10 11 type Client interface { 12 // ListClusterResourcesToDelete lists Kubernetes resources from cluster in namespace for a given odo component. 13 // The mode indicates which component to list, either Dev, Deploy or Any (using constant labels.Component*Mode). 14 ListClusterResourcesToDelete(ctx context.Context, componentName string, namespace string, mode string) ([]unstructured.Unstructured, error) 15 // DeleteResources deletes the unstructured resources and return the resources that failed to be deleted 16 // set wait to true to wait for all the dependencies to be deleted 17 DeleteResources(resources []unstructured.Unstructured, wait bool) []unstructured.Unstructured 18 // ExecutePreStopEvents executes preStop events if any, as a precondition to deleting a devfile component deployment 19 ExecutePreStopEvents(ctx context.Context, devfileObj parser.DevfileObj, appName string, componentName string) error 20 // ListClusterResourcesToDeleteFromDevfile parses all the devfile components and returns a list of resources that are present on the cluster that can be deleted, 21 // and a bool that indicates if the devfile component has been pushed to the innerloop. 22 // The mode indicates which component to list, either Dev, Deploy or Any (using constant labels.Component*Mode). 23 ListClusterResourcesToDeleteFromDevfile(devfileObj parser.DevfileObj, appName string, componentName string, mode string) (bool, []unstructured.Unstructured, error) 24 // ListPodmanResourcesToDelete returns a list of resources that are present on podman in Dev mode that can be deleted for the given component/app, 25 // and a bool that indicates if the devfile component has been pushed to the innerloop. 26 // The mode indicates which component to list, either Dev, Deploy or Any (using constant labels.Component*Mode). 27 ListPodmanResourcesToDelete(appName string, componentName string, mode string) (isInnerLoopDeployed bool, pods []*corev1.Pod, err error) 28 } 29