Skip to content

Commit

Permalink
Merge pull request #5228 from killianmuldoon/fix/clusterctl-panic
Browse files Browse the repository at this point in the history
🐛 Fix panic in clusterctl describe from nil reference
  • Loading branch information
k8s-ci-robot authored Sep 15, 2021
2 parents 42d2371 + 7f5451f commit 8de0995
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 8de0995

Please sign in to comment.