Skip to content

Commit

Permalink
Rename ListResourcesToDelete to ListClusterResourcesToDelete
Browse files Browse the repository at this point in the history
Signed-off-by: Parthvi Vala <pvala@redhat.com>
  • Loading branch information
valaparthvi committed Mar 29, 2022
1 parent f7a9b2a commit 989c4c3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions pkg/component/delete/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
)

type Client interface {
// ListResourcesToDelete lists Kubernetes resources from cluster in namespace for a given odo component
ListResourcesToDelete(componentName string, namespace string) ([]unstructured.Unstructured, error)
// ListClusterResourceToDelete lists Kubernetes resources from cluster in namespace for a given odo component
ListClusterResourceToDelete(componentName string, namespace string) ([]unstructured.Unstructured, error)
// DeleteResources deletes the unstuctured resources and return the resources that failed to be deleted
DeleteResources([]unstructured.Unstructured) []unstructured.Unstructured
// ExecutePreStopEvents executes preStop events if any, as a precondition to deleting a devfile component deployment
Expand Down
32 changes: 16 additions & 16 deletions pkg/component/delete/mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/odo/cli/delete/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (o *ComponentOptions) Run(ctx context.Context) error {
// deleteNamedComponent deletes a component given its name
func (o *ComponentOptions) deleteNamedComponent() error {
log.Info("Searching resources to delete, please wait...")
list, err := o.clientset.DeleteClient.ListResourcesToDelete(o.name, o.namespace)
list, err := o.clientset.DeleteClient.ListClusterResourceToDelete(o.name, o.namespace)
if err != nil {
return err
}
Expand Down Expand Up @@ -130,7 +130,7 @@ func (o *ComponentOptions) deleteDevfileComponent() error {
return nil
}
var remainingResources []unstructured.Unstructured
k8sResources, _ := o.clientset.DeleteClient.ListResourcesToDelete(componentName, namespace)
k8sResources, _ := o.clientset.DeleteClient.ListClusterResourceToDelete(componentName, namespace)
// get resources present in k8sResources(present on the cluster) but not in devfileResources(not present in the devfile)
for _, k8sresource := range k8sResources {
var present bool
Expand Down

0 comments on commit 989c4c3

Please sign in to comment.