mirror of
https://github.com/kubernetes/sample-controller.git
synced 2026-02-15 00:07:52 +08:00
Automatic merge from submit-queue. Manual cherrypick of #65034 to 1.9: make json serializer case sensitive fixes partially https://github.com/kubernetes/kubernetes/issues/64612 This PR imports the latest jsoniterator library so that case sensitivity during unmarshalling is optional. The PR also sets Kubernetes json serializer to be case sensitive. **Release note**: ```release-note ACTION REQUIRED: Kubernetes JSON deserializer is now case-sensitive to restore compatibility with pre-1.8 servers. If your config files contains fields with wrong case, the config files will be now invalid. ``` /sig api-machinery /kind bug /assign caesarxuchao liggitt thockin sttts mbohlool Kubernetes-commit: f4cf484c2cb6056e28fb9759a3c913be3eed990a
75 lines
1.1 KiB
Go
75 lines
1.1 KiB
Go
package jsoniter
|
|
|
|
import (
|
|
"strconv"
|
|
)
|
|
|
|
type uint32Any struct {
|
|
baseAny
|
|
val uint32
|
|
}
|
|
|
|
func (any *uint32Any) LastError() error {
|
|
return nil
|
|
}
|
|
|
|
func (any *uint32Any) ValueType() ValueType {
|
|
return NumberValue
|
|
}
|
|
|
|
func (any *uint32Any) MustBeValid() Any {
|
|
return any
|
|
}
|
|
|
|
func (any *uint32Any) ToBool() bool {
|
|
return any.val != 0
|
|
}
|
|
|
|
func (any *uint32Any) ToInt() int {
|
|
return int(any.val)
|
|
}
|
|
|
|
func (any *uint32Any) ToInt32() int32 {
|
|
return int32(any.val)
|
|
}
|
|
|
|
func (any *uint32Any) ToInt64() int64 {
|
|
return int64(any.val)
|
|
}
|
|
|
|
func (any *uint32Any) ToUint() uint {
|
|
return uint(any.val)
|
|
}
|
|
|
|
func (any *uint32Any) ToUint32() uint32 {
|
|
return any.val
|
|
}
|
|
|
|
func (any *uint32Any) ToUint64() uint64 {
|
|
return uint64(any.val)
|
|
}
|
|
|
|
func (any *uint32Any) ToFloat32() float32 {
|
|
return float32(any.val)
|
|
}
|
|
|
|
func (any *uint32Any) ToFloat64() float64 {
|
|
return float64(any.val)
|
|
}
|
|
|
|
func (any *uint32Any) ToString() string {
|
|
return strconv.FormatInt(int64(any.val), 10)
|
|
}
|
|
|
|
func (any *uint32Any) WriteTo(stream *Stream) {
|
|
stream.WriteUint32(any.val)
|
|
}
|
|
|
|
func (any *uint32Any) Parse() *Iterator {
|
|
return nil
|
|
}
|
|
|
|
func (any *uint32Any) GetInterface() interface{} {
|
|
return any.val
|
|
}
|