Skip to content

Commit

Permalink
Fix panic in clusterctl describe from nil reference
Browse files Browse the repository at this point in the history
  • Loading branch information
killianmuldoon committed Sep 13, 2021
1 parent 846b09b commit 7f5451f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controllers/external/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ const (

// Get uses the client and reference to get an external, unstructured object.
func Get(ctx context.Context, c client.Client, ref *corev1.ObjectReference, namespace string) (*unstructured.Unstructured, error) {
if ref == nil {
return nil, errors.Errorf("cannot get object - object reference not set")
}
obj := new(unstructured.Unstructured)
obj.SetAPIVersion(ref.APIVersion)
obj.SetKind(ref.Kind)
Expand Down

0 comments on commit 7f5451f

Please sign in to comment.