rebase: update kubernetes to latest

updating the kubernetes release to the
latest in main go.mod

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2024-08-19 10:01:33 +02:00
committed by mergify[bot]
parent 63c4c05b35
commit 5a66991bb3
2173 changed files with 98906 additions and 61334 deletions

View File

@ -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 {