rebase: update kubernetes and go version

update kubernetes and go version in api folder.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2024-05-15 08:55:52 +02:00
committed by mergify[bot]
parent e727bd351e
commit 6790633624
43 changed files with 4001 additions and 2233 deletions

View File

@ -236,10 +236,14 @@ func (e WithVersionEncoder) Encode(obj Object, stream io.Writer) error {
gvk = preferredGVK
}
}
kind.SetGroupVersionKind(gvk)
err = e.Encoder.Encode(obj, stream)
kind.SetGroupVersionKind(oldGVK)
return err
// The gvk only needs to be set if not already as desired.
if gvk != oldGVK {
kind.SetGroupVersionKind(gvk)
defer kind.SetGroupVersionKind(oldGVK)
}
return e.Encoder.Encode(obj, stream)
}
// WithoutVersionDecoder clears the group version kind of a deserialized object.