The latestUpdated function does not properly handle the case where a time is omitted from a ManagedFieldsEntry.
type ManagedFieldsEntry struct {
// Time is the timestamp of when the ManagedFields entry was added. The
// timestamp will also be updated if a field is added, the manager
// changes any of the owned fields value or removes a field. The
// timestamp does not update when a field is removed from the entry
// because another manager took it over.
// +optional
Time *Time `json:"time,omitempty" protobuf:"bytes,4,opt,name=time"`
This change adds a check to avoid the nil dereference.
We received a report of a panic:
The
latestUpdated
function does not properly handle the case where a time is omitted from aManagedFieldsEntry
.This change adds a check to avoid the nil dereference.