diff --git a/go.mod b/go.mod index db3b26e53a..c638f95b86 100644 --- a/go.mod +++ b/go.mod @@ -17,16 +17,16 @@ require ( github.com/stretchr/testify v1.9.0 google.golang.org/grpc v1.67.1 google.golang.org/protobuf v1.35.1 - k8s.io/api v0.31.0 - k8s.io/apimachinery v0.31.0 + k8s.io/api v0.31.1 + k8s.io/apimachinery v0.31.1 k8s.io/apiserver v0.31.0 - k8s.io/client-go v0.31.0 + k8s.io/client-go v0.31.1 k8s.io/component-base v0.31.0 k8s.io/component-helpers v0.31.0 k8s.io/csi-translation-lib v0.31.0 k8s.io/klog/v2 v2.130.1 - sigs.k8s.io/controller-runtime v0.19.0 - sigs.k8s.io/gateway-api v1.1.0 + sigs.k8s.io/controller-runtime v0.19.1 + sigs.k8s.io/gateway-api v1.2.0 sigs.k8s.io/sig-storage-lib-external-provisioner/v10 v10.0.1 ) @@ -34,7 +34,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/onsi/ginkgo/v2 v2.21.0 github.com/onsi/gomega v1.34.2 - k8s.io/kubernetes v1.31.0 + k8s.io/kubernetes v1.31.2 ) require ( @@ -124,7 +124,7 @@ require ( gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.31.0 // indirect + k8s.io/apiextensions-apiserver v0.31.1 // indirect k8s.io/cloud-provider v0.30.0 // indirect k8s.io/controller-manager v0.31.0 // indirect k8s.io/kms v0.31.0 // indirect @@ -134,9 +134,9 @@ require ( k8s.io/mount-utils v0.31.0 // indirect k8s.io/pod-security-admission v0.31.0 // indirect k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect - sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect + sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index 4cc60e4223..af654d47d0 100644 --- a/go.sum +++ b/go.sum @@ -302,7 +302,6 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -338,25 +337,25 @@ k8s.io/kubectl v0.31.0 h1:kANwAAPVY02r4U4jARP/C+Q1sssCcN/1p9Nk+7BQKVg= k8s.io/kubectl v0.31.0/go.mod h1:pB47hhFypGsaHAPjlwrNbvhXgmuAr01ZBvAIIUaI8d4= k8s.io/kubelet v0.31.0 h1:IlfkBy7QTojGEm97GuVGhtli0HL/Pgu4AdayiF76yWo= k8s.io/kubelet v0.31.0/go.mod h1:s+OnqnfdIh14PFpUb7NgzM53WSYXcczA3w/1qSzsRc8= -k8s.io/kubernetes v1.31.0 h1:sYAB12TTWexXKp4RxqJMm/7EC+P0mNOgn4Xdj5eu7HM= -k8s.io/kubernetes v1.31.0/go.mod h1:UTpGn7nxrUrPWw5hNIYTAjodcWIvLakgHpLtfrr6GC8= +k8s.io/kubernetes v1.31.2 h1:VNSu4O7Xn5FFRsh9ePXyEPg6ucR21fOftarSdi053Gs= +k8s.io/kubernetes v1.31.2/go.mod h1:9xmT2buyTYj8TRKwRae7FcuY8k5+xlxv7VivvO0KKfs= k8s.io/mount-utils v0.31.0 h1:o+a+n6gyZ7MGc6bIERU3LeFTHbLDBiVReaDpWlJotUE= k8s.io/mount-utils v0.31.0/go.mod h1:HV/VYBUGqYUj4vt82YltzpWvgv8FPg0G9ItyInT3NPU= k8s.io/pod-security-admission v0.31.0 h1:z8lTQ1+EZ8aX+xTrDTT2Udt1b9mzci2o2L2O4TUWSUU= k8s.io/pod-security-admission v0.31.0/go.mod h1:672PutRBAIEOJJljOHDYhXiXrQDDFdB3z7hddN3Pv5c= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= -sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC0ji/Q= -sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= -sigs.k8s.io/gateway-api v1.1.0 h1:DsLDXCi6jR+Xz8/xd0Z1PYl2Pn0TyaFMOPPZIj4inDM= -sigs.k8s.io/gateway-api v1.1.0/go.mod h1:ZH4lHrL2sDi0FHZ9jjneb8kKnGzFWyrTya35sWUTrRs= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 h1:CPT0ExVicCzcpeN4baWEV2ko2Z/AsiZgEdwgcfwLgMo= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= +sigs.k8s.io/controller-runtime v0.19.1 h1:Son+Q40+Be3QWb+niBXAg2vFiYWolDjjRfO8hn/cxOk= +sigs.k8s.io/controller-runtime v0.19.1/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= +sigs.k8s.io/gateway-api v1.2.0 h1:LrToiFwtqKTKZcZtoQPTuo3FxhrrhTgzQG0Te+YGSo8= +sigs.k8s.io/gateway-api v1.2.0/go.mod h1:EpNfEXNjiYfUJypf0eZ0P5iXA9ekSGWaS1WgPaM42X0= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/sig-storage-lib-external-provisioner/v10 v10.0.1 h1:uhd7RobUnVmfkRb3gkYQh4tBOiBEBvdwW/nAthG95Rc= sigs.k8s.io/sig-storage-lib-external-provisioner/v10 v10.0.1/go.mod h1:mfQ2enu5yAHUhpNWsce9NmkqkRQsk70zQT+7KjZ+JMo= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= +sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/vendor/k8s.io/kubernetes/pkg/features/kube_features.go b/vendor/k8s.io/kubernetes/pkg/features/kube_features.go index 80a25132bc..519d448dd5 100644 --- a/vendor/k8s.io/kubernetes/pkg/features/kube_features.go +++ b/vendor/k8s.io/kubernetes/pkg/features/kube_features.go @@ -235,8 +235,7 @@ const ( // owner: @HirazawaUi // kep: http://kep.k8s.io/4004 - // alpha: v1.29 - // beta: v1.31 + // Deprecated: v1.29 (default off) // DisableNodeKubeProxyVersion disable the status.nodeInfo.kubeProxyVersion field of v1.Node DisableNodeKubeProxyVersion featuregate.Feature = "DisableNodeKubeProxyVersion" @@ -1057,7 +1056,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS DisableKubeletCloudCredentialProviders: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, - DisableNodeKubeProxyVersion: {Default: true, PreRelease: featuregate.Beta}, + DisableNodeKubeProxyVersion: {Default: false, PreRelease: featuregate.Deprecated}, // default on in 1.33 DevicePluginCDIDevices: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.33 diff --git a/vendor/k8s.io/kubernetes/test/utils/image/manifest.go b/vendor/k8s.io/kubernetes/test/utils/image/manifest.go index b93383a7a8..22de8316e8 100644 --- a/vendor/k8s.io/kubernetes/test/utils/image/manifest.go +++ b/vendor/k8s.io/kubernetes/test/utils/image/manifest.go @@ -229,7 +229,7 @@ func initImageConfigs(list RegistryList) (map[ImageID]Config, map[ImageID]Config configs[BusyBox] = Config{list.PromoterE2eRegistry, "busybox", "1.36.1-1"} configs[CudaVectorAdd] = Config{list.PromoterE2eRegistry, "cuda-vector-add", "1.0"} configs[CudaVectorAdd2] = Config{list.PromoterE2eRegistry, "cuda-vector-add", "2.3"} - configs[DistrolessIptables] = Config{list.BuildImageRegistry, "distroless-iptables", "v0.5.6"} + configs[DistrolessIptables] = Config{list.BuildImageRegistry, "distroless-iptables", "v0.5.9"} configs[Etcd] = Config{list.GcEtcdRegistry, "etcd", "3.5.15-0"} configs[Httpd] = Config{list.PromoterE2eRegistry, "httpd", "2.4.38-4"} configs[HttpdNew] = Config{list.PromoterE2eRegistry, "httpd", "2.4.39-4"} diff --git a/vendor/modules.txt b/vendor/modules.txt index 994c776d4f..be91309b44 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -658,7 +658,7 @@ gopkg.in/yaml.v2 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/api v0.31.0 => k8s.io/api v0.31.0 +# k8s.io/api v0.31.1 => k8s.io/api v0.31.0 ## explicit; go 1.22.0 k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 @@ -718,12 +718,12 @@ k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 k8s.io/api/storagemigration/v1alpha1 -# k8s.io/apiextensions-apiserver v0.31.0 => k8s.io/apiextensions-apiserver v0.31.0 +# k8s.io/apiextensions-apiserver v0.31.1 => k8s.io/apiextensions-apiserver v0.31.0 ## explicit; go 1.22.0 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/features -# k8s.io/apimachinery v0.31.0 => k8s.io/apimachinery v0.31.0 +# k8s.io/apimachinery v0.31.1 => k8s.io/apimachinery v0.31.0 ## explicit; go 1.22.0 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -941,7 +941,7 @@ k8s.io/apiserver/plugin/pkg/audit/webhook k8s.io/apiserver/plugin/pkg/authenticator/token/webhook k8s.io/apiserver/plugin/pkg/authorizer/webhook k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics -# k8s.io/client-go v0.31.0 => k8s.io/client-go v0.31.0 +# k8s.io/client-go v0.31.1 => k8s.io/client-go v0.31.0 ## explicit; go 1.22.0 k8s.io/client-go/applyconfigurations k8s.io/client-go/applyconfigurations/admissionregistration/v1 @@ -1390,7 +1390,7 @@ k8s.io/kubectl/pkg/util/podutils # k8s.io/kubelet v0.31.0 => k8s.io/kubelet v0.31.0 ## explicit; go 1.22.0 k8s.io/kubelet/pkg/apis -# k8s.io/kubernetes v1.31.0 +# k8s.io/kubernetes v1.31.2 ## explicit; go 1.22.0 k8s.io/kubernetes/pkg/api/legacyscheme k8s.io/kubernetes/pkg/api/service @@ -1479,13 +1479,13 @@ k8s.io/utils/ptr k8s.io/utils/strings k8s.io/utils/strings/slices k8s.io/utils/trace -# sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 +# sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 ## explicit; go 1.21 sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/common/metrics sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client -# sigs.k8s.io/controller-runtime v0.19.0 +# sigs.k8s.io/controller-runtime v0.19.1 ## explicit; go 1.22.0 sigs.k8s.io/controller-runtime/pkg/client sigs.k8s.io/controller-runtime/pkg/client/apiutil @@ -1494,8 +1494,9 @@ sigs.k8s.io/controller-runtime/pkg/client/interceptor sigs.k8s.io/controller-runtime/pkg/internal/field/selector sigs.k8s.io/controller-runtime/pkg/internal/objectutil sigs.k8s.io/controller-runtime/pkg/log -# sigs.k8s.io/gateway-api v1.1.0 +# sigs.k8s.io/gateway-api v1.2.0 ## explicit; go 1.22.0 +sigs.k8s.io/gateway-api/apis/applyconfiguration sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1 sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2 sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3 @@ -1536,7 +1537,7 @@ sigs.k8s.io/json/internal/golang/encoding/json sigs.k8s.io/sig-storage-lib-external-provisioner/v10/controller sigs.k8s.io/sig-storage-lib-external-provisioner/v10/controller/metrics sigs.k8s.io/sig-storage-lib-external-provisioner/v10/util -# sigs.k8s.io/structured-merge-diff/v4 v4.4.1 +# sigs.k8s.io/structured-merge-diff/v4 v4.4.2 ## explicit; go 1.13 sigs.k8s.io/structured-merge-diff/v4/fieldpath sigs.k8s.io/structured-merge-diff/v4/merge diff --git a/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client/client.pb.go b/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client/client.pb.go index da1e37c18b..0831f3e632 100644 --- a/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client/client.pb.go +++ b/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client/client.pb.go @@ -43,6 +43,7 @@ const ( PacketType_CLOSE_RSP PacketType = 3 PacketType_DATA PacketType = 4 PacketType_DIAL_CLS PacketType = 5 + PacketType_DRAIN PacketType = 6 ) // Enum value maps for PacketType. @@ -54,6 +55,7 @@ var ( 3: "CLOSE_RSP", 4: "DATA", 5: "DIAL_CLS", + 6: "DRAIN", } PacketType_value = map[string]int32{ "DIAL_REQ": 0, @@ -62,6 +64,7 @@ var ( "CLOSE_RSP": 3, "DATA": 4, "DIAL_CLS": 5, + "DRAIN": 6, } ) @@ -106,6 +109,7 @@ type Packet struct { // *Packet_CloseRequest // *Packet_CloseResponse // *Packet_CloseDial + // *Packet_Drain Payload isPacket_Payload `protobuf_oneof:"payload"` } @@ -197,6 +201,13 @@ func (x *Packet) GetCloseDial() *CloseDial { return nil } +func (x *Packet) GetDrain() *Drain { + if x, ok := x.GetPayload().(*Packet_Drain); ok { + return x.Drain + } + return nil +} + type isPacket_Payload interface { isPacket_Payload() } @@ -225,6 +236,10 @@ type Packet_CloseDial struct { CloseDial *CloseDial `protobuf:"bytes,7,opt,name=closeDial,proto3,oneof"` } +type Packet_Drain struct { + Drain *Drain `protobuf:"bytes,8,opt,name=drain,proto3,oneof"` +} + func (*Packet_DialRequest) isPacket_Payload() {} func (*Packet_DialResponse) isPacket_Payload() {} @@ -237,6 +252,8 @@ func (*Packet_CloseResponse) isPacket_Payload() {} func (*Packet_CloseDial) isPacket_Payload() {} +func (*Packet_Drain) isPacket_Payload() {} + type DialRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -522,6 +539,44 @@ func (x *CloseDial) GetRandom() int64 { return 0 } +type Drain struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Drain) Reset() { + *x = Drain{} + if protoimpl.UnsafeEnabled { + mi := &file_konnectivity_client_proto_client_client_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Drain) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Drain) ProtoMessage() {} + +func (x *Drain) ProtoReflect() protoreflect.Message { + mi := &file_konnectivity_client_proto_client_client_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Drain.ProtoReflect.Descriptor instead. +func (*Drain) Descriptor() ([]byte, []int) { + return file_konnectivity_client_proto_client_client_proto_rawDescGZIP(), []int{6} +} + type Data struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -538,7 +593,7 @@ type Data struct { func (x *Data) Reset() { *x = Data{} if protoimpl.UnsafeEnabled { - mi := &file_konnectivity_client_proto_client_client_proto_msgTypes[6] + mi := &file_konnectivity_client_proto_client_client_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -551,7 +606,7 @@ func (x *Data) String() string { func (*Data) ProtoMessage() {} func (x *Data) ProtoReflect() protoreflect.Message { - mi := &file_konnectivity_client_proto_client_client_proto_msgTypes[6] + mi := &file_konnectivity_client_proto_client_client_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -564,7 +619,7 @@ func (x *Data) ProtoReflect() protoreflect.Message { // Deprecated: Use Data.ProtoReflect.Descriptor instead. func (*Data) Descriptor() ([]byte, []int) { - return file_konnectivity_client_proto_client_client_proto_rawDescGZIP(), []int{6} + return file_konnectivity_client_proto_client_client_proto_rawDescGZIP(), []int{7} } func (x *Data) GetConnectID() int64 { @@ -594,7 +649,7 @@ var file_konnectivity_client_proto_client_client_proto_rawDesc = []byte{ 0x0a, 0x2d, 0x6b, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xd1, 0x02, 0x0a, 0x06, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1f, 0x0a, 0x04, 0x74, 0x79, + 0xf1, 0x02, 0x0a, 0x06, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x30, 0x0a, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, @@ -614,7 +669,9 @@ var file_konnectivity_client_proto_client_client_proto_rawDesc = []byte{ 0x6c, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x44, 0x69, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x44, 0x69, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x09, 0x63, - 0x6c, 0x6f, 0x73, 0x65, 0x44, 0x69, 0x61, 0x6c, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, + 0x6c, 0x6f, 0x73, 0x65, 0x44, 0x69, 0x61, 0x6c, 0x12, 0x1e, 0x0a, 0x05, 0x64, 0x72, 0x61, 0x69, + 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x44, 0x72, 0x61, 0x69, 0x6e, 0x48, + 0x00, 0x52, 0x05, 0x64, 0x72, 0x61, 0x69, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x5b, 0x0a, 0x0b, 0x44, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x18, @@ -636,26 +693,27 @@ var file_konnectivity_client_proto_client_client_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x49, 0x44, 0x22, 0x23, 0x0a, 0x09, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x44, 0x69, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x61, - 0x6e, 0x64, 0x6f, 0x6d, 0x22, 0x4e, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x2a, 0x5e, 0x0a, 0x0a, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x41, 0x4c, 0x5f, 0x52, 0x45, 0x51, 0x10, 0x00, - 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x41, 0x4c, 0x5f, 0x52, 0x53, 0x50, 0x10, 0x01, 0x12, 0x0d, - 0x0a, 0x09, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, 0x52, 0x45, 0x51, 0x10, 0x02, 0x12, 0x0d, 0x0a, - 0x09, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, 0x52, 0x53, 0x50, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, - 0x44, 0x41, 0x54, 0x41, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x41, 0x4c, 0x5f, 0x43, - 0x4c, 0x53, 0x10, 0x05, 0x32, 0x2f, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x07, 0x2e, - 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x1a, 0x07, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x22, - 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x46, 0x5a, 0x44, 0x73, 0x69, 0x67, 0x73, 0x2e, 0x6b, 0x38, - 0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x6b, 0x6f, 0x6e, - 0x6e, 0x65, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x64, 0x6f, 0x6d, 0x22, 0x07, 0x0a, 0x05, 0x44, 0x72, 0x61, 0x69, 0x6e, 0x22, 0x4e, 0x0a, + 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x2a, 0x69, 0x0a, + 0x0a, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x44, + 0x49, 0x41, 0x4c, 0x5f, 0x52, 0x45, 0x51, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x41, + 0x4c, 0x5f, 0x52, 0x53, 0x50, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4c, 0x4f, 0x53, 0x45, + 0x5f, 0x52, 0x45, 0x51, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x5f, + 0x52, 0x53, 0x50, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x41, 0x54, 0x41, 0x10, 0x04, 0x12, + 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x41, 0x4c, 0x5f, 0x43, 0x4c, 0x53, 0x10, 0x05, 0x12, 0x09, 0x0a, + 0x05, 0x44, 0x52, 0x41, 0x49, 0x4e, 0x10, 0x06, 0x32, 0x2f, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x78, + 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x78, + 0x79, 0x12, 0x07, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x1a, 0x07, 0x2e, 0x50, 0x61, 0x63, + 0x6b, 0x65, 0x74, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x46, 0x5a, 0x44, 0x73, 0x69, 0x67, + 0x73, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2f, 0x6b, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2d, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -671,7 +729,7 @@ func file_konnectivity_client_proto_client_client_proto_rawDescGZIP() []byte { } var file_konnectivity_client_proto_client_client_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_konnectivity_client_proto_client_client_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_konnectivity_client_proto_client_client_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_konnectivity_client_proto_client_client_proto_goTypes = []interface{}{ (PacketType)(0), // 0: PacketType (*Packet)(nil), // 1: Packet @@ -680,23 +738,25 @@ var file_konnectivity_client_proto_client_client_proto_goTypes = []interface{}{ (*CloseRequest)(nil), // 4: CloseRequest (*CloseResponse)(nil), // 5: CloseResponse (*CloseDial)(nil), // 6: CloseDial - (*Data)(nil), // 7: Data + (*Drain)(nil), // 7: Drain + (*Data)(nil), // 8: Data } var file_konnectivity_client_proto_client_client_proto_depIdxs = []int32{ 0, // 0: Packet.type:type_name -> PacketType 2, // 1: Packet.dialRequest:type_name -> DialRequest 3, // 2: Packet.dialResponse:type_name -> DialResponse - 7, // 3: Packet.data:type_name -> Data + 8, // 3: Packet.data:type_name -> Data 4, // 4: Packet.closeRequest:type_name -> CloseRequest 5, // 5: Packet.closeResponse:type_name -> CloseResponse 6, // 6: Packet.closeDial:type_name -> CloseDial - 1, // 7: ProxyService.Proxy:input_type -> Packet - 1, // 8: ProxyService.Proxy:output_type -> Packet - 8, // [8:9] is the sub-list for method output_type - 7, // [7:8] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 7, // 7: Packet.drain:type_name -> Drain + 1, // 8: ProxyService.Proxy:input_type -> Packet + 1, // 9: ProxyService.Proxy:output_type -> Packet + 9, // [9:10] is the sub-list for method output_type + 8, // [8:9] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_konnectivity_client_proto_client_client_proto_init() } @@ -778,6 +838,18 @@ func file_konnectivity_client_proto_client_client_proto_init() { } } file_konnectivity_client_proto_client_client_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Drain); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_konnectivity_client_proto_client_client_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Data); i { case 0: return &v.state @@ -797,6 +869,7 @@ func file_konnectivity_client_proto_client_client_proto_init() { (*Packet_CloseRequest)(nil), (*Packet_CloseResponse)(nil), (*Packet_CloseDial)(nil), + (*Packet_Drain)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -804,7 +877,7 @@ func file_konnectivity_client_proto_client_client_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_konnectivity_client_proto_client_client_proto_rawDesc, NumEnums: 1, - NumMessages: 7, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client/client.proto b/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client/client.proto index 811278e62d..006e0ac83c 100644 --- a/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client/client.proto +++ b/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client/client.proto @@ -30,6 +30,7 @@ enum PacketType { CLOSE_RSP = 3; DATA = 4; DIAL_CLS = 5; + DRAIN = 6; } message Packet { @@ -42,6 +43,7 @@ message Packet { CloseRequest closeRequest = 5; CloseResponse closeResponse = 6; CloseDial closeDial = 7; + Drain drain = 8; } } @@ -85,6 +87,11 @@ message CloseDial { int64 random = 1; } +message Drain { + // A hint from an Agent to Server that it is pending termination. + // A Server should prefer non-draining agents for new dials. +} + message Data { // connectID to connect to int64 connectID = 1; diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/client.go b/vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/client.go index 7366a18528..54f5b5d258 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/client.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/client/fake/client.go @@ -68,16 +68,21 @@ type versionedTracker struct { } type fakeClient struct { - tracker versionedTracker - scheme *runtime.Scheme + // trackerWriteLock must be acquired before writing to + // the tracker or performing reads that affect a following + // write. + trackerWriteLock sync.Mutex + tracker versionedTracker + + schemeWriteLock sync.Mutex + scheme *runtime.Scheme + restMapper meta.RESTMapper withStatusSubresource sets.Set[schema.GroupVersionKind] // indexes maps each GroupVersionKind (GVK) to the indexes registered for that GVK. // The inner map maps from index name to IndexerFunc. indexes map[schema.GroupVersionKind]map[string]client.IndexerFunc - - schemeWriteLock sync.Mutex } var _ client.WithWatch = &fakeClient{} @@ -467,6 +472,11 @@ func (t versionedTracker) updateObject(gvr schema.GroupVersionResource, obj runt switch { case allowsUnconditionalUpdate(gvk): accessor.SetResourceVersion(oldAccessor.GetResourceVersion()) + // This is needed because if the patch explicitly sets the RV to null, the client-go reaction we use + // to apply it and whose output we process here will have it unset. It is not clear why the Kubernetes + // apiserver accepts such a patch, but it does so we just copy that behavior. + // Kubernetes apiserver behavior can be checked like this: + // `kubectl patch configmap foo --patch '{"metadata":{"annotations":{"foo":"bar"},"resourceVersion":null}}' -v=9` case bytes. Contains(debug.Stack(), []byte("sigs.k8s.io/controller-runtime/pkg/client/fake.(*fakeClient).Patch")): // We apply patches using a client-go reaction that ends up calling the trackers Update. As we can't change @@ -508,7 +518,10 @@ func (c *fakeClient) Get(ctx context.Context, key client.ObjectKey, obj client.O return err } - if _, isUnstructured := obj.(runtime.Unstructured); isUnstructured { + _, isUnstructured := obj.(runtime.Unstructured) + _, isPartialObject := obj.(*metav1.PartialObjectMetadata) + + if isUnstructured || isPartialObject { gvk, err := apiutil.GVKForObject(obj, c.scheme) if err != nil { return err @@ -729,6 +742,8 @@ func (c *fakeClient) Create(ctx context.Context, obj client.Object, opts ...clie accessor.SetDeletionTimestamp(nil) } + c.trackerWriteLock.Lock() + defer c.trackerWriteLock.Unlock() return c.tracker.Create(gvr, obj, accessor.GetNamespace()) } @@ -750,6 +765,8 @@ func (c *fakeClient) Delete(ctx context.Context, obj client.Object, opts ...clie } } + c.trackerWriteLock.Lock() + defer c.trackerWriteLock.Unlock() // Check the ResourceVersion if that Precondition was specified. if delOptions.Preconditions != nil && delOptions.Preconditions.ResourceVersion != nil { name := accessor.GetName() @@ -772,7 +789,7 @@ func (c *fakeClient) Delete(ctx context.Context, obj client.Object, opts ...clie } } - return c.deleteObject(gvr, accessor) + return c.deleteObjectLocked(gvr, accessor) } func (c *fakeClient) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error { @@ -790,6 +807,9 @@ func (c *fakeClient) DeleteAllOf(ctx context.Context, obj client.Object, opts .. } } + c.trackerWriteLock.Lock() + defer c.trackerWriteLock.Unlock() + gvr, _ := meta.UnsafeGuessKindToResource(gvk) o, err := c.tracker.List(gvr, gvk, dcOptions.Namespace) if err != nil { @@ -809,7 +829,7 @@ func (c *fakeClient) DeleteAllOf(ctx context.Context, obj client.Object, opts .. if err != nil { return err } - err = c.deleteObject(gvr, accessor) + err = c.deleteObjectLocked(gvr, accessor) if err != nil { return err } @@ -839,6 +859,9 @@ func (c *fakeClient) update(obj client.Object, isStatus bool, opts ...client.Upd if err != nil { return err } + + c.trackerWriteLock.Lock() + defer c.trackerWriteLock.Unlock() return c.tracker.update(gvr, obj, accessor.GetNamespace(), isStatus, false, *updateOptions.AsUpdateOptions()) } @@ -874,6 +897,8 @@ func (c *fakeClient) patch(obj client.Object, patch client.Patch, opts ...client return err } + c.trackerWriteLock.Lock() + defer c.trackerWriteLock.Unlock() oldObj, err := c.tracker.Get(gvr, accessor.GetNamespace(), accessor.GetName()) if err != nil { return err @@ -1082,7 +1107,7 @@ func (c *fakeClient) SubResource(subResource string) client.SubResourceClient { return &fakeSubResourceClient{client: c, subResource: subResource} } -func (c *fakeClient) deleteObject(gvr schema.GroupVersionResource, accessor metav1.Object) error { +func (c *fakeClient) deleteObjectLocked(gvr schema.GroupVersionResource, accessor metav1.Object) error { old, err := c.tracker.Get(gvr, accessor.GetNamespace(), accessor.GetName()) if err == nil { oldAccessor, err := meta.Accessor(old) @@ -1164,7 +1189,7 @@ func (sw *fakeSubResourceClient) Update(ctx context.Context, obj client.Object, switch sw.subResource { case subResourceScale: - if err := sw.client.Get(ctx, client.ObjectKeyFromObject(obj), obj); err != nil { + if err := sw.client.Get(ctx, client.ObjectKeyFromObject(obj), obj.DeepCopyObject().(client.Object)); err != nil { return err } if updateOptions.SubResourceBody == nil { diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/allowedroutes.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/allowedroutes.go index 630e24ff2a..07702c8788 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/allowedroutes.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/allowedroutes.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// AllowedRoutesApplyConfiguration represents an declarative configuration of the AllowedRoutes type for use +// AllowedRoutesApplyConfiguration represents a declarative configuration of the AllowedRoutes type for use // with apply. type AllowedRoutesApplyConfiguration struct { Namespaces *RouteNamespacesApplyConfiguration `json:"namespaces,omitempty"` Kinds []RouteGroupKindApplyConfiguration `json:"kinds,omitempty"` } -// AllowedRoutesApplyConfiguration constructs an declarative configuration of the AllowedRoutes type for use with +// AllowedRoutesApplyConfiguration constructs a declarative configuration of the AllowedRoutes type for use with // apply. func AllowedRoutes() *AllowedRoutesApplyConfiguration { return &AllowedRoutesApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendobjectreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendobjectreference.go index 49487ef722..a8d9c663de 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendobjectreference.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendobjectreference.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// BackendObjectReferenceApplyConfiguration represents an declarative configuration of the BackendObjectReference type for use +// BackendObjectReferenceApplyConfiguration represents a declarative configuration of the BackendObjectReference type for use // with apply. type BackendObjectReferenceApplyConfiguration struct { Group *v1.Group `json:"group,omitempty"` @@ -32,7 +32,7 @@ type BackendObjectReferenceApplyConfiguration struct { Port *v1.PortNumber `json:"port,omitempty"` } -// BackendObjectReferenceApplyConfiguration constructs an declarative configuration of the BackendObjectReference type for use with +// BackendObjectReferenceApplyConfiguration constructs a declarative configuration of the BackendObjectReference type for use with // apply. func BackendObjectReference() *BackendObjectReferenceApplyConfiguration { return &BackendObjectReferenceApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendref.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendref.go index cbbc24c250..c30007dc86 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendref.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendref.go @@ -22,14 +22,14 @@ import ( apisv1 "sigs.k8s.io/gateway-api/apis/v1" ) -// BackendRefApplyConfiguration represents an declarative configuration of the BackendRef type for use +// BackendRefApplyConfiguration represents a declarative configuration of the BackendRef type for use // with apply. type BackendRefApplyConfiguration struct { BackendObjectReferenceApplyConfiguration `json:",inline"` Weight *int32 `json:"weight,omitempty"` } -// BackendRefApplyConfiguration constructs an declarative configuration of the BackendRef type for use with +// BackendRefApplyConfiguration constructs a declarative configuration of the BackendRef type for use with // apply. func BackendRef() *BackendRefApplyConfiguration { return &BackendRefApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/commonroutespec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/commonroutespec.go index faa727cceb..00dcfe71e2 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/commonroutespec.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/commonroutespec.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// CommonRouteSpecApplyConfiguration represents an declarative configuration of the CommonRouteSpec type for use +// CommonRouteSpecApplyConfiguration represents a declarative configuration of the CommonRouteSpec type for use // with apply. type CommonRouteSpecApplyConfiguration struct { ParentRefs []ParentReferenceApplyConfiguration `json:"parentRefs,omitempty"` } -// CommonRouteSpecApplyConfiguration constructs an declarative configuration of the CommonRouteSpec type for use with +// CommonRouteSpecApplyConfiguration constructs a declarative configuration of the CommonRouteSpec type for use with // apply. func CommonRouteSpec() *CommonRouteSpecApplyConfiguration { return &CommonRouteSpecApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/cookieconfig.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/cookieconfig.go index 7702c69a56..9280ddce51 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/cookieconfig.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/cookieconfig.go @@ -22,13 +22,13 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// CookieConfigApplyConfiguration represents an declarative configuration of the CookieConfig type for use +// CookieConfigApplyConfiguration represents a declarative configuration of the CookieConfig type for use // with apply. type CookieConfigApplyConfiguration struct { LifetimeType *v1.CookieLifetimeType `json:"lifetimeType,omitempty"` } -// CookieConfigApplyConfiguration constructs an declarative configuration of the CookieConfig type for use with +// CookieConfigApplyConfiguration constructs a declarative configuration of the CookieConfig type for use with // apply. func CookieConfig() *CookieConfigApplyConfiguration { return &CookieConfigApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/fraction.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/fraction.go new file mode 100644 index 0000000000..2c81976000 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/fraction.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// FractionApplyConfiguration represents a declarative configuration of the Fraction type for use +// with apply. +type FractionApplyConfiguration struct { + Numerator *int32 `json:"numerator,omitempty"` + Denominator *int32 `json:"denominator,omitempty"` +} + +// FractionApplyConfiguration constructs a declarative configuration of the Fraction type for use with +// apply. +func Fraction() *FractionApplyConfiguration { + return &FractionApplyConfiguration{} +} + +// WithNumerator sets the Numerator field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Numerator field is set to the value of the last call. +func (b *FractionApplyConfiguration) WithNumerator(value int32) *FractionApplyConfiguration { + b.Numerator = &value + return b +} + +// WithDenominator sets the Denominator field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Denominator field is set to the value of the last call. +func (b *FractionApplyConfiguration) WithDenominator(value int32) *FractionApplyConfiguration { + b.Denominator = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/frontendtlsvalidation.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/frontendtlsvalidation.go index 7fafdf8cea..5342400ccf 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/frontendtlsvalidation.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/frontendtlsvalidation.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// FrontendTLSValidationApplyConfiguration represents an declarative configuration of the FrontendTLSValidation type for use +// FrontendTLSValidationApplyConfiguration represents a declarative configuration of the FrontendTLSValidation type for use // with apply. type FrontendTLSValidationApplyConfiguration struct { CACertificateRefs []ObjectReferenceApplyConfiguration `json:"caCertificateRefs,omitempty"` } -// FrontendTLSValidationApplyConfiguration constructs an declarative configuration of the FrontendTLSValidation type for use with +// FrontendTLSValidationApplyConfiguration constructs a declarative configuration of the FrontendTLSValidation type for use with // apply. func FrontendTLSValidation() *FrontendTLSValidationApplyConfiguration { return &FrontendTLSValidationApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gateway.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gateway.go index befe0daff9..8e8f27e6fb 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gateway.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gateway.go @@ -23,12 +23,11 @@ import ( types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" gatewayapiapisv1 "sigs.k8s.io/gateway-api/apis/v1" ) -// GatewayApplyConfiguration represents an declarative configuration of the Gateway type for use +// GatewayApplyConfiguration represents a declarative configuration of the Gateway type for use // with apply. type GatewayApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +36,7 @@ type GatewayApplyConfiguration struct { Status *GatewayStatusApplyConfiguration `json:"status,omitempty"` } -// Gateway constructs an declarative configuration of the Gateway type for use with +// Gateway constructs a declarative configuration of the Gateway type for use with // apply. func Gateway(name, namespace string) *GatewayApplyConfiguration { b := &GatewayApplyConfiguration{} @@ -257,3 +256,9 @@ func (b *GatewayApplyConfiguration) WithStatus(value *GatewayStatusApplyConfigur b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *GatewayApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayaddress.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayaddress.go index e810a109d8..28821a7a01 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayaddress.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayaddress.go @@ -22,14 +22,14 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// GatewayAddressApplyConfiguration represents an declarative configuration of the GatewayAddress type for use +// GatewayAddressApplyConfiguration represents a declarative configuration of the GatewayAddress type for use // with apply. type GatewayAddressApplyConfiguration struct { Type *v1.AddressType `json:"type,omitempty"` Value *string `json:"value,omitempty"` } -// GatewayAddressApplyConfiguration constructs an declarative configuration of the GatewayAddress type for use with +// GatewayAddressApplyConfiguration constructs a declarative configuration of the GatewayAddress type for use with // apply. func GatewayAddress() *GatewayAddressApplyConfiguration { return &GatewayAddressApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaybackendtls.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaybackendtls.go new file mode 100644 index 0000000000..eee2550713 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaybackendtls.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// GatewayBackendTLSApplyConfiguration represents a declarative configuration of the GatewayBackendTLS type for use +// with apply. +type GatewayBackendTLSApplyConfiguration struct { + ClientCertificateRef *SecretObjectReferenceApplyConfiguration `json:"clientCertificateRef,omitempty"` +} + +// GatewayBackendTLSApplyConfiguration constructs a declarative configuration of the GatewayBackendTLS type for use with +// apply. +func GatewayBackendTLS() *GatewayBackendTLSApplyConfiguration { + return &GatewayBackendTLSApplyConfiguration{} +} + +// WithClientCertificateRef sets the ClientCertificateRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClientCertificateRef field is set to the value of the last call. +func (b *GatewayBackendTLSApplyConfiguration) WithClientCertificateRef(value *SecretObjectReferenceApplyConfiguration) *GatewayBackendTLSApplyConfiguration { + b.ClientCertificateRef = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclass.go index 63ff9600e7..7d1cfcbc5f 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclass.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclass.go @@ -23,12 +23,11 @@ import ( types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" gatewayapiapisv1 "sigs.k8s.io/gateway-api/apis/v1" ) -// GatewayClassApplyConfiguration represents an declarative configuration of the GatewayClass type for use +// GatewayClassApplyConfiguration represents a declarative configuration of the GatewayClass type for use // with apply. type GatewayClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +36,7 @@ type GatewayClassApplyConfiguration struct { Status *GatewayClassStatusApplyConfiguration `json:"status,omitempty"` } -// GatewayClass constructs an declarative configuration of the GatewayClass type for use with +// GatewayClass constructs a declarative configuration of the GatewayClass type for use with // apply. func GatewayClass(name string) *GatewayClassApplyConfiguration { b := &GatewayClassApplyConfiguration{} @@ -255,3 +254,9 @@ func (b *GatewayClassApplyConfiguration) WithStatus(value *GatewayClassStatusApp b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *GatewayClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassspec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassspec.go index 460724ff72..8591cd2138 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassspec.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassspec.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// GatewayClassSpecApplyConfiguration represents an declarative configuration of the GatewayClassSpec type for use +// GatewayClassSpecApplyConfiguration represents a declarative configuration of the GatewayClassSpec type for use // with apply. type GatewayClassSpecApplyConfiguration struct { ControllerName *v1.GatewayController `json:"controllerName,omitempty"` @@ -30,7 +30,7 @@ type GatewayClassSpecApplyConfiguration struct { Description *string `json:"description,omitempty"` } -// GatewayClassSpecApplyConfiguration constructs an declarative configuration of the GatewayClassSpec type for use with +// GatewayClassSpecApplyConfiguration constructs a declarative configuration of the GatewayClassSpec type for use with // apply. func GatewayClassSpec() *GatewayClassSpecApplyConfiguration { return &GatewayClassSpecApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassstatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassstatus.go index ba5a583179..fb3fa8df15 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassstatus.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassstatus.go @@ -20,17 +20,16 @@ package v1 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" - apisv1 "sigs.k8s.io/gateway-api/apis/v1" ) -// GatewayClassStatusApplyConfiguration represents an declarative configuration of the GatewayClassStatus type for use +// GatewayClassStatusApplyConfiguration represents a declarative configuration of the GatewayClassStatus type for use // with apply. type GatewayClassStatusApplyConfiguration struct { - Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` - SupportedFeatures []apisv1.SupportedFeature `json:"supportedFeatures,omitempty"` + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` + SupportedFeatures []SupportedFeatureApplyConfiguration `json:"supportedFeatures,omitempty"` } -// GatewayClassStatusApplyConfiguration constructs an declarative configuration of the GatewayClassStatus type for use with +// GatewayClassStatusApplyConfiguration constructs a declarative configuration of the GatewayClassStatus type for use with // apply. func GatewayClassStatus() *GatewayClassStatusApplyConfiguration { return &GatewayClassStatusApplyConfiguration{} @@ -52,9 +51,12 @@ func (b *GatewayClassStatusApplyConfiguration) WithConditions(values ...*v1.Cond // WithSupportedFeatures adds the given value to the SupportedFeatures field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the SupportedFeatures field. -func (b *GatewayClassStatusApplyConfiguration) WithSupportedFeatures(values ...apisv1.SupportedFeature) *GatewayClassStatusApplyConfiguration { +func (b *GatewayClassStatusApplyConfiguration) WithSupportedFeatures(values ...*SupportedFeatureApplyConfiguration) *GatewayClassStatusApplyConfiguration { for i := range values { - b.SupportedFeatures = append(b.SupportedFeatures, values[i]) + if values[i] == nil { + panic("nil value passed to WithSupportedFeatures") + } + b.SupportedFeatures = append(b.SupportedFeatures, *values[i]) } return b } diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayinfrastructure.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayinfrastructure.go index 43ca7e63e0..0bed1ad25c 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayinfrastructure.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayinfrastructure.go @@ -22,15 +22,15 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// GatewayInfrastructureApplyConfiguration represents an declarative configuration of the GatewayInfrastructure type for use +// GatewayInfrastructureApplyConfiguration represents a declarative configuration of the GatewayInfrastructure type for use // with apply. type GatewayInfrastructureApplyConfiguration struct { - Labels map[v1.AnnotationKey]v1.AnnotationValue `json:"labels,omitempty"` + Labels map[v1.LabelKey]v1.LabelValue `json:"labels,omitempty"` Annotations map[v1.AnnotationKey]v1.AnnotationValue `json:"annotations,omitempty"` ParametersRef *LocalParametersReferenceApplyConfiguration `json:"parametersRef,omitempty"` } -// GatewayInfrastructureApplyConfiguration constructs an declarative configuration of the GatewayInfrastructure type for use with +// GatewayInfrastructureApplyConfiguration constructs a declarative configuration of the GatewayInfrastructure type for use with // apply. func GatewayInfrastructure() *GatewayInfrastructureApplyConfiguration { return &GatewayInfrastructureApplyConfiguration{} @@ -40,9 +40,9 @@ func GatewayInfrastructure() *GatewayInfrastructureApplyConfiguration { // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. -func (b *GatewayInfrastructureApplyConfiguration) WithLabels(entries map[v1.AnnotationKey]v1.AnnotationValue) *GatewayInfrastructureApplyConfiguration { +func (b *GatewayInfrastructureApplyConfiguration) WithLabels(entries map[v1.LabelKey]v1.LabelValue) *GatewayInfrastructureApplyConfiguration { if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[v1.AnnotationKey]v1.AnnotationValue, len(entries)) + b.Labels = make(map[v1.LabelKey]v1.LabelValue, len(entries)) } for k, v := range entries { b.Labels[k] = v diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayspec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayspec.go index a3f935f651..89ff6b48b5 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayspec.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayspec.go @@ -22,16 +22,17 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// GatewaySpecApplyConfiguration represents an declarative configuration of the GatewaySpec type for use +// GatewaySpecApplyConfiguration represents a declarative configuration of the GatewaySpec type for use // with apply. type GatewaySpecApplyConfiguration struct { GatewayClassName *v1.ObjectName `json:"gatewayClassName,omitempty"` Listeners []ListenerApplyConfiguration `json:"listeners,omitempty"` Addresses []GatewayAddressApplyConfiguration `json:"addresses,omitempty"` Infrastructure *GatewayInfrastructureApplyConfiguration `json:"infrastructure,omitempty"` + BackendTLS *GatewayBackendTLSApplyConfiguration `json:"backendTLS,omitempty"` } -// GatewaySpecApplyConfiguration constructs an declarative configuration of the GatewaySpec type for use with +// GatewaySpecApplyConfiguration constructs a declarative configuration of the GatewaySpec type for use with // apply. func GatewaySpec() *GatewaySpecApplyConfiguration { return &GatewaySpecApplyConfiguration{} @@ -78,3 +79,11 @@ func (b *GatewaySpecApplyConfiguration) WithInfrastructure(value *GatewayInfrast b.Infrastructure = value return b } + +// WithBackendTLS sets the BackendTLS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BackendTLS field is set to the value of the last call. +func (b *GatewaySpecApplyConfiguration) WithBackendTLS(value *GatewayBackendTLSApplyConfiguration) *GatewaySpecApplyConfiguration { + b.BackendTLS = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatus.go index 3bb277d608..3e96cd2907 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatus.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatus.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// GatewayStatusApplyConfiguration represents an declarative configuration of the GatewayStatus type for use +// GatewayStatusApplyConfiguration represents a declarative configuration of the GatewayStatus type for use // with apply. type GatewayStatusApplyConfiguration struct { Addresses []GatewayStatusAddressApplyConfiguration `json:"addresses,omitempty"` @@ -30,7 +30,7 @@ type GatewayStatusApplyConfiguration struct { Listeners []ListenerStatusApplyConfiguration `json:"listeners,omitempty"` } -// GatewayStatusApplyConfiguration constructs an declarative configuration of the GatewayStatus type for use with +// GatewayStatusApplyConfiguration constructs a declarative configuration of the GatewayStatus type for use with // apply. func GatewayStatus() *GatewayStatusApplyConfiguration { return &GatewayStatusApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatusaddress.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatusaddress.go index b21251e107..a40b54415a 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatusaddress.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatusaddress.go @@ -22,14 +22,14 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// GatewayStatusAddressApplyConfiguration represents an declarative configuration of the GatewayStatusAddress type for use +// GatewayStatusAddressApplyConfiguration represents a declarative configuration of the GatewayStatusAddress type for use // with apply. type GatewayStatusAddressApplyConfiguration struct { Type *v1.AddressType `json:"type,omitempty"` Value *string `json:"value,omitempty"` } -// GatewayStatusAddressApplyConfiguration constructs an declarative configuration of the GatewayStatusAddress type for use with +// GatewayStatusAddressApplyConfiguration constructs a declarative configuration of the GatewayStatusAddress type for use with // apply. func GatewayStatusAddress() *GatewayStatusAddressApplyConfiguration { return &GatewayStatusAddressApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaytlsconfig.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaytlsconfig.go index 7062430197..57c76b2e89 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaytlsconfig.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaytlsconfig.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// GatewayTLSConfigApplyConfiguration represents an declarative configuration of the GatewayTLSConfig type for use +// GatewayTLSConfigApplyConfiguration represents a declarative configuration of the GatewayTLSConfig type for use // with apply. type GatewayTLSConfigApplyConfiguration struct { Mode *v1.TLSModeType `json:"mode,omitempty"` @@ -31,7 +31,7 @@ type GatewayTLSConfigApplyConfiguration struct { Options map[v1.AnnotationKey]v1.AnnotationValue `json:"options,omitempty"` } -// GatewayTLSConfigApplyConfiguration constructs an declarative configuration of the GatewayTLSConfig type for use with +// GatewayTLSConfigApplyConfiguration constructs a declarative configuration of the GatewayTLSConfig type for use with // apply. func GatewayTLSConfig() *GatewayTLSConfigApplyConfiguration { return &GatewayTLSConfigApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcbackendref.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcbackendref.go index d3d457bb65..ed8bd4edec 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcbackendref.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcbackendref.go @@ -22,14 +22,14 @@ import ( apisv1 "sigs.k8s.io/gateway-api/apis/v1" ) -// GRPCBackendRefApplyConfiguration represents an declarative configuration of the GRPCBackendRef type for use +// GRPCBackendRefApplyConfiguration represents a declarative configuration of the GRPCBackendRef type for use // with apply. type GRPCBackendRefApplyConfiguration struct { BackendRefApplyConfiguration `json:",inline"` Filters []GRPCRouteFilterApplyConfiguration `json:"filters,omitempty"` } -// GRPCBackendRefApplyConfiguration constructs an declarative configuration of the GRPCBackendRef type for use with +// GRPCBackendRefApplyConfiguration constructs a declarative configuration of the GRPCBackendRef type for use with // apply. func GRPCBackendRef() *GRPCBackendRefApplyConfiguration { return &GRPCBackendRefApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcheadermatch.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcheadermatch.go index 16b6ee4dcc..868f404874 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcheadermatch.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcheadermatch.go @@ -22,15 +22,15 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// GRPCHeaderMatchApplyConfiguration represents an declarative configuration of the GRPCHeaderMatch type for use +// GRPCHeaderMatchApplyConfiguration represents a declarative configuration of the GRPCHeaderMatch type for use // with apply. type GRPCHeaderMatchApplyConfiguration struct { - Type *v1.HeaderMatchType `json:"type,omitempty"` - Name *v1.GRPCHeaderName `json:"name,omitempty"` - Value *string `json:"value,omitempty"` + Type *v1.GRPCHeaderMatchType `json:"type,omitempty"` + Name *v1.GRPCHeaderName `json:"name,omitempty"` + Value *string `json:"value,omitempty"` } -// GRPCHeaderMatchApplyConfiguration constructs an declarative configuration of the GRPCHeaderMatch type for use with +// GRPCHeaderMatchApplyConfiguration constructs a declarative configuration of the GRPCHeaderMatch type for use with // apply. func GRPCHeaderMatch() *GRPCHeaderMatchApplyConfiguration { return &GRPCHeaderMatchApplyConfiguration{} @@ -39,7 +39,7 @@ func GRPCHeaderMatch() *GRPCHeaderMatchApplyConfiguration { // WithType sets the Type field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Type field is set to the value of the last call. -func (b *GRPCHeaderMatchApplyConfiguration) WithType(value v1.HeaderMatchType) *GRPCHeaderMatchApplyConfiguration { +func (b *GRPCHeaderMatchApplyConfiguration) WithType(value v1.GRPCHeaderMatchType) *GRPCHeaderMatchApplyConfiguration { b.Type = &value return b } diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcmethodmatch.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcmethodmatch.go index 7eefe9beb2..26e0804506 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcmethodmatch.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcmethodmatch.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// GRPCMethodMatchApplyConfiguration represents an declarative configuration of the GRPCMethodMatch type for use +// GRPCMethodMatchApplyConfiguration represents a declarative configuration of the GRPCMethodMatch type for use // with apply. type GRPCMethodMatchApplyConfiguration struct { Type *v1.GRPCMethodMatchType `json:"type,omitempty"` @@ -30,7 +30,7 @@ type GRPCMethodMatchApplyConfiguration struct { Method *string `json:"method,omitempty"` } -// GRPCMethodMatchApplyConfiguration constructs an declarative configuration of the GRPCMethodMatch type for use with +// GRPCMethodMatchApplyConfiguration constructs a declarative configuration of the GRPCMethodMatch type for use with // apply. func GRPCMethodMatch() *GRPCMethodMatchApplyConfiguration { return &GRPCMethodMatchApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroute.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroute.go index f44879a857..3c3b376dbf 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroute.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroute.go @@ -23,12 +23,11 @@ import ( types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" gatewayapiapisv1 "sigs.k8s.io/gateway-api/apis/v1" ) -// GRPCRouteApplyConfiguration represents an declarative configuration of the GRPCRoute type for use +// GRPCRouteApplyConfiguration represents a declarative configuration of the GRPCRoute type for use // with apply. type GRPCRouteApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +36,7 @@ type GRPCRouteApplyConfiguration struct { Status *GRPCRouteStatusApplyConfiguration `json:"status,omitempty"` } -// GRPCRoute constructs an declarative configuration of the GRPCRoute type for use with +// GRPCRoute constructs a declarative configuration of the GRPCRoute type for use with // apply. func GRPCRoute(name, namespace string) *GRPCRouteApplyConfiguration { b := &GRPCRouteApplyConfiguration{} @@ -257,3 +256,9 @@ func (b *GRPCRouteApplyConfiguration) WithStatus(value *GRPCRouteStatusApplyConf b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *GRPCRouteApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutefilter.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutefilter.go index f7292af6d3..80f94c947e 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutefilter.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutefilter.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// GRPCRouteFilterApplyConfiguration represents an declarative configuration of the GRPCRouteFilter type for use +// GRPCRouteFilterApplyConfiguration represents a declarative configuration of the GRPCRouteFilter type for use // with apply. type GRPCRouteFilterApplyConfiguration struct { Type *v1.GRPCRouteFilterType `json:"type,omitempty"` @@ -32,7 +32,7 @@ type GRPCRouteFilterApplyConfiguration struct { ExtensionRef *LocalObjectReferenceApplyConfiguration `json:"extensionRef,omitempty"` } -// GRPCRouteFilterApplyConfiguration constructs an declarative configuration of the GRPCRouteFilter type for use with +// GRPCRouteFilterApplyConfiguration constructs a declarative configuration of the GRPCRouteFilter type for use with // apply. func GRPCRouteFilter() *GRPCRouteFilterApplyConfiguration { return &GRPCRouteFilterApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutematch.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutematch.go index cddaef383b..1c068fd5c7 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutematch.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutematch.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// GRPCRouteMatchApplyConfiguration represents an declarative configuration of the GRPCRouteMatch type for use +// GRPCRouteMatchApplyConfiguration represents a declarative configuration of the GRPCRouteMatch type for use // with apply. type GRPCRouteMatchApplyConfiguration struct { Method *GRPCMethodMatchApplyConfiguration `json:"method,omitempty"` Headers []GRPCHeaderMatchApplyConfiguration `json:"headers,omitempty"` } -// GRPCRouteMatchApplyConfiguration constructs an declarative configuration of the GRPCRouteMatch type for use with +// GRPCRouteMatchApplyConfiguration constructs a declarative configuration of the GRPCRouteMatch type for use with // apply. func GRPCRouteMatch() *GRPCRouteMatchApplyConfiguration { return &GRPCRouteMatchApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcrouterule.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcrouterule.go index 367fe37260..447a9ccc2e 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcrouterule.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcrouterule.go @@ -18,21 +18,34 @@ limitations under the License. package v1 -// GRPCRouteRuleApplyConfiguration represents an declarative configuration of the GRPCRouteRule type for use +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GRPCRouteRuleApplyConfiguration represents a declarative configuration of the GRPCRouteRule type for use // with apply. type GRPCRouteRuleApplyConfiguration struct { + Name *v1.SectionName `json:"name,omitempty"` Matches []GRPCRouteMatchApplyConfiguration `json:"matches,omitempty"` Filters []GRPCRouteFilterApplyConfiguration `json:"filters,omitempty"` BackendRefs []GRPCBackendRefApplyConfiguration `json:"backendRefs,omitempty"` SessionPersistence *SessionPersistenceApplyConfiguration `json:"sessionPersistence,omitempty"` } -// GRPCRouteRuleApplyConfiguration constructs an declarative configuration of the GRPCRouteRule type for use with +// GRPCRouteRuleApplyConfiguration constructs a declarative configuration of the GRPCRouteRule type for use with // apply. func GRPCRouteRule() *GRPCRouteRuleApplyConfiguration { return &GRPCRouteRuleApplyConfiguration{} } +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GRPCRouteRuleApplyConfiguration) WithName(value v1.SectionName) *GRPCRouteRuleApplyConfiguration { + b.Name = &value + return b +} + // WithMatches adds the given value to the Matches field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Matches field. diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutespec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutespec.go index 666f502d1f..70c1e63741 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutespec.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutespec.go @@ -22,7 +22,7 @@ import ( apisv1 "sigs.k8s.io/gateway-api/apis/v1" ) -// GRPCRouteSpecApplyConfiguration represents an declarative configuration of the GRPCRouteSpec type for use +// GRPCRouteSpecApplyConfiguration represents a declarative configuration of the GRPCRouteSpec type for use // with apply. type GRPCRouteSpecApplyConfiguration struct { CommonRouteSpecApplyConfiguration `json:",inline"` @@ -30,7 +30,7 @@ type GRPCRouteSpecApplyConfiguration struct { Rules []GRPCRouteRuleApplyConfiguration `json:"rules,omitempty"` } -// GRPCRouteSpecApplyConfiguration constructs an declarative configuration of the GRPCRouteSpec type for use with +// GRPCRouteSpecApplyConfiguration constructs a declarative configuration of the GRPCRouteSpec type for use with // apply. func GRPCRouteSpec() *GRPCRouteSpecApplyConfiguration { return &GRPCRouteSpecApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutestatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutestatus.go index 3a5473b8b0..3ed9c24801 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutestatus.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutestatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// GRPCRouteStatusApplyConfiguration represents an declarative configuration of the GRPCRouteStatus type for use +// GRPCRouteStatusApplyConfiguration represents a declarative configuration of the GRPCRouteStatus type for use // with apply. type GRPCRouteStatusApplyConfiguration struct { RouteStatusApplyConfiguration `json:",inline"` } -// GRPCRouteStatusApplyConfiguration constructs an declarative configuration of the GRPCRouteStatus type for use with +// GRPCRouteStatusApplyConfiguration constructs a declarative configuration of the GRPCRouteStatus type for use with // apply. func GRPCRouteStatus() *GRPCRouteStatusApplyConfiguration { return &GRPCRouteStatusApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpbackendref.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpbackendref.go index 4041d9bc66..3110537f60 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpbackendref.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpbackendref.go @@ -22,14 +22,14 @@ import ( apisv1 "sigs.k8s.io/gateway-api/apis/v1" ) -// HTTPBackendRefApplyConfiguration represents an declarative configuration of the HTTPBackendRef type for use +// HTTPBackendRefApplyConfiguration represents a declarative configuration of the HTTPBackendRef type for use // with apply. type HTTPBackendRefApplyConfiguration struct { BackendRefApplyConfiguration `json:",inline"` Filters []HTTPRouteFilterApplyConfiguration `json:"filters,omitempty"` } -// HTTPBackendRefApplyConfiguration constructs an declarative configuration of the HTTPBackendRef type for use with +// HTTPBackendRefApplyConfiguration constructs a declarative configuration of the HTTPBackendRef type for use with // apply. func HTTPBackendRef() *HTTPBackendRefApplyConfiguration { return &HTTPBackendRefApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheader.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheader.go index a1c9cc915e..9a4bfc8b32 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheader.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheader.go @@ -22,14 +22,14 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// HTTPHeaderApplyConfiguration represents an declarative configuration of the HTTPHeader type for use +// HTTPHeaderApplyConfiguration represents a declarative configuration of the HTTPHeader type for use // with apply. type HTTPHeaderApplyConfiguration struct { Name *v1.HTTPHeaderName `json:"name,omitempty"` Value *string `json:"value,omitempty"` } -// HTTPHeaderApplyConfiguration constructs an declarative configuration of the HTTPHeader type for use with +// HTTPHeaderApplyConfiguration constructs a declarative configuration of the HTTPHeader type for use with // apply. func HTTPHeader() *HTTPHeaderApplyConfiguration { return &HTTPHeaderApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheaderfilter.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheaderfilter.go index f6cc5f24c3..45db46ccca 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheaderfilter.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheaderfilter.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// HTTPHeaderFilterApplyConfiguration represents an declarative configuration of the HTTPHeaderFilter type for use +// HTTPHeaderFilterApplyConfiguration represents a declarative configuration of the HTTPHeaderFilter type for use // with apply. type HTTPHeaderFilterApplyConfiguration struct { Set []HTTPHeaderApplyConfiguration `json:"set,omitempty"` @@ -26,7 +26,7 @@ type HTTPHeaderFilterApplyConfiguration struct { Remove []string `json:"remove,omitempty"` } -// HTTPHeaderFilterApplyConfiguration constructs an declarative configuration of the HTTPHeaderFilter type for use with +// HTTPHeaderFilterApplyConfiguration constructs a declarative configuration of the HTTPHeaderFilter type for use with // apply. func HTTPHeaderFilter() *HTTPHeaderFilterApplyConfiguration { return &HTTPHeaderFilterApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheadermatch.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheadermatch.go index 96abbb4f19..e2ce954a23 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheadermatch.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheadermatch.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// HTTPHeaderMatchApplyConfiguration represents an declarative configuration of the HTTPHeaderMatch type for use +// HTTPHeaderMatchApplyConfiguration represents a declarative configuration of the HTTPHeaderMatch type for use // with apply. type HTTPHeaderMatchApplyConfiguration struct { Type *v1.HeaderMatchType `json:"type,omitempty"` @@ -30,7 +30,7 @@ type HTTPHeaderMatchApplyConfiguration struct { Value *string `json:"value,omitempty"` } -// HTTPHeaderMatchApplyConfiguration constructs an declarative configuration of the HTTPHeaderMatch type for use with +// HTTPHeaderMatchApplyConfiguration constructs a declarative configuration of the HTTPHeaderMatch type for use with // apply. func HTTPHeaderMatch() *HTTPHeaderMatchApplyConfiguration { return &HTTPHeaderMatchApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmatch.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmatch.go index 985121b31b..ca21e6dfcc 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmatch.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmatch.go @@ -22,14 +22,14 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// HTTPPathMatchApplyConfiguration represents an declarative configuration of the HTTPPathMatch type for use +// HTTPPathMatchApplyConfiguration represents a declarative configuration of the HTTPPathMatch type for use // with apply. type HTTPPathMatchApplyConfiguration struct { Type *v1.PathMatchType `json:"type,omitempty"` Value *string `json:"value,omitempty"` } -// HTTPPathMatchApplyConfiguration constructs an declarative configuration of the HTTPPathMatch type for use with +// HTTPPathMatchApplyConfiguration constructs a declarative configuration of the HTTPPathMatch type for use with // apply. func HTTPPathMatch() *HTTPPathMatchApplyConfiguration { return &HTTPPathMatchApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmodifier.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmodifier.go index e675cadb0e..888f3c7f1f 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmodifier.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmodifier.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// HTTPPathModifierApplyConfiguration represents an declarative configuration of the HTTPPathModifier type for use +// HTTPPathModifierApplyConfiguration represents a declarative configuration of the HTTPPathModifier type for use // with apply. type HTTPPathModifierApplyConfiguration struct { Type *v1.HTTPPathModifierType `json:"type,omitempty"` @@ -30,7 +30,7 @@ type HTTPPathModifierApplyConfiguration struct { ReplacePrefixMatch *string `json:"replacePrefixMatch,omitempty"` } -// HTTPPathModifierApplyConfiguration constructs an declarative configuration of the HTTPPathModifier type for use with +// HTTPPathModifierApplyConfiguration constructs a declarative configuration of the HTTPPathModifier type for use with // apply. func HTTPPathModifier() *HTTPPathModifierApplyConfiguration { return &HTTPPathModifierApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpqueryparammatch.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpqueryparammatch.go index 3bc97e21b9..ccbdfe941f 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpqueryparammatch.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpqueryparammatch.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// HTTPQueryParamMatchApplyConfiguration represents an declarative configuration of the HTTPQueryParamMatch type for use +// HTTPQueryParamMatchApplyConfiguration represents a declarative configuration of the HTTPQueryParamMatch type for use // with apply. type HTTPQueryParamMatchApplyConfiguration struct { Type *v1.QueryParamMatchType `json:"type,omitempty"` @@ -30,7 +30,7 @@ type HTTPQueryParamMatchApplyConfiguration struct { Value *string `json:"value,omitempty"` } -// HTTPQueryParamMatchApplyConfiguration constructs an declarative configuration of the HTTPQueryParamMatch type for use with +// HTTPQueryParamMatchApplyConfiguration constructs a declarative configuration of the HTTPQueryParamMatch type for use with // apply. func HTTPQueryParamMatch() *HTTPQueryParamMatchApplyConfiguration { return &HTTPQueryParamMatchApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestmirrorfilter.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestmirrorfilter.go index 1809ff078a..1885cccda0 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestmirrorfilter.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestmirrorfilter.go @@ -18,13 +18,15 @@ limitations under the License. package v1 -// HTTPRequestMirrorFilterApplyConfiguration represents an declarative configuration of the HTTPRequestMirrorFilter type for use +// HTTPRequestMirrorFilterApplyConfiguration represents a declarative configuration of the HTTPRequestMirrorFilter type for use // with apply. type HTTPRequestMirrorFilterApplyConfiguration struct { BackendRef *BackendObjectReferenceApplyConfiguration `json:"backendRef,omitempty"` + Percent *int32 `json:"percent,omitempty"` + Fraction *FractionApplyConfiguration `json:"fraction,omitempty"` } -// HTTPRequestMirrorFilterApplyConfiguration constructs an declarative configuration of the HTTPRequestMirrorFilter type for use with +// HTTPRequestMirrorFilterApplyConfiguration constructs a declarative configuration of the HTTPRequestMirrorFilter type for use with // apply. func HTTPRequestMirrorFilter() *HTTPRequestMirrorFilterApplyConfiguration { return &HTTPRequestMirrorFilterApplyConfiguration{} @@ -37,3 +39,19 @@ func (b *HTTPRequestMirrorFilterApplyConfiguration) WithBackendRef(value *Backen b.BackendRef = value return b } + +// WithPercent sets the Percent field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Percent field is set to the value of the last call. +func (b *HTTPRequestMirrorFilterApplyConfiguration) WithPercent(value int32) *HTTPRequestMirrorFilterApplyConfiguration { + b.Percent = &value + return b +} + +// WithFraction sets the Fraction field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Fraction field is set to the value of the last call. +func (b *HTTPRequestMirrorFilterApplyConfiguration) WithFraction(value *FractionApplyConfiguration) *HTTPRequestMirrorFilterApplyConfiguration { + b.Fraction = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestredirectfilter.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestredirectfilter.go index c4a08c60ce..3a0c860070 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestredirectfilter.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestredirectfilter.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// HTTPRequestRedirectFilterApplyConfiguration represents an declarative configuration of the HTTPRequestRedirectFilter type for use +// HTTPRequestRedirectFilterApplyConfiguration represents a declarative configuration of the HTTPRequestRedirectFilter type for use // with apply. type HTTPRequestRedirectFilterApplyConfiguration struct { Scheme *string `json:"scheme,omitempty"` @@ -32,7 +32,7 @@ type HTTPRequestRedirectFilterApplyConfiguration struct { StatusCode *int `json:"statusCode,omitempty"` } -// HTTPRequestRedirectFilterApplyConfiguration constructs an declarative configuration of the HTTPRequestRedirectFilter type for use with +// HTTPRequestRedirectFilterApplyConfiguration constructs a declarative configuration of the HTTPRequestRedirectFilter type for use with // apply. func HTTPRequestRedirectFilter() *HTTPRequestRedirectFilterApplyConfiguration { return &HTTPRequestRedirectFilterApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproute.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproute.go index 26d94544a4..0fabf88cda 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproute.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproute.go @@ -23,12 +23,11 @@ import ( types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" gatewayapiapisv1 "sigs.k8s.io/gateway-api/apis/v1" ) -// HTTPRouteApplyConfiguration represents an declarative configuration of the HTTPRoute type for use +// HTTPRouteApplyConfiguration represents a declarative configuration of the HTTPRoute type for use // with apply. type HTTPRouteApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +36,7 @@ type HTTPRouteApplyConfiguration struct { Status *HTTPRouteStatusApplyConfiguration `json:"status,omitempty"` } -// HTTPRoute constructs an declarative configuration of the HTTPRoute type for use with +// HTTPRoute constructs a declarative configuration of the HTTPRoute type for use with // apply. func HTTPRoute(name, namespace string) *HTTPRouteApplyConfiguration { b := &HTTPRouteApplyConfiguration{} @@ -257,3 +256,9 @@ func (b *HTTPRouteApplyConfiguration) WithStatus(value *HTTPRouteStatusApplyConf b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *HTTPRouteApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutefilter.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutefilter.go index 9943ebd43b..a1c9b2e604 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutefilter.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutefilter.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// HTTPRouteFilterApplyConfiguration represents an declarative configuration of the HTTPRouteFilter type for use +// HTTPRouteFilterApplyConfiguration represents a declarative configuration of the HTTPRouteFilter type for use // with apply. type HTTPRouteFilterApplyConfiguration struct { Type *v1.HTTPRouteFilterType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type HTTPRouteFilterApplyConfiguration struct { ExtensionRef *LocalObjectReferenceApplyConfiguration `json:"extensionRef,omitempty"` } -// HTTPRouteFilterApplyConfiguration constructs an declarative configuration of the HTTPRouteFilter type for use with +// HTTPRouteFilterApplyConfiguration constructs a declarative configuration of the HTTPRouteFilter type for use with // apply. func HTTPRouteFilter() *HTTPRouteFilterApplyConfiguration { return &HTTPRouteFilterApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutematch.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutematch.go index cfc1e0fbe0..c1d34d121a 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutematch.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutematch.go @@ -22,7 +22,7 @@ import ( apisv1 "sigs.k8s.io/gateway-api/apis/v1" ) -// HTTPRouteMatchApplyConfiguration represents an declarative configuration of the HTTPRouteMatch type for use +// HTTPRouteMatchApplyConfiguration represents a declarative configuration of the HTTPRouteMatch type for use // with apply. type HTTPRouteMatchApplyConfiguration struct { Path *HTTPPathMatchApplyConfiguration `json:"path,omitempty"` @@ -31,7 +31,7 @@ type HTTPRouteMatchApplyConfiguration struct { Method *apisv1.HTTPMethod `json:"method,omitempty"` } -// HTTPRouteMatchApplyConfiguration constructs an declarative configuration of the HTTPRouteMatch type for use with +// HTTPRouteMatchApplyConfiguration constructs a declarative configuration of the HTTPRouteMatch type for use with // apply. func HTTPRouteMatch() *HTTPRouteMatchApplyConfiguration { return &HTTPRouteMatchApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprouteretry.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprouteretry.go new file mode 100644 index 0000000000..7528bccee8 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprouteretry.go @@ -0,0 +1,63 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// HTTPRouteRetryApplyConfiguration represents a declarative configuration of the HTTPRouteRetry type for use +// with apply. +type HTTPRouteRetryApplyConfiguration struct { + Codes []v1.HTTPRouteRetryStatusCode `json:"codes,omitempty"` + Attempts *int `json:"attempts,omitempty"` + Backoff *v1.Duration `json:"backoff,omitempty"` +} + +// HTTPRouteRetryApplyConfiguration constructs a declarative configuration of the HTTPRouteRetry type for use with +// apply. +func HTTPRouteRetry() *HTTPRouteRetryApplyConfiguration { + return &HTTPRouteRetryApplyConfiguration{} +} + +// WithCodes adds the given value to the Codes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Codes field. +func (b *HTTPRouteRetryApplyConfiguration) WithCodes(values ...v1.HTTPRouteRetryStatusCode) *HTTPRouteRetryApplyConfiguration { + for i := range values { + b.Codes = append(b.Codes, values[i]) + } + return b +} + +// WithAttempts sets the Attempts field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Attempts field is set to the value of the last call. +func (b *HTTPRouteRetryApplyConfiguration) WithAttempts(value int) *HTTPRouteRetryApplyConfiguration { + b.Attempts = &value + return b +} + +// WithBackoff sets the Backoff field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Backoff field is set to the value of the last call. +func (b *HTTPRouteRetryApplyConfiguration) WithBackoff(value v1.Duration) *HTTPRouteRetryApplyConfiguration { + b.Backoff = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprouterule.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprouterule.go index dcef6b12e2..b7ac89a7a8 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprouterule.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprouterule.go @@ -18,22 +18,36 @@ limitations under the License. package v1 -// HTTPRouteRuleApplyConfiguration represents an declarative configuration of the HTTPRouteRule type for use +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// HTTPRouteRuleApplyConfiguration represents a declarative configuration of the HTTPRouteRule type for use // with apply. type HTTPRouteRuleApplyConfiguration struct { + Name *v1.SectionName `json:"name,omitempty"` Matches []HTTPRouteMatchApplyConfiguration `json:"matches,omitempty"` Filters []HTTPRouteFilterApplyConfiguration `json:"filters,omitempty"` BackendRefs []HTTPBackendRefApplyConfiguration `json:"backendRefs,omitempty"` Timeouts *HTTPRouteTimeoutsApplyConfiguration `json:"timeouts,omitempty"` + Retry *HTTPRouteRetryApplyConfiguration `json:"retry,omitempty"` SessionPersistence *SessionPersistenceApplyConfiguration `json:"sessionPersistence,omitempty"` } -// HTTPRouteRuleApplyConfiguration constructs an declarative configuration of the HTTPRouteRule type for use with +// HTTPRouteRuleApplyConfiguration constructs a declarative configuration of the HTTPRouteRule type for use with // apply. func HTTPRouteRule() *HTTPRouteRuleApplyConfiguration { return &HTTPRouteRuleApplyConfiguration{} } +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *HTTPRouteRuleApplyConfiguration) WithName(value v1.SectionName) *HTTPRouteRuleApplyConfiguration { + b.Name = &value + return b +} + // WithMatches adds the given value to the Matches field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Matches field. @@ -81,6 +95,14 @@ func (b *HTTPRouteRuleApplyConfiguration) WithTimeouts(value *HTTPRouteTimeoutsA return b } +// WithRetry sets the Retry field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Retry field is set to the value of the last call. +func (b *HTTPRouteRuleApplyConfiguration) WithRetry(value *HTTPRouteRetryApplyConfiguration) *HTTPRouteRuleApplyConfiguration { + b.Retry = value + return b +} + // WithSessionPersistence sets the SessionPersistence field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SessionPersistence field is set to the value of the last call. diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutespec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutespec.go index 21c9dfd86d..e12516149a 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutespec.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutespec.go @@ -22,7 +22,7 @@ import ( apisv1 "sigs.k8s.io/gateway-api/apis/v1" ) -// HTTPRouteSpecApplyConfiguration represents an declarative configuration of the HTTPRouteSpec type for use +// HTTPRouteSpecApplyConfiguration represents a declarative configuration of the HTTPRouteSpec type for use // with apply. type HTTPRouteSpecApplyConfiguration struct { CommonRouteSpecApplyConfiguration `json:",inline"` @@ -30,7 +30,7 @@ type HTTPRouteSpecApplyConfiguration struct { Rules []HTTPRouteRuleApplyConfiguration `json:"rules,omitempty"` } -// HTTPRouteSpecApplyConfiguration constructs an declarative configuration of the HTTPRouteSpec type for use with +// HTTPRouteSpecApplyConfiguration constructs a declarative configuration of the HTTPRouteSpec type for use with // apply. func HTTPRouteSpec() *HTTPRouteSpecApplyConfiguration { return &HTTPRouteSpecApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutestatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutestatus.go index 5d87f89ec5..d7fce10d1e 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutestatus.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutestatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// HTTPRouteStatusApplyConfiguration represents an declarative configuration of the HTTPRouteStatus type for use +// HTTPRouteStatusApplyConfiguration represents a declarative configuration of the HTTPRouteStatus type for use // with apply. type HTTPRouteStatusApplyConfiguration struct { RouteStatusApplyConfiguration `json:",inline"` } -// HTTPRouteStatusApplyConfiguration constructs an declarative configuration of the HTTPRouteStatus type for use with +// HTTPRouteStatusApplyConfiguration constructs a declarative configuration of the HTTPRouteStatus type for use with // apply. func HTTPRouteStatus() *HTTPRouteStatusApplyConfiguration { return &HTTPRouteStatusApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutetimeouts.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutetimeouts.go index 4594ff17d3..98a1a9909a 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutetimeouts.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutetimeouts.go @@ -22,14 +22,14 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// HTTPRouteTimeoutsApplyConfiguration represents an declarative configuration of the HTTPRouteTimeouts type for use +// HTTPRouteTimeoutsApplyConfiguration represents a declarative configuration of the HTTPRouteTimeouts type for use // with apply. type HTTPRouteTimeoutsApplyConfiguration struct { Request *v1.Duration `json:"request,omitempty"` BackendRequest *v1.Duration `json:"backendRequest,omitempty"` } -// HTTPRouteTimeoutsApplyConfiguration constructs an declarative configuration of the HTTPRouteTimeouts type for use with +// HTTPRouteTimeoutsApplyConfiguration constructs a declarative configuration of the HTTPRouteTimeouts type for use with // apply. func HTTPRouteTimeouts() *HTTPRouteTimeoutsApplyConfiguration { return &HTTPRouteTimeoutsApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpurlrewritefilter.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpurlrewritefilter.go index cf8e0130cb..9761c24c28 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpurlrewritefilter.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpurlrewritefilter.go @@ -22,14 +22,14 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// HTTPURLRewriteFilterApplyConfiguration represents an declarative configuration of the HTTPURLRewriteFilter type for use +// HTTPURLRewriteFilterApplyConfiguration represents a declarative configuration of the HTTPURLRewriteFilter type for use // with apply. type HTTPURLRewriteFilterApplyConfiguration struct { Hostname *v1.PreciseHostname `json:"hostname,omitempty"` Path *HTTPPathModifierApplyConfiguration `json:"path,omitempty"` } -// HTTPURLRewriteFilterApplyConfiguration constructs an declarative configuration of the HTTPURLRewriteFilter type for use with +// HTTPURLRewriteFilterApplyConfiguration constructs a declarative configuration of the HTTPURLRewriteFilter type for use with // apply. func HTTPURLRewriteFilter() *HTTPURLRewriteFilterApplyConfiguration { return &HTTPURLRewriteFilterApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listener.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listener.go index b65c09030c..5301fa46de 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listener.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listener.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// ListenerApplyConfiguration represents an declarative configuration of the Listener type for use +// ListenerApplyConfiguration represents a declarative configuration of the Listener type for use // with apply. type ListenerApplyConfiguration struct { Name *v1.SectionName `json:"name,omitempty"` @@ -33,7 +33,7 @@ type ListenerApplyConfiguration struct { AllowedRoutes *AllowedRoutesApplyConfiguration `json:"allowedRoutes,omitempty"` } -// ListenerApplyConfiguration constructs an declarative configuration of the Listener type for use with +// ListenerApplyConfiguration constructs a declarative configuration of the Listener type for use with // apply. func Listener() *ListenerApplyConfiguration { return &ListenerApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listenerstatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listenerstatus.go index 4e4054ec9f..88a877c6dc 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listenerstatus.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listenerstatus.go @@ -20,11 +20,10 @@ package v1 import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" - v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// ListenerStatusApplyConfiguration represents an declarative configuration of the ListenerStatus type for use +// ListenerStatusApplyConfiguration represents a declarative configuration of the ListenerStatus type for use // with apply. type ListenerStatusApplyConfiguration struct { Name *v1.SectionName `json:"name,omitempty"` @@ -33,7 +32,7 @@ type ListenerStatusApplyConfiguration struct { Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` } -// ListenerStatusApplyConfiguration constructs an declarative configuration of the ListenerStatus type for use with +// ListenerStatusApplyConfiguration constructs a declarative configuration of the ListenerStatus type for use with // apply. func ListenerStatus() *ListenerStatusApplyConfiguration { return &ListenerStatusApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localobjectreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localobjectreference.go index 1bb4b9a816..7d7c7a121b 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localobjectreference.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localobjectreference.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// LocalObjectReferenceApplyConfiguration represents an declarative configuration of the LocalObjectReference type for use +// LocalObjectReferenceApplyConfiguration represents a declarative configuration of the LocalObjectReference type for use // with apply. type LocalObjectReferenceApplyConfiguration struct { Group *v1.Group `json:"group,omitempty"` @@ -30,7 +30,7 @@ type LocalObjectReferenceApplyConfiguration struct { Name *v1.ObjectName `json:"name,omitempty"` } -// LocalObjectReferenceApplyConfiguration constructs an declarative configuration of the LocalObjectReference type for use with +// LocalObjectReferenceApplyConfiguration constructs a declarative configuration of the LocalObjectReference type for use with // apply. func LocalObjectReference() *LocalObjectReferenceApplyConfiguration { return &LocalObjectReferenceApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localparametersreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localparametersreference.go index d15c55b776..cde618b044 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localparametersreference.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localparametersreference.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// LocalParametersReferenceApplyConfiguration represents an declarative configuration of the LocalParametersReference type for use +// LocalParametersReferenceApplyConfiguration represents a declarative configuration of the LocalParametersReference type for use // with apply. type LocalParametersReferenceApplyConfiguration struct { Group *v1.Group `json:"group,omitempty"` @@ -30,7 +30,7 @@ type LocalParametersReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// LocalParametersReferenceApplyConfiguration constructs an declarative configuration of the LocalParametersReference type for use with +// LocalParametersReferenceApplyConfiguration constructs a declarative configuration of the LocalParametersReference type for use with // apply. func LocalParametersReference() *LocalParametersReferenceApplyConfiguration { return &LocalParametersReferenceApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/objectreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/objectreference.go index 4580fe61a9..b35f2eaf02 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/objectreference.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/objectreference.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// ObjectReferenceApplyConfiguration represents an declarative configuration of the ObjectReference type for use +// ObjectReferenceApplyConfiguration represents a declarative configuration of the ObjectReference type for use // with apply. type ObjectReferenceApplyConfiguration struct { Group *v1.Group `json:"group,omitempty"` @@ -31,7 +31,7 @@ type ObjectReferenceApplyConfiguration struct { Namespace *v1.Namespace `json:"namespace,omitempty"` } -// ObjectReferenceApplyConfiguration constructs an declarative configuration of the ObjectReference type for use with +// ObjectReferenceApplyConfiguration constructs a declarative configuration of the ObjectReference type for use with // apply. func ObjectReference() *ObjectReferenceApplyConfiguration { return &ObjectReferenceApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parametersreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parametersreference.go index b7a3ae27dc..2f245e5373 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parametersreference.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parametersreference.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// ParametersReferenceApplyConfiguration represents an declarative configuration of the ParametersReference type for use +// ParametersReferenceApplyConfiguration represents a declarative configuration of the ParametersReference type for use // with apply. type ParametersReferenceApplyConfiguration struct { Group *v1.Group `json:"group,omitempty"` @@ -31,7 +31,7 @@ type ParametersReferenceApplyConfiguration struct { Namespace *v1.Namespace `json:"namespace,omitempty"` } -// ParametersReferenceApplyConfiguration constructs an declarative configuration of the ParametersReference type for use with +// ParametersReferenceApplyConfiguration constructs a declarative configuration of the ParametersReference type for use with // apply. func ParametersReference() *ParametersReferenceApplyConfiguration { return &ParametersReferenceApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parentreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parentreference.go index 2c39a83441..612dd2afab 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parentreference.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parentreference.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// ParentReferenceApplyConfiguration represents an declarative configuration of the ParentReference type for use +// ParentReferenceApplyConfiguration represents a declarative configuration of the ParentReference type for use // with apply. type ParentReferenceApplyConfiguration struct { Group *v1.Group `json:"group,omitempty"` @@ -33,7 +33,7 @@ type ParentReferenceApplyConfiguration struct { Port *v1.PortNumber `json:"port,omitempty"` } -// ParentReferenceApplyConfiguration constructs an declarative configuration of the ParentReference type for use with +// ParentReferenceApplyConfiguration constructs a declarative configuration of the ParentReference type for use with // apply. func ParentReference() *ParentReferenceApplyConfiguration { return &ParentReferenceApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routegroupkind.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routegroupkind.go index 84a9b57a2e..470ae4074f 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routegroupkind.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routegroupkind.go @@ -22,14 +22,14 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// RouteGroupKindApplyConfiguration represents an declarative configuration of the RouteGroupKind type for use +// RouteGroupKindApplyConfiguration represents a declarative configuration of the RouteGroupKind type for use // with apply. type RouteGroupKindApplyConfiguration struct { Group *v1.Group `json:"group,omitempty"` Kind *v1.Kind `json:"kind,omitempty"` } -// RouteGroupKindApplyConfiguration constructs an declarative configuration of the RouteGroupKind type for use with +// RouteGroupKindApplyConfiguration constructs a declarative configuration of the RouteGroupKind type for use with // apply. func RouteGroupKind() *RouteGroupKindApplyConfiguration { return &RouteGroupKindApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routenamespaces.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routenamespaces.go index 9b60a56130..33a172897c 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routenamespaces.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routenamespaces.go @@ -23,14 +23,14 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// RouteNamespacesApplyConfiguration represents an declarative configuration of the RouteNamespaces type for use +// RouteNamespacesApplyConfiguration represents a declarative configuration of the RouteNamespaces type for use // with apply. type RouteNamespacesApplyConfiguration struct { From *v1.FromNamespaces `json:"from,omitempty"` Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` } -// RouteNamespacesApplyConfiguration constructs an declarative configuration of the RouteNamespaces type for use with +// RouteNamespacesApplyConfiguration constructs a declarative configuration of the RouteNamespaces type for use with // apply. func RouteNamespaces() *RouteNamespacesApplyConfiguration { return &RouteNamespacesApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routeparentstatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routeparentstatus.go index 1237133547..f52901e544 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routeparentstatus.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routeparentstatus.go @@ -20,11 +20,10 @@ package v1 import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" - apisv1 "sigs.k8s.io/gateway-api/apis/v1" ) -// RouteParentStatusApplyConfiguration represents an declarative configuration of the RouteParentStatus type for use +// RouteParentStatusApplyConfiguration represents a declarative configuration of the RouteParentStatus type for use // with apply. type RouteParentStatusApplyConfiguration struct { ParentRef *ParentReferenceApplyConfiguration `json:"parentRef,omitempty"` @@ -32,7 +31,7 @@ type RouteParentStatusApplyConfiguration struct { Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` } -// RouteParentStatusApplyConfiguration constructs an declarative configuration of the RouteParentStatus type for use with +// RouteParentStatusApplyConfiguration constructs a declarative configuration of the RouteParentStatus type for use with // apply. func RouteParentStatus() *RouteParentStatusApplyConfiguration { return &RouteParentStatusApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routestatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routestatus.go index 5ef84f8028..0502272abb 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routestatus.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routestatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// RouteStatusApplyConfiguration represents an declarative configuration of the RouteStatus type for use +// RouteStatusApplyConfiguration represents a declarative configuration of the RouteStatus type for use // with apply. type RouteStatusApplyConfiguration struct { Parents []RouteParentStatusApplyConfiguration `json:"parents,omitempty"` } -// RouteStatusApplyConfiguration constructs an declarative configuration of the RouteStatus type for use with +// RouteStatusApplyConfiguration constructs a declarative configuration of the RouteStatus type for use with // apply. func RouteStatus() *RouteStatusApplyConfiguration { return &RouteStatusApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/secretobjectreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/secretobjectreference.go index 771fdb0ab3..654f898232 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/secretobjectreference.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/secretobjectreference.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// SecretObjectReferenceApplyConfiguration represents an declarative configuration of the SecretObjectReference type for use +// SecretObjectReferenceApplyConfiguration represents a declarative configuration of the SecretObjectReference type for use // with apply. type SecretObjectReferenceApplyConfiguration struct { Group *v1.Group `json:"group,omitempty"` @@ -31,7 +31,7 @@ type SecretObjectReferenceApplyConfiguration struct { Namespace *v1.Namespace `json:"namespace,omitempty"` } -// SecretObjectReferenceApplyConfiguration constructs an declarative configuration of the SecretObjectReference type for use with +// SecretObjectReferenceApplyConfiguration constructs a declarative configuration of the SecretObjectReference type for use with // apply. func SecretObjectReference() *SecretObjectReferenceApplyConfiguration { return &SecretObjectReferenceApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/sessionpersistence.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/sessionpersistence.go index 7b9de44e3b..b20b07ce86 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/sessionpersistence.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/sessionpersistence.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// SessionPersistenceApplyConfiguration represents an declarative configuration of the SessionPersistence type for use +// SessionPersistenceApplyConfiguration represents a declarative configuration of the SessionPersistence type for use // with apply. type SessionPersistenceApplyConfiguration struct { SessionName *string `json:"sessionName,omitempty"` @@ -32,7 +32,7 @@ type SessionPersistenceApplyConfiguration struct { CookieConfig *CookieConfigApplyConfiguration `json:"cookieConfig,omitempty"` } -// SessionPersistenceApplyConfiguration constructs an declarative configuration of the SessionPersistence type for use with +// SessionPersistenceApplyConfiguration constructs a declarative configuration of the SessionPersistence type for use with // apply. func SessionPersistence() *SessionPersistenceApplyConfiguration { return &SessionPersistenceApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/supportedfeature.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/supportedfeature.go new file mode 100644 index 0000000000..90de05d24d --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/supportedfeature.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// SupportedFeatureApplyConfiguration represents a declarative configuration of the SupportedFeature type for use +// with apply. +type SupportedFeatureApplyConfiguration struct { + Name *v1.FeatureName `json:"name,omitempty"` +} + +// SupportedFeatureApplyConfiguration constructs a declarative configuration of the SupportedFeature type for use with +// apply. +func SupportedFeature() *SupportedFeatureApplyConfiguration { + return &SupportedFeatureApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *SupportedFeatureApplyConfiguration) WithName(value v1.FeatureName) *SupportedFeatureApplyConfiguration { + b.Name = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicy.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicy.go index 835bf3c9d4..e63c8cd653 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicy.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicy.go @@ -23,12 +23,11 @@ import ( types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) -// BackendLBPolicyApplyConfiguration represents an declarative configuration of the BackendLBPolicy type for use +// BackendLBPolicyApplyConfiguration represents a declarative configuration of the BackendLBPolicy type for use // with apply. type BackendLBPolicyApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +36,7 @@ type BackendLBPolicyApplyConfiguration struct { Status *PolicyStatusApplyConfiguration `json:"status,omitempty"` } -// BackendLBPolicy constructs an declarative configuration of the BackendLBPolicy type for use with +// BackendLBPolicy constructs a declarative configuration of the BackendLBPolicy type for use with // apply. func BackendLBPolicy(name, namespace string) *BackendLBPolicyApplyConfiguration { b := &BackendLBPolicyApplyConfiguration{} @@ -257,3 +256,9 @@ func (b *BackendLBPolicyApplyConfiguration) WithStatus(value *PolicyStatusApplyC b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *BackendLBPolicyApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicyspec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicyspec.go index c233994c63..b443579a6b 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicyspec.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicyspec.go @@ -22,14 +22,14 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" ) -// BackendLBPolicySpecApplyConfiguration represents an declarative configuration of the BackendLBPolicySpec type for use +// BackendLBPolicySpecApplyConfiguration represents a declarative configuration of the BackendLBPolicySpec type for use // with apply. type BackendLBPolicySpecApplyConfiguration struct { TargetRefs []LocalPolicyTargetReferenceApplyConfiguration `json:"targetRefs,omitempty"` SessionPersistence *v1.SessionPersistenceApplyConfiguration `json:"sessionPersistence,omitempty"` } -// BackendLBPolicySpecApplyConfiguration constructs an declarative configuration of the BackendLBPolicySpec type for use with +// BackendLBPolicySpecApplyConfiguration constructs a declarative configuration of the BackendLBPolicySpec type for use with // apply. func BackendLBPolicySpec() *BackendLBPolicySpecApplyConfiguration { return &BackendLBPolicySpecApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/grpcroute.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/grpcroute.go index cc095e08c1..7e6f806b2c 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/grpcroute.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/grpcroute.go @@ -28,7 +28,7 @@ import ( v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) -// GRPCRouteApplyConfiguration represents an declarative configuration of the GRPCRoute type for use +// GRPCRouteApplyConfiguration represents a declarative configuration of the GRPCRoute type for use // with apply. type GRPCRouteApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type GRPCRouteApplyConfiguration struct { Status *apisv1.GRPCRouteStatusApplyConfiguration `json:"status,omitempty"` } -// GRPCRoute constructs an declarative configuration of the GRPCRoute type for use with +// GRPCRoute constructs a declarative configuration of the GRPCRoute type for use with // apply. func GRPCRoute(name, namespace string) *GRPCRouteApplyConfiguration { b := &GRPCRouteApplyConfiguration{} @@ -257,3 +257,9 @@ func (b *GRPCRouteApplyConfiguration) WithStatus(value *apisv1.GRPCRouteStatusAp b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *GRPCRouteApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreference.go index b4999d79cf..9560a9a49c 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreference.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreference.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// LocalPolicyTargetReferenceApplyConfiguration represents an declarative configuration of the LocalPolicyTargetReference type for use +// LocalPolicyTargetReferenceApplyConfiguration represents a declarative configuration of the LocalPolicyTargetReference type for use // with apply. type LocalPolicyTargetReferenceApplyConfiguration struct { Group *v1.Group `json:"group,omitempty"` @@ -30,7 +30,7 @@ type LocalPolicyTargetReferenceApplyConfiguration struct { Name *v1.ObjectName `json:"name,omitempty"` } -// LocalPolicyTargetReferenceApplyConfiguration constructs an declarative configuration of the LocalPolicyTargetReference type for use with +// LocalPolicyTargetReferenceApplyConfiguration constructs a declarative configuration of the LocalPolicyTargetReference type for use with // apply. func LocalPolicyTargetReference() *LocalPolicyTargetReferenceApplyConfiguration { return &LocalPolicyTargetReferenceApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreferencewithsectionname.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreferencewithsectionname.go index 259da87bc3..72577d01c2 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreferencewithsectionname.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreferencewithsectionname.go @@ -22,14 +22,14 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// LocalPolicyTargetReferenceWithSectionNameApplyConfiguration represents an declarative configuration of the LocalPolicyTargetReferenceWithSectionName type for use +// LocalPolicyTargetReferenceWithSectionNameApplyConfiguration represents a declarative configuration of the LocalPolicyTargetReferenceWithSectionName type for use // with apply. type LocalPolicyTargetReferenceWithSectionNameApplyConfiguration struct { LocalPolicyTargetReferenceApplyConfiguration `json:",inline"` SectionName *v1.SectionName `json:"sectionName,omitempty"` } -// LocalPolicyTargetReferenceWithSectionNameApplyConfiguration constructs an declarative configuration of the LocalPolicyTargetReferenceWithSectionName type for use with +// LocalPolicyTargetReferenceWithSectionNameApplyConfiguration constructs a declarative configuration of the LocalPolicyTargetReferenceWithSectionName type for use with // apply. func LocalPolicyTargetReferenceWithSectionName() *LocalPolicyTargetReferenceWithSectionNameApplyConfiguration { return &LocalPolicyTargetReferenceWithSectionNameApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policyancestorstatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policyancestorstatus.go index f43e15e4bf..d59b5c78ae 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policyancestorstatus.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policyancestorstatus.go @@ -24,7 +24,7 @@ import ( apisv1 "sigs.k8s.io/gateway-api/apis/v1" ) -// PolicyAncestorStatusApplyConfiguration represents an declarative configuration of the PolicyAncestorStatus type for use +// PolicyAncestorStatusApplyConfiguration represents a declarative configuration of the PolicyAncestorStatus type for use // with apply. type PolicyAncestorStatusApplyConfiguration struct { AncestorRef *v1.ParentReferenceApplyConfiguration `json:"ancestorRef,omitempty"` @@ -32,7 +32,7 @@ type PolicyAncestorStatusApplyConfiguration struct { Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` } -// PolicyAncestorStatusApplyConfiguration constructs an declarative configuration of the PolicyAncestorStatus type for use with +// PolicyAncestorStatusApplyConfiguration constructs a declarative configuration of the PolicyAncestorStatus type for use with // apply. func PolicyAncestorStatus() *PolicyAncestorStatusApplyConfiguration { return &PolicyAncestorStatusApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policystatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policystatus.go index 86063588f5..b7b158b29a 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policystatus.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policystatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha2 -// PolicyStatusApplyConfiguration represents an declarative configuration of the PolicyStatus type for use +// PolicyStatusApplyConfiguration represents a declarative configuration of the PolicyStatus type for use // with apply. type PolicyStatusApplyConfiguration struct { Ancestors []PolicyAncestorStatusApplyConfiguration `json:"ancestors,omitempty"` } -// PolicyStatusApplyConfiguration constructs an declarative configuration of the PolicyStatus type for use with +// PolicyStatusApplyConfiguration constructs a declarative configuration of the PolicyStatus type for use with // apply. func PolicyStatus() *PolicyStatusApplyConfiguration { return &PolicyStatusApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/referencegrant.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/referencegrant.go index f7a7f4d1ad..e25a74a63e 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/referencegrant.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/referencegrant.go @@ -28,7 +28,7 @@ import ( v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) -// ReferenceGrantApplyConfiguration represents an declarative configuration of the ReferenceGrant type for use +// ReferenceGrantApplyConfiguration represents a declarative configuration of the ReferenceGrant type for use // with apply. type ReferenceGrantApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ReferenceGrantApplyConfiguration struct { Spec *v1beta1.ReferenceGrantSpecApplyConfiguration `json:"spec,omitempty"` } -// ReferenceGrant constructs an declarative configuration of the ReferenceGrant type for use with +// ReferenceGrant constructs a declarative configuration of the ReferenceGrant type for use with // apply. func ReferenceGrant(name, namespace string) *ReferenceGrantApplyConfiguration { b := &ReferenceGrantApplyConfiguration{} @@ -248,3 +248,9 @@ func (b *ReferenceGrantApplyConfiguration) WithSpec(value *v1beta1.ReferenceGran b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ReferenceGrantApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproute.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproute.go index ed6cfbfd41..1edbd0d753 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproute.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproute.go @@ -23,12 +23,11 @@ import ( types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) -// TCPRouteApplyConfiguration represents an declarative configuration of the TCPRoute type for use +// TCPRouteApplyConfiguration represents a declarative configuration of the TCPRoute type for use // with apply. type TCPRouteApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +36,7 @@ type TCPRouteApplyConfiguration struct { Status *TCPRouteStatusApplyConfiguration `json:"status,omitempty"` } -// TCPRoute constructs an declarative configuration of the TCPRoute type for use with +// TCPRoute constructs a declarative configuration of the TCPRoute type for use with // apply. func TCPRoute(name, namespace string) *TCPRouteApplyConfiguration { b := &TCPRouteApplyConfiguration{} @@ -257,3 +256,9 @@ func (b *TCPRouteApplyConfiguration) WithStatus(value *TCPRouteStatusApplyConfig b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *TCPRouteApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcprouterule.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcprouterule.go index 3c6e418c2f..450d89992d 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcprouterule.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcprouterule.go @@ -19,25 +19,35 @@ limitations under the License. package v1alpha2 import ( - v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// TCPRouteRuleApplyConfiguration represents an declarative configuration of the TCPRouteRule type for use +// TCPRouteRuleApplyConfiguration represents a declarative configuration of the TCPRouteRule type for use // with apply. type TCPRouteRuleApplyConfiguration struct { - BackendRefs []v1.BackendRefApplyConfiguration `json:"backendRefs,omitempty"` + Name *v1.SectionName `json:"name,omitempty"` + BackendRefs []apisv1.BackendRefApplyConfiguration `json:"backendRefs,omitempty"` } -// TCPRouteRuleApplyConfiguration constructs an declarative configuration of the TCPRouteRule type for use with +// TCPRouteRuleApplyConfiguration constructs a declarative configuration of the TCPRouteRule type for use with // apply. func TCPRouteRule() *TCPRouteRuleApplyConfiguration { return &TCPRouteRuleApplyConfiguration{} } +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *TCPRouteRuleApplyConfiguration) WithName(value v1.SectionName) *TCPRouteRuleApplyConfiguration { + b.Name = &value + return b +} + // WithBackendRefs adds the given value to the BackendRefs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the BackendRefs field. -func (b *TCPRouteRuleApplyConfiguration) WithBackendRefs(values ...*v1.BackendRefApplyConfiguration) *TCPRouteRuleApplyConfiguration { +func (b *TCPRouteRuleApplyConfiguration) WithBackendRefs(values ...*apisv1.BackendRefApplyConfiguration) *TCPRouteRuleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithBackendRefs") diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutespec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutespec.go index 62fdffc7c7..375a7f4b16 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutespec.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutespec.go @@ -22,14 +22,14 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" ) -// TCPRouteSpecApplyConfiguration represents an declarative configuration of the TCPRouteSpec type for use +// TCPRouteSpecApplyConfiguration represents a declarative configuration of the TCPRouteSpec type for use // with apply. type TCPRouteSpecApplyConfiguration struct { v1.CommonRouteSpecApplyConfiguration `json:",inline"` Rules []TCPRouteRuleApplyConfiguration `json:"rules,omitempty"` } -// TCPRouteSpecApplyConfiguration constructs an declarative configuration of the TCPRouteSpec type for use with +// TCPRouteSpecApplyConfiguration constructs a declarative configuration of the TCPRouteSpec type for use with // apply. func TCPRouteSpec() *TCPRouteSpecApplyConfiguration { return &TCPRouteSpecApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutestatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutestatus.go index 74be49a173..a32ffd2bfd 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutestatus.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutestatus.go @@ -22,13 +22,13 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" ) -// TCPRouteStatusApplyConfiguration represents an declarative configuration of the TCPRouteStatus type for use +// TCPRouteStatusApplyConfiguration represents a declarative configuration of the TCPRouteStatus type for use // with apply. type TCPRouteStatusApplyConfiguration struct { v1.RouteStatusApplyConfiguration `json:",inline"` } -// TCPRouteStatusApplyConfiguration constructs an declarative configuration of the TCPRouteStatus type for use with +// TCPRouteStatusApplyConfiguration constructs a declarative configuration of the TCPRouteStatus type for use with // apply. func TCPRouteStatus() *TCPRouteStatusApplyConfiguration { return &TCPRouteStatusApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroute.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroute.go index 8a22aa8d66..5cfdd67395 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroute.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroute.go @@ -23,12 +23,11 @@ import ( types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) -// TLSRouteApplyConfiguration represents an declarative configuration of the TLSRoute type for use +// TLSRouteApplyConfiguration represents a declarative configuration of the TLSRoute type for use // with apply. type TLSRouteApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +36,7 @@ type TLSRouteApplyConfiguration struct { Status *TLSRouteStatusApplyConfiguration `json:"status,omitempty"` } -// TLSRoute constructs an declarative configuration of the TLSRoute type for use with +// TLSRoute constructs a declarative configuration of the TLSRoute type for use with // apply. func TLSRoute(name, namespace string) *TLSRouteApplyConfiguration { b := &TLSRouteApplyConfiguration{} @@ -257,3 +256,9 @@ func (b *TLSRouteApplyConfiguration) WithStatus(value *TLSRouteStatusApplyConfig b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *TLSRouteApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsrouterule.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsrouterule.go index a2dacdf9b8..e7124fc866 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsrouterule.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsrouterule.go @@ -19,25 +19,35 @@ limitations under the License. package v1alpha2 import ( - v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// TLSRouteRuleApplyConfiguration represents an declarative configuration of the TLSRouteRule type for use +// TLSRouteRuleApplyConfiguration represents a declarative configuration of the TLSRouteRule type for use // with apply. type TLSRouteRuleApplyConfiguration struct { - BackendRefs []v1.BackendRefApplyConfiguration `json:"backendRefs,omitempty"` + Name *v1.SectionName `json:"name,omitempty"` + BackendRefs []apisv1.BackendRefApplyConfiguration `json:"backendRefs,omitempty"` } -// TLSRouteRuleApplyConfiguration constructs an declarative configuration of the TLSRouteRule type for use with +// TLSRouteRuleApplyConfiguration constructs a declarative configuration of the TLSRouteRule type for use with // apply. func TLSRouteRule() *TLSRouteRuleApplyConfiguration { return &TLSRouteRuleApplyConfiguration{} } +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *TLSRouteRuleApplyConfiguration) WithName(value v1.SectionName) *TLSRouteRuleApplyConfiguration { + b.Name = &value + return b +} + // WithBackendRefs adds the given value to the BackendRefs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the BackendRefs field. -func (b *TLSRouteRuleApplyConfiguration) WithBackendRefs(values ...*v1.BackendRefApplyConfiguration) *TLSRouteRuleApplyConfiguration { +func (b *TLSRouteRuleApplyConfiguration) WithBackendRefs(values ...*apisv1.BackendRefApplyConfiguration) *TLSRouteRuleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithBackendRefs") diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutespec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutespec.go index 0de333f9ff..a8e3745ff2 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutespec.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutespec.go @@ -20,11 +20,10 @@ package v1alpha2 import ( v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" - apisv1 "sigs.k8s.io/gateway-api/apis/v1" ) -// TLSRouteSpecApplyConfiguration represents an declarative configuration of the TLSRouteSpec type for use +// TLSRouteSpecApplyConfiguration represents a declarative configuration of the TLSRouteSpec type for use // with apply. type TLSRouteSpecApplyConfiguration struct { v1.CommonRouteSpecApplyConfiguration `json:",inline"` @@ -32,7 +31,7 @@ type TLSRouteSpecApplyConfiguration struct { Rules []TLSRouteRuleApplyConfiguration `json:"rules,omitempty"` } -// TLSRouteSpecApplyConfiguration constructs an declarative configuration of the TLSRouteSpec type for use with +// TLSRouteSpecApplyConfiguration constructs a declarative configuration of the TLSRouteSpec type for use with // apply. func TLSRouteSpec() *TLSRouteSpecApplyConfiguration { return &TLSRouteSpecApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutestatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutestatus.go index f8677962c2..4f0cb40826 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutestatus.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutestatus.go @@ -22,13 +22,13 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" ) -// TLSRouteStatusApplyConfiguration represents an declarative configuration of the TLSRouteStatus type for use +// TLSRouteStatusApplyConfiguration represents a declarative configuration of the TLSRouteStatus type for use // with apply. type TLSRouteStatusApplyConfiguration struct { v1.RouteStatusApplyConfiguration `json:",inline"` } -// TLSRouteStatusApplyConfiguration constructs an declarative configuration of the TLSRouteStatus type for use with +// TLSRouteStatusApplyConfiguration constructs a declarative configuration of the TLSRouteStatus type for use with // apply. func TLSRouteStatus() *TLSRouteStatusApplyConfiguration { return &TLSRouteStatusApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproute.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproute.go index ba4d21f60f..377e85d87e 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproute.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproute.go @@ -23,12 +23,11 @@ import ( types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) -// UDPRouteApplyConfiguration represents an declarative configuration of the UDPRoute type for use +// UDPRouteApplyConfiguration represents a declarative configuration of the UDPRoute type for use // with apply. type UDPRouteApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +36,7 @@ type UDPRouteApplyConfiguration struct { Status *UDPRouteStatusApplyConfiguration `json:"status,omitempty"` } -// UDPRoute constructs an declarative configuration of the UDPRoute type for use with +// UDPRoute constructs a declarative configuration of the UDPRoute type for use with // apply. func UDPRoute(name, namespace string) *UDPRouteApplyConfiguration { b := &UDPRouteApplyConfiguration{} @@ -257,3 +256,9 @@ func (b *UDPRouteApplyConfiguration) WithStatus(value *UDPRouteStatusApplyConfig b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *UDPRouteApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udprouterule.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udprouterule.go index 8cc077ecc9..fd6171a2c7 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udprouterule.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udprouterule.go @@ -19,25 +19,35 @@ limitations under the License. package v1alpha2 import ( - v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// UDPRouteRuleApplyConfiguration represents an declarative configuration of the UDPRouteRule type for use +// UDPRouteRuleApplyConfiguration represents a declarative configuration of the UDPRouteRule type for use // with apply. type UDPRouteRuleApplyConfiguration struct { - BackendRefs []v1.BackendRefApplyConfiguration `json:"backendRefs,omitempty"` + Name *v1.SectionName `json:"name,omitempty"` + BackendRefs []apisv1.BackendRefApplyConfiguration `json:"backendRefs,omitempty"` } -// UDPRouteRuleApplyConfiguration constructs an declarative configuration of the UDPRouteRule type for use with +// UDPRouteRuleApplyConfiguration constructs a declarative configuration of the UDPRouteRule type for use with // apply. func UDPRouteRule() *UDPRouteRuleApplyConfiguration { return &UDPRouteRuleApplyConfiguration{} } +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *UDPRouteRuleApplyConfiguration) WithName(value v1.SectionName) *UDPRouteRuleApplyConfiguration { + b.Name = &value + return b +} + // WithBackendRefs adds the given value to the BackendRefs field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the BackendRefs field. -func (b *UDPRouteRuleApplyConfiguration) WithBackendRefs(values ...*v1.BackendRefApplyConfiguration) *UDPRouteRuleApplyConfiguration { +func (b *UDPRouteRuleApplyConfiguration) WithBackendRefs(values ...*apisv1.BackendRefApplyConfiguration) *UDPRouteRuleApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithBackendRefs") diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutespec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutespec.go index e73fb75d30..eed193696b 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutespec.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutespec.go @@ -22,14 +22,14 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" ) -// UDPRouteSpecApplyConfiguration represents an declarative configuration of the UDPRouteSpec type for use +// UDPRouteSpecApplyConfiguration represents a declarative configuration of the UDPRouteSpec type for use // with apply. type UDPRouteSpecApplyConfiguration struct { v1.CommonRouteSpecApplyConfiguration `json:",inline"` Rules []UDPRouteRuleApplyConfiguration `json:"rules,omitempty"` } -// UDPRouteSpecApplyConfiguration constructs an declarative configuration of the UDPRouteSpec type for use with +// UDPRouteSpecApplyConfiguration constructs a declarative configuration of the UDPRouteSpec type for use with // apply. func UDPRouteSpec() *UDPRouteSpecApplyConfiguration { return &UDPRouteSpecApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutestatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutestatus.go index 453004a652..57abcf15a2 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutestatus.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutestatus.go @@ -22,13 +22,13 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" ) -// UDPRouteStatusApplyConfiguration represents an declarative configuration of the UDPRouteStatus type for use +// UDPRouteStatusApplyConfiguration represents a declarative configuration of the UDPRouteStatus type for use // with apply. type UDPRouteStatusApplyConfiguration struct { v1.RouteStatusApplyConfiguration `json:",inline"` } -// UDPRouteStatusApplyConfiguration constructs an declarative configuration of the UDPRouteStatus type for use with +// UDPRouteStatusApplyConfiguration constructs a declarative configuration of the UDPRouteStatus type for use with // apply. func UDPRouteStatus() *UDPRouteStatusApplyConfiguration { return &UDPRouteStatusApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicy.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicy.go index 5d8f6dfa63..5cbf6a8d9e 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicy.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicy.go @@ -24,12 +24,11 @@ import ( managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" v1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" apisv1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" ) -// BackendTLSPolicyApplyConfiguration represents an declarative configuration of the BackendTLSPolicy type for use +// BackendTLSPolicyApplyConfiguration represents a declarative configuration of the BackendTLSPolicy type for use // with apply. type BackendTLSPolicyApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -38,7 +37,7 @@ type BackendTLSPolicyApplyConfiguration struct { Status *v1alpha2.PolicyStatusApplyConfiguration `json:"status,omitempty"` } -// BackendTLSPolicy constructs an declarative configuration of the BackendTLSPolicy type for use with +// BackendTLSPolicy constructs a declarative configuration of the BackendTLSPolicy type for use with // apply. func BackendTLSPolicy(name, namespace string) *BackendTLSPolicyApplyConfiguration { b := &BackendTLSPolicyApplyConfiguration{} @@ -258,3 +257,9 @@ func (b *BackendTLSPolicyApplyConfiguration) WithStatus(value *v1alpha2.PolicySt b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *BackendTLSPolicyApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyspec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyspec.go index 16b16a8cbc..5290a35fa0 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyspec.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyspec.go @@ -20,16 +20,18 @@ package v1alpha3 import ( v1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" + v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// BackendTLSPolicySpecApplyConfiguration represents an declarative configuration of the BackendTLSPolicySpec type for use +// BackendTLSPolicySpecApplyConfiguration represents a declarative configuration of the BackendTLSPolicySpec type for use // with apply. type BackendTLSPolicySpecApplyConfiguration struct { TargetRefs []v1alpha2.LocalPolicyTargetReferenceWithSectionNameApplyConfiguration `json:"targetRefs,omitempty"` Validation *BackendTLSPolicyValidationApplyConfiguration `json:"validation,omitempty"` + Options map[v1.AnnotationKey]v1.AnnotationValue `json:"options,omitempty"` } -// BackendTLSPolicySpecApplyConfiguration constructs an declarative configuration of the BackendTLSPolicySpec type for use with +// BackendTLSPolicySpecApplyConfiguration constructs a declarative configuration of the BackendTLSPolicySpec type for use with // apply. func BackendTLSPolicySpec() *BackendTLSPolicySpecApplyConfiguration { return &BackendTLSPolicySpecApplyConfiguration{} @@ -55,3 +57,17 @@ func (b *BackendTLSPolicySpecApplyConfiguration) WithValidation(value *BackendTL b.Validation = value return b } + +// WithOptions puts the entries into the Options field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Options field, +// overwriting an existing map entries in Options field with the same key. +func (b *BackendTLSPolicySpecApplyConfiguration) WithOptions(entries map[v1.AnnotationKey]v1.AnnotationValue) *BackendTLSPolicySpecApplyConfiguration { + if b.Options == nil && len(entries) > 0 { + b.Options = make(map[v1.AnnotationKey]v1.AnnotationValue, len(entries)) + } + for k, v := range entries { + b.Options[k] = v + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyvalidation.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyvalidation.go index 952c5926b6..1245e2853c 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyvalidation.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyvalidation.go @@ -24,15 +24,16 @@ import ( v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" ) -// BackendTLSPolicyValidationApplyConfiguration represents an declarative configuration of the BackendTLSPolicyValidation type for use +// BackendTLSPolicyValidationApplyConfiguration represents a declarative configuration of the BackendTLSPolicyValidation type for use // with apply. type BackendTLSPolicyValidationApplyConfiguration struct { CACertificateRefs []v1.LocalObjectReferenceApplyConfiguration `json:"caCertificateRefs,omitempty"` WellKnownCACertificates *v1alpha3.WellKnownCACertificatesType `json:"wellKnownCACertificates,omitempty"` Hostname *apisv1.PreciseHostname `json:"hostname,omitempty"` + SubjectAltNames []SubjectAltNameApplyConfiguration `json:"subjectAltNames,omitempty"` } -// BackendTLSPolicyValidationApplyConfiguration constructs an declarative configuration of the BackendTLSPolicyValidation type for use with +// BackendTLSPolicyValidationApplyConfiguration constructs a declarative configuration of the BackendTLSPolicyValidation type for use with // apply. func BackendTLSPolicyValidation() *BackendTLSPolicyValidationApplyConfiguration { return &BackendTLSPolicyValidationApplyConfiguration{} @@ -66,3 +67,16 @@ func (b *BackendTLSPolicyValidationApplyConfiguration) WithHostname(value apisv1 b.Hostname = &value return b } + +// WithSubjectAltNames adds the given value to the SubjectAltNames field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SubjectAltNames field. +func (b *BackendTLSPolicyValidationApplyConfiguration) WithSubjectAltNames(values ...*SubjectAltNameApplyConfiguration) *BackendTLSPolicyValidationApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSubjectAltNames") + } + b.SubjectAltNames = append(b.SubjectAltNames, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/subjectaltname.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/subjectaltname.go new file mode 100644 index 0000000000..ae71ef3137 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/subjectaltname.go @@ -0,0 +1,62 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" + v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" +) + +// SubjectAltNameApplyConfiguration represents a declarative configuration of the SubjectAltName type for use +// with apply. +type SubjectAltNameApplyConfiguration struct { + Type *v1alpha3.SubjectAltNameType `json:"type,omitempty"` + Hostname *v1.Hostname `json:"hostname,omitempty"` + URI *v1.AbsoluteURI `json:"uri,omitempty"` +} + +// SubjectAltNameApplyConfiguration constructs a declarative configuration of the SubjectAltName type for use with +// apply. +func SubjectAltName() *SubjectAltNameApplyConfiguration { + return &SubjectAltNameApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *SubjectAltNameApplyConfiguration) WithType(value v1alpha3.SubjectAltNameType) *SubjectAltNameApplyConfiguration { + b.Type = &value + return b +} + +// WithHostname sets the Hostname field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Hostname field is set to the value of the last call. +func (b *SubjectAltNameApplyConfiguration) WithHostname(value v1.Hostname) *SubjectAltNameApplyConfiguration { + b.Hostname = &value + return b +} + +// WithURI sets the URI field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URI field is set to the value of the last call. +func (b *SubjectAltNameApplyConfiguration) WithURI(value v1.AbsoluteURI) *SubjectAltNameApplyConfiguration { + b.URI = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gateway.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gateway.go index ced36f358a..8046345c75 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gateway.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gateway.go @@ -28,7 +28,7 @@ import ( v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" ) -// GatewayApplyConfiguration represents an declarative configuration of the Gateway type for use +// GatewayApplyConfiguration represents a declarative configuration of the Gateway type for use // with apply. type GatewayApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type GatewayApplyConfiguration struct { Status *apisv1.GatewayStatusApplyConfiguration `json:"status,omitempty"` } -// Gateway constructs an declarative configuration of the Gateway type for use with +// Gateway constructs a declarative configuration of the Gateway type for use with // apply. func Gateway(name, namespace string) *GatewayApplyConfiguration { b := &GatewayApplyConfiguration{} @@ -257,3 +257,9 @@ func (b *GatewayApplyConfiguration) WithStatus(value *apisv1.GatewayStatusApplyC b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *GatewayApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gatewayclass.go index 6b3c5856c1..938c6ba0a4 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gatewayclass.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gatewayclass.go @@ -28,7 +28,7 @@ import ( v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" ) -// GatewayClassApplyConfiguration represents an declarative configuration of the GatewayClass type for use +// GatewayClassApplyConfiguration represents a declarative configuration of the GatewayClass type for use // with apply. type GatewayClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type GatewayClassApplyConfiguration struct { Status *apisv1.GatewayClassStatusApplyConfiguration `json:"status,omitempty"` } -// GatewayClass constructs an declarative configuration of the GatewayClass type for use with +// GatewayClass constructs a declarative configuration of the GatewayClass type for use with // apply. func GatewayClass(name string) *GatewayClassApplyConfiguration { b := &GatewayClassApplyConfiguration{} @@ -255,3 +255,9 @@ func (b *GatewayClassApplyConfiguration) WithStatus(value *apisv1.GatewayClassSt b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *GatewayClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/httproute.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/httproute.go index 221b2fd180..84a40d9a32 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/httproute.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/httproute.go @@ -28,7 +28,7 @@ import ( v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" ) -// HTTPRouteApplyConfiguration represents an declarative configuration of the HTTPRoute type for use +// HTTPRouteApplyConfiguration represents a declarative configuration of the HTTPRoute type for use // with apply. type HTTPRouteApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type HTTPRouteApplyConfiguration struct { Status *apisv1.HTTPRouteStatusApplyConfiguration `json:"status,omitempty"` } -// HTTPRoute constructs an declarative configuration of the HTTPRoute type for use with +// HTTPRoute constructs a declarative configuration of the HTTPRoute type for use with // apply. func HTTPRoute(name, namespace string) *HTTPRouteApplyConfiguration { b := &HTTPRouteApplyConfiguration{} @@ -257,3 +257,9 @@ func (b *HTTPRouteApplyConfiguration) WithStatus(value *apisv1.HTTPRouteStatusAp b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *HTTPRouteApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrant.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrant.go index 4c0c7dc51a..b6b8c2e507 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrant.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrant.go @@ -23,12 +23,11 @@ import ( types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" apisv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" ) -// ReferenceGrantApplyConfiguration represents an declarative configuration of the ReferenceGrant type for use +// ReferenceGrantApplyConfiguration represents a declarative configuration of the ReferenceGrant type for use // with apply. type ReferenceGrantApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +35,7 @@ type ReferenceGrantApplyConfiguration struct { Spec *ReferenceGrantSpecApplyConfiguration `json:"spec,omitempty"` } -// ReferenceGrant constructs an declarative configuration of the ReferenceGrant type for use with +// ReferenceGrant constructs a declarative configuration of the ReferenceGrant type for use with // apply. func ReferenceGrant(name, namespace string) *ReferenceGrantApplyConfiguration { b := &ReferenceGrantApplyConfiguration{} @@ -248,3 +247,9 @@ func (b *ReferenceGrantApplyConfiguration) WithSpec(value *ReferenceGrantSpecApp b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ReferenceGrantApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantfrom.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantfrom.go index fa494a5403..168c1c0308 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantfrom.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantfrom.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// ReferenceGrantFromApplyConfiguration represents an declarative configuration of the ReferenceGrantFrom type for use +// ReferenceGrantFromApplyConfiguration represents a declarative configuration of the ReferenceGrantFrom type for use // with apply. type ReferenceGrantFromApplyConfiguration struct { Group *v1.Group `json:"group,omitempty"` @@ -30,7 +30,7 @@ type ReferenceGrantFromApplyConfiguration struct { Namespace *v1.Namespace `json:"namespace,omitempty"` } -// ReferenceGrantFromApplyConfiguration constructs an declarative configuration of the ReferenceGrantFrom type for use with +// ReferenceGrantFromApplyConfiguration constructs a declarative configuration of the ReferenceGrantFrom type for use with // apply. func ReferenceGrantFrom() *ReferenceGrantFromApplyConfiguration { return &ReferenceGrantFromApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantspec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantspec.go index 9fc339fcd8..f70297fcb0 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantspec.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantspec.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// ReferenceGrantSpecApplyConfiguration represents an declarative configuration of the ReferenceGrantSpec type for use +// ReferenceGrantSpecApplyConfiguration represents a declarative configuration of the ReferenceGrantSpec type for use // with apply. type ReferenceGrantSpecApplyConfiguration struct { From []ReferenceGrantFromApplyConfiguration `json:"from,omitempty"` To []ReferenceGrantToApplyConfiguration `json:"to,omitempty"` } -// ReferenceGrantSpecApplyConfiguration constructs an declarative configuration of the ReferenceGrantSpec type for use with +// ReferenceGrantSpecApplyConfiguration constructs a declarative configuration of the ReferenceGrantSpec type for use with // apply. func ReferenceGrantSpec() *ReferenceGrantSpecApplyConfiguration { return &ReferenceGrantSpecApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantto.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantto.go index c1e0ba760d..c417945775 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantto.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantto.go @@ -22,7 +22,7 @@ import ( v1 "sigs.k8s.io/gateway-api/apis/v1" ) -// ReferenceGrantToApplyConfiguration represents an declarative configuration of the ReferenceGrantTo type for use +// ReferenceGrantToApplyConfiguration represents a declarative configuration of the ReferenceGrantTo type for use // with apply. type ReferenceGrantToApplyConfiguration struct { Group *v1.Group `json:"group,omitempty"` @@ -30,7 +30,7 @@ type ReferenceGrantToApplyConfiguration struct { Name *v1.ObjectName `json:"name,omitempty"` } -// ReferenceGrantToApplyConfiguration constructs an declarative configuration of the ReferenceGrantTo type for use with +// ReferenceGrantToApplyConfiguration constructs a declarative configuration of the ReferenceGrantTo type for use with // apply. func ReferenceGrantTo() *ReferenceGrantToApplyConfiguration { return &ReferenceGrantToApplyConfiguration{} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/internal/internal.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/internal/internal.go index 21866f5425..07a0df71dd 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/internal/internal.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/internal/internal.go @@ -282,6 +282,16 @@ var schemaYAML = typed.YAMLObject(`types: - name: lifetimeType type: scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1.Fraction + map: + fields: + - name: denominator + type: + scalar: numeric + - name: numerator + type: + scalar: numeric + default: 0 - name: io.k8s.sigs.gateway-api.apis.v1.FrontendTLSValidation map: fields: @@ -420,6 +430,9 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.sigs.gateway-api.apis.v1.GRPCRouteMatch elementRelationship: atomic + - name: name + type: + scalar: string - name: sessionPersistence type: namedType: io.k8s.sigs.gateway-api.apis.v1.SessionPersistence @@ -484,6 +497,12 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" +- name: io.k8s.sigs.gateway-api.apis.v1.GatewayBackendTLS + map: + fields: + - name: clientCertificateRef + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.SecretObjectReference - name: io.k8s.sigs.gateway-api.apis.v1.GatewayClass map: fields: @@ -533,8 +552,10 @@ var schemaYAML = typed.YAMLObject(`types: type: list: elementType: - scalar: string + namedType: io.k8s.sigs.gateway-api.apis.v1.SupportedFeature elementRelationship: associative + keys: + - name - name: io.k8s.sigs.gateway-api.apis.v1.GatewayInfrastructure map: fields: @@ -560,6 +581,9 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayAddress elementRelationship: atomic + - name: backendTLS + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayBackendTLS - name: gatewayClassName type: scalar: string @@ -751,6 +775,12 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.sigs.gateway-api.apis.v1.BackendObjectReference default: {} + - name: fraction + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.Fraction + - name: percent + type: + scalar: numeric - name: io.k8s.sigs.gateway-api.apis.v1.HTTPRequestRedirectFilter map: fields: @@ -840,6 +870,21 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: associative keys: - name +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteRetry + map: + fields: + - name: attempts + type: + scalar: numeric + - name: backoff + type: + scalar: string + - name: codes + type: + list: + elementType: + scalar: numeric + elementRelationship: atomic - name: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteRule map: fields: @@ -861,6 +906,12 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteMatch elementRelationship: atomic + - name: name + type: + scalar: string + - name: retry + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteRetry - name: sessionPersistence type: namedType: io.k8s.sigs.gateway-api.apis.v1.SessionPersistence @@ -1124,6 +1175,13 @@ var schemaYAML = typed.YAMLObject(`types: - name: type type: scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1.SupportedFeature + map: + fields: + - name: name + type: + scalar: string + default: "" - name: io.k8s.sigs.gateway-api.apis.v1alpha2.BackendLBPolicy map: fields: @@ -1290,6 +1348,9 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.sigs.gateway-api.apis.v1.BackendRef elementRelationship: atomic + - name: name + type: + scalar: string - name: io.k8s.sigs.gateway-api.apis.v1alpha2.TCPRouteSpec map: fields: @@ -1344,6 +1405,9 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.sigs.gateway-api.apis.v1.BackendRef elementRelationship: atomic + - name: name + type: + scalar: string - name: io.k8s.sigs.gateway-api.apis.v1alpha2.TLSRouteSpec map: fields: @@ -1404,6 +1468,9 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.sigs.gateway-api.apis.v1.BackendRef elementRelationship: atomic + - name: name + type: + scalar: string - name: io.k8s.sigs.gateway-api.apis.v1alpha2.UDPRouteSpec map: fields: @@ -1452,6 +1519,11 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.sigs.gateway-api.apis.v1alpha3.BackendTLSPolicySpec map: fields: + - name: options + type: + map: + elementType: + scalar: string - name: targetRefs type: list: @@ -1475,9 +1547,28 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: subjectAltNames + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha3.SubjectAltName + elementRelationship: atomic - name: wellKnownCACertificates type: scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1alpha3.SubjectAltName + map: + fields: + - name: hostname + type: + scalar: string + - name: type + type: + scalar: string + default: "" + - name: uri + type: + scalar: string - name: io.k8s.sigs.gateway-api.apis.v1beta1.Gateway map: fields: diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/utils.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/utils.go new file mode 100644 index 0000000000..debd0d9f68 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/utils.go @@ -0,0 +1,234 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package applyconfiguration + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + testing "k8s.io/client-go/testing" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" + apisv1alpha3 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3" + apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + v1 "sigs.k8s.io/gateway-api/apis/v1" + v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" + v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" +) + +// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no +// apply configuration type exists for the given GroupVersionKind. +func ForKind(kind schema.GroupVersionKind) interface{} { + switch kind { + // Group=gateway.networking.k8s.io, Version=v1 + case v1.SchemeGroupVersion.WithKind("AllowedRoutes"): + return &apisv1.AllowedRoutesApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("BackendObjectReference"): + return &apisv1.BackendObjectReferenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("BackendRef"): + return &apisv1.BackendRefApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CommonRouteSpec"): + return &apisv1.CommonRouteSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CookieConfig"): + return &apisv1.CookieConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Fraction"): + return &apisv1.FractionApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("FrontendTLSValidation"): + return &apisv1.FrontendTLSValidationApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Gateway"): + return &apisv1.GatewayApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GatewayAddress"): + return &apisv1.GatewayAddressApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GatewayBackendTLS"): + return &apisv1.GatewayBackendTLSApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GatewayClass"): + return &apisv1.GatewayClassApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GatewayClassSpec"): + return &apisv1.GatewayClassSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GatewayClassStatus"): + return &apisv1.GatewayClassStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GatewayInfrastructure"): + return &apisv1.GatewayInfrastructureApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GatewaySpec"): + return &apisv1.GatewaySpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GatewayStatus"): + return &apisv1.GatewayStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GatewayStatusAddress"): + return &apisv1.GatewayStatusAddressApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GatewayTLSConfig"): + return &apisv1.GatewayTLSConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GRPCBackendRef"): + return &apisv1.GRPCBackendRefApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GRPCHeaderMatch"): + return &apisv1.GRPCHeaderMatchApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GRPCMethodMatch"): + return &apisv1.GRPCMethodMatchApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GRPCRoute"): + return &apisv1.GRPCRouteApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GRPCRouteFilter"): + return &apisv1.GRPCRouteFilterApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GRPCRouteMatch"): + return &apisv1.GRPCRouteMatchApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GRPCRouteRule"): + return &apisv1.GRPCRouteRuleApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GRPCRouteSpec"): + return &apisv1.GRPCRouteSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("GRPCRouteStatus"): + return &apisv1.GRPCRouteStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPBackendRef"): + return &apisv1.HTTPBackendRefApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPHeader"): + return &apisv1.HTTPHeaderApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPHeaderFilter"): + return &apisv1.HTTPHeaderFilterApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPHeaderMatch"): + return &apisv1.HTTPHeaderMatchApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPPathMatch"): + return &apisv1.HTTPPathMatchApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPPathModifier"): + return &apisv1.HTTPPathModifierApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPQueryParamMatch"): + return &apisv1.HTTPQueryParamMatchApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPRequestMirrorFilter"): + return &apisv1.HTTPRequestMirrorFilterApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPRequestRedirectFilter"): + return &apisv1.HTTPRequestRedirectFilterApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPRoute"): + return &apisv1.HTTPRouteApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPRouteFilter"): + return &apisv1.HTTPRouteFilterApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPRouteMatch"): + return &apisv1.HTTPRouteMatchApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPRouteRetry"): + return &apisv1.HTTPRouteRetryApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPRouteRule"): + return &apisv1.HTTPRouteRuleApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPRouteSpec"): + return &apisv1.HTTPRouteSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPRouteStatus"): + return &apisv1.HTTPRouteStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPRouteTimeouts"): + return &apisv1.HTTPRouteTimeoutsApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("HTTPURLRewriteFilter"): + return &apisv1.HTTPURLRewriteFilterApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("Listener"): + return &apisv1.ListenerApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ListenerStatus"): + return &apisv1.ListenerStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("LocalObjectReference"): + return &apisv1.LocalObjectReferenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("LocalParametersReference"): + return &apisv1.LocalParametersReferenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ObjectReference"): + return &apisv1.ObjectReferenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ParametersReference"): + return &apisv1.ParametersReferenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ParentReference"): + return &apisv1.ParentReferenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("RouteGroupKind"): + return &apisv1.RouteGroupKindApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("RouteNamespaces"): + return &apisv1.RouteNamespacesApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("RouteParentStatus"): + return &apisv1.RouteParentStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("RouteStatus"): + return &apisv1.RouteStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("SecretObjectReference"): + return &apisv1.SecretObjectReferenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("SessionPersistence"): + return &apisv1.SessionPersistenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("SupportedFeature"): + return &apisv1.SupportedFeatureApplyConfiguration{} + + // Group=gateway.networking.k8s.io, Version=v1alpha2 + case v1alpha2.SchemeGroupVersion.WithKind("BackendLBPolicy"): + return &apisv1alpha2.BackendLBPolicyApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("BackendLBPolicySpec"): + return &apisv1alpha2.BackendLBPolicySpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("GRPCRoute"): + return &apisv1alpha2.GRPCRouteApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("LocalPolicyTargetReference"): + return &apisv1alpha2.LocalPolicyTargetReferenceApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("LocalPolicyTargetReferenceWithSectionName"): + return &apisv1alpha2.LocalPolicyTargetReferenceWithSectionNameApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("PolicyAncestorStatus"): + return &apisv1alpha2.PolicyAncestorStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("PolicyStatus"): + return &apisv1alpha2.PolicyStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ReferenceGrant"): + return &apisv1alpha2.ReferenceGrantApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TCPRoute"): + return &apisv1alpha2.TCPRouteApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TCPRouteRule"): + return &apisv1alpha2.TCPRouteRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TCPRouteSpec"): + return &apisv1alpha2.TCPRouteSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TCPRouteStatus"): + return &apisv1alpha2.TCPRouteStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TLSRoute"): + return &apisv1alpha2.TLSRouteApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TLSRouteRule"): + return &apisv1alpha2.TLSRouteRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TLSRouteSpec"): + return &apisv1alpha2.TLSRouteSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TLSRouteStatus"): + return &apisv1alpha2.TLSRouteStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("UDPRoute"): + return &apisv1alpha2.UDPRouteApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("UDPRouteRule"): + return &apisv1alpha2.UDPRouteRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("UDPRouteSpec"): + return &apisv1alpha2.UDPRouteSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("UDPRouteStatus"): + return &apisv1alpha2.UDPRouteStatusApplyConfiguration{} + + // Group=gateway.networking.k8s.io, Version=v1alpha3 + case v1alpha3.SchemeGroupVersion.WithKind("BackendTLSPolicy"): + return &apisv1alpha3.BackendTLSPolicyApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("BackendTLSPolicySpec"): + return &apisv1alpha3.BackendTLSPolicySpecApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("BackendTLSPolicyValidation"): + return &apisv1alpha3.BackendTLSPolicyValidationApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("SubjectAltName"): + return &apisv1alpha3.SubjectAltNameApplyConfiguration{} + + // Group=gateway.networking.k8s.io, Version=v1beta1 + case v1beta1.SchemeGroupVersion.WithKind("Gateway"): + return &apisv1beta1.GatewayApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("GatewayClass"): + return &apisv1beta1.GatewayClassApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("HTTPRoute"): + return &apisv1beta1.HTTPRouteApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("ReferenceGrant"): + return &apisv1beta1.ReferenceGrantApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("ReferenceGrantFrom"): + return &apisv1beta1.ReferenceGrantFromApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("ReferenceGrantSpec"): + return &apisv1beta1.ReferenceGrantSpecApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("ReferenceGrantTo"): + return &apisv1beta1.ReferenceGrantToApplyConfiguration{} + + } + return nil +} + +func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter { + return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()} +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1/gateway_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1/gateway_types.go index caa5e96bf3..5211f5a3cb 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1/gateway_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1/gateway_types.go @@ -224,11 +224,19 @@ type GatewaySpec struct { // Infrastructure defines infrastructure level attributes about this Gateway instance. // - // Support: Core + // Support: Extended // - // // +optional Infrastructure *GatewayInfrastructure `json:"infrastructure,omitempty"` + + // BackendTLS configures TLS settings for when this Gateway is connecting to + // backends with TLS. + // + // Support: Core + // + // +optional + // + BackendTLS *GatewayBackendTLS `json:"backendTLS,omitempty"` } // Listener embodies the concept of a logical endpoint where a Gateway accepts @@ -351,7 +359,7 @@ type Listener struct { // // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=255 -// +kubebuilder:validation:Pattern=`^[a-zA-Z0-9]([-a-zSA-Z0-9]*[a-zA-Z0-9])?$|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9]+$` +// +kubebuilder:validation:Pattern=`^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?$|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9]+$` type ProtocolType string const ( @@ -374,6 +382,29 @@ const ( UDPProtocolType ProtocolType = "UDP" ) +// GatewayBackendTLS describes backend TLS configuration for gateway. +type GatewayBackendTLS struct { + // ClientCertificateRef is a reference to an object that contains a Client + // Certificate and the associated private key. + // + // References to a resource in different namespace are invalid UNLESS there + // is a ReferenceGrant in the target namespace that allows the certificate + // to be attached. If a ReferenceGrant does not allow this reference, the + // "ResolvedRefs" condition MUST be set to False for this listener with the + // "RefNotPermitted" reason. + // + // ClientCertificateRef can reference to standard Kubernetes resources, i.e. + // Secret, or implementation-specific custom resources. + // + // This setting can be overridden on the service level by use of BackendTLSPolicy. + // + // Support: Core + // + // +optional + // + ClientCertificateRef *SecretObjectReference `json:"clientCertificateRef,omitempty"` +} + // GatewayTLSConfig describes a TLS configuration. // // +kubebuilder:validation:XValidation:message="certificateRefs or options must be specified when mode is Terminate",rule="self.mode == 'Terminate' ? size(self.certificateRefs) > 0 || size(self.options) > 0 : true" @@ -679,11 +710,16 @@ type GatewayInfrastructure struct { // // An implementation may chose to add additional implementation-specific labels as they see fit. // + // If an implementation maps these labels to Pods, or any other resource that would need to be recreated when labels + // change, it SHOULD clearly warn about this behavior in documentation. + // // Support: Extended // // +optional // +kubebuilder:validation:MaxProperties=8 - Labels map[AnnotationKey]AnnotationValue `json:"labels,omitempty"` + // +kubebuilder:validation:XValidation:message="Label keys must be in the form of an optional DNS subdomain prefix followed by a required name segment of up to 63 characters.",rule="self.all(key, key.matches(r\"\"\"^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?([A-Za-z0-9][-A-Za-z0-9_.]{0,61})?[A-Za-z0-9]$\"\"\"))" + // +kubebuilder:validation:XValidation:message="If specified, the label key's prefix must be a DNS subdomain not longer than 253 characters in total.",rule="self.all(key, key.split(\"/\")[0].size() < 253)" + Labels map[LabelKey]LabelValue `json:"labels,omitempty"` // Annotations that SHOULD be applied to any resources created in response to this Gateway. // @@ -696,6 +732,8 @@ type GatewayInfrastructure struct { // // +optional // +kubebuilder:validation:MaxProperties=8 + // +kubebuilder:validation:XValidation:message="Annotation keys must be in the form of an optional DNS subdomain prefix followed by a required name segment of up to 63 characters.",rule="self.all(key, key.matches(r\"\"\"^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?([A-Za-z0-9][-A-Za-z0-9_.]{0,61})?[A-Za-z0-9]$\"\"\"))" + // +kubebuilder:validation:XValidation:message="If specified, the annotation key's prefix must be a DNS subdomain not longer than 253 characters in total.",rule="self.all(key, key.split(\"/\")[0].size() < 253)" Annotations map[AnnotationKey]AnnotationValue `json:"annotations,omitempty"` // ParametersRef is a reference to a resource that contains the configuration diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1/gatewayclass_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1/gatewayclass_types.go index 21875dce19..9aeaddfa0b 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1/gatewayclass_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1/gatewayclass_types.go @@ -60,7 +60,7 @@ type GatewayClass struct { // Implementations MUST populate status on all GatewayClass resources which // specify their controller name. // - // +kubebuilder:default={conditions: {{type: "Accepted", status: "Unknown", message: "Waiting for controller", reason: "Waiting", lastTransitionTime: "1970-01-01T00:00:00Z"}}} + // +kubebuilder:default={conditions: {{type: "Accepted", status: "Unknown", message: "Waiting for controller", reason: "Pending", lastTransitionTime: "1970-01-01T00:00:00Z"}}} Status GatewayClassStatus `json:"status,omitempty"` } @@ -93,8 +93,10 @@ type GatewayClassSpec struct { // or an implementation-specific custom resource. The resource can be // cluster-scoped or namespace-scoped. // - // If the referent cannot be found, the GatewayClass's "InvalidParameters" - // status condition will be true. + // If the referent cannot be found, refers to an unsupported kind, or when + // the data within that resource is malformed, the GatewayClass SHOULD be + // rejected with the "Accepted" status condition set to "False" and an + // "InvalidParameters" reason. // // A Gateway for this GatewayClass may provide its own `parametersRef`. When both are specified, // the merging behavior is implementation specific. @@ -162,6 +164,7 @@ const ( // Possible reasons for this condition to be False are: // // * "InvalidParameters" + // * "Unsupported" // * "UnsupportedVersion" // // Possible reasons for this condition to be Unknown are: @@ -176,9 +179,10 @@ const ( // true. GatewayClassReasonAccepted GatewayClassConditionReason = "Accepted" - // This reason is used with the "Accepted" condition when the - // GatewayClass was not accepted because the parametersRef field - // was invalid, with more detail in the message. + // This reason is used with the "Accepted" condition when the GatewayClass + // was not accepted because the parametersRef field refers to a nonexistent + // or unsupported resource or kind, or when the data within that resource is + // malformed. GatewayClassReasonInvalidParameters GatewayClassConditionReason = "InvalidParameters" // This reason is used with the "Accepted" condition when the @@ -187,6 +191,11 @@ const ( // GatewayClass. GatewayClassReasonPending GatewayClassConditionReason = "Pending" + // This reason is used with the "Accepted" condition when the GatewayClass + // was not accepted because the implementation does not support a + // user-defined GatewayClass. + GatewayClassReasonUnsupported GatewayClassConditionReason = "Unsupported" + // Deprecated: Use "Pending" instead. GatewayClassReasonWaiting GatewayClassConditionReason = "Waiting" ) @@ -252,9 +261,10 @@ type GatewayClassStatus struct { Conditions []metav1.Condition `json:"conditions,omitempty"` // SupportedFeatures is the set of features the GatewayClass support. - // It MUST be sorted in ascending alphabetical order. + // It MUST be sorted in ascending alphabetical order by the Name key. // +optional - // +listType=set + // +listType=map + // +listMapKey=name // // +kubebuilder:validation:MaxItems=64 SupportedFeatures []SupportedFeature `json:"supportedFeatures,omitempty"` @@ -269,6 +279,10 @@ type GatewayClassList struct { Items []GatewayClass `json:"items"` } -// SupportedFeature is used to describe distinct features that are covered by +// FeatureName is used to describe distinct features that are covered by // conformance tests. -type SupportedFeature string +type FeatureName string + +type SupportedFeature struct { + Name FeatureName `json:"name"` +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1/grpcroute_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1/grpcroute_types.go index 91a8a3d268..953ba0243b 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1/grpcroute_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1/grpcroute_types.go @@ -143,6 +143,8 @@ type GRPCRouteSpec struct { // // +optional // +kubebuilder:validation:MaxItems=16 + // +kubebuilder:validation:XValidation:message="While 16 rules and 64 matches per rule are allowed, the total number of matches across all rules in a route must be less than 128",rule="(self.size() > 0 ? (has(self[0].matches) ? self[0].matches.size() : 0) : 0) + (self.size() > 1 ? (has(self[1].matches) ? self[1].matches.size() : 0) : 0) + (self.size() > 2 ? (has(self[2].matches) ? self[2].matches.size() : 0) : 0) + (self.size() > 3 ? (has(self[3].matches) ? self[3].matches.size() : 0) : 0) + (self.size() > 4 ? (has(self[4].matches) ? self[4].matches.size() : 0) : 0) + (self.size() > 5 ? (has(self[5].matches) ? self[5].matches.size() : 0) : 0) + (self.size() > 6 ? (has(self[6].matches) ? self[6].matches.size() : 0) : 0) + (self.size() > 7 ? (has(self[7].matches) ? self[7].matches.size() : 0) : 0) + (self.size() > 8 ? (has(self[8].matches) ? self[8].matches.size() : 0) : 0) + (self.size() > 9 ? (has(self[9].matches) ? self[9].matches.size() : 0) : 0) + (self.size() > 10 ? (has(self[10].matches) ? self[10].matches.size() : 0) : 0) + (self.size() > 11 ? (has(self[11].matches) ? self[11].matches.size() : 0) : 0) + (self.size() > 12 ? (has(self[12].matches) ? self[12].matches.size() : 0) : 0) + (self.size() > 13 ? (has(self[13].matches) ? self[13].matches.size() : 0) : 0) + (self.size() > 14 ? (has(self[14].matches) ? self[14].matches.size() : 0) : 0) + (self.size() > 15 ? (has(self[15].matches) ? self[15].matches.size() : 0) : 0) <= 128" + // Rules []GRPCRouteRule `json:"rules,omitempty"` } @@ -150,6 +152,13 @@ type GRPCRouteSpec struct { // conditions (matches), processing it (filters), and forwarding the request to // an API object (backendRefs). type GRPCRouteRule struct { + // Name is the name of the route rule. This name MUST be unique within a Route if it is set. + // + // Support: Extended + // +optional + // + Name *SectionName `json:"name,omitempty"` + // Matches define conditions used for matching the rule against incoming // gRPC requests. Each match is independent, i.e. this rule will be matched // if **any** one of the matches is satisfied. @@ -387,7 +396,7 @@ type GRPCHeaderMatch struct { // // +optional // +kubebuilder:default=Exact - Type *HeaderMatchType `json:"type,omitempty"` + Type *GRPCHeaderMatchType `json:"type,omitempty"` // Name is the name of the gRPC Header to be matched. // @@ -541,6 +550,8 @@ type GRPCRouteFilter struct { // Support: Extended // // +optional + // + // RequestMirror *HTTPRequestMirrorFilter `json:"requestMirror,omitempty"` // ExtensionRef is an optional, implementation-specific extension to the diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1/httproute_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1/httproute_types.go index 736e80982a..3322c68eac 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1/httproute_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1/httproute_types.go @@ -117,8 +117,10 @@ type HTTPRouteSpec struct { // Rules are a list of HTTP matchers, filters and actions. // // +optional + // // +kubebuilder:validation:MaxItems=16 // +kubebuilder:default={{matches: {{path: {type: "PathPrefix", value: "/"}}}}} + // +kubebuilder:validation:XValidation:message="While 16 rules and 64 matches per rule are allowed, the total number of matches across all rules in a route must be less than 128",rule="(self.size() > 0 ? self[0].matches.size() : 0) + (self.size() > 1 ? self[1].matches.size() : 0) + (self.size() > 2 ? self[2].matches.size() : 0) + (self.size() > 3 ? self[3].matches.size() : 0) + (self.size() > 4 ? self[4].matches.size() : 0) + (self.size() > 5 ? self[5].matches.size() : 0) + (self.size() > 6 ? self[6].matches.size() : 0) + (self.size() > 7 ? self[7].matches.size() : 0) + (self.size() > 8 ? self[8].matches.size() : 0) + (self.size() > 9 ? self[9].matches.size() : 0) + (self.size() > 10 ? self[10].matches.size() : 0) + (self.size() > 11 ? self[11].matches.size() : 0) + (self.size() > 12 ? self[12].matches.size() : 0) + (self.size() > 13 ? self[13].matches.size() : 0) + (self.size() > 14 ? self[14].matches.size() : 0) + (self.size() > 15 ? self[15].matches.size() : 0) <= 128" Rules []HTTPRouteRule `json:"rules,omitempty"` } @@ -132,6 +134,13 @@ type HTTPRouteSpec struct { // +kubebuilder:validation:XValidation:message="Within backendRefs, when using RequestRedirect filter with path.replacePrefixMatch, exactly one PathPrefix match must be specified",rule="(has(self.backendRefs) && self.backendRefs.exists_one(b, (has(b.filters) && b.filters.exists_one(f, has(f.requestRedirect) && has(f.requestRedirect.path) && f.requestRedirect.path.type == 'ReplacePrefixMatch' && has(f.requestRedirect.path.replacePrefixMatch))) )) ? ((size(self.matches) != 1 || !has(self.matches[0].path) || self.matches[0].path.type != 'PathPrefix') ? false : true) : true" // +kubebuilder:validation:XValidation:message="Within backendRefs, When using URLRewrite filter with path.replacePrefixMatch, exactly one PathPrefix match must be specified",rule="(has(self.backendRefs) && self.backendRefs.exists_one(b, (has(b.filters) && b.filters.exists_one(f, has(f.urlRewrite) && has(f.urlRewrite.path) && f.urlRewrite.path.type == 'ReplacePrefixMatch' && has(f.urlRewrite.path.replacePrefixMatch))) )) ? ((size(self.matches) != 1 || !has(self.matches[0].path) || self.matches[0].path.type != 'PathPrefix') ? false : true) : true" type HTTPRouteRule struct { + // Name is the name of the route rule. This name MUST be unique within a Route if it is set. + // + // Support: Extended + // +optional + // + Name *SectionName `json:"name,omitempty"` + // Matches define conditions used for matching the rule against incoming // HTTP requests. Each match is independent, i.e. this rule will be matched // if **any** one of the matches is satisfied. @@ -190,7 +199,7 @@ type HTTPRouteRule struct { // parent a request is coming from, a HTTP 404 status code MUST be returned. // // +optional - // +kubebuilder:validation:MaxItems=8 + // +kubebuilder:validation:MaxItems=64 // +kubebuilder:default={{path:{ type: "PathPrefix", value: "/"}}} Matches []HTTPRouteMatch `json:"matches,omitempty"` @@ -263,6 +272,11 @@ type HTTPRouteRule struct { // invalid, 50 percent of traffic must receive a 500. Implementations may // choose how that 50 percent is determined. // + // When a HTTPBackendRef refers to a Service that has no ready endpoints, + // implementations SHOULD return a 503 for requests to that backend instead. + // If an implementation chooses to do this, all of the above rules for 500 responses + // MUST also apply for responses that return a 503. + // // Support: Core for Kubernetes Service // // Support: Extended for Kubernetes ServiceImport @@ -280,9 +294,16 @@ type HTTPRouteRule struct { // Support: Extended // // +optional - // Timeouts *HTTPRouteTimeouts `json:"timeouts,omitempty"` + // Retry defines the configuration for when to retry an HTTP request. + // + // Support: Extended + // + // +optional + // + Retry *HTTPRouteRetry `json:"retry,omitempty"` + // SessionPersistence defines and configures session persistence // for the route rule. // @@ -316,7 +337,8 @@ type HTTPRouteTimeouts struct { // request stream has been received instead of immediately after the transaction is // initiated by the client. // - // When this field is unspecified, request timeout behavior is implementation-specific. + // The value of Request is a Gateway API Duration string as defined by GEP-2257. When this + // field is unspecified, request timeout behavior is implementation-specific. // // Support: Extended // @@ -336,8 +358,10 @@ type HTTPRouteTimeouts struct { // may result in more than one call from the gateway to the destination backend, // for example, if automatic retries are supported. // - // Because the Request timeout encompasses the BackendRequest timeout, the value of - // BackendRequest must be <= the value of Request timeout. + // The value of BackendRequest must be a Gateway API Duration string as defined by + // GEP-2257. When this field is unspecified, its behavior is implementation-specific; + // when specified, the value of BackendRequest must be no more than the value of the + // Request timeout (since the Request timeout encompasses the BackendRequest timeout). // // Support: Extended // @@ -345,6 +369,95 @@ type HTTPRouteTimeouts struct { BackendRequest *Duration `json:"backendRequest,omitempty"` } +// HTTPRouteRetry defines retry configuration for an HTTPRoute. +// +// Implementations SHOULD retry on connection errors (disconnect, reset, timeout, +// TCP failure) if a retry stanza is configured. +type HTTPRouteRetry struct { + // Codes defines the HTTP response status codes for which a backend request + // should be retried. + // + // Support: Extended + // + // +optional + Codes []HTTPRouteRetryStatusCode `json:"codes,omitempty"` + + // Attempts specifies the maxmimum number of times an individual request + // from the gateway to a backend should be retried. + // + // If the maximum number of retries has been attempted without a successful + // response from the backend, the Gateway MUST return an error. + // + // When this field is unspecified, the number of times to attempt to retry + // a backend request is implementation-specific. + // + // Support: Extended + // + // +optional + Attempts *int `json:"attempts,omitempty"` + + // Backoff specifies the minimum duration a Gateway should wait between + // retry attempts and is represented in Gateway API Duration formatting. + // + // For example, setting the `rules[].retry.backoff` field to the value + // `100ms` will cause a backend request to first be retried approximately + // 100 milliseconds after timing out or receiving a response code configured + // to be retryable. + // + // An implementation MAY use an exponential or alternative backoff strategy + // for subsequent retry attempts, MAY cap the maximum backoff duration to + // some amount greater than the specified minimum, and MAY add arbitrary + // jitter to stagger requests, as long as unsuccessful backend requests are + // not retried before the configured minimum duration. + // + // If a Request timeout (`rules[].timeouts.request`) is configured on the + // route, the entire duration of the initial request and any retry attempts + // MUST not exceed the Request timeout duration. If any retry attempts are + // still in progress when the Request timeout duration has been reached, + // these SHOULD be canceled if possible and the Gateway MUST immediately + // return a timeout error. + // + // If a BackendRequest timeout (`rules[].timeouts.backendRequest`) is + // configured on the route, any retry attempts which reach the configured + // BackendRequest timeout duration without a response SHOULD be canceled if + // possible and the Gateway should wait for at least the specified backoff + // duration before attempting to retry the backend request again. + // + // If a BackendRequest timeout is _not_ configured on the route, retry + // attempts MAY time out after an implementation default duration, or MAY + // remain pending until a configured Request timeout or implementation + // default duration for total request time is reached. + // + // When this field is unspecified, the time to wait between retry attempts + // is implementation-specific. + // + // Support: Extended + // + // +optional + Backoff *Duration `json:"backoff,omitempty"` +} + +// HTTPRouteRetryStatusCode defines an HTTP response status code for +// which a backend request should be retried. +// +// Implementations MUST support the following status codes as retryable: +// +// * 500 +// * 502 +// * 503 +// * 504 +// +// Implementations MAY support specifying additional discrete values in the +// 500-599 range. +// +// Implementations MAY support specifying discrete values in the 400-499 range, +// which are often inadvisable to retry. +// +// +kubebuilder:validation:Minimum:=400 +// +kubebuilder:validation:Maximum:=599 +// +type HTTPRouteRetryStatusCode int + // PathMatchType specifies the semantics of how HTTP paths should be compared. // Valid PathMatchType values, along with their support levels, are: // @@ -741,6 +854,8 @@ type HTTPRouteFilter struct { // Support: Extended // // +optional + // + // RequestMirror *HTTPRequestMirrorFilter `json:"requestMirror,omitempty"` // RequestRedirect defines a schema for a filter that responds to the @@ -1137,6 +1252,29 @@ type HTTPRequestMirrorFilter struct { // // Support: Implementation-specific for any other resource BackendRef BackendObjectReference `json:"backendRef"` + + // Percent represents the percentage of requests that should be + // mirrored to BackendRef. Its minimum value is 0 (indicating 0% of + // requests) and its maximum value is 100 (indicating 100% of requests). + // + // Only one of Fraction or Percent may be specified. If neither field + // is specified, 100% of requests will be mirrored. + // + // +optional + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=100 + // + Percent *int32 `json:"percent,omitempty"` + + // Fraction represents the fraction of requests that should be + // mirrored to BackendRef. + // + // Only one of Fraction or Percent may be specified. If neither field + // is specified, 100% of requests will be mirrored. + // + // +optional + // + Fraction *Fraction `json:"fraction,omitempty"` } // HTTPBackendRef defines how a HTTPRoute forwards a HTTP request. diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1/shared_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1/shared_types.go index bed2cc8b8e..8349636956 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1/shared_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1/shared_types.go @@ -535,6 +535,19 @@ type Hostname string // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` type PreciseHostname string +// AbsoluteURI represents a Uniform Resource Identifier (URI) as defined by RFC3986. + +// The AbsoluteURI MUST NOT be a relative URI, and it MUST follow the URI syntax and +// encoding rules specified in RFC3986. The AbsoluteURI MUST include both a +// scheme (e.g., "http" or "spiffe") and a scheme-specific-part. URIs that +// include an authority MUST include a fully qualified domain name or +// IP address as the host. + +// +kubebuilder:validation:MinLength=1 +// +kubebuilder:validation:MaxLength=253 +// +kubebuilder:validation:Pattern=`^(([^:/?#]+):)(//([^/?#]*))([^?#]*)(\?([^#]*))?(#(.*))?` +type AbsoluteURI string + // Group refers to a Kubernetes Group. It must either be an empty string or a // RFC 1123 subdomain. // @@ -666,7 +679,7 @@ type GatewayController string // // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 -// +kubebuilder:validation:Pattern=`^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]/?)*$` +// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?([A-Za-z0-9][-A-Za-z0-9_.]{0,61})?[A-Za-z0-9]$` type AnnotationKey string // AnnotationValue is the value of an annotation in Gateway API. This is used @@ -678,6 +691,45 @@ type AnnotationKey string // +kubebuilder:validation:MaxLength=4096 type AnnotationValue string +// LabelKey is the key of a label in the Gateway API. This is used for validation +// of maps such as Gateway infrastructure labels. This matches the Kubernetes +// "qualified name" validation that is used for labels. +// +// Valid values include: +// +// * example +// * example.com +// * example.com/path +// * example.com/path.html +// +// Invalid values include: +// +// * example~ - "~" is an invalid character +// * example.com. - can not start or end with "." +// +// +kubebuilder:validation:MinLength=1 +// +kubebuilder:validation:MaxLength=253 +// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?([A-Za-z0-9][-A-Za-z0-9_.]{0,61})?[A-Za-z0-9]$` +type LabelKey string + +// LabelValue is the value of a label in the Gateway API. This is used for validation +// of maps such as Gateway infrastructure labels. This matches the Kubernetes +// label validation rules: +// * must be 63 characters or less (can be empty), +// * unless empty, must begin and end with an alphanumeric character ([a-z0-9A-Z]), +// * could contain dashes (-), underscores (_), dots (.), and alphanumerics between. +// +// Valid values include: +// +// * MyValue +// * my.name +// * 123-my-value +// +// +kubebuilder:validation:MinLength=0 +// +kubebuilder:validation:MaxLength=63 +// +kubebuilder:validation:Pattern=`^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$` +type LabelValue string + // AddressType defines how a network address is represented as a text string. // This may take two possible forms: // @@ -745,7 +797,7 @@ const ( ) // SessionPersistence defines the desired state of SessionPersistence. -// +kubebuilder:validation:XValidation:message="AbsoluteTimeout must be specified when cookie lifetimeType is Permanent",rule="!has(self.cookieConfig.lifetimeType) || self.cookieConfig.lifetimeType != 'Permanent' || has(self.absoluteTimeout)" +// +kubebuilder:validation:XValidation:message="AbsoluteTimeout must be specified when cookie lifetimeType is Permanent",rule="!has(self.cookieConfig) || !has(self.cookieConfig.lifetimeType) || self.cookieConfig.lifetimeType != 'Permanent' || has(self.absoluteTimeout)" type SessionPersistence struct { // SessionName defines the name of the persistent session token // which may be reflected in the cookie or the header. Users @@ -855,3 +907,14 @@ const ( // Support: Extended PermanentCookieLifetimeType CookieLifetimeType = "Permanent" ) + +// +kubebuilder:validation:XValidation:message="numerator must be less than or equal to denominator",rule="self.numerator <= self.denominator" +type Fraction struct { + // +kubebuilder:validation:Minimum=0 + Numerator int32 `json:"numerator"` + + // +optional + // +kubebuilder:default=100 + // +kubebuilder:validation:Minimum=1 + Denominator *int32 `json:"denominator,omitempty"` +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/gateway-api/apis/v1/zz_generated.deepcopy.go index ddb9bb9d49..62fb99b0d5 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1/zz_generated.deepcopy.go @@ -150,6 +150,26 @@ func (in *CookieConfig) DeepCopy() *CookieConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Fraction) DeepCopyInto(out *Fraction) { + *out = *in + if in.Denominator != nil { + in, out := &in.Denominator, &out.Denominator + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Fraction. +func (in *Fraction) DeepCopy() *Fraction { + if in == nil { + return nil + } + out := new(Fraction) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *FrontendTLSValidation) DeepCopyInto(out *FrontendTLSValidation) { *out = *in @@ -200,7 +220,7 @@ func (in *GRPCHeaderMatch) DeepCopyInto(out *GRPCHeaderMatch) { *out = *in if in.Type != nil { in, out := &in.Type, &out.Type - *out = new(HeaderMatchType) + *out = new(GRPCHeaderMatchType) **out = **in } } @@ -369,6 +389,11 @@ func (in *GRPCRouteMatch) DeepCopy() *GRPCRouteMatch { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GRPCRouteRule) DeepCopyInto(out *GRPCRouteRule) { *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(SectionName) + **out = **in + } if in.Matches != nil { in, out := &in.Matches, &out.Matches *out = make([]GRPCRouteMatch, len(*in)) @@ -498,6 +523,26 @@ func (in *GatewayAddress) DeepCopy() *GatewayAddress { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayBackendTLS) DeepCopyInto(out *GatewayBackendTLS) { + *out = *in + if in.ClientCertificateRef != nil { + in, out := &in.ClientCertificateRef, &out.ClientCertificateRef + *out = new(SecretObjectReference) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayBackendTLS. +func (in *GatewayBackendTLS) DeepCopy() *GatewayBackendTLS { + if in == nil { + return nil + } + out := new(GatewayBackendTLS) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GatewayClass) DeepCopyInto(out *GatewayClass) { *out = *in @@ -614,7 +659,7 @@ func (in *GatewayInfrastructure) DeepCopyInto(out *GatewayInfrastructure) { *out = *in if in.Labels != nil { in, out := &in.Labels, &out.Labels - *out = make(map[AnnotationKey]AnnotationValue, len(*in)) + *out = make(map[LabelKey]LabelValue, len(*in)) for key, val := range *in { (*out)[key] = val } @@ -697,6 +742,11 @@ func (in *GatewaySpec) DeepCopyInto(out *GatewaySpec) { *out = new(GatewayInfrastructure) (*in).DeepCopyInto(*out) } + if in.BackendTLS != nil { + in, out := &in.BackendTLS, &out.BackendTLS + *out = new(GatewayBackendTLS) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewaySpec. @@ -966,6 +1016,16 @@ func (in *HTTPQueryParamMatch) DeepCopy() *HTTPQueryParamMatch { func (in *HTTPRequestMirrorFilter) DeepCopyInto(out *HTTPRequestMirrorFilter) { *out = *in in.BackendRef.DeepCopyInto(&out.BackendRef) + if in.Percent != nil { + in, out := &in.Percent, &out.Percent + *out = new(int32) + **out = **in + } + if in.Fraction != nil { + in, out := &in.Fraction, &out.Fraction + *out = new(Fraction) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRequestMirrorFilter. @@ -1161,9 +1221,44 @@ func (in *HTTPRouteMatch) DeepCopy() *HTTPRouteMatch { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPRouteRetry) DeepCopyInto(out *HTTPRouteRetry) { + *out = *in + if in.Codes != nil { + in, out := &in.Codes, &out.Codes + *out = make([]HTTPRouteRetryStatusCode, len(*in)) + copy(*out, *in) + } + if in.Attempts != nil { + in, out := &in.Attempts, &out.Attempts + *out = new(int) + **out = **in + } + if in.Backoff != nil { + in, out := &in.Backoff, &out.Backoff + *out = new(Duration) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRouteRetry. +func (in *HTTPRouteRetry) DeepCopy() *HTTPRouteRetry { + if in == nil { + return nil + } + out := new(HTTPRouteRetry) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HTTPRouteRule) DeepCopyInto(out *HTTPRouteRule) { *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(SectionName) + **out = **in + } if in.Matches != nil { in, out := &in.Matches, &out.Matches *out = make([]HTTPRouteMatch, len(*in)) @@ -1190,6 +1285,11 @@ func (in *HTTPRouteRule) DeepCopyInto(out *HTTPRouteRule) { *out = new(HTTPRouteTimeouts) (*in).DeepCopyInto(*out) } + if in.Retry != nil { + in, out := &in.Retry, &out.Retry + *out = new(HTTPRouteRetry) + (*in).DeepCopyInto(*out) + } if in.SessionPersistence != nil { in, out := &in.SessionPersistence, &out.SessionPersistence *out = new(SessionPersistence) @@ -1629,3 +1729,18 @@ func (in *SessionPersistence) DeepCopy() *SessionPersistence { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SupportedFeature) DeepCopyInto(out *SupportedFeature) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SupportedFeature. +func (in *SupportedFeature) DeepCopy() *SupportedFeature { + if in == nil { + return nil + } + out := new(SupportedFeature) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/backendlbpolicy_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/backendlbpolicy_types.go index f6cc9741ec..83cd69a061 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/backendlbpolicy_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/backendlbpolicy_types.go @@ -26,6 +26,9 @@ import ( // +kubebuilder:storageversion // +kubebuilder:resource:categories=gateway-api,shortName=blbpolicy // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +// +// BackendLBPolicy is a Direct Attached Policy. +// +kubebuilder:metadata:labels="gateway.networking.k8s.io/policy=Direct" // BackendLBPolicy provides a way to define load balancing rules // for a backend. diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/grpcroute_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/grpcroute_types.go index 0b0bb4e85a..0750c2cb6b 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/grpcroute_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/grpcroute_types.go @@ -24,6 +24,7 @@ import ( // +genclient // +kubebuilder:object:root=true +// +kubebuilder:skipversion // +kubebuilder:deprecatedversion:warning="The v1alpha2 version of GRPCRoute has been deprecated and will be removed in a future release of the API. Please upgrade to v1." type GRPCRoute v1.GRPCRoute diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/referencegrant_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/referencegrant_types.go index d673062608..372022f77c 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/referencegrant_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/referencegrant_types.go @@ -26,6 +26,7 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:categories=gateway-api,shortName=refgrant // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +// +kubebuilder:skipversion // +kubebuilder:deprecatedversion:warning="The v1alpha2 version of ReferenceGrant has been deprecated and will be removed in a future release of the API. Please upgrade to v1beta1." // ReferenceGrant identifies kinds of resources in other namespaces that are diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/tcproute_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/tcproute_types.go index fe927ab8d4..b79253dd33 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/tcproute_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/tcproute_types.go @@ -49,6 +49,7 @@ type TCPRouteSpec struct { // // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:MaxItems=16 + // Rules []TCPRouteRule `json:"rules"` } @@ -59,6 +60,12 @@ type TCPRouteStatus struct { // TCPRouteRule is the configuration for a given rule. type TCPRouteRule struct { + // Name is the name of the route rule. This name MUST be unique within a Route if it is set. + // + // Support: Extended + // +optional + Name *SectionName `json:"name,omitempty"` + // BackendRefs defines the backend(s) where matching requests should be // sent. If unspecified or invalid (refers to a non-existent resource or a // Service with no endpoints), the underlying implementation MUST actively diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/tlsroute_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/tlsroute_types.go index afe34d82d6..26dfde77c7 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/tlsroute_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/tlsroute_types.go @@ -90,6 +90,7 @@ type TLSRouteSpec struct { // // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:MaxItems=16 + // Rules []TLSRouteRule `json:"rules"` } @@ -100,6 +101,12 @@ type TLSRouteStatus struct { // TLSRouteRule is the configuration for a given rule. type TLSRouteRule struct { + // Name is the name of the route rule. This name MUST be unique within a Route if it is set. + // + // Support: Extended + // +optional + Name *SectionName `json:"name,omitempty"` + // BackendRefs defines the backend(s) where matching requests should be // sent. If unspecified or invalid (refers to a non-existent resource or // a Service with no endpoints), the rule performs no forwarding; if no diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/udproute_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/udproute_types.go index 9e3770c293..9e7fe3ff80 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/udproute_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/udproute_types.go @@ -49,6 +49,7 @@ type UDPRouteSpec struct { // // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:MaxItems=16 + // Rules []UDPRouteRule `json:"rules"` } @@ -59,6 +60,12 @@ type UDPRouteStatus struct { // UDPRouteRule is the configuration for a given rule. type UDPRouteRule struct { + // Name is the name of the route rule. This name MUST be unique within a Route if it is set. + // + // Support: Extended + // +optional + Name *SectionName `json:"name,omitempty"` + // BackendRefs defines the backend(s) where matching requests should be // sent. If unspecified or invalid (refers to a non-existent resource or a // Service with no endpoints), the underlying implementation MUST actively diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/zz_generated.deepcopy.go index 3bf9f0fbe6..5306ca135d 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/zz_generated.deepcopy.go @@ -390,6 +390,11 @@ func (in *TCPRouteList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TCPRouteRule) DeepCopyInto(out *TCPRouteRule) { *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(v1.SectionName) + **out = **in + } if in.BackendRefs != nil { in, out := &in.BackendRefs, &out.BackendRefs *out = make([]v1.BackendRef, len(*in)) @@ -510,6 +515,11 @@ func (in *TLSRouteList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TLSRouteRule) DeepCopyInto(out *TLSRouteRule) { *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(v1.SectionName) + **out = **in + } if in.BackendRefs != nil { in, out := &in.BackendRefs, &out.BackendRefs *out = make([]v1.BackendRef, len(*in)) @@ -635,6 +645,11 @@ func (in *UDPRouteList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UDPRouteRule) DeepCopyInto(out *UDPRouteRule) { *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(v1.SectionName) + **out = **in + } if in.BackendRefs != nil { in, out := &in.BackendRefs, &out.BackendRefs *out = make([]v1.BackendRef, len(*in)) diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/backendtlspolicy_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/backendtlspolicy_types.go index cafd1a7ff3..83f3b2df26 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/backendtlspolicy_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/backendtlspolicy_types.go @@ -75,6 +75,21 @@ type BackendTLSPolicySpec struct { // Validation contains backend TLS validation configuration. Validation BackendTLSPolicyValidation `json:"validation"` + + // Options are a list of key/value pairs to enable extended TLS + // configuration for each implementation. For example, configuring the + // minimum TLS version or supported cipher suites. + // + // A set of common keys MAY be defined by the API in the future. To avoid + // any ambiguity, implementation-specific definitions MUST use + // domain-prefixed names, such as `example.com/my-custom-option`. + // Un-prefixed names are reserved for key names defined by Gateway API. + // + // Support: Implementation-specific + // + // +optional + // +kubebuilder:validation:MaxProperties=16 + Options map[v1.AnnotationKey]v1.AnnotationValue `json:"options,omitempty"` } // BackendTLSPolicyValidation contains backend TLS validation configuration. @@ -126,11 +141,52 @@ type BackendTLSPolicyValidation struct { // backends: // // 1. Hostname MUST be used as the SNI to connect to the backend (RFC 6066). - // 2. Hostname MUST be used for authentication and MUST match the certificate - // served by the matching backend. + // 2. If SubjectAltNames is not specified, Hostname MUST be used for + // authentication and MUST match the certificate served by the matching + // backend. // // Support: Core Hostname v1.PreciseHostname `json:"hostname"` + + // SubjectAltNames contains one or more Subject Alternative Names. + // When specified, the certificate served from the backend MUST have at least one + // Subject Alternate Name matching one of the specified SubjectAltNames. + // + // Support: Core + // + // +optional + // +kubebuilder:validation:MaxItems=5 + SubjectAltNames []SubjectAltName `json:"subjectAltNames,omitempty"` +} + +// SubjectAltName represents Subject Alternative Name. +// +kubebuilder:validation:XValidation:message="SubjectAltName element must contain Hostname, if Type is set to Hostname",rule="!(self.type == \"Hostname\" && (!has(self.hostname) || self.hostname == \"\"))" +// +kubebuilder:validation:XValidation:message="SubjectAltName element must not contain Hostname, if Type is not set to Hostname",rule="!(self.type != \"Hostname\" && has(self.hostname) && self.hostname != \"\")" +// +kubebuilder:validation:XValidation:message="SubjectAltName element must contain URI, if Type is set to URI",rule="!(self.type == \"URI\" && (!has(self.uri) || self.uri == \"\"))" +// +kubebuilder:validation:XValidation:message="SubjectAltName element must not contain URI, if Type is not set to URI",rule="!(self.type != \"URI\" && has(self.uri) && self.uri != \"\")" +type SubjectAltName struct { + // Type determines the format of the Subject Alternative Name. Always required. + // + // Support: Core + Type SubjectAltNameType `json:"type"` + + // Hostname contains Subject Alternative Name specified in DNS name format. + // Required when Type is set to Hostname, ignored otherwise. + // + // Support: Core + // + // +optional + Hostname v1.Hostname `json:"hostname,omitempty"` + + // URI contains Subject Alternative Name specified in a full URI format. + // It MUST include both a scheme (e.g., "http" or "ftp") and a scheme-specific-part. + // Common values include SPIFFE IDs like "spiffe://mycluster.example.com/ns/myns/sa/svc1sa". + // Required when Type is set to URI, ignored otherwise. + // + // Support: Core + // + // +optional + URI v1.AbsoluteURI `json:"uri,omitempty"` } // WellKnownCACertificatesType is the type of CA certificate that will be used @@ -142,3 +198,19 @@ const ( // WellKnownCACertificatesSystem indicates that well known system CA certificates should be used. WellKnownCACertificatesSystem WellKnownCACertificatesType = "System" ) + +// SubjectAltNameType is the type of the Subject Alternative Name. +// +kubebuilder:validation:Enum=Hostname;URI +type SubjectAltNameType string + +const ( + // HostnameSubjectAltNameType specifies hostname-based SAN. + // + // Support: Core + HostnameSubjectAltNameType SubjectAltNameType = "Hostname" + + // URISubjectAltNameType specifies URI-based SAN, e.g. SPIFFE id. + // + // Support: Core + URISubjectAltNameType SubjectAltNameType = "URI" +) diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/zz_generated.deepcopy.go index 5339c534c9..876ac9f7b6 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/zz_generated.deepcopy.go @@ -96,6 +96,13 @@ func (in *BackendTLSPolicySpec) DeepCopyInto(out *BackendTLSPolicySpec) { } } in.Validation.DeepCopyInto(&out.Validation) + if in.Options != nil { + in, out := &in.Options, &out.Options + *out = make(map[v1.AnnotationKey]v1.AnnotationValue, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTLSPolicySpec. @@ -121,6 +128,11 @@ func (in *BackendTLSPolicyValidation) DeepCopyInto(out *BackendTLSPolicyValidati *out = new(WellKnownCACertificatesType) **out = **in } + if in.SubjectAltNames != nil { + in, out := &in.SubjectAltNames, &out.SubjectAltNames + *out = make([]SubjectAltName, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTLSPolicyValidation. @@ -132,3 +144,18 @@ func (in *BackendTLSPolicyValidation) DeepCopy() *BackendTLSPolicyValidation { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubjectAltName) DeepCopyInto(out *SubjectAltName) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubjectAltName. +func (in *SubjectAltName) DeepCopy() *SubjectAltName { + if in == nil { + return nil + } + out := new(SubjectAltName) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/httproute_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/httproute_types.go index 25ab2560d8..81c7e228c1 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/httproute_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/httproute_types.go @@ -111,7 +111,7 @@ type HeaderMatchType = v1.HeaderMatchType // // * "/invalid" - "/" is an invalid character // +k8s:deepcopy-gen=false -type HTTPHeaderName = v1.HeaderName +type HTTPHeaderName = v1.HTTPHeaderName // HTTPHeaderMatch describes how to select a HTTP route by matching HTTP request // headers. diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/fake/clientset_generated.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/fake/clientset_generated.go index c588377449..7d165c93ba 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -24,6 +24,7 @@ import ( "k8s.io/client-go/discovery" fakediscovery "k8s.io/client-go/discovery/fake" "k8s.io/client-go/testing" + applyconfiguration "sigs.k8s.io/gateway-api/apis/applyconfiguration" clientset "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned" gatewayv1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1" fakegatewayv1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake" @@ -37,8 +38,12 @@ import ( // NewSimpleClientset returns a clientset that will respond with the provided objects. // It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement +// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement // for a real clientset and is mostly useful in simple unit tests. +// +// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves +// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. +// via --with-applyconfig). func NewSimpleClientset(objects ...runtime.Object) *Clientset { o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) for _, obj := range objects { @@ -80,6 +85,38 @@ func (c *Clientset) Tracker() testing.ObjectTracker { return c.tracker } +// NewClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewClientset(objects ...runtime.Object) *Clientset { + o := testing.NewFieldManagedObjectTracker( + scheme, + codecs.UniversalDecoder(), + applyconfiguration.NewTypeConverter(scheme), + ) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + var ( _ clientset.Interface = &Clientset{} _ testing.FakeClient = &Clientset{} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gateway.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gateway.go index 589461d4ce..38b4ec9ca9 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gateway.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gateway.go @@ -44,22 +44,24 @@ var gatewaysKind = v1.SchemeGroupVersion.WithKind("Gateway") // Get takes name of the gateway, and returns the corresponding gateway object, and an error if there is any. func (c *FakeGateways) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Gateway, err error) { + emptyResult := &v1.Gateway{} obj, err := c.Fake. - Invokes(testing.NewGetAction(gatewaysResource, c.ns, name), &v1.Gateway{}) + Invokes(testing.NewGetActionWithOptions(gatewaysResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Gateway), err } // List takes label and field selectors, and returns the list of Gateways that match those selectors. func (c *FakeGateways) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GatewayList, err error) { + emptyResult := &v1.GatewayList{} obj, err := c.Fake. - Invokes(testing.NewListAction(gatewaysResource, gatewaysKind, c.ns, opts), &v1.GatewayList{}) + Invokes(testing.NewListActionWithOptions(gatewaysResource, gatewaysKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,40 +80,43 @@ func (c *FakeGateways) List(ctx context.Context, opts metav1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested gateways. func (c *FakeGateways) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(gatewaysResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(gatewaysResource, c.ns, opts)) } // Create takes the representation of a gateway and creates it. Returns the server's representation of the gateway, and an error, if there is any. func (c *FakeGateways) Create(ctx context.Context, gateway *v1.Gateway, opts metav1.CreateOptions) (result *v1.Gateway, err error) { + emptyResult := &v1.Gateway{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(gatewaysResource, c.ns, gateway), &v1.Gateway{}) + Invokes(testing.NewCreateActionWithOptions(gatewaysResource, c.ns, gateway, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Gateway), err } // Update takes the representation of a gateway and updates it. Returns the server's representation of the gateway, and an error, if there is any. func (c *FakeGateways) Update(ctx context.Context, gateway *v1.Gateway, opts metav1.UpdateOptions) (result *v1.Gateway, err error) { + emptyResult := &v1.Gateway{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(gatewaysResource, c.ns, gateway), &v1.Gateway{}) + Invokes(testing.NewUpdateActionWithOptions(gatewaysResource, c.ns, gateway, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Gateway), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeGateways) UpdateStatus(ctx context.Context, gateway *v1.Gateway, opts metav1.UpdateOptions) (*v1.Gateway, error) { +func (c *FakeGateways) UpdateStatus(ctx context.Context, gateway *v1.Gateway, opts metav1.UpdateOptions) (result *v1.Gateway, err error) { + emptyResult := &v1.Gateway{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(gatewaysResource, "status", c.ns, gateway), &v1.Gateway{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(gatewaysResource, "status", c.ns, gateway, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Gateway), err } @@ -126,7 +131,7 @@ func (c *FakeGateways) Delete(ctx context.Context, name string, opts metav1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeGateways) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(gatewaysResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(gatewaysResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.GatewayList{}) return err @@ -134,11 +139,12 @@ func (c *FakeGateways) DeleteCollection(ctx context.Context, opts metav1.DeleteO // Patch applies the patch and returns the patched gateway. func (c *FakeGateways) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Gateway, err error) { + emptyResult := &v1.Gateway{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, name, pt, data, subresources...), &v1.Gateway{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(gatewaysResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Gateway), err } @@ -156,11 +162,12 @@ func (c *FakeGateways) Apply(ctx context.Context, gateway *apisv1.GatewayApplyCo if name == nil { return nil, fmt.Errorf("gateway.Name must be provided to Apply") } + emptyResult := &v1.Gateway{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, *name, types.ApplyPatchType, data), &v1.Gateway{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(gatewaysResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Gateway), err } @@ -179,11 +186,12 @@ func (c *FakeGateways) ApplyStatus(ctx context.Context, gateway *apisv1.GatewayA if name == nil { return nil, fmt.Errorf("gateway.Name must be provided to Apply") } + emptyResult := &v1.Gateway{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.Gateway{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(gatewaysResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Gateway), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gatewayclass.go index 69d777711a..4cec1cac6f 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gatewayclass.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gatewayclass.go @@ -43,20 +43,22 @@ var gatewayclassesKind = v1.SchemeGroupVersion.WithKind("GatewayClass") // Get takes name of the gatewayClass, and returns the corresponding gatewayClass object, and an error if there is any. func (c *FakeGatewayClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GatewayClass, err error) { + emptyResult := &v1.GatewayClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(gatewayclassesResource, name), &v1.GatewayClass{}) + Invokes(testing.NewRootGetActionWithOptions(gatewayclassesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GatewayClass), err } // List takes label and field selectors, and returns the list of GatewayClasses that match those selectors. func (c *FakeGatewayClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GatewayClassList, err error) { + emptyResult := &v1.GatewayClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(gatewayclassesResource, gatewayclassesKind, opts), &v1.GatewayClassList{}) + Invokes(testing.NewRootListActionWithOptions(gatewayclassesResource, gatewayclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -75,36 +77,39 @@ func (c *FakeGatewayClasses) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested gatewayClasses. func (c *FakeGatewayClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(gatewayclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(gatewayclassesResource, opts)) } // Create takes the representation of a gatewayClass and creates it. Returns the server's representation of the gatewayClass, and an error, if there is any. func (c *FakeGatewayClasses) Create(ctx context.Context, gatewayClass *v1.GatewayClass, opts metav1.CreateOptions) (result *v1.GatewayClass, err error) { + emptyResult := &v1.GatewayClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(gatewayclassesResource, gatewayClass), &v1.GatewayClass{}) + Invokes(testing.NewRootCreateActionWithOptions(gatewayclassesResource, gatewayClass, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GatewayClass), err } // Update takes the representation of a gatewayClass and updates it. Returns the server's representation of the gatewayClass, and an error, if there is any. func (c *FakeGatewayClasses) Update(ctx context.Context, gatewayClass *v1.GatewayClass, opts metav1.UpdateOptions) (result *v1.GatewayClass, err error) { + emptyResult := &v1.GatewayClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(gatewayclassesResource, gatewayClass), &v1.GatewayClass{}) + Invokes(testing.NewRootUpdateActionWithOptions(gatewayclassesResource, gatewayClass, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GatewayClass), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeGatewayClasses) UpdateStatus(ctx context.Context, gatewayClass *v1.GatewayClass, opts metav1.UpdateOptions) (*v1.GatewayClass, error) { +func (c *FakeGatewayClasses) UpdateStatus(ctx context.Context, gatewayClass *v1.GatewayClass, opts metav1.UpdateOptions) (result *v1.GatewayClass, err error) { + emptyResult := &v1.GatewayClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(gatewayclassesResource, "status", gatewayClass), &v1.GatewayClass{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(gatewayclassesResource, "status", gatewayClass, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GatewayClass), err } @@ -118,7 +123,7 @@ func (c *FakeGatewayClasses) Delete(ctx context.Context, name string, opts metav // DeleteCollection deletes a collection of objects. func (c *FakeGatewayClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(gatewayclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(gatewayclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.GatewayClassList{}) return err @@ -126,10 +131,11 @@ func (c *FakeGatewayClasses) DeleteCollection(ctx context.Context, opts metav1.D // Patch applies the patch and returns the patched gatewayClass. func (c *FakeGatewayClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GatewayClass, err error) { + emptyResult := &v1.GatewayClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(gatewayclassesResource, name, pt, data, subresources...), &v1.GatewayClass{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(gatewayclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GatewayClass), err } @@ -147,10 +153,11 @@ func (c *FakeGatewayClasses) Apply(ctx context.Context, gatewayClass *apisv1.Gat if name == nil { return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") } + emptyResult := &v1.GatewayClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(gatewayclassesResource, *name, types.ApplyPatchType, data), &v1.GatewayClass{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(gatewayclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GatewayClass), err } @@ -169,10 +176,11 @@ func (c *FakeGatewayClasses) ApplyStatus(ctx context.Context, gatewayClass *apis if name == nil { return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") } + emptyResult := &v1.GatewayClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(gatewayclassesResource, *name, types.ApplyPatchType, data, "status"), &v1.GatewayClass{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(gatewayclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GatewayClass), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_grpcroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_grpcroute.go index 9e6bf9f87f..e4992e422b 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_grpcroute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_grpcroute.go @@ -44,22 +44,24 @@ var grpcroutesKind = v1.SchemeGroupVersion.WithKind("GRPCRoute") // Get takes name of the gRPCRoute, and returns the corresponding gRPCRoute object, and an error if there is any. func (c *FakeGRPCRoutes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GRPCRoute, err error) { + emptyResult := &v1.GRPCRoute{} obj, err := c.Fake. - Invokes(testing.NewGetAction(grpcroutesResource, c.ns, name), &v1.GRPCRoute{}) + Invokes(testing.NewGetActionWithOptions(grpcroutesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GRPCRoute), err } // List takes label and field selectors, and returns the list of GRPCRoutes that match those selectors. func (c *FakeGRPCRoutes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GRPCRouteList, err error) { + emptyResult := &v1.GRPCRouteList{} obj, err := c.Fake. - Invokes(testing.NewListAction(grpcroutesResource, grpcroutesKind, c.ns, opts), &v1.GRPCRouteList{}) + Invokes(testing.NewListActionWithOptions(grpcroutesResource, grpcroutesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,40 +80,43 @@ func (c *FakeGRPCRoutes) List(ctx context.Context, opts metav1.ListOptions) (res // Watch returns a watch.Interface that watches the requested gRPCRoutes. func (c *FakeGRPCRoutes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(grpcroutesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(grpcroutesResource, c.ns, opts)) } // Create takes the representation of a gRPCRoute and creates it. Returns the server's representation of the gRPCRoute, and an error, if there is any. func (c *FakeGRPCRoutes) Create(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.CreateOptions) (result *v1.GRPCRoute, err error) { + emptyResult := &v1.GRPCRoute{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(grpcroutesResource, c.ns, gRPCRoute), &v1.GRPCRoute{}) + Invokes(testing.NewCreateActionWithOptions(grpcroutesResource, c.ns, gRPCRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GRPCRoute), err } // Update takes the representation of a gRPCRoute and updates it. Returns the server's representation of the gRPCRoute, and an error, if there is any. func (c *FakeGRPCRoutes) Update(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.UpdateOptions) (result *v1.GRPCRoute, err error) { + emptyResult := &v1.GRPCRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(grpcroutesResource, c.ns, gRPCRoute), &v1.GRPCRoute{}) + Invokes(testing.NewUpdateActionWithOptions(grpcroutesResource, c.ns, gRPCRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GRPCRoute), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeGRPCRoutes) UpdateStatus(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.UpdateOptions) (*v1.GRPCRoute, error) { +func (c *FakeGRPCRoutes) UpdateStatus(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.UpdateOptions) (result *v1.GRPCRoute, err error) { + emptyResult := &v1.GRPCRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(grpcroutesResource, "status", c.ns, gRPCRoute), &v1.GRPCRoute{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(grpcroutesResource, "status", c.ns, gRPCRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GRPCRoute), err } @@ -126,7 +131,7 @@ func (c *FakeGRPCRoutes) Delete(ctx context.Context, name string, opts metav1.De // DeleteCollection deletes a collection of objects. func (c *FakeGRPCRoutes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(grpcroutesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(grpcroutesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.GRPCRouteList{}) return err @@ -134,11 +139,12 @@ func (c *FakeGRPCRoutes) DeleteCollection(ctx context.Context, opts metav1.Delet // Patch applies the patch and returns the patched gRPCRoute. func (c *FakeGRPCRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GRPCRoute, err error) { + emptyResult := &v1.GRPCRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(grpcroutesResource, c.ns, name, pt, data, subresources...), &v1.GRPCRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(grpcroutesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GRPCRoute), err } @@ -156,11 +162,12 @@ func (c *FakeGRPCRoutes) Apply(ctx context.Context, gRPCRoute *apisv1.GRPCRouteA if name == nil { return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") } + emptyResult := &v1.GRPCRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(grpcroutesResource, c.ns, *name, types.ApplyPatchType, data), &v1.GRPCRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(grpcroutesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GRPCRoute), err } @@ -179,11 +186,12 @@ func (c *FakeGRPCRoutes) ApplyStatus(ctx context.Context, gRPCRoute *apisv1.GRPC if name == nil { return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") } + emptyResult := &v1.GRPCRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(grpcroutesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.GRPCRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(grpcroutesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.GRPCRoute), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httproute.go index 77c2f0d7e4..2673628ea3 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httproute.go @@ -44,22 +44,24 @@ var httproutesKind = v1.SchemeGroupVersion.WithKind("HTTPRoute") // Get takes name of the hTTPRoute, and returns the corresponding hTTPRoute object, and an error if there is any. func (c *FakeHTTPRoutes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HTTPRoute, err error) { + emptyResult := &v1.HTTPRoute{} obj, err := c.Fake. - Invokes(testing.NewGetAction(httproutesResource, c.ns, name), &v1.HTTPRoute{}) + Invokes(testing.NewGetActionWithOptions(httproutesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HTTPRoute), err } // List takes label and field selectors, and returns the list of HTTPRoutes that match those selectors. func (c *FakeHTTPRoutes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HTTPRouteList, err error) { + emptyResult := &v1.HTTPRouteList{} obj, err := c.Fake. - Invokes(testing.NewListAction(httproutesResource, httproutesKind, c.ns, opts), &v1.HTTPRouteList{}) + Invokes(testing.NewListActionWithOptions(httproutesResource, httproutesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,40 +80,43 @@ func (c *FakeHTTPRoutes) List(ctx context.Context, opts metav1.ListOptions) (res // Watch returns a watch.Interface that watches the requested hTTPRoutes. func (c *FakeHTTPRoutes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(httproutesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(httproutesResource, c.ns, opts)) } // Create takes the representation of a hTTPRoute and creates it. Returns the server's representation of the hTTPRoute, and an error, if there is any. func (c *FakeHTTPRoutes) Create(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.CreateOptions) (result *v1.HTTPRoute, err error) { + emptyResult := &v1.HTTPRoute{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(httproutesResource, c.ns, hTTPRoute), &v1.HTTPRoute{}) + Invokes(testing.NewCreateActionWithOptions(httproutesResource, c.ns, hTTPRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HTTPRoute), err } // Update takes the representation of a hTTPRoute and updates it. Returns the server's representation of the hTTPRoute, and an error, if there is any. func (c *FakeHTTPRoutes) Update(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.UpdateOptions) (result *v1.HTTPRoute, err error) { + emptyResult := &v1.HTTPRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(httproutesResource, c.ns, hTTPRoute), &v1.HTTPRoute{}) + Invokes(testing.NewUpdateActionWithOptions(httproutesResource, c.ns, hTTPRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HTTPRoute), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeHTTPRoutes) UpdateStatus(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.UpdateOptions) (*v1.HTTPRoute, error) { +func (c *FakeHTTPRoutes) UpdateStatus(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.UpdateOptions) (result *v1.HTTPRoute, err error) { + emptyResult := &v1.HTTPRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(httproutesResource, "status", c.ns, hTTPRoute), &v1.HTTPRoute{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(httproutesResource, "status", c.ns, hTTPRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HTTPRoute), err } @@ -126,7 +131,7 @@ func (c *FakeHTTPRoutes) Delete(ctx context.Context, name string, opts metav1.De // DeleteCollection deletes a collection of objects. func (c *FakeHTTPRoutes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(httproutesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(httproutesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.HTTPRouteList{}) return err @@ -134,11 +139,12 @@ func (c *FakeHTTPRoutes) DeleteCollection(ctx context.Context, opts metav1.Delet // Patch applies the patch and returns the patched hTTPRoute. func (c *FakeHTTPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HTTPRoute, err error) { + emptyResult := &v1.HTTPRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(httproutesResource, c.ns, name, pt, data, subresources...), &v1.HTTPRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(httproutesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HTTPRoute), err } @@ -156,11 +162,12 @@ func (c *FakeHTTPRoutes) Apply(ctx context.Context, hTTPRoute *apisv1.HTTPRouteA if name == nil { return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") } + emptyResult := &v1.HTTPRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(httproutesResource, c.ns, *name, types.ApplyPatchType, data), &v1.HTTPRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(httproutesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HTTPRoute), err } @@ -179,11 +186,12 @@ func (c *FakeHTTPRoutes) ApplyStatus(ctx context.Context, hTTPRoute *apisv1.HTTP if name == nil { return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") } + emptyResult := &v1.HTTPRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(httproutesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.HTTPRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(httproutesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HTTPRoute), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gateway.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gateway.go index 9ad264580d..0e7d9372a5 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gateway.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gateway.go @@ -20,14 +20,11 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" @@ -43,6 +40,7 @@ type GatewaysGetter interface { type GatewayInterface interface { Create(ctx context.Context, gateway *v1.Gateway, opts metav1.CreateOptions) (*v1.Gateway, error) Update(ctx context.Context, gateway *v1.Gateway, opts metav1.UpdateOptions) (*v1.Gateway, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, gateway *v1.Gateway, opts metav1.UpdateOptions) (*v1.Gateway, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -51,206 +49,25 @@ type GatewayInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Gateway, err error) Apply(ctx context.Context, gateway *apisv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, gateway *apisv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) GatewayExpansion } // gateways implements GatewayInterface type gateways struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.Gateway, *v1.GatewayList, *apisv1.GatewayApplyConfiguration] } // newGateways returns a Gateways func newGateways(c *GatewayV1Client, namespace string) *gateways { return &gateways{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.Gateway, *v1.GatewayList, *apisv1.GatewayApplyConfiguration]( + "gateways", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Gateway { return &v1.Gateway{} }, + func() *v1.GatewayList { return &v1.GatewayList{} }), } } - -// Get takes name of the gateway, and returns the corresponding gateway object, and an error if there is any. -func (c *gateways) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Gateway, err error) { - result = &v1.Gateway{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gateways"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Gateways that match those selectors. -func (c *gateways) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GatewayList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.GatewayList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gateways"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested gateways. -func (c *gateways) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("gateways"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a gateway and creates it. Returns the server's representation of the gateway, and an error, if there is any. -func (c *gateways) Create(ctx context.Context, gateway *v1.Gateway, opts metav1.CreateOptions) (result *v1.Gateway, err error) { - result = &v1.Gateway{} - err = c.client.Post(). - Namespace(c.ns). - Resource("gateways"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gateway). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a gateway and updates it. Returns the server's representation of the gateway, and an error, if there is any. -func (c *gateways) Update(ctx context.Context, gateway *v1.Gateway, opts metav1.UpdateOptions) (result *v1.Gateway, err error) { - result = &v1.Gateway{} - err = c.client.Put(). - Namespace(c.ns). - Resource("gateways"). - Name(gateway.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gateway). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *gateways) UpdateStatus(ctx context.Context, gateway *v1.Gateway, opts metav1.UpdateOptions) (result *v1.Gateway, err error) { - result = &v1.Gateway{} - err = c.client.Put(). - Namespace(c.ns). - Resource("gateways"). - Name(gateway.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gateway). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the gateway and deletes it. Returns an error if one occurs. -func (c *gateways) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("gateways"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *gateways) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("gateways"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched gateway. -func (c *gateways) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Gateway, err error) { - result = &v1.Gateway{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("gateways"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied gateway. -func (c *gateways) Apply(ctx context.Context, gateway *apisv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) { - if gateway == nil { - return nil, fmt.Errorf("gateway provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(gateway) - if err != nil { - return nil, err - } - name := gateway.Name - if name == nil { - return nil, fmt.Errorf("gateway.Name must be provided to Apply") - } - result = &v1.Gateway{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("gateways"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *gateways) ApplyStatus(ctx context.Context, gateway *apisv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) { - if gateway == nil { - return nil, fmt.Errorf("gateway provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(gateway) - if err != nil { - return nil, err - } - - name := gateway.Name - if name == nil { - return nil, fmt.Errorf("gateway.Name must be provided to Apply") - } - - result = &v1.Gateway{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("gateways"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gatewayclass.go index 817b92a7c3..2f764f147d 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gatewayclass.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gatewayclass.go @@ -20,14 +20,11 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" @@ -43,6 +40,7 @@ type GatewayClassesGetter interface { type GatewayClassInterface interface { Create(ctx context.Context, gatewayClass *v1.GatewayClass, opts metav1.CreateOptions) (*v1.GatewayClass, error) Update(ctx context.Context, gatewayClass *v1.GatewayClass, opts metav1.UpdateOptions) (*v1.GatewayClass, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, gatewayClass *v1.GatewayClass, opts metav1.UpdateOptions) (*v1.GatewayClass, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -51,193 +49,25 @@ type GatewayClassInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GatewayClass, err error) Apply(ctx context.Context, gatewayClass *apisv1.GatewayClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GatewayClass, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, gatewayClass *apisv1.GatewayClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GatewayClass, err error) GatewayClassExpansion } // gatewayClasses implements GatewayClassInterface type gatewayClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.GatewayClass, *v1.GatewayClassList, *apisv1.GatewayClassApplyConfiguration] } // newGatewayClasses returns a GatewayClasses func newGatewayClasses(c *GatewayV1Client) *gatewayClasses { return &gatewayClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.GatewayClass, *v1.GatewayClassList, *apisv1.GatewayClassApplyConfiguration]( + "gatewayclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.GatewayClass { return &v1.GatewayClass{} }, + func() *v1.GatewayClassList { return &v1.GatewayClassList{} }), } } - -// Get takes name of the gatewayClass, and returns the corresponding gatewayClass object, and an error if there is any. -func (c *gatewayClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GatewayClass, err error) { - result = &v1.GatewayClass{} - err = c.client.Get(). - Resource("gatewayclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of GatewayClasses that match those selectors. -func (c *gatewayClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GatewayClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.GatewayClassList{} - err = c.client.Get(). - Resource("gatewayclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested gatewayClasses. -func (c *gatewayClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("gatewayclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a gatewayClass and creates it. Returns the server's representation of the gatewayClass, and an error, if there is any. -func (c *gatewayClasses) Create(ctx context.Context, gatewayClass *v1.GatewayClass, opts metav1.CreateOptions) (result *v1.GatewayClass, err error) { - result = &v1.GatewayClass{} - err = c.client.Post(). - Resource("gatewayclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gatewayClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a gatewayClass and updates it. Returns the server's representation of the gatewayClass, and an error, if there is any. -func (c *gatewayClasses) Update(ctx context.Context, gatewayClass *v1.GatewayClass, opts metav1.UpdateOptions) (result *v1.GatewayClass, err error) { - result = &v1.GatewayClass{} - err = c.client.Put(). - Resource("gatewayclasses"). - Name(gatewayClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gatewayClass). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *gatewayClasses) UpdateStatus(ctx context.Context, gatewayClass *v1.GatewayClass, opts metav1.UpdateOptions) (result *v1.GatewayClass, err error) { - result = &v1.GatewayClass{} - err = c.client.Put(). - Resource("gatewayclasses"). - Name(gatewayClass.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gatewayClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the gatewayClass and deletes it. Returns an error if one occurs. -func (c *gatewayClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("gatewayclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *gatewayClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("gatewayclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched gatewayClass. -func (c *gatewayClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GatewayClass, err error) { - result = &v1.GatewayClass{} - err = c.client.Patch(pt). - Resource("gatewayclasses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied gatewayClass. -func (c *gatewayClasses) Apply(ctx context.Context, gatewayClass *apisv1.GatewayClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GatewayClass, err error) { - if gatewayClass == nil { - return nil, fmt.Errorf("gatewayClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(gatewayClass) - if err != nil { - return nil, err - } - name := gatewayClass.Name - if name == nil { - return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") - } - result = &v1.GatewayClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("gatewayclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *gatewayClasses) ApplyStatus(ctx context.Context, gatewayClass *apisv1.GatewayClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GatewayClass, err error) { - if gatewayClass == nil { - return nil, fmt.Errorf("gatewayClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(gatewayClass) - if err != nil { - return nil, err - } - - name := gatewayClass.Name - if name == nil { - return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") - } - - result = &v1.GatewayClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("gatewayclasses"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/grpcroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/grpcroute.go index f8e1c2132f..55748a1d29 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/grpcroute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/grpcroute.go @@ -20,14 +20,11 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" @@ -43,6 +40,7 @@ type GRPCRoutesGetter interface { type GRPCRouteInterface interface { Create(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.CreateOptions) (*v1.GRPCRoute, error) Update(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.UpdateOptions) (*v1.GRPCRoute, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.UpdateOptions) (*v1.GRPCRoute, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -51,206 +49,25 @@ type GRPCRouteInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GRPCRoute, err error) Apply(ctx context.Context, gRPCRoute *apisv1.GRPCRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GRPCRoute, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, gRPCRoute *apisv1.GRPCRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GRPCRoute, err error) GRPCRouteExpansion } // gRPCRoutes implements GRPCRouteInterface type gRPCRoutes struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.GRPCRoute, *v1.GRPCRouteList, *apisv1.GRPCRouteApplyConfiguration] } // newGRPCRoutes returns a GRPCRoutes func newGRPCRoutes(c *GatewayV1Client, namespace string) *gRPCRoutes { return &gRPCRoutes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.GRPCRoute, *v1.GRPCRouteList, *apisv1.GRPCRouteApplyConfiguration]( + "grpcroutes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.GRPCRoute { return &v1.GRPCRoute{} }, + func() *v1.GRPCRouteList { return &v1.GRPCRouteList{} }), } } - -// Get takes name of the gRPCRoute, and returns the corresponding gRPCRoute object, and an error if there is any. -func (c *gRPCRoutes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GRPCRoute, err error) { - result = &v1.GRPCRoute{} - err = c.client.Get(). - Namespace(c.ns). - Resource("grpcroutes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of GRPCRoutes that match those selectors. -func (c *gRPCRoutes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GRPCRouteList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.GRPCRouteList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("grpcroutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested gRPCRoutes. -func (c *gRPCRoutes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("grpcroutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a gRPCRoute and creates it. Returns the server's representation of the gRPCRoute, and an error, if there is any. -func (c *gRPCRoutes) Create(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.CreateOptions) (result *v1.GRPCRoute, err error) { - result = &v1.GRPCRoute{} - err = c.client.Post(). - Namespace(c.ns). - Resource("grpcroutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gRPCRoute). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a gRPCRoute and updates it. Returns the server's representation of the gRPCRoute, and an error, if there is any. -func (c *gRPCRoutes) Update(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.UpdateOptions) (result *v1.GRPCRoute, err error) { - result = &v1.GRPCRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("grpcroutes"). - Name(gRPCRoute.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gRPCRoute). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *gRPCRoutes) UpdateStatus(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.UpdateOptions) (result *v1.GRPCRoute, err error) { - result = &v1.GRPCRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("grpcroutes"). - Name(gRPCRoute.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gRPCRoute). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the gRPCRoute and deletes it. Returns an error if one occurs. -func (c *gRPCRoutes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("grpcroutes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *gRPCRoutes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("grpcroutes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched gRPCRoute. -func (c *gRPCRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GRPCRoute, err error) { - result = &v1.GRPCRoute{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("grpcroutes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied gRPCRoute. -func (c *gRPCRoutes) Apply(ctx context.Context, gRPCRoute *apisv1.GRPCRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GRPCRoute, err error) { - if gRPCRoute == nil { - return nil, fmt.Errorf("gRPCRoute provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(gRPCRoute) - if err != nil { - return nil, err - } - name := gRPCRoute.Name - if name == nil { - return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") - } - result = &v1.GRPCRoute{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("grpcroutes"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *gRPCRoutes) ApplyStatus(ctx context.Context, gRPCRoute *apisv1.GRPCRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GRPCRoute, err error) { - if gRPCRoute == nil { - return nil, fmt.Errorf("gRPCRoute provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(gRPCRoute) - if err != nil { - return nil, err - } - - name := gRPCRoute.Name - if name == nil { - return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") - } - - result = &v1.GRPCRoute{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("grpcroutes"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/httproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/httproute.go index 89cab587c2..29f4fe9c6b 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/httproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/httproute.go @@ -20,14 +20,11 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" @@ -43,6 +40,7 @@ type HTTPRoutesGetter interface { type HTTPRouteInterface interface { Create(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.CreateOptions) (*v1.HTTPRoute, error) Update(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.UpdateOptions) (*v1.HTTPRoute, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.UpdateOptions) (*v1.HTTPRoute, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -51,206 +49,25 @@ type HTTPRouteInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HTTPRoute, err error) Apply(ctx context.Context, hTTPRoute *apisv1.HTTPRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HTTPRoute, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, hTTPRoute *apisv1.HTTPRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HTTPRoute, err error) HTTPRouteExpansion } // hTTPRoutes implements HTTPRouteInterface type hTTPRoutes struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.HTTPRoute, *v1.HTTPRouteList, *apisv1.HTTPRouteApplyConfiguration] } // newHTTPRoutes returns a HTTPRoutes func newHTTPRoutes(c *GatewayV1Client, namespace string) *hTTPRoutes { return &hTTPRoutes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.HTTPRoute, *v1.HTTPRouteList, *apisv1.HTTPRouteApplyConfiguration]( + "httproutes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.HTTPRoute { return &v1.HTTPRoute{} }, + func() *v1.HTTPRouteList { return &v1.HTTPRouteList{} }), } } - -// Get takes name of the hTTPRoute, and returns the corresponding hTTPRoute object, and an error if there is any. -func (c *hTTPRoutes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HTTPRoute, err error) { - result = &v1.HTTPRoute{} - err = c.client.Get(). - Namespace(c.ns). - Resource("httproutes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of HTTPRoutes that match those selectors. -func (c *hTTPRoutes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HTTPRouteList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.HTTPRouteList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("httproutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested hTTPRoutes. -func (c *hTTPRoutes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("httproutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a hTTPRoute and creates it. Returns the server's representation of the hTTPRoute, and an error, if there is any. -func (c *hTTPRoutes) Create(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.CreateOptions) (result *v1.HTTPRoute, err error) { - result = &v1.HTTPRoute{} - err = c.client.Post(). - Namespace(c.ns). - Resource("httproutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(hTTPRoute). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a hTTPRoute and updates it. Returns the server's representation of the hTTPRoute, and an error, if there is any. -func (c *hTTPRoutes) Update(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.UpdateOptions) (result *v1.HTTPRoute, err error) { - result = &v1.HTTPRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("httproutes"). - Name(hTTPRoute.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(hTTPRoute). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *hTTPRoutes) UpdateStatus(ctx context.Context, hTTPRoute *v1.HTTPRoute, opts metav1.UpdateOptions) (result *v1.HTTPRoute, err error) { - result = &v1.HTTPRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("httproutes"). - Name(hTTPRoute.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(hTTPRoute). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the hTTPRoute and deletes it. Returns an error if one occurs. -func (c *hTTPRoutes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("httproutes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *hTTPRoutes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("httproutes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched hTTPRoute. -func (c *hTTPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HTTPRoute, err error) { - result = &v1.HTTPRoute{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("httproutes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied hTTPRoute. -func (c *hTTPRoutes) Apply(ctx context.Context, hTTPRoute *apisv1.HTTPRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HTTPRoute, err error) { - if hTTPRoute == nil { - return nil, fmt.Errorf("hTTPRoute provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(hTTPRoute) - if err != nil { - return nil, err - } - name := hTTPRoute.Name - if name == nil { - return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") - } - result = &v1.HTTPRoute{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("httproutes"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *hTTPRoutes) ApplyStatus(ctx context.Context, hTTPRoute *apisv1.HTTPRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HTTPRoute, err error) { - if hTTPRoute == nil { - return nil, fmt.Errorf("hTTPRoute provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(hTTPRoute) - if err != nil { - return nil, err - } - - name := hTTPRoute.Name - if name == nil { - return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") - } - - result = &v1.HTTPRoute{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("httproutes"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendlbpolicy.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendlbpolicy.go index 514cac1e28..0429945002 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendlbpolicy.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendlbpolicy.go @@ -20,14 +20,11 @@ package v1alpha2 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" @@ -43,6 +40,7 @@ type BackendLBPoliciesGetter interface { type BackendLBPolicyInterface interface { Create(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.CreateOptions) (*v1alpha2.BackendLBPolicy, error) Update(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendLBPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendLBPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,206 +49,25 @@ type BackendLBPolicyInterface interface { Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendLBPolicy, err error) Apply(ctx context.Context, backendLBPolicy *apisv1alpha2.BackendLBPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendLBPolicy, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, backendLBPolicy *apisv1alpha2.BackendLBPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendLBPolicy, err error) BackendLBPolicyExpansion } // backendLBPolicies implements BackendLBPolicyInterface type backendLBPolicies struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha2.BackendLBPolicy, *v1alpha2.BackendLBPolicyList, *apisv1alpha2.BackendLBPolicyApplyConfiguration] } // newBackendLBPolicies returns a BackendLBPolicies func newBackendLBPolicies(c *GatewayV1alpha2Client, namespace string) *backendLBPolicies { return &backendLBPolicies{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha2.BackendLBPolicy, *v1alpha2.BackendLBPolicyList, *apisv1alpha2.BackendLBPolicyApplyConfiguration]( + "backendlbpolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha2.BackendLBPolicy { return &v1alpha2.BackendLBPolicy{} }, + func() *v1alpha2.BackendLBPolicyList { return &v1alpha2.BackendLBPolicyList{} }), } } - -// Get takes name of the backendLBPolicy, and returns the corresponding backendLBPolicy object, and an error if there is any. -func (c *backendLBPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.BackendLBPolicy, err error) { - result = &v1alpha2.BackendLBPolicy{} - err = c.client.Get(). - Namespace(c.ns). - Resource("backendlbpolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of BackendLBPolicies that match those selectors. -func (c *backendLBPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.BackendLBPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.BackendLBPolicyList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("backendlbpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested backendLBPolicies. -func (c *backendLBPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("backendlbpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a backendLBPolicy and creates it. Returns the server's representation of the backendLBPolicy, and an error, if there is any. -func (c *backendLBPolicies) Create(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.CreateOptions) (result *v1alpha2.BackendLBPolicy, err error) { - result = &v1alpha2.BackendLBPolicy{} - err = c.client.Post(). - Namespace(c.ns). - Resource("backendlbpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backendLBPolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a backendLBPolicy and updates it. Returns the server's representation of the backendLBPolicy, and an error, if there is any. -func (c *backendLBPolicies) Update(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendLBPolicy, err error) { - result = &v1alpha2.BackendLBPolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("backendlbpolicies"). - Name(backendLBPolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backendLBPolicy). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *backendLBPolicies) UpdateStatus(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendLBPolicy, err error) { - result = &v1alpha2.BackendLBPolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("backendlbpolicies"). - Name(backendLBPolicy.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backendLBPolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the backendLBPolicy and deletes it. Returns an error if one occurs. -func (c *backendLBPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("backendlbpolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *backendLBPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("backendlbpolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched backendLBPolicy. -func (c *backendLBPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendLBPolicy, err error) { - result = &v1alpha2.BackendLBPolicy{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("backendlbpolicies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied backendLBPolicy. -func (c *backendLBPolicies) Apply(ctx context.Context, backendLBPolicy *apisv1alpha2.BackendLBPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendLBPolicy, err error) { - if backendLBPolicy == nil { - return nil, fmt.Errorf("backendLBPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(backendLBPolicy) - if err != nil { - return nil, err - } - name := backendLBPolicy.Name - if name == nil { - return nil, fmt.Errorf("backendLBPolicy.Name must be provided to Apply") - } - result = &v1alpha2.BackendLBPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("backendlbpolicies"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *backendLBPolicies) ApplyStatus(ctx context.Context, backendLBPolicy *apisv1alpha2.BackendLBPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendLBPolicy, err error) { - if backendLBPolicy == nil { - return nil, fmt.Errorf("backendLBPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(backendLBPolicy) - if err != nil { - return nil, err - } - - name := backendLBPolicy.Name - if name == nil { - return nil, fmt.Errorf("backendLBPolicy.Name must be provided to Apply") - } - - result = &v1alpha2.BackendLBPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("backendlbpolicies"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendlbpolicy.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendlbpolicy.go index dab088600b..9053eac042 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendlbpolicy.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendlbpolicy.go @@ -44,22 +44,24 @@ var backendlbpoliciesKind = v1alpha2.SchemeGroupVersion.WithKind("BackendLBPolic // Get takes name of the backendLBPolicy, and returns the corresponding backendLBPolicy object, and an error if there is any. func (c *FakeBackendLBPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.BackendLBPolicy, err error) { + emptyResult := &v1alpha2.BackendLBPolicy{} obj, err := c.Fake. - Invokes(testing.NewGetAction(backendlbpoliciesResource, c.ns, name), &v1alpha2.BackendLBPolicy{}) + Invokes(testing.NewGetActionWithOptions(backendlbpoliciesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.BackendLBPolicy), err } // List takes label and field selectors, and returns the list of BackendLBPolicies that match those selectors. func (c *FakeBackendLBPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.BackendLBPolicyList, err error) { + emptyResult := &v1alpha2.BackendLBPolicyList{} obj, err := c.Fake. - Invokes(testing.NewListAction(backendlbpoliciesResource, backendlbpoliciesKind, c.ns, opts), &v1alpha2.BackendLBPolicyList{}) + Invokes(testing.NewListActionWithOptions(backendlbpoliciesResource, backendlbpoliciesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,40 +80,43 @@ func (c *FakeBackendLBPolicies) List(ctx context.Context, opts v1.ListOptions) ( // Watch returns a watch.Interface that watches the requested backendLBPolicies. func (c *FakeBackendLBPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(backendlbpoliciesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(backendlbpoliciesResource, c.ns, opts)) } // Create takes the representation of a backendLBPolicy and creates it. Returns the server's representation of the backendLBPolicy, and an error, if there is any. func (c *FakeBackendLBPolicies) Create(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.CreateOptions) (result *v1alpha2.BackendLBPolicy, err error) { + emptyResult := &v1alpha2.BackendLBPolicy{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(backendlbpoliciesResource, c.ns, backendLBPolicy), &v1alpha2.BackendLBPolicy{}) + Invokes(testing.NewCreateActionWithOptions(backendlbpoliciesResource, c.ns, backendLBPolicy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.BackendLBPolicy), err } // Update takes the representation of a backendLBPolicy and updates it. Returns the server's representation of the backendLBPolicy, and an error, if there is any. func (c *FakeBackendLBPolicies) Update(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendLBPolicy, err error) { + emptyResult := &v1alpha2.BackendLBPolicy{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(backendlbpoliciesResource, c.ns, backendLBPolicy), &v1alpha2.BackendLBPolicy{}) + Invokes(testing.NewUpdateActionWithOptions(backendlbpoliciesResource, c.ns, backendLBPolicy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.BackendLBPolicy), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeBackendLBPolicies) UpdateStatus(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendLBPolicy, error) { +func (c *FakeBackendLBPolicies) UpdateStatus(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendLBPolicy, err error) { + emptyResult := &v1alpha2.BackendLBPolicy{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(backendlbpoliciesResource, "status", c.ns, backendLBPolicy), &v1alpha2.BackendLBPolicy{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(backendlbpoliciesResource, "status", c.ns, backendLBPolicy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.BackendLBPolicy), err } @@ -126,7 +131,7 @@ func (c *FakeBackendLBPolicies) Delete(ctx context.Context, name string, opts v1 // DeleteCollection deletes a collection of objects. func (c *FakeBackendLBPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(backendlbpoliciesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(backendlbpoliciesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha2.BackendLBPolicyList{}) return err @@ -134,11 +139,12 @@ func (c *FakeBackendLBPolicies) DeleteCollection(ctx context.Context, opts v1.De // Patch applies the patch and returns the patched backendLBPolicy. func (c *FakeBackendLBPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendLBPolicy, err error) { + emptyResult := &v1alpha2.BackendLBPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(backendlbpoliciesResource, c.ns, name, pt, data, subresources...), &v1alpha2.BackendLBPolicy{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(backendlbpoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.BackendLBPolicy), err } @@ -156,11 +162,12 @@ func (c *FakeBackendLBPolicies) Apply(ctx context.Context, backendLBPolicy *apis if name == nil { return nil, fmt.Errorf("backendLBPolicy.Name must be provided to Apply") } + emptyResult := &v1alpha2.BackendLBPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(backendlbpoliciesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.BackendLBPolicy{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(backendlbpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.BackendLBPolicy), err } @@ -179,11 +186,12 @@ func (c *FakeBackendLBPolicies) ApplyStatus(ctx context.Context, backendLBPolicy if name == nil { return nil, fmt.Errorf("backendLBPolicy.Name must be provided to Apply") } + emptyResult := &v1alpha2.BackendLBPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(backendlbpoliciesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha2.BackendLBPolicy{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(backendlbpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.BackendLBPolicy), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_grpcroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_grpcroute.go index 3059cb9944..82ea2b8db7 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_grpcroute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_grpcroute.go @@ -44,22 +44,24 @@ var grpcroutesKind = v1alpha2.SchemeGroupVersion.WithKind("GRPCRoute") // Get takes name of the gRPCRoute, and returns the corresponding gRPCRoute object, and an error if there is any. func (c *FakeGRPCRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.GRPCRoute, err error) { + emptyResult := &v1alpha2.GRPCRoute{} obj, err := c.Fake. - Invokes(testing.NewGetAction(grpcroutesResource, c.ns, name), &v1alpha2.GRPCRoute{}) + Invokes(testing.NewGetActionWithOptions(grpcroutesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.GRPCRoute), err } // List takes label and field selectors, and returns the list of GRPCRoutes that match those selectors. func (c *FakeGRPCRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.GRPCRouteList, err error) { + emptyResult := &v1alpha2.GRPCRouteList{} obj, err := c.Fake. - Invokes(testing.NewListAction(grpcroutesResource, grpcroutesKind, c.ns, opts), &v1alpha2.GRPCRouteList{}) + Invokes(testing.NewListActionWithOptions(grpcroutesResource, grpcroutesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,40 +80,43 @@ func (c *FakeGRPCRoutes) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested gRPCRoutes. func (c *FakeGRPCRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(grpcroutesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(grpcroutesResource, c.ns, opts)) } // Create takes the representation of a gRPCRoute and creates it. Returns the server's representation of the gRPCRoute, and an error, if there is any. func (c *FakeGRPCRoutes) Create(ctx context.Context, gRPCRoute *v1alpha2.GRPCRoute, opts v1.CreateOptions) (result *v1alpha2.GRPCRoute, err error) { + emptyResult := &v1alpha2.GRPCRoute{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(grpcroutesResource, c.ns, gRPCRoute), &v1alpha2.GRPCRoute{}) + Invokes(testing.NewCreateActionWithOptions(grpcroutesResource, c.ns, gRPCRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.GRPCRoute), err } // Update takes the representation of a gRPCRoute and updates it. Returns the server's representation of the gRPCRoute, and an error, if there is any. func (c *FakeGRPCRoutes) Update(ctx context.Context, gRPCRoute *v1alpha2.GRPCRoute, opts v1.UpdateOptions) (result *v1alpha2.GRPCRoute, err error) { + emptyResult := &v1alpha2.GRPCRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(grpcroutesResource, c.ns, gRPCRoute), &v1alpha2.GRPCRoute{}) + Invokes(testing.NewUpdateActionWithOptions(grpcroutesResource, c.ns, gRPCRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.GRPCRoute), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeGRPCRoutes) UpdateStatus(ctx context.Context, gRPCRoute *v1alpha2.GRPCRoute, opts v1.UpdateOptions) (*v1alpha2.GRPCRoute, error) { +func (c *FakeGRPCRoutes) UpdateStatus(ctx context.Context, gRPCRoute *v1alpha2.GRPCRoute, opts v1.UpdateOptions) (result *v1alpha2.GRPCRoute, err error) { + emptyResult := &v1alpha2.GRPCRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(grpcroutesResource, "status", c.ns, gRPCRoute), &v1alpha2.GRPCRoute{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(grpcroutesResource, "status", c.ns, gRPCRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.GRPCRoute), err } @@ -126,7 +131,7 @@ func (c *FakeGRPCRoutes) Delete(ctx context.Context, name string, opts v1.Delete // DeleteCollection deletes a collection of objects. func (c *FakeGRPCRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(grpcroutesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(grpcroutesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha2.GRPCRouteList{}) return err @@ -134,11 +139,12 @@ func (c *FakeGRPCRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOpt // Patch applies the patch and returns the patched gRPCRoute. func (c *FakeGRPCRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.GRPCRoute, err error) { + emptyResult := &v1alpha2.GRPCRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(grpcroutesResource, c.ns, name, pt, data, subresources...), &v1alpha2.GRPCRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(grpcroutesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.GRPCRoute), err } @@ -156,11 +162,12 @@ func (c *FakeGRPCRoutes) Apply(ctx context.Context, gRPCRoute *apisv1alpha2.GRPC if name == nil { return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") } + emptyResult := &v1alpha2.GRPCRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(grpcroutesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.GRPCRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(grpcroutesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.GRPCRoute), err } @@ -179,11 +186,12 @@ func (c *FakeGRPCRoutes) ApplyStatus(ctx context.Context, gRPCRoute *apisv1alpha if name == nil { return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") } + emptyResult := &v1alpha2.GRPCRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(grpcroutesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha2.GRPCRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(grpcroutesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.GRPCRoute), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_referencegrant.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_referencegrant.go index 50c90fa8a1..31b65d3a5b 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_referencegrant.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_referencegrant.go @@ -44,22 +44,24 @@ var referencegrantsKind = v1alpha2.SchemeGroupVersion.WithKind("ReferenceGrant") // Get takes name of the referenceGrant, and returns the corresponding referenceGrant object, and an error if there is any. func (c *FakeReferenceGrants) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ReferenceGrant, err error) { + emptyResult := &v1alpha2.ReferenceGrant{} obj, err := c.Fake. - Invokes(testing.NewGetAction(referencegrantsResource, c.ns, name), &v1alpha2.ReferenceGrant{}) + Invokes(testing.NewGetActionWithOptions(referencegrantsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ReferenceGrant), err } // List takes label and field selectors, and returns the list of ReferenceGrants that match those selectors. func (c *FakeReferenceGrants) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ReferenceGrantList, err error) { + emptyResult := &v1alpha2.ReferenceGrantList{} obj, err := c.Fake. - Invokes(testing.NewListAction(referencegrantsResource, referencegrantsKind, c.ns, opts), &v1alpha2.ReferenceGrantList{}) + Invokes(testing.NewListActionWithOptions(referencegrantsResource, referencegrantsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,28 +80,30 @@ func (c *FakeReferenceGrants) List(ctx context.Context, opts v1.ListOptions) (re // Watch returns a watch.Interface that watches the requested referenceGrants. func (c *FakeReferenceGrants) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(referencegrantsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(referencegrantsResource, c.ns, opts)) } // Create takes the representation of a referenceGrant and creates it. Returns the server's representation of the referenceGrant, and an error, if there is any. func (c *FakeReferenceGrants) Create(ctx context.Context, referenceGrant *v1alpha2.ReferenceGrant, opts v1.CreateOptions) (result *v1alpha2.ReferenceGrant, err error) { + emptyResult := &v1alpha2.ReferenceGrant{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(referencegrantsResource, c.ns, referenceGrant), &v1alpha2.ReferenceGrant{}) + Invokes(testing.NewCreateActionWithOptions(referencegrantsResource, c.ns, referenceGrant, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ReferenceGrant), err } // Update takes the representation of a referenceGrant and updates it. Returns the server's representation of the referenceGrant, and an error, if there is any. func (c *FakeReferenceGrants) Update(ctx context.Context, referenceGrant *v1alpha2.ReferenceGrant, opts v1.UpdateOptions) (result *v1alpha2.ReferenceGrant, err error) { + emptyResult := &v1alpha2.ReferenceGrant{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(referencegrantsResource, c.ns, referenceGrant), &v1alpha2.ReferenceGrant{}) + Invokes(testing.NewUpdateActionWithOptions(referencegrantsResource, c.ns, referenceGrant, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ReferenceGrant), err } @@ -114,7 +118,7 @@ func (c *FakeReferenceGrants) Delete(ctx context.Context, name string, opts v1.D // DeleteCollection deletes a collection of objects. func (c *FakeReferenceGrants) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(referencegrantsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(referencegrantsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha2.ReferenceGrantList{}) return err @@ -122,11 +126,12 @@ func (c *FakeReferenceGrants) DeleteCollection(ctx context.Context, opts v1.Dele // Patch applies the patch and returns the patched referenceGrant. func (c *FakeReferenceGrants) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ReferenceGrant, err error) { + emptyResult := &v1alpha2.ReferenceGrant{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(referencegrantsResource, c.ns, name, pt, data, subresources...), &v1alpha2.ReferenceGrant{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(referencegrantsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ReferenceGrant), err } @@ -144,11 +149,12 @@ func (c *FakeReferenceGrants) Apply(ctx context.Context, referenceGrant *apisv1a if name == nil { return nil, fmt.Errorf("referenceGrant.Name must be provided to Apply") } + emptyResult := &v1alpha2.ReferenceGrant{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(referencegrantsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.ReferenceGrant{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(referencegrantsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ReferenceGrant), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tcproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tcproute.go index b93e76628d..32b88e16c3 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tcproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tcproute.go @@ -44,22 +44,24 @@ var tcproutesKind = v1alpha2.SchemeGroupVersion.WithKind("TCPRoute") // Get takes name of the tCPRoute, and returns the corresponding tCPRoute object, and an error if there is any. func (c *FakeTCPRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.TCPRoute, err error) { + emptyResult := &v1alpha2.TCPRoute{} obj, err := c.Fake. - Invokes(testing.NewGetAction(tcproutesResource, c.ns, name), &v1alpha2.TCPRoute{}) + Invokes(testing.NewGetActionWithOptions(tcproutesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.TCPRoute), err } // List takes label and field selectors, and returns the list of TCPRoutes that match those selectors. func (c *FakeTCPRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.TCPRouteList, err error) { + emptyResult := &v1alpha2.TCPRouteList{} obj, err := c.Fake. - Invokes(testing.NewListAction(tcproutesResource, tcproutesKind, c.ns, opts), &v1alpha2.TCPRouteList{}) + Invokes(testing.NewListActionWithOptions(tcproutesResource, tcproutesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,40 +80,43 @@ func (c *FakeTCPRoutes) List(ctx context.Context, opts v1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested tCPRoutes. func (c *FakeTCPRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(tcproutesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(tcproutesResource, c.ns, opts)) } // Create takes the representation of a tCPRoute and creates it. Returns the server's representation of the tCPRoute, and an error, if there is any. func (c *FakeTCPRoutes) Create(ctx context.Context, tCPRoute *v1alpha2.TCPRoute, opts v1.CreateOptions) (result *v1alpha2.TCPRoute, err error) { + emptyResult := &v1alpha2.TCPRoute{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(tcproutesResource, c.ns, tCPRoute), &v1alpha2.TCPRoute{}) + Invokes(testing.NewCreateActionWithOptions(tcproutesResource, c.ns, tCPRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.TCPRoute), err } // Update takes the representation of a tCPRoute and updates it. Returns the server's representation of the tCPRoute, and an error, if there is any. func (c *FakeTCPRoutes) Update(ctx context.Context, tCPRoute *v1alpha2.TCPRoute, opts v1.UpdateOptions) (result *v1alpha2.TCPRoute, err error) { + emptyResult := &v1alpha2.TCPRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(tcproutesResource, c.ns, tCPRoute), &v1alpha2.TCPRoute{}) + Invokes(testing.NewUpdateActionWithOptions(tcproutesResource, c.ns, tCPRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.TCPRoute), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeTCPRoutes) UpdateStatus(ctx context.Context, tCPRoute *v1alpha2.TCPRoute, opts v1.UpdateOptions) (*v1alpha2.TCPRoute, error) { +func (c *FakeTCPRoutes) UpdateStatus(ctx context.Context, tCPRoute *v1alpha2.TCPRoute, opts v1.UpdateOptions) (result *v1alpha2.TCPRoute, err error) { + emptyResult := &v1alpha2.TCPRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(tcproutesResource, "status", c.ns, tCPRoute), &v1alpha2.TCPRoute{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(tcproutesResource, "status", c.ns, tCPRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.TCPRoute), err } @@ -126,7 +131,7 @@ func (c *FakeTCPRoutes) Delete(ctx context.Context, name string, opts v1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeTCPRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(tcproutesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(tcproutesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha2.TCPRouteList{}) return err @@ -134,11 +139,12 @@ func (c *FakeTCPRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOpti // Patch applies the patch and returns the patched tCPRoute. func (c *FakeTCPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.TCPRoute, err error) { + emptyResult := &v1alpha2.TCPRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tcproutesResource, c.ns, name, pt, data, subresources...), &v1alpha2.TCPRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(tcproutesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.TCPRoute), err } @@ -156,11 +162,12 @@ func (c *FakeTCPRoutes) Apply(ctx context.Context, tCPRoute *apisv1alpha2.TCPRou if name == nil { return nil, fmt.Errorf("tCPRoute.Name must be provided to Apply") } + emptyResult := &v1alpha2.TCPRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tcproutesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.TCPRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(tcproutesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.TCPRoute), err } @@ -179,11 +186,12 @@ func (c *FakeTCPRoutes) ApplyStatus(ctx context.Context, tCPRoute *apisv1alpha2. if name == nil { return nil, fmt.Errorf("tCPRoute.Name must be provided to Apply") } + emptyResult := &v1alpha2.TCPRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tcproutesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha2.TCPRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(tcproutesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.TCPRoute), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tlsroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tlsroute.go index 9383876158..ba8255216f 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tlsroute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tlsroute.go @@ -44,22 +44,24 @@ var tlsroutesKind = v1alpha2.SchemeGroupVersion.WithKind("TLSRoute") // Get takes name of the tLSRoute, and returns the corresponding tLSRoute object, and an error if there is any. func (c *FakeTLSRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.TLSRoute, err error) { + emptyResult := &v1alpha2.TLSRoute{} obj, err := c.Fake. - Invokes(testing.NewGetAction(tlsroutesResource, c.ns, name), &v1alpha2.TLSRoute{}) + Invokes(testing.NewGetActionWithOptions(tlsroutesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.TLSRoute), err } // List takes label and field selectors, and returns the list of TLSRoutes that match those selectors. func (c *FakeTLSRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.TLSRouteList, err error) { + emptyResult := &v1alpha2.TLSRouteList{} obj, err := c.Fake. - Invokes(testing.NewListAction(tlsroutesResource, tlsroutesKind, c.ns, opts), &v1alpha2.TLSRouteList{}) + Invokes(testing.NewListActionWithOptions(tlsroutesResource, tlsroutesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,40 +80,43 @@ func (c *FakeTLSRoutes) List(ctx context.Context, opts v1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested tLSRoutes. func (c *FakeTLSRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(tlsroutesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(tlsroutesResource, c.ns, opts)) } // Create takes the representation of a tLSRoute and creates it. Returns the server's representation of the tLSRoute, and an error, if there is any. func (c *FakeTLSRoutes) Create(ctx context.Context, tLSRoute *v1alpha2.TLSRoute, opts v1.CreateOptions) (result *v1alpha2.TLSRoute, err error) { + emptyResult := &v1alpha2.TLSRoute{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(tlsroutesResource, c.ns, tLSRoute), &v1alpha2.TLSRoute{}) + Invokes(testing.NewCreateActionWithOptions(tlsroutesResource, c.ns, tLSRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.TLSRoute), err } // Update takes the representation of a tLSRoute and updates it. Returns the server's representation of the tLSRoute, and an error, if there is any. func (c *FakeTLSRoutes) Update(ctx context.Context, tLSRoute *v1alpha2.TLSRoute, opts v1.UpdateOptions) (result *v1alpha2.TLSRoute, err error) { + emptyResult := &v1alpha2.TLSRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(tlsroutesResource, c.ns, tLSRoute), &v1alpha2.TLSRoute{}) + Invokes(testing.NewUpdateActionWithOptions(tlsroutesResource, c.ns, tLSRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.TLSRoute), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeTLSRoutes) UpdateStatus(ctx context.Context, tLSRoute *v1alpha2.TLSRoute, opts v1.UpdateOptions) (*v1alpha2.TLSRoute, error) { +func (c *FakeTLSRoutes) UpdateStatus(ctx context.Context, tLSRoute *v1alpha2.TLSRoute, opts v1.UpdateOptions) (result *v1alpha2.TLSRoute, err error) { + emptyResult := &v1alpha2.TLSRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(tlsroutesResource, "status", c.ns, tLSRoute), &v1alpha2.TLSRoute{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(tlsroutesResource, "status", c.ns, tLSRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.TLSRoute), err } @@ -126,7 +131,7 @@ func (c *FakeTLSRoutes) Delete(ctx context.Context, name string, opts v1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeTLSRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(tlsroutesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(tlsroutesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha2.TLSRouteList{}) return err @@ -134,11 +139,12 @@ func (c *FakeTLSRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOpti // Patch applies the patch and returns the patched tLSRoute. func (c *FakeTLSRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.TLSRoute, err error) { + emptyResult := &v1alpha2.TLSRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tlsroutesResource, c.ns, name, pt, data, subresources...), &v1alpha2.TLSRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(tlsroutesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.TLSRoute), err } @@ -156,11 +162,12 @@ func (c *FakeTLSRoutes) Apply(ctx context.Context, tLSRoute *apisv1alpha2.TLSRou if name == nil { return nil, fmt.Errorf("tLSRoute.Name must be provided to Apply") } + emptyResult := &v1alpha2.TLSRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tlsroutesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.TLSRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(tlsroutesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.TLSRoute), err } @@ -179,11 +186,12 @@ func (c *FakeTLSRoutes) ApplyStatus(ctx context.Context, tLSRoute *apisv1alpha2. if name == nil { return nil, fmt.Errorf("tLSRoute.Name must be provided to Apply") } + emptyResult := &v1alpha2.TLSRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(tlsroutesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha2.TLSRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(tlsroutesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.TLSRoute), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_udproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_udproute.go index 027f4a4c17..54a5b4d725 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_udproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_udproute.go @@ -44,22 +44,24 @@ var udproutesKind = v1alpha2.SchemeGroupVersion.WithKind("UDPRoute") // Get takes name of the uDPRoute, and returns the corresponding uDPRoute object, and an error if there is any. func (c *FakeUDPRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.UDPRoute, err error) { + emptyResult := &v1alpha2.UDPRoute{} obj, err := c.Fake. - Invokes(testing.NewGetAction(udproutesResource, c.ns, name), &v1alpha2.UDPRoute{}) + Invokes(testing.NewGetActionWithOptions(udproutesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.UDPRoute), err } // List takes label and field selectors, and returns the list of UDPRoutes that match those selectors. func (c *FakeUDPRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.UDPRouteList, err error) { + emptyResult := &v1alpha2.UDPRouteList{} obj, err := c.Fake. - Invokes(testing.NewListAction(udproutesResource, udproutesKind, c.ns, opts), &v1alpha2.UDPRouteList{}) + Invokes(testing.NewListActionWithOptions(udproutesResource, udproutesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,40 +80,43 @@ func (c *FakeUDPRoutes) List(ctx context.Context, opts v1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested uDPRoutes. func (c *FakeUDPRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(udproutesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(udproutesResource, c.ns, opts)) } // Create takes the representation of a uDPRoute and creates it. Returns the server's representation of the uDPRoute, and an error, if there is any. func (c *FakeUDPRoutes) Create(ctx context.Context, uDPRoute *v1alpha2.UDPRoute, opts v1.CreateOptions) (result *v1alpha2.UDPRoute, err error) { + emptyResult := &v1alpha2.UDPRoute{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(udproutesResource, c.ns, uDPRoute), &v1alpha2.UDPRoute{}) + Invokes(testing.NewCreateActionWithOptions(udproutesResource, c.ns, uDPRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.UDPRoute), err } // Update takes the representation of a uDPRoute and updates it. Returns the server's representation of the uDPRoute, and an error, if there is any. func (c *FakeUDPRoutes) Update(ctx context.Context, uDPRoute *v1alpha2.UDPRoute, opts v1.UpdateOptions) (result *v1alpha2.UDPRoute, err error) { + emptyResult := &v1alpha2.UDPRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(udproutesResource, c.ns, uDPRoute), &v1alpha2.UDPRoute{}) + Invokes(testing.NewUpdateActionWithOptions(udproutesResource, c.ns, uDPRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.UDPRoute), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeUDPRoutes) UpdateStatus(ctx context.Context, uDPRoute *v1alpha2.UDPRoute, opts v1.UpdateOptions) (*v1alpha2.UDPRoute, error) { +func (c *FakeUDPRoutes) UpdateStatus(ctx context.Context, uDPRoute *v1alpha2.UDPRoute, opts v1.UpdateOptions) (result *v1alpha2.UDPRoute, err error) { + emptyResult := &v1alpha2.UDPRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(udproutesResource, "status", c.ns, uDPRoute), &v1alpha2.UDPRoute{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(udproutesResource, "status", c.ns, uDPRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.UDPRoute), err } @@ -126,7 +131,7 @@ func (c *FakeUDPRoutes) Delete(ctx context.Context, name string, opts v1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeUDPRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(udproutesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(udproutesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha2.UDPRouteList{}) return err @@ -134,11 +139,12 @@ func (c *FakeUDPRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOpti // Patch applies the patch and returns the patched uDPRoute. func (c *FakeUDPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.UDPRoute, err error) { + emptyResult := &v1alpha2.UDPRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(udproutesResource, c.ns, name, pt, data, subresources...), &v1alpha2.UDPRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(udproutesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.UDPRoute), err } @@ -156,11 +162,12 @@ func (c *FakeUDPRoutes) Apply(ctx context.Context, uDPRoute *apisv1alpha2.UDPRou if name == nil { return nil, fmt.Errorf("uDPRoute.Name must be provided to Apply") } + emptyResult := &v1alpha2.UDPRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(udproutesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.UDPRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(udproutesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.UDPRoute), err } @@ -179,11 +186,12 @@ func (c *FakeUDPRoutes) ApplyStatus(ctx context.Context, uDPRoute *apisv1alpha2. if name == nil { return nil, fmt.Errorf("uDPRoute.Name must be provided to Apply") } + emptyResult := &v1alpha2.UDPRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(udproutesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha2.UDPRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(udproutesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.UDPRoute), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/grpcroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/grpcroute.go index 5e08af49dd..75752337e9 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/grpcroute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/grpcroute.go @@ -20,14 +20,11 @@ package v1alpha2 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" @@ -43,6 +40,7 @@ type GRPCRoutesGetter interface { type GRPCRouteInterface interface { Create(ctx context.Context, gRPCRoute *v1alpha2.GRPCRoute, opts v1.CreateOptions) (*v1alpha2.GRPCRoute, error) Update(ctx context.Context, gRPCRoute *v1alpha2.GRPCRoute, opts v1.UpdateOptions) (*v1alpha2.GRPCRoute, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, gRPCRoute *v1alpha2.GRPCRoute, opts v1.UpdateOptions) (*v1alpha2.GRPCRoute, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,206 +49,25 @@ type GRPCRouteInterface interface { Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.GRPCRoute, err error) Apply(ctx context.Context, gRPCRoute *apisv1alpha2.GRPCRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.GRPCRoute, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, gRPCRoute *apisv1alpha2.GRPCRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.GRPCRoute, err error) GRPCRouteExpansion } // gRPCRoutes implements GRPCRouteInterface type gRPCRoutes struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha2.GRPCRoute, *v1alpha2.GRPCRouteList, *apisv1alpha2.GRPCRouteApplyConfiguration] } // newGRPCRoutes returns a GRPCRoutes func newGRPCRoutes(c *GatewayV1alpha2Client, namespace string) *gRPCRoutes { return &gRPCRoutes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha2.GRPCRoute, *v1alpha2.GRPCRouteList, *apisv1alpha2.GRPCRouteApplyConfiguration]( + "grpcroutes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha2.GRPCRoute { return &v1alpha2.GRPCRoute{} }, + func() *v1alpha2.GRPCRouteList { return &v1alpha2.GRPCRouteList{} }), } } - -// Get takes name of the gRPCRoute, and returns the corresponding gRPCRoute object, and an error if there is any. -func (c *gRPCRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.GRPCRoute, err error) { - result = &v1alpha2.GRPCRoute{} - err = c.client.Get(). - Namespace(c.ns). - Resource("grpcroutes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of GRPCRoutes that match those selectors. -func (c *gRPCRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.GRPCRouteList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.GRPCRouteList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("grpcroutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested gRPCRoutes. -func (c *gRPCRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("grpcroutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a gRPCRoute and creates it. Returns the server's representation of the gRPCRoute, and an error, if there is any. -func (c *gRPCRoutes) Create(ctx context.Context, gRPCRoute *v1alpha2.GRPCRoute, opts v1.CreateOptions) (result *v1alpha2.GRPCRoute, err error) { - result = &v1alpha2.GRPCRoute{} - err = c.client.Post(). - Namespace(c.ns). - Resource("grpcroutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gRPCRoute). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a gRPCRoute and updates it. Returns the server's representation of the gRPCRoute, and an error, if there is any. -func (c *gRPCRoutes) Update(ctx context.Context, gRPCRoute *v1alpha2.GRPCRoute, opts v1.UpdateOptions) (result *v1alpha2.GRPCRoute, err error) { - result = &v1alpha2.GRPCRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("grpcroutes"). - Name(gRPCRoute.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gRPCRoute). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *gRPCRoutes) UpdateStatus(ctx context.Context, gRPCRoute *v1alpha2.GRPCRoute, opts v1.UpdateOptions) (result *v1alpha2.GRPCRoute, err error) { - result = &v1alpha2.GRPCRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("grpcroutes"). - Name(gRPCRoute.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gRPCRoute). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the gRPCRoute and deletes it. Returns an error if one occurs. -func (c *gRPCRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("grpcroutes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *gRPCRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("grpcroutes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched gRPCRoute. -func (c *gRPCRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.GRPCRoute, err error) { - result = &v1alpha2.GRPCRoute{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("grpcroutes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied gRPCRoute. -func (c *gRPCRoutes) Apply(ctx context.Context, gRPCRoute *apisv1alpha2.GRPCRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.GRPCRoute, err error) { - if gRPCRoute == nil { - return nil, fmt.Errorf("gRPCRoute provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(gRPCRoute) - if err != nil { - return nil, err - } - name := gRPCRoute.Name - if name == nil { - return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") - } - result = &v1alpha2.GRPCRoute{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("grpcroutes"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *gRPCRoutes) ApplyStatus(ctx context.Context, gRPCRoute *apisv1alpha2.GRPCRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.GRPCRoute, err error) { - if gRPCRoute == nil { - return nil, fmt.Errorf("gRPCRoute provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(gRPCRoute) - if err != nil { - return nil, err - } - - name := gRPCRoute.Name - if name == nil { - return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") - } - - result = &v1alpha2.GRPCRoute{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("grpcroutes"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/referencegrant.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/referencegrant.go index ca799f71a1..bbe6f8790e 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/referencegrant.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/referencegrant.go @@ -20,14 +20,11 @@ package v1alpha2 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" @@ -55,154 +52,18 @@ type ReferenceGrantInterface interface { // referenceGrants implements ReferenceGrantInterface type referenceGrants struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha2.ReferenceGrant, *v1alpha2.ReferenceGrantList, *apisv1alpha2.ReferenceGrantApplyConfiguration] } // newReferenceGrants returns a ReferenceGrants func newReferenceGrants(c *GatewayV1alpha2Client, namespace string) *referenceGrants { return &referenceGrants{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha2.ReferenceGrant, *v1alpha2.ReferenceGrantList, *apisv1alpha2.ReferenceGrantApplyConfiguration]( + "referencegrants", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha2.ReferenceGrant { return &v1alpha2.ReferenceGrant{} }, + func() *v1alpha2.ReferenceGrantList { return &v1alpha2.ReferenceGrantList{} }), } } - -// Get takes name of the referenceGrant, and returns the corresponding referenceGrant object, and an error if there is any. -func (c *referenceGrants) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ReferenceGrant, err error) { - result = &v1alpha2.ReferenceGrant{} - err = c.client.Get(). - Namespace(c.ns). - Resource("referencegrants"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ReferenceGrants that match those selectors. -func (c *referenceGrants) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ReferenceGrantList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.ReferenceGrantList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("referencegrants"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested referenceGrants. -func (c *referenceGrants) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("referencegrants"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a referenceGrant and creates it. Returns the server's representation of the referenceGrant, and an error, if there is any. -func (c *referenceGrants) Create(ctx context.Context, referenceGrant *v1alpha2.ReferenceGrant, opts v1.CreateOptions) (result *v1alpha2.ReferenceGrant, err error) { - result = &v1alpha2.ReferenceGrant{} - err = c.client.Post(). - Namespace(c.ns). - Resource("referencegrants"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(referenceGrant). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a referenceGrant and updates it. Returns the server's representation of the referenceGrant, and an error, if there is any. -func (c *referenceGrants) Update(ctx context.Context, referenceGrant *v1alpha2.ReferenceGrant, opts v1.UpdateOptions) (result *v1alpha2.ReferenceGrant, err error) { - result = &v1alpha2.ReferenceGrant{} - err = c.client.Put(). - Namespace(c.ns). - Resource("referencegrants"). - Name(referenceGrant.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(referenceGrant). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the referenceGrant and deletes it. Returns an error if one occurs. -func (c *referenceGrants) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("referencegrants"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *referenceGrants) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("referencegrants"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched referenceGrant. -func (c *referenceGrants) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ReferenceGrant, err error) { - result = &v1alpha2.ReferenceGrant{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("referencegrants"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied referenceGrant. -func (c *referenceGrants) Apply(ctx context.Context, referenceGrant *apisv1alpha2.ReferenceGrantApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ReferenceGrant, err error) { - if referenceGrant == nil { - return nil, fmt.Errorf("referenceGrant provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(referenceGrant) - if err != nil { - return nil, err - } - name := referenceGrant.Name - if name == nil { - return nil, fmt.Errorf("referenceGrant.Name must be provided to Apply") - } - result = &v1alpha2.ReferenceGrant{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("referencegrants"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tcproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tcproute.go index ffc6fa2ee8..9a9959cf7c 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tcproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tcproute.go @@ -20,14 +20,11 @@ package v1alpha2 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" @@ -43,6 +40,7 @@ type TCPRoutesGetter interface { type TCPRouteInterface interface { Create(ctx context.Context, tCPRoute *v1alpha2.TCPRoute, opts v1.CreateOptions) (*v1alpha2.TCPRoute, error) Update(ctx context.Context, tCPRoute *v1alpha2.TCPRoute, opts v1.UpdateOptions) (*v1alpha2.TCPRoute, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, tCPRoute *v1alpha2.TCPRoute, opts v1.UpdateOptions) (*v1alpha2.TCPRoute, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,206 +49,25 @@ type TCPRouteInterface interface { Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.TCPRoute, err error) Apply(ctx context.Context, tCPRoute *apisv1alpha2.TCPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TCPRoute, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, tCPRoute *apisv1alpha2.TCPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TCPRoute, err error) TCPRouteExpansion } // tCPRoutes implements TCPRouteInterface type tCPRoutes struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha2.TCPRoute, *v1alpha2.TCPRouteList, *apisv1alpha2.TCPRouteApplyConfiguration] } // newTCPRoutes returns a TCPRoutes func newTCPRoutes(c *GatewayV1alpha2Client, namespace string) *tCPRoutes { return &tCPRoutes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha2.TCPRoute, *v1alpha2.TCPRouteList, *apisv1alpha2.TCPRouteApplyConfiguration]( + "tcproutes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha2.TCPRoute { return &v1alpha2.TCPRoute{} }, + func() *v1alpha2.TCPRouteList { return &v1alpha2.TCPRouteList{} }), } } - -// Get takes name of the tCPRoute, and returns the corresponding tCPRoute object, and an error if there is any. -func (c *tCPRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.TCPRoute, err error) { - result = &v1alpha2.TCPRoute{} - err = c.client.Get(). - Namespace(c.ns). - Resource("tcproutes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of TCPRoutes that match those selectors. -func (c *tCPRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.TCPRouteList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.TCPRouteList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("tcproutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested tCPRoutes. -func (c *tCPRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("tcproutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a tCPRoute and creates it. Returns the server's representation of the tCPRoute, and an error, if there is any. -func (c *tCPRoutes) Create(ctx context.Context, tCPRoute *v1alpha2.TCPRoute, opts v1.CreateOptions) (result *v1alpha2.TCPRoute, err error) { - result = &v1alpha2.TCPRoute{} - err = c.client.Post(). - Namespace(c.ns). - Resource("tcproutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tCPRoute). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a tCPRoute and updates it. Returns the server's representation of the tCPRoute, and an error, if there is any. -func (c *tCPRoutes) Update(ctx context.Context, tCPRoute *v1alpha2.TCPRoute, opts v1.UpdateOptions) (result *v1alpha2.TCPRoute, err error) { - result = &v1alpha2.TCPRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("tcproutes"). - Name(tCPRoute.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tCPRoute). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *tCPRoutes) UpdateStatus(ctx context.Context, tCPRoute *v1alpha2.TCPRoute, opts v1.UpdateOptions) (result *v1alpha2.TCPRoute, err error) { - result = &v1alpha2.TCPRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("tcproutes"). - Name(tCPRoute.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tCPRoute). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the tCPRoute and deletes it. Returns an error if one occurs. -func (c *tCPRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("tcproutes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *tCPRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("tcproutes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched tCPRoute. -func (c *tCPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.TCPRoute, err error) { - result = &v1alpha2.TCPRoute{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("tcproutes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied tCPRoute. -func (c *tCPRoutes) Apply(ctx context.Context, tCPRoute *apisv1alpha2.TCPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TCPRoute, err error) { - if tCPRoute == nil { - return nil, fmt.Errorf("tCPRoute provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(tCPRoute) - if err != nil { - return nil, err - } - name := tCPRoute.Name - if name == nil { - return nil, fmt.Errorf("tCPRoute.Name must be provided to Apply") - } - result = &v1alpha2.TCPRoute{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("tcproutes"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *tCPRoutes) ApplyStatus(ctx context.Context, tCPRoute *apisv1alpha2.TCPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TCPRoute, err error) { - if tCPRoute == nil { - return nil, fmt.Errorf("tCPRoute provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(tCPRoute) - if err != nil { - return nil, err - } - - name := tCPRoute.Name - if name == nil { - return nil, fmt.Errorf("tCPRoute.Name must be provided to Apply") - } - - result = &v1alpha2.TCPRoute{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("tcproutes"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tlsroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tlsroute.go index 23719242fa..d98da0fbab 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tlsroute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tlsroute.go @@ -20,14 +20,11 @@ package v1alpha2 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" @@ -43,6 +40,7 @@ type TLSRoutesGetter interface { type TLSRouteInterface interface { Create(ctx context.Context, tLSRoute *v1alpha2.TLSRoute, opts v1.CreateOptions) (*v1alpha2.TLSRoute, error) Update(ctx context.Context, tLSRoute *v1alpha2.TLSRoute, opts v1.UpdateOptions) (*v1alpha2.TLSRoute, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, tLSRoute *v1alpha2.TLSRoute, opts v1.UpdateOptions) (*v1alpha2.TLSRoute, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,206 +49,25 @@ type TLSRouteInterface interface { Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.TLSRoute, err error) Apply(ctx context.Context, tLSRoute *apisv1alpha2.TLSRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TLSRoute, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, tLSRoute *apisv1alpha2.TLSRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TLSRoute, err error) TLSRouteExpansion } // tLSRoutes implements TLSRouteInterface type tLSRoutes struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha2.TLSRoute, *v1alpha2.TLSRouteList, *apisv1alpha2.TLSRouteApplyConfiguration] } // newTLSRoutes returns a TLSRoutes func newTLSRoutes(c *GatewayV1alpha2Client, namespace string) *tLSRoutes { return &tLSRoutes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha2.TLSRoute, *v1alpha2.TLSRouteList, *apisv1alpha2.TLSRouteApplyConfiguration]( + "tlsroutes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha2.TLSRoute { return &v1alpha2.TLSRoute{} }, + func() *v1alpha2.TLSRouteList { return &v1alpha2.TLSRouteList{} }), } } - -// Get takes name of the tLSRoute, and returns the corresponding tLSRoute object, and an error if there is any. -func (c *tLSRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.TLSRoute, err error) { - result = &v1alpha2.TLSRoute{} - err = c.client.Get(). - Namespace(c.ns). - Resource("tlsroutes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of TLSRoutes that match those selectors. -func (c *tLSRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.TLSRouteList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.TLSRouteList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("tlsroutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested tLSRoutes. -func (c *tLSRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("tlsroutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a tLSRoute and creates it. Returns the server's representation of the tLSRoute, and an error, if there is any. -func (c *tLSRoutes) Create(ctx context.Context, tLSRoute *v1alpha2.TLSRoute, opts v1.CreateOptions) (result *v1alpha2.TLSRoute, err error) { - result = &v1alpha2.TLSRoute{} - err = c.client.Post(). - Namespace(c.ns). - Resource("tlsroutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tLSRoute). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a tLSRoute and updates it. Returns the server's representation of the tLSRoute, and an error, if there is any. -func (c *tLSRoutes) Update(ctx context.Context, tLSRoute *v1alpha2.TLSRoute, opts v1.UpdateOptions) (result *v1alpha2.TLSRoute, err error) { - result = &v1alpha2.TLSRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("tlsroutes"). - Name(tLSRoute.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tLSRoute). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *tLSRoutes) UpdateStatus(ctx context.Context, tLSRoute *v1alpha2.TLSRoute, opts v1.UpdateOptions) (result *v1alpha2.TLSRoute, err error) { - result = &v1alpha2.TLSRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("tlsroutes"). - Name(tLSRoute.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tLSRoute). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the tLSRoute and deletes it. Returns an error if one occurs. -func (c *tLSRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("tlsroutes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *tLSRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("tlsroutes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched tLSRoute. -func (c *tLSRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.TLSRoute, err error) { - result = &v1alpha2.TLSRoute{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("tlsroutes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied tLSRoute. -func (c *tLSRoutes) Apply(ctx context.Context, tLSRoute *apisv1alpha2.TLSRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TLSRoute, err error) { - if tLSRoute == nil { - return nil, fmt.Errorf("tLSRoute provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(tLSRoute) - if err != nil { - return nil, err - } - name := tLSRoute.Name - if name == nil { - return nil, fmt.Errorf("tLSRoute.Name must be provided to Apply") - } - result = &v1alpha2.TLSRoute{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("tlsroutes"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *tLSRoutes) ApplyStatus(ctx context.Context, tLSRoute *apisv1alpha2.TLSRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TLSRoute, err error) { - if tLSRoute == nil { - return nil, fmt.Errorf("tLSRoute provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(tLSRoute) - if err != nil { - return nil, err - } - - name := tLSRoute.Name - if name == nil { - return nil, fmt.Errorf("tLSRoute.Name must be provided to Apply") - } - - result = &v1alpha2.TLSRoute{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("tlsroutes"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/udproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/udproute.go index 3217a9004f..820bed9f31 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/udproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/udproute.go @@ -20,14 +20,11 @@ package v1alpha2 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" @@ -43,6 +40,7 @@ type UDPRoutesGetter interface { type UDPRouteInterface interface { Create(ctx context.Context, uDPRoute *v1alpha2.UDPRoute, opts v1.CreateOptions) (*v1alpha2.UDPRoute, error) Update(ctx context.Context, uDPRoute *v1alpha2.UDPRoute, opts v1.UpdateOptions) (*v1alpha2.UDPRoute, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, uDPRoute *v1alpha2.UDPRoute, opts v1.UpdateOptions) (*v1alpha2.UDPRoute, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,206 +49,25 @@ type UDPRouteInterface interface { Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.UDPRoute, err error) Apply(ctx context.Context, uDPRoute *apisv1alpha2.UDPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.UDPRoute, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, uDPRoute *apisv1alpha2.UDPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.UDPRoute, err error) UDPRouteExpansion } // uDPRoutes implements UDPRouteInterface type uDPRoutes struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha2.UDPRoute, *v1alpha2.UDPRouteList, *apisv1alpha2.UDPRouteApplyConfiguration] } // newUDPRoutes returns a UDPRoutes func newUDPRoutes(c *GatewayV1alpha2Client, namespace string) *uDPRoutes { return &uDPRoutes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha2.UDPRoute, *v1alpha2.UDPRouteList, *apisv1alpha2.UDPRouteApplyConfiguration]( + "udproutes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha2.UDPRoute { return &v1alpha2.UDPRoute{} }, + func() *v1alpha2.UDPRouteList { return &v1alpha2.UDPRouteList{} }), } } - -// Get takes name of the uDPRoute, and returns the corresponding uDPRoute object, and an error if there is any. -func (c *uDPRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.UDPRoute, err error) { - result = &v1alpha2.UDPRoute{} - err = c.client.Get(). - Namespace(c.ns). - Resource("udproutes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of UDPRoutes that match those selectors. -func (c *uDPRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.UDPRouteList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.UDPRouteList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("udproutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested uDPRoutes. -func (c *uDPRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("udproutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a uDPRoute and creates it. Returns the server's representation of the uDPRoute, and an error, if there is any. -func (c *uDPRoutes) Create(ctx context.Context, uDPRoute *v1alpha2.UDPRoute, opts v1.CreateOptions) (result *v1alpha2.UDPRoute, err error) { - result = &v1alpha2.UDPRoute{} - err = c.client.Post(). - Namespace(c.ns). - Resource("udproutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(uDPRoute). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a uDPRoute and updates it. Returns the server's representation of the uDPRoute, and an error, if there is any. -func (c *uDPRoutes) Update(ctx context.Context, uDPRoute *v1alpha2.UDPRoute, opts v1.UpdateOptions) (result *v1alpha2.UDPRoute, err error) { - result = &v1alpha2.UDPRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("udproutes"). - Name(uDPRoute.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(uDPRoute). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *uDPRoutes) UpdateStatus(ctx context.Context, uDPRoute *v1alpha2.UDPRoute, opts v1.UpdateOptions) (result *v1alpha2.UDPRoute, err error) { - result = &v1alpha2.UDPRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("udproutes"). - Name(uDPRoute.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(uDPRoute). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the uDPRoute and deletes it. Returns an error if one occurs. -func (c *uDPRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("udproutes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *uDPRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("udproutes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched uDPRoute. -func (c *uDPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.UDPRoute, err error) { - result = &v1alpha2.UDPRoute{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("udproutes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied uDPRoute. -func (c *uDPRoutes) Apply(ctx context.Context, uDPRoute *apisv1alpha2.UDPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.UDPRoute, err error) { - if uDPRoute == nil { - return nil, fmt.Errorf("uDPRoute provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(uDPRoute) - if err != nil { - return nil, err - } - name := uDPRoute.Name - if name == nil { - return nil, fmt.Errorf("uDPRoute.Name must be provided to Apply") - } - result = &v1alpha2.UDPRoute{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("udproutes"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *uDPRoutes) ApplyStatus(ctx context.Context, uDPRoute *apisv1alpha2.UDPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.UDPRoute, err error) { - if uDPRoute == nil { - return nil, fmt.Errorf("uDPRoute provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(uDPRoute) - if err != nil { - return nil, err - } - - name := uDPRoute.Name - if name == nil { - return nil, fmt.Errorf("uDPRoute.Name must be provided to Apply") - } - - result = &v1alpha2.UDPRoute{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("udproutes"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/backendtlspolicy.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/backendtlspolicy.go index aecd62b6bb..3edd7e6279 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/backendtlspolicy.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/backendtlspolicy.go @@ -20,14 +20,11 @@ package v1alpha3 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" apisv1alpha3 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3" v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" @@ -43,6 +40,7 @@ type BackendTLSPoliciesGetter interface { type BackendTLSPolicyInterface interface { Create(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.CreateOptions) (*v1alpha3.BackendTLSPolicy, error) Update(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.UpdateOptions) (*v1alpha3.BackendTLSPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.UpdateOptions) (*v1alpha3.BackendTLSPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,206 +49,25 @@ type BackendTLSPolicyInterface interface { Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.BackendTLSPolicy, err error) Apply(ctx context.Context, backendTLSPolicy *apisv1alpha3.BackendTLSPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.BackendTLSPolicy, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, backendTLSPolicy *apisv1alpha3.BackendTLSPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.BackendTLSPolicy, err error) BackendTLSPolicyExpansion } // backendTLSPolicies implements BackendTLSPolicyInterface type backendTLSPolicies struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha3.BackendTLSPolicy, *v1alpha3.BackendTLSPolicyList, *apisv1alpha3.BackendTLSPolicyApplyConfiguration] } // newBackendTLSPolicies returns a BackendTLSPolicies func newBackendTLSPolicies(c *GatewayV1alpha3Client, namespace string) *backendTLSPolicies { return &backendTLSPolicies{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha3.BackendTLSPolicy, *v1alpha3.BackendTLSPolicyList, *apisv1alpha3.BackendTLSPolicyApplyConfiguration]( + "backendtlspolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha3.BackendTLSPolicy { return &v1alpha3.BackendTLSPolicy{} }, + func() *v1alpha3.BackendTLSPolicyList { return &v1alpha3.BackendTLSPolicyList{} }), } } - -// Get takes name of the backendTLSPolicy, and returns the corresponding backendTLSPolicy object, and an error if there is any. -func (c *backendTLSPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.BackendTLSPolicy, err error) { - result = &v1alpha3.BackendTLSPolicy{} - err = c.client.Get(). - Namespace(c.ns). - Resource("backendtlspolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of BackendTLSPolicies that match those selectors. -func (c *backendTLSPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.BackendTLSPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha3.BackendTLSPolicyList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("backendtlspolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested backendTLSPolicies. -func (c *backendTLSPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("backendtlspolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a backendTLSPolicy and creates it. Returns the server's representation of the backendTLSPolicy, and an error, if there is any. -func (c *backendTLSPolicies) Create(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.CreateOptions) (result *v1alpha3.BackendTLSPolicy, err error) { - result = &v1alpha3.BackendTLSPolicy{} - err = c.client.Post(). - Namespace(c.ns). - Resource("backendtlspolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backendTLSPolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a backendTLSPolicy and updates it. Returns the server's representation of the backendTLSPolicy, and an error, if there is any. -func (c *backendTLSPolicies) Update(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.UpdateOptions) (result *v1alpha3.BackendTLSPolicy, err error) { - result = &v1alpha3.BackendTLSPolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("backendtlspolicies"). - Name(backendTLSPolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backendTLSPolicy). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *backendTLSPolicies) UpdateStatus(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.UpdateOptions) (result *v1alpha3.BackendTLSPolicy, err error) { - result = &v1alpha3.BackendTLSPolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("backendtlspolicies"). - Name(backendTLSPolicy.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(backendTLSPolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the backendTLSPolicy and deletes it. Returns an error if one occurs. -func (c *backendTLSPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("backendtlspolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *backendTLSPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("backendtlspolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched backendTLSPolicy. -func (c *backendTLSPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.BackendTLSPolicy, err error) { - result = &v1alpha3.BackendTLSPolicy{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("backendtlspolicies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied backendTLSPolicy. -func (c *backendTLSPolicies) Apply(ctx context.Context, backendTLSPolicy *apisv1alpha3.BackendTLSPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.BackendTLSPolicy, err error) { - if backendTLSPolicy == nil { - return nil, fmt.Errorf("backendTLSPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(backendTLSPolicy) - if err != nil { - return nil, err - } - name := backendTLSPolicy.Name - if name == nil { - return nil, fmt.Errorf("backendTLSPolicy.Name must be provided to Apply") - } - result = &v1alpha3.BackendTLSPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("backendtlspolicies"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *backendTLSPolicies) ApplyStatus(ctx context.Context, backendTLSPolicy *apisv1alpha3.BackendTLSPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.BackendTLSPolicy, err error) { - if backendTLSPolicy == nil { - return nil, fmt.Errorf("backendTLSPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(backendTLSPolicy) - if err != nil { - return nil, err - } - - name := backendTLSPolicy.Name - if name == nil { - return nil, fmt.Errorf("backendTLSPolicy.Name must be provided to Apply") - } - - result = &v1alpha3.BackendTLSPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("backendtlspolicies"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/fake_backendtlspolicy.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/fake_backendtlspolicy.go index 65ec24e635..042a931aea 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/fake_backendtlspolicy.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/fake_backendtlspolicy.go @@ -44,22 +44,24 @@ var backendtlspoliciesKind = v1alpha3.SchemeGroupVersion.WithKind("BackendTLSPol // Get takes name of the backendTLSPolicy, and returns the corresponding backendTLSPolicy object, and an error if there is any. func (c *FakeBackendTLSPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.BackendTLSPolicy, err error) { + emptyResult := &v1alpha3.BackendTLSPolicy{} obj, err := c.Fake. - Invokes(testing.NewGetAction(backendtlspoliciesResource, c.ns, name), &v1alpha3.BackendTLSPolicy{}) + Invokes(testing.NewGetActionWithOptions(backendtlspoliciesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha3.BackendTLSPolicy), err } // List takes label and field selectors, and returns the list of BackendTLSPolicies that match those selectors. func (c *FakeBackendTLSPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.BackendTLSPolicyList, err error) { + emptyResult := &v1alpha3.BackendTLSPolicyList{} obj, err := c.Fake. - Invokes(testing.NewListAction(backendtlspoliciesResource, backendtlspoliciesKind, c.ns, opts), &v1alpha3.BackendTLSPolicyList{}) + Invokes(testing.NewListActionWithOptions(backendtlspoliciesResource, backendtlspoliciesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,40 +80,43 @@ func (c *FakeBackendTLSPolicies) List(ctx context.Context, opts v1.ListOptions) // Watch returns a watch.Interface that watches the requested backendTLSPolicies. func (c *FakeBackendTLSPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(backendtlspoliciesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(backendtlspoliciesResource, c.ns, opts)) } // Create takes the representation of a backendTLSPolicy and creates it. Returns the server's representation of the backendTLSPolicy, and an error, if there is any. func (c *FakeBackendTLSPolicies) Create(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.CreateOptions) (result *v1alpha3.BackendTLSPolicy, err error) { + emptyResult := &v1alpha3.BackendTLSPolicy{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(backendtlspoliciesResource, c.ns, backendTLSPolicy), &v1alpha3.BackendTLSPolicy{}) + Invokes(testing.NewCreateActionWithOptions(backendtlspoliciesResource, c.ns, backendTLSPolicy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha3.BackendTLSPolicy), err } // Update takes the representation of a backendTLSPolicy and updates it. Returns the server's representation of the backendTLSPolicy, and an error, if there is any. func (c *FakeBackendTLSPolicies) Update(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.UpdateOptions) (result *v1alpha3.BackendTLSPolicy, err error) { + emptyResult := &v1alpha3.BackendTLSPolicy{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(backendtlspoliciesResource, c.ns, backendTLSPolicy), &v1alpha3.BackendTLSPolicy{}) + Invokes(testing.NewUpdateActionWithOptions(backendtlspoliciesResource, c.ns, backendTLSPolicy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha3.BackendTLSPolicy), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeBackendTLSPolicies) UpdateStatus(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.UpdateOptions) (*v1alpha3.BackendTLSPolicy, error) { +func (c *FakeBackendTLSPolicies) UpdateStatus(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.UpdateOptions) (result *v1alpha3.BackendTLSPolicy, err error) { + emptyResult := &v1alpha3.BackendTLSPolicy{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(backendtlspoliciesResource, "status", c.ns, backendTLSPolicy), &v1alpha3.BackendTLSPolicy{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(backendtlspoliciesResource, "status", c.ns, backendTLSPolicy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha3.BackendTLSPolicy), err } @@ -126,7 +131,7 @@ func (c *FakeBackendTLSPolicies) Delete(ctx context.Context, name string, opts v // DeleteCollection deletes a collection of objects. func (c *FakeBackendTLSPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(backendtlspoliciesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(backendtlspoliciesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha3.BackendTLSPolicyList{}) return err @@ -134,11 +139,12 @@ func (c *FakeBackendTLSPolicies) DeleteCollection(ctx context.Context, opts v1.D // Patch applies the patch and returns the patched backendTLSPolicy. func (c *FakeBackendTLSPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.BackendTLSPolicy, err error) { + emptyResult := &v1alpha3.BackendTLSPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(backendtlspoliciesResource, c.ns, name, pt, data, subresources...), &v1alpha3.BackendTLSPolicy{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(backendtlspoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha3.BackendTLSPolicy), err } @@ -156,11 +162,12 @@ func (c *FakeBackendTLSPolicies) Apply(ctx context.Context, backendTLSPolicy *ap if name == nil { return nil, fmt.Errorf("backendTLSPolicy.Name must be provided to Apply") } + emptyResult := &v1alpha3.BackendTLSPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(backendtlspoliciesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha3.BackendTLSPolicy{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(backendtlspoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha3.BackendTLSPolicy), err } @@ -179,11 +186,12 @@ func (c *FakeBackendTLSPolicies) ApplyStatus(ctx context.Context, backendTLSPoli if name == nil { return nil, fmt.Errorf("backendTLSPolicy.Name must be provided to Apply") } + emptyResult := &v1alpha3.BackendTLSPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(backendtlspoliciesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha3.BackendTLSPolicy{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(backendtlspoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha3.BackendTLSPolicy), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gateway.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gateway.go index e591318ced..757c95f11b 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gateway.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gateway.go @@ -44,22 +44,24 @@ var gatewaysKind = v1beta1.SchemeGroupVersion.WithKind("Gateway") // Get takes name of the gateway, and returns the corresponding gateway object, and an error if there is any. func (c *FakeGateways) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Gateway, err error) { + emptyResult := &v1beta1.Gateway{} obj, err := c.Fake. - Invokes(testing.NewGetAction(gatewaysResource, c.ns, name), &v1beta1.Gateway{}) + Invokes(testing.NewGetActionWithOptions(gatewaysResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Gateway), err } // List takes label and field selectors, and returns the list of Gateways that match those selectors. func (c *FakeGateways) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.GatewayList, err error) { + emptyResult := &v1beta1.GatewayList{} obj, err := c.Fake. - Invokes(testing.NewListAction(gatewaysResource, gatewaysKind, c.ns, opts), &v1beta1.GatewayList{}) + Invokes(testing.NewListActionWithOptions(gatewaysResource, gatewaysKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,40 +80,43 @@ func (c *FakeGateways) List(ctx context.Context, opts v1.ListOptions) (result *v // Watch returns a watch.Interface that watches the requested gateways. func (c *FakeGateways) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(gatewaysResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(gatewaysResource, c.ns, opts)) } // Create takes the representation of a gateway and creates it. Returns the server's representation of the gateway, and an error, if there is any. func (c *FakeGateways) Create(ctx context.Context, gateway *v1beta1.Gateway, opts v1.CreateOptions) (result *v1beta1.Gateway, err error) { + emptyResult := &v1beta1.Gateway{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(gatewaysResource, c.ns, gateway), &v1beta1.Gateway{}) + Invokes(testing.NewCreateActionWithOptions(gatewaysResource, c.ns, gateway, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Gateway), err } // Update takes the representation of a gateway and updates it. Returns the server's representation of the gateway, and an error, if there is any. func (c *FakeGateways) Update(ctx context.Context, gateway *v1beta1.Gateway, opts v1.UpdateOptions) (result *v1beta1.Gateway, err error) { + emptyResult := &v1beta1.Gateway{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(gatewaysResource, c.ns, gateway), &v1beta1.Gateway{}) + Invokes(testing.NewUpdateActionWithOptions(gatewaysResource, c.ns, gateway, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Gateway), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeGateways) UpdateStatus(ctx context.Context, gateway *v1beta1.Gateway, opts v1.UpdateOptions) (*v1beta1.Gateway, error) { +func (c *FakeGateways) UpdateStatus(ctx context.Context, gateway *v1beta1.Gateway, opts v1.UpdateOptions) (result *v1beta1.Gateway, err error) { + emptyResult := &v1beta1.Gateway{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(gatewaysResource, "status", c.ns, gateway), &v1beta1.Gateway{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(gatewaysResource, "status", c.ns, gateway, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Gateway), err } @@ -126,7 +131,7 @@ func (c *FakeGateways) Delete(ctx context.Context, name string, opts v1.DeleteOp // DeleteCollection deletes a collection of objects. func (c *FakeGateways) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(gatewaysResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(gatewaysResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.GatewayList{}) return err @@ -134,11 +139,12 @@ func (c *FakeGateways) DeleteCollection(ctx context.Context, opts v1.DeleteOptio // Patch applies the patch and returns the patched gateway. func (c *FakeGateways) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Gateway, err error) { + emptyResult := &v1beta1.Gateway{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, name, pt, data, subresources...), &v1beta1.Gateway{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(gatewaysResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Gateway), err } @@ -156,11 +162,12 @@ func (c *FakeGateways) Apply(ctx context.Context, gateway *apisv1beta1.GatewayAp if name == nil { return nil, fmt.Errorf("gateway.Name must be provided to Apply") } + emptyResult := &v1beta1.Gateway{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Gateway{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(gatewaysResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Gateway), err } @@ -179,11 +186,12 @@ func (c *FakeGateways) ApplyStatus(ctx context.Context, gateway *apisv1beta1.Gat if name == nil { return nil, fmt.Errorf("gateway.Name must be provided to Apply") } + emptyResult := &v1beta1.Gateway{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.Gateway{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(gatewaysResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Gateway), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gatewayclass.go index 4eb6d6a41f..0260974731 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gatewayclass.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gatewayclass.go @@ -43,20 +43,22 @@ var gatewayclassesKind = v1beta1.SchemeGroupVersion.WithKind("GatewayClass") // Get takes name of the gatewayClass, and returns the corresponding gatewayClass object, and an error if there is any. func (c *FakeGatewayClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.GatewayClass, err error) { + emptyResult := &v1beta1.GatewayClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(gatewayclassesResource, name), &v1beta1.GatewayClass{}) + Invokes(testing.NewRootGetActionWithOptions(gatewayclassesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.GatewayClass), err } // List takes label and field selectors, and returns the list of GatewayClasses that match those selectors. func (c *FakeGatewayClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.GatewayClassList, err error) { + emptyResult := &v1beta1.GatewayClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(gatewayclassesResource, gatewayclassesKind, opts), &v1beta1.GatewayClassList{}) + Invokes(testing.NewRootListActionWithOptions(gatewayclassesResource, gatewayclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -75,36 +77,39 @@ func (c *FakeGatewayClasses) List(ctx context.Context, opts v1.ListOptions) (res // Watch returns a watch.Interface that watches the requested gatewayClasses. func (c *FakeGatewayClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(gatewayclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(gatewayclassesResource, opts)) } // Create takes the representation of a gatewayClass and creates it. Returns the server's representation of the gatewayClass, and an error, if there is any. func (c *FakeGatewayClasses) Create(ctx context.Context, gatewayClass *v1beta1.GatewayClass, opts v1.CreateOptions) (result *v1beta1.GatewayClass, err error) { + emptyResult := &v1beta1.GatewayClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(gatewayclassesResource, gatewayClass), &v1beta1.GatewayClass{}) + Invokes(testing.NewRootCreateActionWithOptions(gatewayclassesResource, gatewayClass, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.GatewayClass), err } // Update takes the representation of a gatewayClass and updates it. Returns the server's representation of the gatewayClass, and an error, if there is any. func (c *FakeGatewayClasses) Update(ctx context.Context, gatewayClass *v1beta1.GatewayClass, opts v1.UpdateOptions) (result *v1beta1.GatewayClass, err error) { + emptyResult := &v1beta1.GatewayClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(gatewayclassesResource, gatewayClass), &v1beta1.GatewayClass{}) + Invokes(testing.NewRootUpdateActionWithOptions(gatewayclassesResource, gatewayClass, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.GatewayClass), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeGatewayClasses) UpdateStatus(ctx context.Context, gatewayClass *v1beta1.GatewayClass, opts v1.UpdateOptions) (*v1beta1.GatewayClass, error) { +func (c *FakeGatewayClasses) UpdateStatus(ctx context.Context, gatewayClass *v1beta1.GatewayClass, opts v1.UpdateOptions) (result *v1beta1.GatewayClass, err error) { + emptyResult := &v1beta1.GatewayClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(gatewayclassesResource, "status", gatewayClass), &v1beta1.GatewayClass{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(gatewayclassesResource, "status", gatewayClass, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.GatewayClass), err } @@ -118,7 +123,7 @@ func (c *FakeGatewayClasses) Delete(ctx context.Context, name string, opts v1.De // DeleteCollection deletes a collection of objects. func (c *FakeGatewayClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(gatewayclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(gatewayclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.GatewayClassList{}) return err @@ -126,10 +131,11 @@ func (c *FakeGatewayClasses) DeleteCollection(ctx context.Context, opts v1.Delet // Patch applies the patch and returns the patched gatewayClass. func (c *FakeGatewayClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.GatewayClass, err error) { + emptyResult := &v1beta1.GatewayClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(gatewayclassesResource, name, pt, data, subresources...), &v1beta1.GatewayClass{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(gatewayclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.GatewayClass), err } @@ -147,10 +153,11 @@ func (c *FakeGatewayClasses) Apply(ctx context.Context, gatewayClass *apisv1beta if name == nil { return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") } + emptyResult := &v1beta1.GatewayClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(gatewayclassesResource, *name, types.ApplyPatchType, data), &v1beta1.GatewayClass{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(gatewayclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.GatewayClass), err } @@ -169,10 +176,11 @@ func (c *FakeGatewayClasses) ApplyStatus(ctx context.Context, gatewayClass *apis if name == nil { return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") } + emptyResult := &v1beta1.GatewayClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(gatewayclassesResource, *name, types.ApplyPatchType, data, "status"), &v1beta1.GatewayClass{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(gatewayclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.GatewayClass), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_httproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_httproute.go index cae13dec84..75b4b7107b 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_httproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_httproute.go @@ -44,22 +44,24 @@ var httproutesKind = v1beta1.SchemeGroupVersion.WithKind("HTTPRoute") // Get takes name of the hTTPRoute, and returns the corresponding hTTPRoute object, and an error if there is any. func (c *FakeHTTPRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.HTTPRoute, err error) { + emptyResult := &v1beta1.HTTPRoute{} obj, err := c.Fake. - Invokes(testing.NewGetAction(httproutesResource, c.ns, name), &v1beta1.HTTPRoute{}) + Invokes(testing.NewGetActionWithOptions(httproutesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.HTTPRoute), err } // List takes label and field selectors, and returns the list of HTTPRoutes that match those selectors. func (c *FakeHTTPRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.HTTPRouteList, err error) { + emptyResult := &v1beta1.HTTPRouteList{} obj, err := c.Fake. - Invokes(testing.NewListAction(httproutesResource, httproutesKind, c.ns, opts), &v1beta1.HTTPRouteList{}) + Invokes(testing.NewListActionWithOptions(httproutesResource, httproutesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,40 +80,43 @@ func (c *FakeHTTPRoutes) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested hTTPRoutes. func (c *FakeHTTPRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(httproutesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(httproutesResource, c.ns, opts)) } // Create takes the representation of a hTTPRoute and creates it. Returns the server's representation of the hTTPRoute, and an error, if there is any. func (c *FakeHTTPRoutes) Create(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.CreateOptions) (result *v1beta1.HTTPRoute, err error) { + emptyResult := &v1beta1.HTTPRoute{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(httproutesResource, c.ns, hTTPRoute), &v1beta1.HTTPRoute{}) + Invokes(testing.NewCreateActionWithOptions(httproutesResource, c.ns, hTTPRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.HTTPRoute), err } // Update takes the representation of a hTTPRoute and updates it. Returns the server's representation of the hTTPRoute, and an error, if there is any. func (c *FakeHTTPRoutes) Update(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.UpdateOptions) (result *v1beta1.HTTPRoute, err error) { + emptyResult := &v1beta1.HTTPRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(httproutesResource, c.ns, hTTPRoute), &v1beta1.HTTPRoute{}) + Invokes(testing.NewUpdateActionWithOptions(httproutesResource, c.ns, hTTPRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.HTTPRoute), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeHTTPRoutes) UpdateStatus(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.UpdateOptions) (*v1beta1.HTTPRoute, error) { +func (c *FakeHTTPRoutes) UpdateStatus(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.UpdateOptions) (result *v1beta1.HTTPRoute, err error) { + emptyResult := &v1beta1.HTTPRoute{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(httproutesResource, "status", c.ns, hTTPRoute), &v1beta1.HTTPRoute{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(httproutesResource, "status", c.ns, hTTPRoute, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.HTTPRoute), err } @@ -126,7 +131,7 @@ func (c *FakeHTTPRoutes) Delete(ctx context.Context, name string, opts v1.Delete // DeleteCollection deletes a collection of objects. func (c *FakeHTTPRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(httproutesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(httproutesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.HTTPRouteList{}) return err @@ -134,11 +139,12 @@ func (c *FakeHTTPRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOpt // Patch applies the patch and returns the patched hTTPRoute. func (c *FakeHTTPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.HTTPRoute, err error) { + emptyResult := &v1beta1.HTTPRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(httproutesResource, c.ns, name, pt, data, subresources...), &v1beta1.HTTPRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(httproutesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.HTTPRoute), err } @@ -156,11 +162,12 @@ func (c *FakeHTTPRoutes) Apply(ctx context.Context, hTTPRoute *apisv1beta1.HTTPR if name == nil { return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") } + emptyResult := &v1beta1.HTTPRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(httproutesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.HTTPRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(httproutesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.HTTPRoute), err } @@ -179,11 +186,12 @@ func (c *FakeHTTPRoutes) ApplyStatus(ctx context.Context, hTTPRoute *apisv1beta1 if name == nil { return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") } + emptyResult := &v1beta1.HTTPRoute{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(httproutesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.HTTPRoute{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(httproutesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.HTTPRoute), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_referencegrant.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_referencegrant.go index d6e31e827e..2f5daecf86 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_referencegrant.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_referencegrant.go @@ -44,22 +44,24 @@ var referencegrantsKind = v1beta1.SchemeGroupVersion.WithKind("ReferenceGrant") // Get takes name of the referenceGrant, and returns the corresponding referenceGrant object, and an error if there is any. func (c *FakeReferenceGrants) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ReferenceGrant, err error) { + emptyResult := &v1beta1.ReferenceGrant{} obj, err := c.Fake. - Invokes(testing.NewGetAction(referencegrantsResource, c.ns, name), &v1beta1.ReferenceGrant{}) + Invokes(testing.NewGetActionWithOptions(referencegrantsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ReferenceGrant), err } // List takes label and field selectors, and returns the list of ReferenceGrants that match those selectors. func (c *FakeReferenceGrants) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReferenceGrantList, err error) { + emptyResult := &v1beta1.ReferenceGrantList{} obj, err := c.Fake. - Invokes(testing.NewListAction(referencegrantsResource, referencegrantsKind, c.ns, opts), &v1beta1.ReferenceGrantList{}) + Invokes(testing.NewListActionWithOptions(referencegrantsResource, referencegrantsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -78,28 +80,30 @@ func (c *FakeReferenceGrants) List(ctx context.Context, opts v1.ListOptions) (re // Watch returns a watch.Interface that watches the requested referenceGrants. func (c *FakeReferenceGrants) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(referencegrantsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(referencegrantsResource, c.ns, opts)) } // Create takes the representation of a referenceGrant and creates it. Returns the server's representation of the referenceGrant, and an error, if there is any. func (c *FakeReferenceGrants) Create(ctx context.Context, referenceGrant *v1beta1.ReferenceGrant, opts v1.CreateOptions) (result *v1beta1.ReferenceGrant, err error) { + emptyResult := &v1beta1.ReferenceGrant{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(referencegrantsResource, c.ns, referenceGrant), &v1beta1.ReferenceGrant{}) + Invokes(testing.NewCreateActionWithOptions(referencegrantsResource, c.ns, referenceGrant, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ReferenceGrant), err } // Update takes the representation of a referenceGrant and updates it. Returns the server's representation of the referenceGrant, and an error, if there is any. func (c *FakeReferenceGrants) Update(ctx context.Context, referenceGrant *v1beta1.ReferenceGrant, opts v1.UpdateOptions) (result *v1beta1.ReferenceGrant, err error) { + emptyResult := &v1beta1.ReferenceGrant{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(referencegrantsResource, c.ns, referenceGrant), &v1beta1.ReferenceGrant{}) + Invokes(testing.NewUpdateActionWithOptions(referencegrantsResource, c.ns, referenceGrant, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ReferenceGrant), err } @@ -114,7 +118,7 @@ func (c *FakeReferenceGrants) Delete(ctx context.Context, name string, opts v1.D // DeleteCollection deletes a collection of objects. func (c *FakeReferenceGrants) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(referencegrantsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(referencegrantsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ReferenceGrantList{}) return err @@ -122,11 +126,12 @@ func (c *FakeReferenceGrants) DeleteCollection(ctx context.Context, opts v1.Dele // Patch applies the patch and returns the patched referenceGrant. func (c *FakeReferenceGrants) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ReferenceGrant, err error) { + emptyResult := &v1beta1.ReferenceGrant{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(referencegrantsResource, c.ns, name, pt, data, subresources...), &v1beta1.ReferenceGrant{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(referencegrantsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ReferenceGrant), err } @@ -144,11 +149,12 @@ func (c *FakeReferenceGrants) Apply(ctx context.Context, referenceGrant *apisv1b if name == nil { return nil, fmt.Errorf("referenceGrant.Name must be provided to Apply") } + emptyResult := &v1beta1.ReferenceGrant{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(referencegrantsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.ReferenceGrant{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(referencegrantsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ReferenceGrant), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gateway.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gateway.go index ad54bccd57..6ed67c9955 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gateway.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gateway.go @@ -20,14 +20,11 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" @@ -43,6 +40,7 @@ type GatewaysGetter interface { type GatewayInterface interface { Create(ctx context.Context, gateway *v1beta1.Gateway, opts v1.CreateOptions) (*v1beta1.Gateway, error) Update(ctx context.Context, gateway *v1beta1.Gateway, opts v1.UpdateOptions) (*v1beta1.Gateway, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, gateway *v1beta1.Gateway, opts v1.UpdateOptions) (*v1beta1.Gateway, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,206 +49,25 @@ type GatewayInterface interface { Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Gateway, err error) Apply(ctx context.Context, gateway *apisv1beta1.GatewayApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Gateway, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, gateway *apisv1beta1.GatewayApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Gateway, err error) GatewayExpansion } // gateways implements GatewayInterface type gateways struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.Gateway, *v1beta1.GatewayList, *apisv1beta1.GatewayApplyConfiguration] } // newGateways returns a Gateways func newGateways(c *GatewayV1beta1Client, namespace string) *gateways { return &gateways{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.Gateway, *v1beta1.GatewayList, *apisv1beta1.GatewayApplyConfiguration]( + "gateways", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.Gateway { return &v1beta1.Gateway{} }, + func() *v1beta1.GatewayList { return &v1beta1.GatewayList{} }), } } - -// Get takes name of the gateway, and returns the corresponding gateway object, and an error if there is any. -func (c *gateways) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Gateway, err error) { - result = &v1beta1.Gateway{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gateways"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Gateways that match those selectors. -func (c *gateways) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.GatewayList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.GatewayList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gateways"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested gateways. -func (c *gateways) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("gateways"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a gateway and creates it. Returns the server's representation of the gateway, and an error, if there is any. -func (c *gateways) Create(ctx context.Context, gateway *v1beta1.Gateway, opts v1.CreateOptions) (result *v1beta1.Gateway, err error) { - result = &v1beta1.Gateway{} - err = c.client.Post(). - Namespace(c.ns). - Resource("gateways"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gateway). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a gateway and updates it. Returns the server's representation of the gateway, and an error, if there is any. -func (c *gateways) Update(ctx context.Context, gateway *v1beta1.Gateway, opts v1.UpdateOptions) (result *v1beta1.Gateway, err error) { - result = &v1beta1.Gateway{} - err = c.client.Put(). - Namespace(c.ns). - Resource("gateways"). - Name(gateway.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gateway). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *gateways) UpdateStatus(ctx context.Context, gateway *v1beta1.Gateway, opts v1.UpdateOptions) (result *v1beta1.Gateway, err error) { - result = &v1beta1.Gateway{} - err = c.client.Put(). - Namespace(c.ns). - Resource("gateways"). - Name(gateway.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gateway). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the gateway and deletes it. Returns an error if one occurs. -func (c *gateways) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("gateways"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *gateways) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("gateways"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched gateway. -func (c *gateways) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Gateway, err error) { - result = &v1beta1.Gateway{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("gateways"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied gateway. -func (c *gateways) Apply(ctx context.Context, gateway *apisv1beta1.GatewayApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Gateway, err error) { - if gateway == nil { - return nil, fmt.Errorf("gateway provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(gateway) - if err != nil { - return nil, err - } - name := gateway.Name - if name == nil { - return nil, fmt.Errorf("gateway.Name must be provided to Apply") - } - result = &v1beta1.Gateway{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("gateways"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *gateways) ApplyStatus(ctx context.Context, gateway *apisv1beta1.GatewayApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Gateway, err error) { - if gateway == nil { - return nil, fmt.Errorf("gateway provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(gateway) - if err != nil { - return nil, err - } - - name := gateway.Name - if name == nil { - return nil, fmt.Errorf("gateway.Name must be provided to Apply") - } - - result = &v1beta1.Gateway{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("gateways"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gatewayclass.go index 45bd5fcad0..f54b1e49be 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gatewayclass.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gatewayclass.go @@ -20,14 +20,11 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" @@ -43,6 +40,7 @@ type GatewayClassesGetter interface { type GatewayClassInterface interface { Create(ctx context.Context, gatewayClass *v1beta1.GatewayClass, opts v1.CreateOptions) (*v1beta1.GatewayClass, error) Update(ctx context.Context, gatewayClass *v1beta1.GatewayClass, opts v1.UpdateOptions) (*v1beta1.GatewayClass, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, gatewayClass *v1beta1.GatewayClass, opts v1.UpdateOptions) (*v1beta1.GatewayClass, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,193 +49,25 @@ type GatewayClassInterface interface { Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.GatewayClass, err error) Apply(ctx context.Context, gatewayClass *apisv1beta1.GatewayClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.GatewayClass, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, gatewayClass *apisv1beta1.GatewayClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.GatewayClass, err error) GatewayClassExpansion } // gatewayClasses implements GatewayClassInterface type gatewayClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.GatewayClass, *v1beta1.GatewayClassList, *apisv1beta1.GatewayClassApplyConfiguration] } // newGatewayClasses returns a GatewayClasses func newGatewayClasses(c *GatewayV1beta1Client) *gatewayClasses { return &gatewayClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.GatewayClass, *v1beta1.GatewayClassList, *apisv1beta1.GatewayClassApplyConfiguration]( + "gatewayclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.GatewayClass { return &v1beta1.GatewayClass{} }, + func() *v1beta1.GatewayClassList { return &v1beta1.GatewayClassList{} }), } } - -// Get takes name of the gatewayClass, and returns the corresponding gatewayClass object, and an error if there is any. -func (c *gatewayClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.GatewayClass, err error) { - result = &v1beta1.GatewayClass{} - err = c.client.Get(). - Resource("gatewayclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of GatewayClasses that match those selectors. -func (c *gatewayClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.GatewayClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.GatewayClassList{} - err = c.client.Get(). - Resource("gatewayclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested gatewayClasses. -func (c *gatewayClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("gatewayclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a gatewayClass and creates it. Returns the server's representation of the gatewayClass, and an error, if there is any. -func (c *gatewayClasses) Create(ctx context.Context, gatewayClass *v1beta1.GatewayClass, opts v1.CreateOptions) (result *v1beta1.GatewayClass, err error) { - result = &v1beta1.GatewayClass{} - err = c.client.Post(). - Resource("gatewayclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gatewayClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a gatewayClass and updates it. Returns the server's representation of the gatewayClass, and an error, if there is any. -func (c *gatewayClasses) Update(ctx context.Context, gatewayClass *v1beta1.GatewayClass, opts v1.UpdateOptions) (result *v1beta1.GatewayClass, err error) { - result = &v1beta1.GatewayClass{} - err = c.client.Put(). - Resource("gatewayclasses"). - Name(gatewayClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gatewayClass). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *gatewayClasses) UpdateStatus(ctx context.Context, gatewayClass *v1beta1.GatewayClass, opts v1.UpdateOptions) (result *v1beta1.GatewayClass, err error) { - result = &v1beta1.GatewayClass{} - err = c.client.Put(). - Resource("gatewayclasses"). - Name(gatewayClass.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gatewayClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the gatewayClass and deletes it. Returns an error if one occurs. -func (c *gatewayClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("gatewayclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *gatewayClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("gatewayclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched gatewayClass. -func (c *gatewayClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.GatewayClass, err error) { - result = &v1beta1.GatewayClass{} - err = c.client.Patch(pt). - Resource("gatewayclasses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied gatewayClass. -func (c *gatewayClasses) Apply(ctx context.Context, gatewayClass *apisv1beta1.GatewayClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.GatewayClass, err error) { - if gatewayClass == nil { - return nil, fmt.Errorf("gatewayClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(gatewayClass) - if err != nil { - return nil, err - } - name := gatewayClass.Name - if name == nil { - return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") - } - result = &v1beta1.GatewayClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("gatewayclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *gatewayClasses) ApplyStatus(ctx context.Context, gatewayClass *apisv1beta1.GatewayClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.GatewayClass, err error) { - if gatewayClass == nil { - return nil, fmt.Errorf("gatewayClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(gatewayClass) - if err != nil { - return nil, err - } - - name := gatewayClass.Name - if name == nil { - return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") - } - - result = &v1beta1.GatewayClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("gatewayclasses"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/httproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/httproute.go index a85262dca2..884a3d6108 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/httproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/httproute.go @@ -20,14 +20,11 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" @@ -43,6 +40,7 @@ type HTTPRoutesGetter interface { type HTTPRouteInterface interface { Create(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.CreateOptions) (*v1beta1.HTTPRoute, error) Update(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.UpdateOptions) (*v1beta1.HTTPRoute, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.UpdateOptions) (*v1beta1.HTTPRoute, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -51,206 +49,25 @@ type HTTPRouteInterface interface { Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.HTTPRoute, err error) Apply(ctx context.Context, hTTPRoute *apisv1beta1.HTTPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.HTTPRoute, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, hTTPRoute *apisv1beta1.HTTPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.HTTPRoute, err error) HTTPRouteExpansion } // hTTPRoutes implements HTTPRouteInterface type hTTPRoutes struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.HTTPRoute, *v1beta1.HTTPRouteList, *apisv1beta1.HTTPRouteApplyConfiguration] } // newHTTPRoutes returns a HTTPRoutes func newHTTPRoutes(c *GatewayV1beta1Client, namespace string) *hTTPRoutes { return &hTTPRoutes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.HTTPRoute, *v1beta1.HTTPRouteList, *apisv1beta1.HTTPRouteApplyConfiguration]( + "httproutes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.HTTPRoute { return &v1beta1.HTTPRoute{} }, + func() *v1beta1.HTTPRouteList { return &v1beta1.HTTPRouteList{} }), } } - -// Get takes name of the hTTPRoute, and returns the corresponding hTTPRoute object, and an error if there is any. -func (c *hTTPRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.HTTPRoute, err error) { - result = &v1beta1.HTTPRoute{} - err = c.client.Get(). - Namespace(c.ns). - Resource("httproutes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of HTTPRoutes that match those selectors. -func (c *hTTPRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.HTTPRouteList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.HTTPRouteList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("httproutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested hTTPRoutes. -func (c *hTTPRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("httproutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a hTTPRoute and creates it. Returns the server's representation of the hTTPRoute, and an error, if there is any. -func (c *hTTPRoutes) Create(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.CreateOptions) (result *v1beta1.HTTPRoute, err error) { - result = &v1beta1.HTTPRoute{} - err = c.client.Post(). - Namespace(c.ns). - Resource("httproutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(hTTPRoute). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a hTTPRoute and updates it. Returns the server's representation of the hTTPRoute, and an error, if there is any. -func (c *hTTPRoutes) Update(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.UpdateOptions) (result *v1beta1.HTTPRoute, err error) { - result = &v1beta1.HTTPRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("httproutes"). - Name(hTTPRoute.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(hTTPRoute). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *hTTPRoutes) UpdateStatus(ctx context.Context, hTTPRoute *v1beta1.HTTPRoute, opts v1.UpdateOptions) (result *v1beta1.HTTPRoute, err error) { - result = &v1beta1.HTTPRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("httproutes"). - Name(hTTPRoute.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(hTTPRoute). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the hTTPRoute and deletes it. Returns an error if one occurs. -func (c *hTTPRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("httproutes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *hTTPRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("httproutes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched hTTPRoute. -func (c *hTTPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.HTTPRoute, err error) { - result = &v1beta1.HTTPRoute{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("httproutes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied hTTPRoute. -func (c *hTTPRoutes) Apply(ctx context.Context, hTTPRoute *apisv1beta1.HTTPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.HTTPRoute, err error) { - if hTTPRoute == nil { - return nil, fmt.Errorf("hTTPRoute provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(hTTPRoute) - if err != nil { - return nil, err - } - name := hTTPRoute.Name - if name == nil { - return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") - } - result = &v1beta1.HTTPRoute{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("httproutes"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *hTTPRoutes) ApplyStatus(ctx context.Context, hTTPRoute *apisv1beta1.HTTPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.HTTPRoute, err error) { - if hTTPRoute == nil { - return nil, fmt.Errorf("hTTPRoute provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(hTTPRoute) - if err != nil { - return nil, err - } - - name := hTTPRoute.Name - if name == nil { - return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") - } - - result = &v1beta1.HTTPRoute{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("httproutes"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/referencegrant.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/referencegrant.go index 575bbd4c05..992727e305 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/referencegrant.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/referencegrant.go @@ -20,14 +20,11 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" @@ -55,154 +52,18 @@ type ReferenceGrantInterface interface { // referenceGrants implements ReferenceGrantInterface type referenceGrants struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.ReferenceGrant, *v1beta1.ReferenceGrantList, *apisv1beta1.ReferenceGrantApplyConfiguration] } // newReferenceGrants returns a ReferenceGrants func newReferenceGrants(c *GatewayV1beta1Client, namespace string) *referenceGrants { return &referenceGrants{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.ReferenceGrant, *v1beta1.ReferenceGrantList, *apisv1beta1.ReferenceGrantApplyConfiguration]( + "referencegrants", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.ReferenceGrant { return &v1beta1.ReferenceGrant{} }, + func() *v1beta1.ReferenceGrantList { return &v1beta1.ReferenceGrantList{} }), } } - -// Get takes name of the referenceGrant, and returns the corresponding referenceGrant object, and an error if there is any. -func (c *referenceGrants) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ReferenceGrant, err error) { - result = &v1beta1.ReferenceGrant{} - err = c.client.Get(). - Namespace(c.ns). - Resource("referencegrants"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ReferenceGrants that match those selectors. -func (c *referenceGrants) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReferenceGrantList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ReferenceGrantList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("referencegrants"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested referenceGrants. -func (c *referenceGrants) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("referencegrants"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a referenceGrant and creates it. Returns the server's representation of the referenceGrant, and an error, if there is any. -func (c *referenceGrants) Create(ctx context.Context, referenceGrant *v1beta1.ReferenceGrant, opts v1.CreateOptions) (result *v1beta1.ReferenceGrant, err error) { - result = &v1beta1.ReferenceGrant{} - err = c.client.Post(). - Namespace(c.ns). - Resource("referencegrants"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(referenceGrant). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a referenceGrant and updates it. Returns the server's representation of the referenceGrant, and an error, if there is any. -func (c *referenceGrants) Update(ctx context.Context, referenceGrant *v1beta1.ReferenceGrant, opts v1.UpdateOptions) (result *v1beta1.ReferenceGrant, err error) { - result = &v1beta1.ReferenceGrant{} - err = c.client.Put(). - Namespace(c.ns). - Resource("referencegrants"). - Name(referenceGrant.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(referenceGrant). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the referenceGrant and deletes it. Returns an error if one occurs. -func (c *referenceGrants) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("referencegrants"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *referenceGrants) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("referencegrants"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched referenceGrant. -func (c *referenceGrants) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ReferenceGrant, err error) { - result = &v1beta1.ReferenceGrant{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("referencegrants"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied referenceGrant. -func (c *referenceGrants) Apply(ctx context.Context, referenceGrant *apisv1beta1.ReferenceGrantApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReferenceGrant, err error) { - if referenceGrant == nil { - return nil, fmt.Errorf("referenceGrant provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(referenceGrant) - if err != nil { - return nil, err - } - name := referenceGrant.Name - if name == nil { - return nil, fmt.Errorf("referenceGrant.Name must be provided to Apply") - } - result = &v1beta1.ReferenceGrant{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("referencegrants"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/factory.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/factory.go index e7f08e89f1..0f5f0550c8 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/factory.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/factory.go @@ -228,6 +228,7 @@ type SharedInformerFactory interface { // Start initializes all requested informers. They are handled in goroutines // which run until the stop channel gets closed. + // Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync. Start(stopCh <-chan struct{}) // Shutdown marks a factory as shutting down. At that point no new diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/gateway.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/gateway.go index 82a886c86c..a709b86266 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/gateway.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/gateway.go @@ -19,8 +19,8 @@ limitations under the License. package v1 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1 "sigs.k8s.io/gateway-api/apis/v1" ) @@ -38,25 +38,17 @@ type GatewayLister interface { // gatewayLister implements the GatewayLister interface. type gatewayLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Gateway] } // NewGatewayLister returns a new GatewayLister. func NewGatewayLister(indexer cache.Indexer) GatewayLister { - return &gatewayLister{indexer: indexer} -} - -// List lists all Gateways in the indexer. -func (s *gatewayLister) List(selector labels.Selector) (ret []*v1.Gateway, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Gateway)) - }) - return ret, err + return &gatewayLister{listers.New[*v1.Gateway](indexer, v1.Resource("gateway"))} } // Gateways returns an object that can list and get Gateways. func (s *gatewayLister) Gateways(namespace string) GatewayNamespaceLister { - return gatewayNamespaceLister{indexer: s.indexer, namespace: namespace} + return gatewayNamespaceLister{listers.NewNamespaced[*v1.Gateway](s.ResourceIndexer, namespace)} } // GatewayNamespaceLister helps list and get Gateways. @@ -74,26 +66,5 @@ type GatewayNamespaceLister interface { // gatewayNamespaceLister implements the GatewayNamespaceLister // interface. type gatewayNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Gateways in the indexer for a given namespace. -func (s gatewayNamespaceLister) List(selector labels.Selector) (ret []*v1.Gateway, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Gateway)) - }) - return ret, err -} - -// Get retrieves the Gateway from the indexer for a given namespace and name. -func (s gatewayNamespaceLister) Get(name string) (*v1.Gateway, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("gateway"), name) - } - return obj.(*v1.Gateway), nil + listers.ResourceIndexer[*v1.Gateway] } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/gatewayclass.go index e3ddf47e27..477e91983d 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/gatewayclass.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/gatewayclass.go @@ -19,8 +19,8 @@ limitations under the License. package v1 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1 "sigs.k8s.io/gateway-api/apis/v1" ) @@ -39,30 +39,10 @@ type GatewayClassLister interface { // gatewayClassLister implements the GatewayClassLister interface. type gatewayClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.GatewayClass] } // NewGatewayClassLister returns a new GatewayClassLister. func NewGatewayClassLister(indexer cache.Indexer) GatewayClassLister { - return &gatewayClassLister{indexer: indexer} -} - -// List lists all GatewayClasses in the indexer. -func (s *gatewayClassLister) List(selector labels.Selector) (ret []*v1.GatewayClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.GatewayClass)) - }) - return ret, err -} - -// Get retrieves the GatewayClass from the index for a given name. -func (s *gatewayClassLister) Get(name string) (*v1.GatewayClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("gatewayclass"), name) - } - return obj.(*v1.GatewayClass), nil + return &gatewayClassLister{listers.New[*v1.GatewayClass](indexer, v1.Resource("gatewayclass"))} } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/grpcroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/grpcroute.go index 5859b59a10..0409c9a402 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/grpcroute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/grpcroute.go @@ -19,8 +19,8 @@ limitations under the License. package v1 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1 "sigs.k8s.io/gateway-api/apis/v1" ) @@ -38,25 +38,17 @@ type GRPCRouteLister interface { // gRPCRouteLister implements the GRPCRouteLister interface. type gRPCRouteLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.GRPCRoute] } // NewGRPCRouteLister returns a new GRPCRouteLister. func NewGRPCRouteLister(indexer cache.Indexer) GRPCRouteLister { - return &gRPCRouteLister{indexer: indexer} -} - -// List lists all GRPCRoutes in the indexer. -func (s *gRPCRouteLister) List(selector labels.Selector) (ret []*v1.GRPCRoute, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.GRPCRoute)) - }) - return ret, err + return &gRPCRouteLister{listers.New[*v1.GRPCRoute](indexer, v1.Resource("grpcroute"))} } // GRPCRoutes returns an object that can list and get GRPCRoutes. func (s *gRPCRouteLister) GRPCRoutes(namespace string) GRPCRouteNamespaceLister { - return gRPCRouteNamespaceLister{indexer: s.indexer, namespace: namespace} + return gRPCRouteNamespaceLister{listers.NewNamespaced[*v1.GRPCRoute](s.ResourceIndexer, namespace)} } // GRPCRouteNamespaceLister helps list and get GRPCRoutes. @@ -74,26 +66,5 @@ type GRPCRouteNamespaceLister interface { // gRPCRouteNamespaceLister implements the GRPCRouteNamespaceLister // interface. type gRPCRouteNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all GRPCRoutes in the indexer for a given namespace. -func (s gRPCRouteNamespaceLister) List(selector labels.Selector) (ret []*v1.GRPCRoute, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.GRPCRoute)) - }) - return ret, err -} - -// Get retrieves the GRPCRoute from the indexer for a given namespace and name. -func (s gRPCRouteNamespaceLister) Get(name string) (*v1.GRPCRoute, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("grpcroute"), name) - } - return obj.(*v1.GRPCRoute), nil + listers.ResourceIndexer[*v1.GRPCRoute] } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/httproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/httproute.go index edf16efc5f..2cbbe09d94 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/httproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/httproute.go @@ -19,8 +19,8 @@ limitations under the License. package v1 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1 "sigs.k8s.io/gateway-api/apis/v1" ) @@ -38,25 +38,17 @@ type HTTPRouteLister interface { // hTTPRouteLister implements the HTTPRouteLister interface. type hTTPRouteLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.HTTPRoute] } // NewHTTPRouteLister returns a new HTTPRouteLister. func NewHTTPRouteLister(indexer cache.Indexer) HTTPRouteLister { - return &hTTPRouteLister{indexer: indexer} -} - -// List lists all HTTPRoutes in the indexer. -func (s *hTTPRouteLister) List(selector labels.Selector) (ret []*v1.HTTPRoute, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.HTTPRoute)) - }) - return ret, err + return &hTTPRouteLister{listers.New[*v1.HTTPRoute](indexer, v1.Resource("httproute"))} } // HTTPRoutes returns an object that can list and get HTTPRoutes. func (s *hTTPRouteLister) HTTPRoutes(namespace string) HTTPRouteNamespaceLister { - return hTTPRouteNamespaceLister{indexer: s.indexer, namespace: namespace} + return hTTPRouteNamespaceLister{listers.NewNamespaced[*v1.HTTPRoute](s.ResourceIndexer, namespace)} } // HTTPRouteNamespaceLister helps list and get HTTPRoutes. @@ -74,26 +66,5 @@ type HTTPRouteNamespaceLister interface { // hTTPRouteNamespaceLister implements the HTTPRouteNamespaceLister // interface. type hTTPRouteNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all HTTPRoutes in the indexer for a given namespace. -func (s hTTPRouteNamespaceLister) List(selector labels.Selector) (ret []*v1.HTTPRoute, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.HTTPRoute)) - }) - return ret, err -} - -// Get retrieves the HTTPRoute from the indexer for a given namespace and name. -func (s hTTPRouteNamespaceLister) Get(name string) (*v1.HTTPRoute, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("httproute"), name) - } - return obj.(*v1.HTTPRoute), nil + listers.ResourceIndexer[*v1.HTTPRoute] } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/backendlbpolicy.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/backendlbpolicy.go index 1b01f4ec3f..3b09cd2d43 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/backendlbpolicy.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/backendlbpolicy.go @@ -19,8 +19,8 @@ limitations under the License. package v1alpha2 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) @@ -38,25 +38,17 @@ type BackendLBPolicyLister interface { // backendLBPolicyLister implements the BackendLBPolicyLister interface. type backendLBPolicyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha2.BackendLBPolicy] } // NewBackendLBPolicyLister returns a new BackendLBPolicyLister. func NewBackendLBPolicyLister(indexer cache.Indexer) BackendLBPolicyLister { - return &backendLBPolicyLister{indexer: indexer} -} - -// List lists all BackendLBPolicies in the indexer. -func (s *backendLBPolicyLister) List(selector labels.Selector) (ret []*v1alpha2.BackendLBPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.BackendLBPolicy)) - }) - return ret, err + return &backendLBPolicyLister{listers.New[*v1alpha2.BackendLBPolicy](indexer, v1alpha2.Resource("backendlbpolicy"))} } // BackendLBPolicies returns an object that can list and get BackendLBPolicies. func (s *backendLBPolicyLister) BackendLBPolicies(namespace string) BackendLBPolicyNamespaceLister { - return backendLBPolicyNamespaceLister{indexer: s.indexer, namespace: namespace} + return backendLBPolicyNamespaceLister{listers.NewNamespaced[*v1alpha2.BackendLBPolicy](s.ResourceIndexer, namespace)} } // BackendLBPolicyNamespaceLister helps list and get BackendLBPolicies. @@ -74,26 +66,5 @@ type BackendLBPolicyNamespaceLister interface { // backendLBPolicyNamespaceLister implements the BackendLBPolicyNamespaceLister // interface. type backendLBPolicyNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all BackendLBPolicies in the indexer for a given namespace. -func (s backendLBPolicyNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.BackendLBPolicy, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.BackendLBPolicy)) - }) - return ret, err -} - -// Get retrieves the BackendLBPolicy from the indexer for a given namespace and name. -func (s backendLBPolicyNamespaceLister) Get(name string) (*v1alpha2.BackendLBPolicy, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("backendlbpolicy"), name) - } - return obj.(*v1alpha2.BackendLBPolicy), nil + listers.ResourceIndexer[*v1alpha2.BackendLBPolicy] } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/grpcroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/grpcroute.go index 822cddba97..9ec44ce2b3 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/grpcroute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/grpcroute.go @@ -19,8 +19,8 @@ limitations under the License. package v1alpha2 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) @@ -38,25 +38,17 @@ type GRPCRouteLister interface { // gRPCRouteLister implements the GRPCRouteLister interface. type gRPCRouteLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha2.GRPCRoute] } // NewGRPCRouteLister returns a new GRPCRouteLister. func NewGRPCRouteLister(indexer cache.Indexer) GRPCRouteLister { - return &gRPCRouteLister{indexer: indexer} -} - -// List lists all GRPCRoutes in the indexer. -func (s *gRPCRouteLister) List(selector labels.Selector) (ret []*v1alpha2.GRPCRoute, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.GRPCRoute)) - }) - return ret, err + return &gRPCRouteLister{listers.New[*v1alpha2.GRPCRoute](indexer, v1alpha2.Resource("grpcroute"))} } // GRPCRoutes returns an object that can list and get GRPCRoutes. func (s *gRPCRouteLister) GRPCRoutes(namespace string) GRPCRouteNamespaceLister { - return gRPCRouteNamespaceLister{indexer: s.indexer, namespace: namespace} + return gRPCRouteNamespaceLister{listers.NewNamespaced[*v1alpha2.GRPCRoute](s.ResourceIndexer, namespace)} } // GRPCRouteNamespaceLister helps list and get GRPCRoutes. @@ -74,26 +66,5 @@ type GRPCRouteNamespaceLister interface { // gRPCRouteNamespaceLister implements the GRPCRouteNamespaceLister // interface. type gRPCRouteNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all GRPCRoutes in the indexer for a given namespace. -func (s gRPCRouteNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.GRPCRoute, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.GRPCRoute)) - }) - return ret, err -} - -// Get retrieves the GRPCRoute from the indexer for a given namespace and name. -func (s gRPCRouteNamespaceLister) Get(name string) (*v1alpha2.GRPCRoute, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("grpcroute"), name) - } - return obj.(*v1alpha2.GRPCRoute), nil + listers.ResourceIndexer[*v1alpha2.GRPCRoute] } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/referencegrant.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/referencegrant.go index eb8c7a5615..8df80e9252 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/referencegrant.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/referencegrant.go @@ -19,8 +19,8 @@ limitations under the License. package v1alpha2 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) @@ -38,25 +38,17 @@ type ReferenceGrantLister interface { // referenceGrantLister implements the ReferenceGrantLister interface. type referenceGrantLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha2.ReferenceGrant] } // NewReferenceGrantLister returns a new ReferenceGrantLister. func NewReferenceGrantLister(indexer cache.Indexer) ReferenceGrantLister { - return &referenceGrantLister{indexer: indexer} -} - -// List lists all ReferenceGrants in the indexer. -func (s *referenceGrantLister) List(selector labels.Selector) (ret []*v1alpha2.ReferenceGrant, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.ReferenceGrant)) - }) - return ret, err + return &referenceGrantLister{listers.New[*v1alpha2.ReferenceGrant](indexer, v1alpha2.Resource("referencegrant"))} } // ReferenceGrants returns an object that can list and get ReferenceGrants. func (s *referenceGrantLister) ReferenceGrants(namespace string) ReferenceGrantNamespaceLister { - return referenceGrantNamespaceLister{indexer: s.indexer, namespace: namespace} + return referenceGrantNamespaceLister{listers.NewNamespaced[*v1alpha2.ReferenceGrant](s.ResourceIndexer, namespace)} } // ReferenceGrantNamespaceLister helps list and get ReferenceGrants. @@ -74,26 +66,5 @@ type ReferenceGrantNamespaceLister interface { // referenceGrantNamespaceLister implements the ReferenceGrantNamespaceLister // interface. type referenceGrantNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ReferenceGrants in the indexer for a given namespace. -func (s referenceGrantNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.ReferenceGrant, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.ReferenceGrant)) - }) - return ret, err -} - -// Get retrieves the ReferenceGrant from the indexer for a given namespace and name. -func (s referenceGrantNamespaceLister) Get(name string) (*v1alpha2.ReferenceGrant, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("referencegrant"), name) - } - return obj.(*v1alpha2.ReferenceGrant), nil + listers.ResourceIndexer[*v1alpha2.ReferenceGrant] } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/tcproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/tcproute.go index f9582ed03e..4b34f9a2d9 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/tcproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/tcproute.go @@ -19,8 +19,8 @@ limitations under the License. package v1alpha2 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) @@ -38,25 +38,17 @@ type TCPRouteLister interface { // tCPRouteLister implements the TCPRouteLister interface. type tCPRouteLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha2.TCPRoute] } // NewTCPRouteLister returns a new TCPRouteLister. func NewTCPRouteLister(indexer cache.Indexer) TCPRouteLister { - return &tCPRouteLister{indexer: indexer} -} - -// List lists all TCPRoutes in the indexer. -func (s *tCPRouteLister) List(selector labels.Selector) (ret []*v1alpha2.TCPRoute, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.TCPRoute)) - }) - return ret, err + return &tCPRouteLister{listers.New[*v1alpha2.TCPRoute](indexer, v1alpha2.Resource("tcproute"))} } // TCPRoutes returns an object that can list and get TCPRoutes. func (s *tCPRouteLister) TCPRoutes(namespace string) TCPRouteNamespaceLister { - return tCPRouteNamespaceLister{indexer: s.indexer, namespace: namespace} + return tCPRouteNamespaceLister{listers.NewNamespaced[*v1alpha2.TCPRoute](s.ResourceIndexer, namespace)} } // TCPRouteNamespaceLister helps list and get TCPRoutes. @@ -74,26 +66,5 @@ type TCPRouteNamespaceLister interface { // tCPRouteNamespaceLister implements the TCPRouteNamespaceLister // interface. type tCPRouteNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all TCPRoutes in the indexer for a given namespace. -func (s tCPRouteNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.TCPRoute, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.TCPRoute)) - }) - return ret, err -} - -// Get retrieves the TCPRoute from the indexer for a given namespace and name. -func (s tCPRouteNamespaceLister) Get(name string) (*v1alpha2.TCPRoute, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("tcproute"), name) - } - return obj.(*v1alpha2.TCPRoute), nil + listers.ResourceIndexer[*v1alpha2.TCPRoute] } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/tlsroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/tlsroute.go index 0c68c2e71f..ad021d0d14 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/tlsroute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/tlsroute.go @@ -19,8 +19,8 @@ limitations under the License. package v1alpha2 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) @@ -38,25 +38,17 @@ type TLSRouteLister interface { // tLSRouteLister implements the TLSRouteLister interface. type tLSRouteLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha2.TLSRoute] } // NewTLSRouteLister returns a new TLSRouteLister. func NewTLSRouteLister(indexer cache.Indexer) TLSRouteLister { - return &tLSRouteLister{indexer: indexer} -} - -// List lists all TLSRoutes in the indexer. -func (s *tLSRouteLister) List(selector labels.Selector) (ret []*v1alpha2.TLSRoute, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.TLSRoute)) - }) - return ret, err + return &tLSRouteLister{listers.New[*v1alpha2.TLSRoute](indexer, v1alpha2.Resource("tlsroute"))} } // TLSRoutes returns an object that can list and get TLSRoutes. func (s *tLSRouteLister) TLSRoutes(namespace string) TLSRouteNamespaceLister { - return tLSRouteNamespaceLister{indexer: s.indexer, namespace: namespace} + return tLSRouteNamespaceLister{listers.NewNamespaced[*v1alpha2.TLSRoute](s.ResourceIndexer, namespace)} } // TLSRouteNamespaceLister helps list and get TLSRoutes. @@ -74,26 +66,5 @@ type TLSRouteNamespaceLister interface { // tLSRouteNamespaceLister implements the TLSRouteNamespaceLister // interface. type tLSRouteNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all TLSRoutes in the indexer for a given namespace. -func (s tLSRouteNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.TLSRoute, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.TLSRoute)) - }) - return ret, err -} - -// Get retrieves the TLSRoute from the indexer for a given namespace and name. -func (s tLSRouteNamespaceLister) Get(name string) (*v1alpha2.TLSRoute, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("tlsroute"), name) - } - return obj.(*v1alpha2.TLSRoute), nil + listers.ResourceIndexer[*v1alpha2.TLSRoute] } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/udproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/udproute.go index ef47d5a105..e4e4a20643 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/udproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/udproute.go @@ -19,8 +19,8 @@ limitations under the License. package v1alpha2 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) @@ -38,25 +38,17 @@ type UDPRouteLister interface { // uDPRouteLister implements the UDPRouteLister interface. type uDPRouteLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha2.UDPRoute] } // NewUDPRouteLister returns a new UDPRouteLister. func NewUDPRouteLister(indexer cache.Indexer) UDPRouteLister { - return &uDPRouteLister{indexer: indexer} -} - -// List lists all UDPRoutes in the indexer. -func (s *uDPRouteLister) List(selector labels.Selector) (ret []*v1alpha2.UDPRoute, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.UDPRoute)) - }) - return ret, err + return &uDPRouteLister{listers.New[*v1alpha2.UDPRoute](indexer, v1alpha2.Resource("udproute"))} } // UDPRoutes returns an object that can list and get UDPRoutes. func (s *uDPRouteLister) UDPRoutes(namespace string) UDPRouteNamespaceLister { - return uDPRouteNamespaceLister{indexer: s.indexer, namespace: namespace} + return uDPRouteNamespaceLister{listers.NewNamespaced[*v1alpha2.UDPRoute](s.ResourceIndexer, namespace)} } // UDPRouteNamespaceLister helps list and get UDPRoutes. @@ -74,26 +66,5 @@ type UDPRouteNamespaceLister interface { // uDPRouteNamespaceLister implements the UDPRouteNamespaceLister // interface. type uDPRouteNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all UDPRoutes in the indexer for a given namespace. -func (s uDPRouteNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.UDPRoute, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.UDPRoute)) - }) - return ret, err -} - -// Get retrieves the UDPRoute from the indexer for a given namespace and name. -func (s uDPRouteNamespaceLister) Get(name string) (*v1alpha2.UDPRoute, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("udproute"), name) - } - return obj.(*v1alpha2.UDPRoute), nil + listers.ResourceIndexer[*v1alpha2.UDPRoute] } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha3/backendtlspolicy.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha3/backendtlspolicy.go index 56ea817373..c881c849f4 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha3/backendtlspolicy.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha3/backendtlspolicy.go @@ -19,8 +19,8 @@ limitations under the License. package v1alpha3 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" ) @@ -38,25 +38,17 @@ type BackendTLSPolicyLister interface { // backendTLSPolicyLister implements the BackendTLSPolicyLister interface. type backendTLSPolicyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha3.BackendTLSPolicy] } // NewBackendTLSPolicyLister returns a new BackendTLSPolicyLister. func NewBackendTLSPolicyLister(indexer cache.Indexer) BackendTLSPolicyLister { - return &backendTLSPolicyLister{indexer: indexer} -} - -// List lists all BackendTLSPolicies in the indexer. -func (s *backendTLSPolicyLister) List(selector labels.Selector) (ret []*v1alpha3.BackendTLSPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha3.BackendTLSPolicy)) - }) - return ret, err + return &backendTLSPolicyLister{listers.New[*v1alpha3.BackendTLSPolicy](indexer, v1alpha3.Resource("backendtlspolicy"))} } // BackendTLSPolicies returns an object that can list and get BackendTLSPolicies. func (s *backendTLSPolicyLister) BackendTLSPolicies(namespace string) BackendTLSPolicyNamespaceLister { - return backendTLSPolicyNamespaceLister{indexer: s.indexer, namespace: namespace} + return backendTLSPolicyNamespaceLister{listers.NewNamespaced[*v1alpha3.BackendTLSPolicy](s.ResourceIndexer, namespace)} } // BackendTLSPolicyNamespaceLister helps list and get BackendTLSPolicies. @@ -74,26 +66,5 @@ type BackendTLSPolicyNamespaceLister interface { // backendTLSPolicyNamespaceLister implements the BackendTLSPolicyNamespaceLister // interface. type backendTLSPolicyNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all BackendTLSPolicies in the indexer for a given namespace. -func (s backendTLSPolicyNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.BackendTLSPolicy, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha3.BackendTLSPolicy)) - }) - return ret, err -} - -// Get retrieves the BackendTLSPolicy from the indexer for a given namespace and name. -func (s backendTLSPolicyNamespaceLister) Get(name string) (*v1alpha3.BackendTLSPolicy, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha3.Resource("backendtlspolicy"), name) - } - return obj.(*v1alpha3.BackendTLSPolicy), nil + listers.ResourceIndexer[*v1alpha3.BackendTLSPolicy] } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/gateway.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/gateway.go index 34a6707cb0..2b20013c17 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/gateway.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/gateway.go @@ -19,8 +19,8 @@ limitations under the License. package v1beta1 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" ) @@ -38,25 +38,17 @@ type GatewayLister interface { // gatewayLister implements the GatewayLister interface. type gatewayLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.Gateway] } // NewGatewayLister returns a new GatewayLister. func NewGatewayLister(indexer cache.Indexer) GatewayLister { - return &gatewayLister{indexer: indexer} -} - -// List lists all Gateways in the indexer. -func (s *gatewayLister) List(selector labels.Selector) (ret []*v1beta1.Gateway, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Gateway)) - }) - return ret, err + return &gatewayLister{listers.New[*v1beta1.Gateway](indexer, v1beta1.Resource("gateway"))} } // Gateways returns an object that can list and get Gateways. func (s *gatewayLister) Gateways(namespace string) GatewayNamespaceLister { - return gatewayNamespaceLister{indexer: s.indexer, namespace: namespace} + return gatewayNamespaceLister{listers.NewNamespaced[*v1beta1.Gateway](s.ResourceIndexer, namespace)} } // GatewayNamespaceLister helps list and get Gateways. @@ -74,26 +66,5 @@ type GatewayNamespaceLister interface { // gatewayNamespaceLister implements the GatewayNamespaceLister // interface. type gatewayNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Gateways in the indexer for a given namespace. -func (s gatewayNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Gateway, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Gateway)) - }) - return ret, err -} - -// Get retrieves the Gateway from the indexer for a given namespace and name. -func (s gatewayNamespaceLister) Get(name string) (*v1beta1.Gateway, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("gateway"), name) - } - return obj.(*v1beta1.Gateway), nil + listers.ResourceIndexer[*v1beta1.Gateway] } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/gatewayclass.go index 2161270142..c2ae2ec025 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/gatewayclass.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/gatewayclass.go @@ -19,8 +19,8 @@ limitations under the License. package v1beta1 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" ) @@ -39,30 +39,10 @@ type GatewayClassLister interface { // gatewayClassLister implements the GatewayClassLister interface. type gatewayClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.GatewayClass] } // NewGatewayClassLister returns a new GatewayClassLister. func NewGatewayClassLister(indexer cache.Indexer) GatewayClassLister { - return &gatewayClassLister{indexer: indexer} -} - -// List lists all GatewayClasses in the indexer. -func (s *gatewayClassLister) List(selector labels.Selector) (ret []*v1beta1.GatewayClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.GatewayClass)) - }) - return ret, err -} - -// Get retrieves the GatewayClass from the index for a given name. -func (s *gatewayClassLister) Get(name string) (*v1beta1.GatewayClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("gatewayclass"), name) - } - return obj.(*v1beta1.GatewayClass), nil + return &gatewayClassLister{listers.New[*v1beta1.GatewayClass](indexer, v1beta1.Resource("gatewayclass"))} } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/httproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/httproute.go index 6d27a03358..243226986c 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/httproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/httproute.go @@ -19,8 +19,8 @@ limitations under the License. package v1beta1 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" ) @@ -38,25 +38,17 @@ type HTTPRouteLister interface { // hTTPRouteLister implements the HTTPRouteLister interface. type hTTPRouteLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.HTTPRoute] } // NewHTTPRouteLister returns a new HTTPRouteLister. func NewHTTPRouteLister(indexer cache.Indexer) HTTPRouteLister { - return &hTTPRouteLister{indexer: indexer} -} - -// List lists all HTTPRoutes in the indexer. -func (s *hTTPRouteLister) List(selector labels.Selector) (ret []*v1beta1.HTTPRoute, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.HTTPRoute)) - }) - return ret, err + return &hTTPRouteLister{listers.New[*v1beta1.HTTPRoute](indexer, v1beta1.Resource("httproute"))} } // HTTPRoutes returns an object that can list and get HTTPRoutes. func (s *hTTPRouteLister) HTTPRoutes(namespace string) HTTPRouteNamespaceLister { - return hTTPRouteNamespaceLister{indexer: s.indexer, namespace: namespace} + return hTTPRouteNamespaceLister{listers.NewNamespaced[*v1beta1.HTTPRoute](s.ResourceIndexer, namespace)} } // HTTPRouteNamespaceLister helps list and get HTTPRoutes. @@ -74,26 +66,5 @@ type HTTPRouteNamespaceLister interface { // hTTPRouteNamespaceLister implements the HTTPRouteNamespaceLister // interface. type hTTPRouteNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all HTTPRoutes in the indexer for a given namespace. -func (s hTTPRouteNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.HTTPRoute, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.HTTPRoute)) - }) - return ret, err -} - -// Get retrieves the HTTPRoute from the indexer for a given namespace and name. -func (s hTTPRouteNamespaceLister) Get(name string) (*v1beta1.HTTPRoute, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("httproute"), name) - } - return obj.(*v1beta1.HTTPRoute), nil + listers.ResourceIndexer[*v1beta1.HTTPRoute] } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/referencegrant.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/referencegrant.go index 8144734b27..5263fef653 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/referencegrant.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1/referencegrant.go @@ -19,8 +19,8 @@ limitations under the License. package v1beta1 import ( - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" ) @@ -38,25 +38,17 @@ type ReferenceGrantLister interface { // referenceGrantLister implements the ReferenceGrantLister interface. type referenceGrantLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.ReferenceGrant] } // NewReferenceGrantLister returns a new ReferenceGrantLister. func NewReferenceGrantLister(indexer cache.Indexer) ReferenceGrantLister { - return &referenceGrantLister{indexer: indexer} -} - -// List lists all ReferenceGrants in the indexer. -func (s *referenceGrantLister) List(selector labels.Selector) (ret []*v1beta1.ReferenceGrant, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ReferenceGrant)) - }) - return ret, err + return &referenceGrantLister{listers.New[*v1beta1.ReferenceGrant](indexer, v1beta1.Resource("referencegrant"))} } // ReferenceGrants returns an object that can list and get ReferenceGrants. func (s *referenceGrantLister) ReferenceGrants(namespace string) ReferenceGrantNamespaceLister { - return referenceGrantNamespaceLister{indexer: s.indexer, namespace: namespace} + return referenceGrantNamespaceLister{listers.NewNamespaced[*v1beta1.ReferenceGrant](s.ResourceIndexer, namespace)} } // ReferenceGrantNamespaceLister helps list and get ReferenceGrants. @@ -74,26 +66,5 @@ type ReferenceGrantNamespaceLister interface { // referenceGrantNamespaceLister implements the ReferenceGrantNamespaceLister // interface. type referenceGrantNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ReferenceGrants in the indexer for a given namespace. -func (s referenceGrantNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.ReferenceGrant, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ReferenceGrant)) - }) - return ret, err -} - -// Get retrieves the ReferenceGrant from the indexer for a given namespace and name. -func (s referenceGrantNamespaceLister) Get(name string) (*v1beta1.ReferenceGrant, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("referencegrant"), name) - } - return obj.(*v1beta1.ReferenceGrant), nil + listers.ResourceIndexer[*v1beta1.ReferenceGrant] } diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v4/fieldpath/set.go b/vendor/sigs.k8s.io/structured-merge-diff/v4/fieldpath/set.go index 6d182768d0..77ae251163 100644 --- a/vendor/sigs.k8s.io/structured-merge-diff/v4/fieldpath/set.go +++ b/vendor/sigs.k8s.io/structured-merge-diff/v4/fieldpath/set.go @@ -17,6 +17,8 @@ limitations under the License. package fieldpath import ( + "fmt" + "sigs.k8s.io/structured-merge-diff/v4/value" "sort" "strings" @@ -136,6 +138,198 @@ func (s *Set) EnsureNamedFieldsAreMembers(sc *schema.Schema, tr schema.TypeRef) } } +// MakePrefixMatcherOrDie is the same as PrefixMatcher except it panics if parts can't be +// turned into a SetMatcher. +func MakePrefixMatcherOrDie(parts ...interface{}) *SetMatcher { + result, err := PrefixMatcher(parts...) + if err != nil { + panic(err) + } + return result +} + +// PrefixMatcher creates a SetMatcher that matches all field paths prefixed by the given list of matcher path parts. +// The matcher parts may any of: +// +// - PathElementMatcher - for wildcards, `MatchAnyPathElement()` can be used as well. +// - PathElement - for any path element +// - value.FieldList - for listMap keys +// - value.Value - for scalar list elements +// - string - For field names +// - int - for array indices +func PrefixMatcher(parts ...interface{}) (*SetMatcher, error) { + current := MatchAnySet() // match all field path suffixes + for i := len(parts) - 1; i >= 0; i-- { + part := parts[i] + var pattern PathElementMatcher + switch t := part.(type) { + case PathElementMatcher: + // any path matcher, including wildcard + pattern = t + case PathElement: + // any path element + pattern = PathElementMatcher{PathElement: t} + case *value.FieldList: + // a listMap key + if len(*t) == 0 { + return nil, fmt.Errorf("associative list key type path elements must have at least one key (got zero)") + } + pattern = PathElementMatcher{PathElement: PathElement{Key: t}} + case value.Value: + // a scalar or set-type list element + pattern = PathElementMatcher{PathElement: PathElement{Value: &t}} + case string: + // a plain field name + pattern = PathElementMatcher{PathElement: PathElement{FieldName: &t}} + case int: + // a plain list index + pattern = PathElementMatcher{PathElement: PathElement{Index: &t}} + default: + return nil, fmt.Errorf("unexpected type %T", t) + } + current = &SetMatcher{ + members: []*SetMemberMatcher{{ + Path: pattern, + Child: current, + }}, + } + } + return current, nil +} + +// MatchAnyPathElement returns a PathElementMatcher that matches any path element. +func MatchAnyPathElement() PathElementMatcher { + return PathElementMatcher{Wildcard: true} +} + +// MatchAnySet returns a SetMatcher that matches any set. +func MatchAnySet() *SetMatcher { + return &SetMatcher{wildcard: true} +} + +// NewSetMatcher returns a new SetMatcher. +// Wildcard members take precedent over non-wildcard members; +// all non-wildcard members are ignored if there is a wildcard members. +func NewSetMatcher(wildcard bool, members ...*SetMemberMatcher) *SetMatcher { + sort.Sort(sortedMemberMatcher(members)) + return &SetMatcher{wildcard: wildcard, members: members} +} + +// SetMatcher defines a matcher that matches fields in a Set. +// SetMatcher is structured much like a Set but with wildcard support. +type SetMatcher struct { + // wildcard indicates that all members and children are included in the match. + // If set, the members field is ignored. + wildcard bool + // members provides patterns to match the members of a Set. + // Wildcard members are sorted before non-wildcards and take precedent over + // non-wildcard members. + members sortedMemberMatcher +} + +type sortedMemberMatcher []*SetMemberMatcher + +func (s sortedMemberMatcher) Len() int { return len(s) } +func (s sortedMemberMatcher) Less(i, j int) bool { return s[i].Path.Less(s[j].Path) } +func (s sortedMemberMatcher) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s sortedMemberMatcher) Find(p PathElementMatcher) (location int, ok bool) { + return sort.Find(len(s), func(i int) int { + return s[i].Path.Compare(p) + }) +} + +// Merge merges s and s2 and returns a SetMatcher that matches all field paths matched by either s or s2. +// During the merge, members of s and s2 with the same PathElementMatcher merged into a single member +// with the children of each merged by calling this function recursively. +func (s *SetMatcher) Merge(s2 *SetMatcher) *SetMatcher { + if s.wildcard || s2.wildcard { + return NewSetMatcher(true) + } + merged := make(sortedMemberMatcher, len(s.members), len(s.members)+len(s2.members)) + copy(merged, s.members) + for _, m := range s2.members { + if i, ok := s.members.Find(m.Path); ok { + // since merged is a shallow copy, do not modify elements in place + merged[i] = &SetMemberMatcher{ + Path: merged[i].Path, + Child: merged[i].Child.Merge(m.Child), + } + } else { + merged = append(merged, m) + } + } + return NewSetMatcher(false, merged...) // sort happens here +} + +// SetMemberMatcher defines a matcher that matches the members of a Set. +// SetMemberMatcher is structured much like the elements of a SetNodeMap, but +// with wildcard support. +type SetMemberMatcher struct { + // Path provides a matcher to match members of a Set. + // If Path is a wildcard, all members of a Set are included in the match. + // Otherwise, if any Path is Equal to a member of a Set, that member is + // included in the match and the children of that member are matched + // against the Child matcher. + Path PathElementMatcher + + // Child provides a matcher to use for the children of matched members of a Set. + Child *SetMatcher +} + +// PathElementMatcher defined a path matcher for a PathElement. +type PathElementMatcher struct { + // Wildcard indicates that all PathElements are matched by this matcher. + // If set, PathElement is ignored. + Wildcard bool + + // PathElement indicates that a PathElement is matched if it is Equal + // to this PathElement. + PathElement +} + +func (p PathElementMatcher) Equals(p2 PathElementMatcher) bool { + return p.Wildcard != p2.Wildcard && p.PathElement.Equals(p2.PathElement) +} + +func (p PathElementMatcher) Less(p2 PathElementMatcher) bool { + if p.Wildcard && !p2.Wildcard { + return true + } else if p2.Wildcard { + return false + } + return p.PathElement.Less(p2.PathElement) +} + +func (p PathElementMatcher) Compare(p2 PathElementMatcher) int { + if p.Wildcard && !p2.Wildcard { + return -1 + } else if p2.Wildcard { + return 1 + } + return p.PathElement.Compare(p2.PathElement) +} + +// FilterIncludeMatches returns a Set with only the field paths that match. +func (s *Set) FilterIncludeMatches(pattern *SetMatcher) *Set { + if pattern.wildcard { + return s + } + + members := PathElementSet{} + for _, m := range s.Members.members { + for _, pm := range pattern.members { + if pm.Path.Wildcard || pm.Path.PathElement.Equals(m) { + members.Insert(m) + break + } + } + } + return &Set{ + Members: members, + Children: *s.Children.FilterIncludeMatches(pattern), + } +} + // Size returns the number of members of the set. func (s *Set) Size() int { return s.Members.Size() + s.Children.Size() @@ -476,6 +670,33 @@ func (s *SetNodeMap) EnsureNamedFieldsAreMembers(sc *schema.Schema, tr schema.Ty } } +// FilterIncludeMatches returns a SetNodeMap with only the field paths that match the matcher. +func (s *SetNodeMap) FilterIncludeMatches(pattern *SetMatcher) *SetNodeMap { + if pattern.wildcard { + return s + } + + var out sortedSetNode + for _, member := range s.members { + for _, c := range pattern.members { + if c.Path.Wildcard || c.Path.PathElement.Equals(member.pathElement) { + childSet := member.set.FilterIncludeMatches(c.Child) + if childSet.Size() > 0 { + out = append(out, setNode{ + pathElement: member.pathElement, + set: childSet, + }) + } + break + } + } + } + + return &SetNodeMap{ + members: out, + } +} + // Iterate calls f for each PathElement in the set. func (s *SetNodeMap) Iterate(f func(PathElement)) { for _, n := range s.members { @@ -503,3 +724,59 @@ func (s *SetNodeMap) Leaves() *SetNodeMap { } return out } + +// Filter defines an interface for excluding field paths from a set. +// NewExcludeSetFilter can be used to create a filter that removes +// specific field paths and all of their children. +// NewIncludeMatcherFilter can be used to create a filter that removes all fields except +// the fields that match a field path matcher. PrefixMatcher and MakePrefixMatcherOrDie +// can be used to define field path patterns. +type Filter interface { + // Filter returns a filtered copy of the set. + Filter(*Set) *Set +} + +// NewExcludeSetFilter returns a filter that removes field paths in the exclude set. +func NewExcludeSetFilter(exclude *Set) Filter { + return excludeFilter{exclude} +} + +// NewExcludeFilterSetMap converts a map of APIVersion to exclude set to a map of APIVersion to exclude filters. +func NewExcludeFilterSetMap(resetFields map[APIVersion]*Set) map[APIVersion]Filter { + result := make(map[APIVersion]Filter) + for k, v := range resetFields { + result[k] = excludeFilter{v} + } + return result +} + +type excludeFilter struct { + excludeSet *Set +} + +func (t excludeFilter) Filter(set *Set) *Set { + return set.RecursiveDifference(t.excludeSet) +} + +// NewIncludeMatcherFilter returns a filter that only includes field paths that match. +// If no matchers are provided, the filter includes all field paths. +// PrefixMatcher and MakePrefixMatcherOrDie can help create basic matcher. +func NewIncludeMatcherFilter(matchers ...*SetMatcher) Filter { + if len(matchers) == 0 { + return includeMatcherFilter{&SetMatcher{wildcard: true}} + } + matcher := matchers[0] + for i := 1; i < len(matchers); i++ { + matcher = matcher.Merge(matchers[i]) + } + + return includeMatcherFilter{matcher} +} + +type includeMatcherFilter struct { + matcher *SetMatcher +} + +func (pf includeMatcherFilter) Filter(set *Set) *Set { + return set.FilterIncludeMatches(pf.matcher) +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/update.go b/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/update.go index d5a977d607..34ab2d6fb4 100644 --- a/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/update.go +++ b/vendor/sigs.k8s.io/structured-merge-diff/v4/merge/update.go @@ -15,7 +15,6 @@ package merge import ( "fmt" - "sigs.k8s.io/structured-merge-diff/v4/fieldpath" "sigs.k8s.io/structured-merge-diff/v4/typed" "sigs.k8s.io/structured-merge-diff/v4/value" @@ -31,8 +30,8 @@ type Converter interface { // UpdateBuilder allows you to create a new Updater by exposing all of // the options and setting them once. type UpdaterBuilder struct { - Converter Converter - IgnoredFields map[fieldpath.APIVersion]*fieldpath.Set + Converter Converter + IgnoreFilter map[fieldpath.APIVersion]fieldpath.Filter // Stop comparing the new object with old object after applying. // This was initially used to avoid spurious etcd update, but @@ -46,7 +45,7 @@ type UpdaterBuilder struct { func (u *UpdaterBuilder) BuildUpdater() *Updater { return &Updater{ Converter: u.Converter, - IgnoredFields: u.IgnoredFields, + IgnoreFilter: u.IgnoreFilter, returnInputOnNoop: u.ReturnInputOnNoop, } } @@ -58,7 +57,7 @@ type Updater struct { Converter Converter // Deprecated: This will eventually become private. - IgnoredFields map[fieldpath.APIVersion]*fieldpath.Set + IgnoreFilter map[fieldpath.APIVersion]fieldpath.Filter returnInputOnNoop bool } @@ -72,7 +71,7 @@ func (s *Updater) update(oldObject, newObject *typed.TypedValue, version fieldpa } versions := map[fieldpath.APIVersion]*typed.Comparison{ - version: compare.ExcludeFields(s.IgnoredFields[version]), + version: compare.FilterFields(s.IgnoreFilter[version]), } for manager, managerSet := range managers { @@ -102,7 +101,7 @@ func (s *Updater) update(oldObject, newObject *typed.TypedValue, version fieldpa if err != nil { return nil, nil, fmt.Errorf("failed to compare objects: %v", err) } - versions[managerSet.APIVersion()] = compare.ExcludeFields(s.IgnoredFields[managerSet.APIVersion()]) + versions[managerSet.APIVersion()] = compare.FilterFields(s.IgnoreFilter[managerSet.APIVersion()]) } conflictSet := managerSet.Set().Intersection(compare.Modified.Union(compare.Added)) @@ -154,13 +153,14 @@ func (s *Updater) Update(liveObject, newObject *typed.TypedValue, version fieldp if _, ok := managers[manager]; !ok { managers[manager] = fieldpath.NewVersionedSet(fieldpath.NewSet(), version, false) } - - ignored := s.IgnoredFields[version] - if ignored == nil { - ignored = fieldpath.NewSet() + set := managers[manager].Set().Difference(compare.Removed).Union(compare.Modified).Union(compare.Added) + ignoreFilter := s.IgnoreFilter[version] + if ignoreFilter != nil { + set = ignoreFilter.Filter(set) } + managers[manager] = fieldpath.NewVersionedSet( - managers[manager].Set().Difference(compare.Removed).Union(compare.Modified).Union(compare.Added).RecursiveDifference(ignored), + set, version, false, ) @@ -189,13 +189,9 @@ func (s *Updater) Apply(liveObject, configObject *typed.TypedValue, version fiel return nil, fieldpath.ManagedFields{}, fmt.Errorf("failed to get field set: %v", err) } - ignored := s.IgnoredFields[version] - if ignored != nil { - set = set.RecursiveDifference(ignored) - // TODO: is this correct. If we don't remove from lastSet pruning might remove the fields? - if lastSet != nil { - lastSet.Set().RecursiveDifference(ignored) - } + ignoreFilter := s.IgnoreFilter[version] + if ignoreFilter != nil { + set = ignoreFilter.Filter(set) } managers[manager] = fieldpath.NewVersionedSet(set, version, true) newObject, err = s.prune(newObject, managers, manager, lastSet) diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/compare.go b/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/compare.go index ed483cbbc4..5fffa5e2cd 100644 --- a/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/compare.go +++ b/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/compare.go @@ -72,6 +72,16 @@ func (c *Comparison) ExcludeFields(fields *fieldpath.Set) *Comparison { return c } +func (c *Comparison) FilterFields(filter fieldpath.Filter) *Comparison { + if filter == nil { + return c + } + c.Removed = filter.Filter(c.Removed) + c.Modified = filter.Filter(c.Modified) + c.Added = filter.Filter(c.Added) + return c +} + type compareWalker struct { lhs value.Value rhs value.Value diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/parser.go b/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/parser.go index 4258ee5bab..0e9f7cc7e4 100644 --- a/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/parser.go +++ b/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/parser.go @@ -19,9 +19,9 @@ package typed import ( "fmt" - yaml "gopkg.in/yaml.v2" "sigs.k8s.io/structured-merge-diff/v4/schema" "sigs.k8s.io/structured-merge-diff/v4/value" + yaml "sigs.k8s.io/yaml/goyaml.v2" ) // YAMLObject is an object encoded in YAML. diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v4/value/reflectcache.go b/vendor/sigs.k8s.io/structured-merge-diff/v4/value/reflectcache.go index f0d58d42cb..88693b87e8 100644 --- a/vendor/sigs.k8s.io/structured-merge-diff/v4/value/reflectcache.go +++ b/vendor/sigs.k8s.io/structured-merge-diff/v4/value/reflectcache.go @@ -19,7 +19,9 @@ package value import ( "bytes" "encoding/json" + "errors" "fmt" + "io" "reflect" "sort" "sync" @@ -184,6 +186,11 @@ func (e TypeReflectCacheEntry) ToUnstructured(sv reflect.Value) (interface{}, er // This is based on https://github.com/kubernetes/kubernetes/blob/82c9e5c814eb7acc6cc0a090c057294d0667ad66/staging/src/k8s.io/apimachinery/pkg/runtime/converter.go#L505 // and is intended to replace it. + // Check if the object is a nil pointer. + if sv.Kind() == reflect.Ptr && sv.IsNil() { + // We're done - we don't need to store anything. + return nil, nil + } // Check if the object has a custom string converter and use it if available, since it is much more efficient // than round tripping through json. if converter, ok := e.getUnstructuredConverter(sv); ok { @@ -191,11 +198,6 @@ func (e TypeReflectCacheEntry) ToUnstructured(sv reflect.Value) (interface{}, er } // Check if the object has a custom JSON marshaller/unmarshaller. if marshaler, ok := e.getJsonMarshaler(sv); ok { - if sv.Kind() == reflect.Ptr && sv.IsNil() { - // We're done - we don't need to store anything. - return nil, nil - } - data, err := marshaler.MarshalJSON() if err != nil { return nil, err @@ -379,34 +381,47 @@ const maxDepth = 10000 // unmarshal unmarshals the given data // If v is a *map[string]interface{}, numbers are converted to int64 or float64 func unmarshal(data []byte, v interface{}) error { + // Build a decoder from the given data + decoder := json.NewDecoder(bytes.NewBuffer(data)) + // Preserve numbers, rather than casting to float64 automatically + decoder.UseNumber() + // Run the decode + if err := decoder.Decode(v); err != nil { + return err + } + next := decoder.InputOffset() + if _, err := decoder.Token(); !errors.Is(err, io.EOF) { + tail := bytes.TrimLeft(data[next:], " \t\r\n") + return fmt.Errorf("unexpected trailing data at offset %d", len(data)-len(tail)) + } + + // If the decode succeeds, post-process the object to convert json.Number objects to int64 or float64 switch v := v.(type) { case *map[string]interface{}: - // Build a decoder from the given data - decoder := json.NewDecoder(bytes.NewBuffer(data)) - // Preserve numbers, rather than casting to float64 automatically - decoder.UseNumber() - // Run the decode - if err := decoder.Decode(v); err != nil { - return err - } - // If the decode succeeds, post-process the map to convert json.Number objects to int64 or float64 return convertMapNumbers(*v, 0) case *[]interface{}: - // Build a decoder from the given data - decoder := json.NewDecoder(bytes.NewBuffer(data)) - // Preserve numbers, rather than casting to float64 automatically - decoder.UseNumber() - // Run the decode - if err := decoder.Decode(v); err != nil { - return err - } - // If the decode succeeds, post-process the map to convert json.Number objects to int64 or float64 return convertSliceNumbers(*v, 0) + case *interface{}: + return convertInterfaceNumbers(v, 0) + default: - return json.Unmarshal(data, v) + return nil + } +} + +func convertInterfaceNumbers(v *interface{}, depth int) error { + var err error + switch v2 := (*v).(type) { + case json.Number: + *v, err = convertNumber(v2) + case map[string]interface{}: + err = convertMapNumbers(v2, depth+1) + case []interface{}: + err = convertSliceNumbers(v2, depth+1) } + return err } // convertMapNumbers traverses the map, converting any json.Number values to int64 or float64. diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v4/value/value.go b/vendor/sigs.k8s.io/structured-merge-diff/v4/value/value.go index ea79e3a000..f72e5cd25e 100644 --- a/vendor/sigs.k8s.io/structured-merge-diff/v4/value/value.go +++ b/vendor/sigs.k8s.io/structured-merge-diff/v4/value/value.go @@ -23,7 +23,7 @@ import ( "strings" jsoniter "github.com/json-iterator/go" - "gopkg.in/yaml.v2" + yaml "sigs.k8s.io/yaml/goyaml.v2" ) var (