Skip to content

Commit 4a96a78

Browse files
committed
Log an error instead of panicking
1 parent 8859a42 commit 4a96a78

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/util/utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ func GVRFromType(resourceName string, expectedType interface{}) *schema.GroupVer
144144
}
145145
t, err := meta.TypeAccessor(expectedType)
146146
if err != nil {
147-
panic(err)
147+
klog.ErrorS(err, "Failed to get type accessor", "expectedType", expectedType)
148+
return nil
148149
}
149150
apiVersion := t.GetAPIVersion()
150151
g, v, found := strings.Cut(apiVersion, "/")

0 commit comments

Comments
 (0)