mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-05 15:37:35 +00:00
Bump fxamacker/cbor/v2 to v2.7.0-beta.
This library release makes a number of behaviors configurable in ways that are required for CBOR support in Kubernetes.
This commit is contained in:
8
vendor/github.com/fxamacker/cbor/v2/simplevalue.go
generated
vendored
8
vendor/github.com/fxamacker/cbor/v2/simplevalue.go
generated
vendored
@@ -33,11 +33,11 @@ func (sv SimpleValue) MarshalCBOR() ([]byte, error) {
|
||||
// only has a single representation variant)."
|
||||
|
||||
switch {
|
||||
case sv <= 23:
|
||||
case sv <= maxSimpleValueInAdditionalInformation:
|
||||
return []byte{byte(cborTypePrimitives) | byte(sv)}, nil
|
||||
|
||||
case sv >= 32:
|
||||
return []byte{byte(cborTypePrimitives) | byte(24), byte(sv)}, nil
|
||||
case sv >= minSimpleValueIn1ByteArgument:
|
||||
return []byte{byte(cborTypePrimitives) | additionalInformationWith1ByteArgument, byte(sv)}, nil
|
||||
|
||||
default:
|
||||
return nil, &UnsupportedValueError{msg: fmt.Sprintf("SimpleValue(%d)", sv)}
|
||||
@@ -57,7 +57,7 @@ func (sv *SimpleValue) UnmarshalCBOR(data []byte) error {
|
||||
if typ != cborTypePrimitives {
|
||||
return &UnmarshalTypeError{CBORType: typ.String(), GoType: "SimpleValue"}
|
||||
}
|
||||
if ai > 24 {
|
||||
if ai > additionalInformationWith1ByteArgument {
|
||||
return &UnmarshalTypeError{CBORType: typ.String(), GoType: "SimpleValue", errorMsg: "not simple values"}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user