mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
Allow decoding RFC 3339 CBOR strings to time.Time.
We had been relying on a bug in the library when it should have been rejected by default. That bug has been fixed and a new option added to opt-in to the behavior we need.
This commit is contained in:
parent
c4279660ca
commit
b24defacc5
@ -84,6 +84,10 @@ var Decode cbor.DecMode = func() cbor.DecMode {
|
||||
// When decoding an unrecognized tag to interface{}, return the decoded tag content
|
||||
// instead of the default, a cbor.Tag representing a (number, content) pair.
|
||||
UnrecognizedTagToAny: cbor.UnrecognizedTagContentToAny,
|
||||
|
||||
// For parity with JSON, strings can be decoded into time.Time if they are RFC 3339
|
||||
// timestamps.
|
||||
ByteStringToTime: cbor.ByteStringToTimeAllowed,
|
||||
}.DecMode()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
Loading…
Reference in New Issue
Block a user