- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for EqualitiesOrDie (0.24 sec)
-
staging/src/k8s.io/apimachinery/pkg/conversion/deep_equal.go
// go std lib. But for convenience, we expose the type here, too. type Equalities struct { reflect.Equalities } // For convenience, panics on errors func EqualitiesOrDie(funcs ...interface{}) Equalities { e := Equalities{reflect.Equalities{}} if err := e.AddFuncs(funcs...); err != nil { panic(err) } return e } // Performs a shallow copy of the equalities map
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Thu Jul 14 18:55:26 UTC 2022 - 1.3K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/api/equality/semantic.go
"k8s.io/apimachinery/pkg/labels" ) // Semantic can do semantic deep equality checks for api objects. // Example: apiequality.Semantic.DeepEqual(aPod, aPodWithNonNilButEmptyMaps) == true var Semantic = conversion.EqualitiesOrDie( func(a, b resource.Quantity) bool { // Ignore formatting, only care that numeric value stayed the same. // TODO: if we decide it's important, it should be safe to start comparing the format. //
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri Aug 04 12:02:53 UTC 2017 - 1.5K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/codec_test.go
codec := cf.LegacyCodec(schema.GroupVersion{Version: "v1"}) return s, codec } var semantic = conversion.EqualitiesOrDie( func(a, b runtimetesting.MyWeirdCustomEmbeddedVersionKindField) bool { a.APIVersion, a.ObjectKind = "", "" b.APIVersion, b.ObjectKind = "", "" return a == b }, )
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Apr 12 15:46:12 UTC 2023 - 13.2K bytes - Viewed (0) -
pkg/apis/core/helper/helpers.go
} return nonConvertibleKeys } // Semantic can do semantic deep equality checks for core objects. // Example: apiequality.Semantic.DeepEqual(aPod, aPodWithNonNilButEmptyMaps) == true var Semantic = conversion.EqualitiesOrDie( func(a, b resource.Quantity) bool { // Ignore formatting, only care that numeric value stayed the same. // TODO: if we decide it's important, it should be safe to start comparing the format. //
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sat Oct 28 07:31:28 UTC 2023 - 16.1K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/third_party/forked/golang/reflect/deep_equal.go
"reflect" "strings" ) // Equalities is a map from type to a function comparing two values of // that type. type Equalities map[reflect.Type]reflect.Value // For convenience, panics on errors func EqualitiesOrDie(funcs ...interface{}) Equalities { e := Equalities{} if err := e.AddFuncs(funcs...); err != nil { panic(err) } return e } // AddFuncs is a shortcut for multiple calls to AddFunc.
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed Jul 20 17:18:42 UTC 2022 - 10.8K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/appendixa_test.go
func TestAppendixA(t *testing.T) { hex := func(h string) []byte { b, err := hex.DecodeString(h) if err != nil { t.Fatal(err) } return b } eq := conversion.EqualitiesOrDie( // NaN float64 values are always inequal and have multiple representations. RFC 8949 // Section 4.2.2 recommends protocols not supporting NaN payloads or signaling NaNs
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Thu Feb 15 18:59:36 UTC 2024 - 15.8K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/runtime/converter_test.go
"github.com/google/go-cmp/cmp" fuzz "github.com/google/gofuzz" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var simpleEquality = conversion.EqualitiesOrDie( func(a, b time.Time) bool { return a.UTC() == b.UTC() }, ) // Define a number of test types. type A struct { A int `json:"aa,omitempty"` B string `json:"ab,omitempty"`
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Jul 11 16:02:13 UTC 2023 - 22.9K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/runtime/converter.go
DefaultUnstructuredConverter = &unstructuredConverter{ mismatchDetection: parseBool(os.Getenv("KUBE_PATCH_CONVERSION_DETECTOR")), comparison: conversion.EqualitiesOrDie( func(a, b time.Time) bool { return a.UTC() == b.UTC() }, ), } ) func parseBool(key string) bool { if len(key) == 0 { return false } value, err := strconv.ParseBool(key)
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Jul 11 16:02:13 UTC 2023 - 24.9K bytes - Viewed (0) -
pkg/controller/endpoint/endpoints_controller.go
// endpoints in Endpoints and EndpointSlice objects to avoid unnecessary updates // caused by Pod resourceVersion change. var semanticIgnoreResourceVersion = conversion.EqualitiesOrDie( func(a, b v1.ObjectReference) bool { a.ResourceVersion = "" b.ResourceVersion = "" return a == b }, ) // endpointSubsetsEqualIgnoreResourceVersion returns true if EndpointSubsets
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sat May 04 18:33:12 UTC 2024 - 26.3K bytes - Viewed (0)