Open MaxMcAdam opened 2 years ago
I had this same problem. It looks like the nil Time
field is at .Status.LastUpdated
, so adding this line before doing the conversion resolved the panic for me:
// import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
opGroup.Status.LastUpdated = &metav1.Time{}
This works with the v1alpha1 types that I have tried (ClusterServiceVersion, Subscription, CatalogSource) but not OperatorGroups. I've included a minimal example to trigger the panic but it also panics when the required fields in the OperatorGroup object are filled out. For context, I am trying to use the v1 scheme to recognize an operator group yaml but create the object with a dynamic client which is why I want to convert from OperatorGroup to unstructured.