mirror of https://github.com/k3s-io/k3s
Merge pull request #45167 from deads2k/api-09-unstructured-fix
Automatic merge from submit-queue prevent panic on setting nil deletion timestamp Setting a nil deletionstamp on unstructured causes panics. This is done when preparing for create.pull/6/head
commit
c51efa9ba0
|
@ -406,6 +406,10 @@ func (u *Unstructured) GetDeletionTimestamp() *metav1.Time {
|
|||
}
|
||||
|
||||
func (u *Unstructured) SetDeletionTimestamp(timestamp *metav1.Time) {
|
||||
if timestamp == nil {
|
||||
u.setNestedField(nil, "metadata", "deletionTimestamp")
|
||||
return
|
||||
}
|
||||
ts, _ := timestamp.MarshalQueryParameter()
|
||||
u.setNestedField(ts, "metadata", "deletionTimestamp")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue