mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: update kubernetes in api folder
updating the kubernetes to 1.31.0 in the api folder. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
2c0e65b828
commit
63c4c05b35
29
api/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go
generated
vendored
29
api/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go
generated
vendored
@ -25,6 +25,8 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
cbor "k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct"
|
||||
|
||||
inf "gopkg.in/inf.v0"
|
||||
)
|
||||
|
||||
@ -683,6 +685,12 @@ func (q Quantity) MarshalJSON() ([]byte, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (q Quantity) MarshalCBOR() ([]byte, error) {
|
||||
// The call to String() should never return the string "<nil>" because the receiver's
|
||||
// address will never be nil.
|
||||
return cbor.Marshal(q.String())
|
||||
}
|
||||
|
||||
// ToUnstructured implements the value.UnstructuredConverter interface.
|
||||
func (q Quantity) ToUnstructured() interface{} {
|
||||
return q.String()
|
||||
@ -711,6 +719,27 @@ func (q *Quantity) UnmarshalJSON(value []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (q *Quantity) UnmarshalCBOR(value []byte) error {
|
||||
var s *string
|
||||
if err := cbor.Unmarshal(value, &s); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if s == nil {
|
||||
q.d.Dec = nil
|
||||
q.i = int64Amount{}
|
||||
return nil
|
||||
}
|
||||
|
||||
parsed, err := ParseQuantity(strings.TrimSpace(*s))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*q = parsed
|
||||
return nil
|
||||
}
|
||||
|
||||
// NewDecimalQuantity returns a new Quantity representing the given
|
||||
// value in the given format.
|
||||
func NewDecimalQuantity(b inf.Dec, format Format) *Quantity {
|
||||
|
Reference in New Issue
Block a user