Skip to content

Commit

Permalink
add more test cases
Browse files Browse the repository at this point in the history
more testing coverage of the auto pruning functionality

references operator-framework#101
  • Loading branch information
everettraven committed Apr 7, 2022
1 parent 7a9d915 commit 6c3c9d2
Show file tree
Hide file tree
Showing 3 changed files with 331 additions and 97 deletions.
6 changes: 3 additions & 3 deletions prune/prunables.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func DefaultPodIsPruneable(obj client.Object) error {

// If the pod has Succeeded then we can remove it
if pod.Status.Phase != corev1.PodSucceeded {
return fmt.Errorf("can not prune Pod as it has not finished running")
return fmt.Errorf("can not prune Pod as it has not succeeded")
}

return nil
Expand Down Expand Up @@ -91,13 +91,13 @@ func ConvertClientObjectToKind(object client.Object, kind interface{}) error {
unstructuredObject, err := runtime.DefaultUnstructuredConverter.ToUnstructured(object)

if err != nil {
return err
return fmt.Errorf("failed to convert object to Unstructured -- %s", err)
}

err = runtime.DefaultUnstructuredConverter.FromUnstructured(unstructuredObject, kind)

if err != nil {
return err
return fmt.Errorf("failed to convert object to kind -- %s", err)
}

return nil
Expand Down
Loading

0 comments on commit 6c3c9d2

Please sign in to comment.