From 246fe7580698d9903e4c553c1b79080233f876a4 Mon Sep 17 00:00:00 2001 From: Pavan <25031267+Pavan-SAP@users.noreply.github.com> Date: Thu, 27 Aug 2026 22:03:19 +0200 Subject: [PATCH] [Misc] Operator: Go Dependencies updated code: - Update to the latest version of dependencies. - Update type/CRDs --- crds/sme.sap.com_capapplicationversions.yaml | 156 ++++++++++++++++++ go.mod | 42 ++--- go.sum | 92 +++++------ .../sme.sap.com/v1alpha1/capapplication.go | 2 +- .../v1alpha1/capapplicationstatus.go | 2 +- .../v1alpha1/capapplicationversion.go | 2 +- .../v1alpha1/capapplicationversionstatus.go | 2 +- .../sme.sap.com/v1alpha1/captenant.go | 2 +- .../v1alpha1/captenantoperation.go | 2 +- .../v1alpha1/captenantoperationspec.go | 2 +- .../v1alpha1/captenantoperationstatus.go | 2 +- .../sme.sap.com/v1alpha1/captenantoutput.go | 2 +- .../sme.sap.com/v1alpha1/captenantspec.go | 2 +- .../sme.sap.com/v1alpha1/captenantstatus.go | 2 +- .../sme.sap.com/v1alpha1/clusterdomain.go | 2 +- .../sme.sap.com/v1alpha1/deploymentdetails.go | 2 +- .../sme.sap.com/v1alpha1/domain.go | 2 +- .../sme.sap.com/v1alpha1/domainstatus.go | 2 +- .../sme.sap.com/v1alpha1/jobdetails.go | 2 +- pkg/client/clientset/versioned/clientset.go | 4 +- .../versioned/fake/clientset_generated.go | 2 +- .../informers/externalversions/factory.go | 4 +- .../sme.sap.com/v1alpha1/capapplication.go | 104 +++++++++++- .../v1alpha1/capapplicationversion.go | 104 +++++++++++- .../sme.sap.com/v1alpha1/captenant.go | 104 +++++++++++- .../v1alpha1/captenantoperation.go | 104 +++++++++++- .../sme.sap.com/v1alpha1/captenantoutput.go | 104 +++++++++++- .../sme.sap.com/v1alpha1/clusterdomain.go | 104 +++++++++++- .../sme.sap.com/v1alpha1/domain.go | 104 +++++++++++- .../sme.sap.com/v1alpha1/interface.go | 42 ++--- 30 files changed, 951 insertions(+), 151 deletions(-) diff --git a/crds/sme.sap.com_capapplicationversions.yaml b/crds/sme.sap.com_capapplicationversions.yaml index bdd2efa5..223df4b7 100644 --- a/crds/sme.sap.com_capapplicationversions.yaml +++ b/crds/sme.sap.com_capapplicationversions.yaml @@ -1170,6 +1170,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -1230,6 +1232,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -1274,6 +1278,8 @@ spec: type: integer grpc: properties: + mode: + type: string port: format: int32 type: integer @@ -1307,6 +1313,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -1381,6 +1389,8 @@ spec: type: integer grpc: properties: + mode: + type: string port: format: int32 type: integer @@ -1414,6 +1424,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -1605,6 +1617,8 @@ spec: type: integer grpc: properties: + mode: + type: string port: format: int32 type: integer @@ -1638,6 +1652,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -1699,6 +1715,11 @@ spec: volumeMounts: items: properties: + bindMountOptions: + items: + type: string + type: array + x-kubernetes-list-type: set mountPath: type: string mountPropagation: @@ -1763,6 +1784,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -1823,6 +1846,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -1867,6 +1892,8 @@ spec: type: integer grpc: properties: + mode: + type: string port: format: int32 type: integer @@ -1900,6 +1927,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -2149,6 +2178,8 @@ spec: type: integer grpc: properties: + mode: + type: string port: format: int32 type: integer @@ -2182,6 +2213,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -2342,6 +2375,8 @@ spec: type: integer grpc: properties: + mode: + type: string port: format: int32 type: integer @@ -2375,6 +2410,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -2525,6 +2562,11 @@ spec: volumeMounts: items: properties: + bindMountOptions: + items: + type: string + type: array + x-kubernetes-list-type: set mountPath: type: string mountPropagation: @@ -2641,6 +2683,9 @@ spec: defaultMode: format: int32 type: integer + defaultUser: + format: int64 + type: integer items: items: properties: @@ -2651,6 +2696,9 @@ spec: type: integer path: type: string + user: + format: int64 + type: integer required: - key - path @@ -2691,6 +2739,9 @@ spec: defaultMode: format: int32 type: integer + defaultUser: + format: int64 + type: integer items: items: properties: @@ -2725,6 +2776,9 @@ spec: - resource type: object x-kubernetes-map-type: atomic + user: + format: int64 + type: integer required: - path type: object @@ -2735,6 +2789,9 @@ spec: properties: medium: type: string + mode: + format: int32 + type: integer sizeLimit: anyOf: - type: integer @@ -3029,6 +3086,9 @@ spec: defaultMode: format: int32 type: integer + defaultUser: + format: int64 + type: integer sources: items: properties: @@ -3068,6 +3128,9 @@ spec: type: string signerName: type: string + user: + format: int64 + type: integer required: - path type: object @@ -3083,6 +3146,9 @@ spec: type: integer path: type: string + user: + format: int64 + type: integer required: - key - path @@ -3132,6 +3198,9 @@ spec: - resource type: object x-kubernetes-map-type: atomic + user: + format: int64 + type: integer required: - path type: object @@ -3153,6 +3222,9 @@ spec: type: integer signerName: type: string + user: + format: int64 + type: integer userAnnotations: additionalProperties: type: string @@ -3173,6 +3245,9 @@ spec: type: integer path: type: string + user: + format: int64 + type: integer required: - key - path @@ -3195,6 +3270,9 @@ spec: type: integer path: type: string + user: + format: int64 + type: integer required: - path type: object @@ -3292,6 +3370,9 @@ spec: defaultMode: format: int32 type: integer + defaultUser: + format: int64 + type: integer items: items: properties: @@ -3302,6 +3383,9 @@ spec: type: integer path: type: string + user: + format: int64 + type: integer required: - key - path @@ -4059,6 +4143,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -4119,6 +4205,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -4163,6 +4251,8 @@ spec: type: integer grpc: properties: + mode: + type: string port: format: int32 type: integer @@ -4196,6 +4286,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -4270,6 +4362,8 @@ spec: type: integer grpc: properties: + mode: + type: string port: format: int32 type: integer @@ -4303,6 +4397,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -4494,6 +4590,8 @@ spec: type: integer grpc: properties: + mode: + type: string port: format: int32 type: integer @@ -4527,6 +4625,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -4588,6 +4688,11 @@ spec: volumeMounts: items: properties: + bindMountOptions: + items: + type: string + type: array + x-kubernetes-list-type: set mountPath: type: string mountPropagation: @@ -4652,6 +4757,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -4712,6 +4819,8 @@ spec: - type: integer - type: string x-kubernetes-int-or-string: true + protocol: + type: string scheme: type: string required: @@ -5018,6 +5127,11 @@ spec: volumeMounts: items: properties: + bindMountOptions: + items: + type: string + type: array + x-kubernetes-list-type: set mountPath: type: string mountPropagation: @@ -5134,6 +5248,9 @@ spec: defaultMode: format: int32 type: integer + defaultUser: + format: int64 + type: integer items: items: properties: @@ -5144,6 +5261,9 @@ spec: type: integer path: type: string + user: + format: int64 + type: integer required: - key - path @@ -5184,6 +5304,9 @@ spec: defaultMode: format: int32 type: integer + defaultUser: + format: int64 + type: integer items: items: properties: @@ -5218,6 +5341,9 @@ spec: - resource type: object x-kubernetes-map-type: atomic + user: + format: int64 + type: integer required: - path type: object @@ -5228,6 +5354,9 @@ spec: properties: medium: type: string + mode: + format: int32 + type: integer sizeLimit: anyOf: - type: integer @@ -5522,6 +5651,9 @@ spec: defaultMode: format: int32 type: integer + defaultUser: + format: int64 + type: integer sources: items: properties: @@ -5561,6 +5693,9 @@ spec: type: string signerName: type: string + user: + format: int64 + type: integer required: - path type: object @@ -5576,6 +5711,9 @@ spec: type: integer path: type: string + user: + format: int64 + type: integer required: - key - path @@ -5625,6 +5763,9 @@ spec: - resource type: object x-kubernetes-map-type: atomic + user: + format: int64 + type: integer required: - path type: object @@ -5646,6 +5787,9 @@ spec: type: integer signerName: type: string + user: + format: int64 + type: integer userAnnotations: additionalProperties: type: string @@ -5666,6 +5810,9 @@ spec: type: integer path: type: string + user: + format: int64 + type: integer required: - key - path @@ -5688,6 +5835,9 @@ spec: type: integer path: type: string + user: + format: int64 + type: integer required: - path type: object @@ -5785,6 +5935,9 @@ spec: defaultMode: format: int32 type: integer + defaultUser: + format: int64 + type: integer items: items: properties: @@ -5795,6 +5948,9 @@ spec: type: integer path: type: string + user: + format: int64 + type: integer required: - key - path diff --git a/go.mod b/go.mod index e621543a..6427866b 100644 --- a/go.mod +++ b/go.mod @@ -26,11 +26,11 @@ require ( golang.org/x/time v0.15.0 gomodules.xyz/jsonpatch/v2 v2.5.0 google.golang.org/protobuf v1.36.12 - istio.io/api v1.30.3 - istio.io/client-go v1.30.3 - k8s.io/api v0.36.4 - k8s.io/apimachinery v0.36.4 - k8s.io/client-go v0.36.4 + istio.io/api v1.30.4 + istio.io/client-go v1.30.4 + k8s.io/api v0.37.0 + k8s.io/apimachinery v0.37.0 + k8s.io/client-go v0.37.0 k8s.io/klog/v2 v2.140.0 sigs.k8s.io/structured-merge-diff/v6 v6.4.2 ) @@ -44,19 +44,19 @@ require ( github.com/fxamacker/cbor/v2 v2.9.3 // indirect github.com/gardener/gardener/pkg/apis v1.149.3 // indirect github.com/go-openapi/jsonpointer v1.0.0 // indirect - github.com/go-openapi/jsonreference v1.0.0 // indirect - github.com/go-openapi/swag v0.29.0 // indirect - github.com/go-openapi/swag/cmdutils v0.29.0 // indirect - github.com/go-openapi/swag/conv v0.29.0 // indirect - github.com/go-openapi/swag/fileutils v0.29.0 // indirect - github.com/go-openapi/swag/jsonutils v0.29.0 // indirect - github.com/go-openapi/swag/loading v0.29.0 // indirect - github.com/go-openapi/swag/mangling v0.29.0 // indirect - github.com/go-openapi/swag/netutils v0.29.0 // indirect - github.com/go-openapi/swag/pools v0.29.0 // indirect - github.com/go-openapi/swag/stringutils v0.29.0 // indirect - github.com/go-openapi/swag/typeutils v0.29.0 // indirect - github.com/go-openapi/swag/yamlutils v0.29.0 // indirect + github.com/go-openapi/jsonreference v1.0.1 // indirect + github.com/go-openapi/swag v0.29.1 // indirect + github.com/go-openapi/swag/cmdutils v0.29.1 // indirect + github.com/go-openapi/swag/conv v0.29.1 // indirect + github.com/go-openapi/swag/fileutils v0.29.1 // indirect + github.com/go-openapi/swag/jsonutils v0.29.1 // indirect + github.com/go-openapi/swag/loading v0.29.1 // indirect + github.com/go-openapi/swag/mangling v0.29.1 // indirect + github.com/go-openapi/swag/netutils v0.29.1 // indirect + github.com/go-openapi/swag/pools v0.29.1 // indirect + github.com/go-openapi/swag/stringutils v0.29.1 // indirect + github.com/go-openapi/swag/typeutils v0.29.1 // indirect + github.com/go-openapi/swag/yamlutils v0.29.1 // indirect github.com/goccy/go-json v0.10.6 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.7.1 // indirect @@ -83,11 +83,11 @@ require ( golang.org/x/sys v0.47.0 // indirect golang.org/x/term v0.45.0 // indirect golang.org/x/text v0.41.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260825221802-da73d73af1c5 // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - k8s.io/apiextensions-apiserver v0.36.4 // indirect - k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad // indirect + k8s.io/apiextensions-apiserver v0.37.0 // indirect + k8s.io/kube-openapi v0.0.0-20260821135717-be32def86098 // indirect k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 // indirect sigs.k8s.io/controller-runtime v0.24.1 // indirect sigs.k8s.io/gateway-api v1.6.1 // indirect diff --git a/go.sum b/go.sum index df4871fa..b1a9f3c4 100644 --- a/go.sum +++ b/go.sum @@ -36,34 +36,34 @@ github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= github.com/go-openapi/jsonpointer v1.0.0 h1:kR9tHqY0CtZaOPVFm622dPVNhrvYpwr4uCxgL3h1H8s= github.com/go-openapi/jsonpointer v1.0.0/go.mod h1:Z3rw7dWu1p9IgitXCFamSlA5lmDiklEB6vkaxcNZW5Y= -github.com/go-openapi/jsonreference v1.0.0 h1:jlmTr6torcd1YgDQvSfNmRtKzYDO4FGBkrAdlAVWnpY= -github.com/go-openapi/jsonreference v1.0.0/go.mod h1:jtwdyGbJk0Xhe5Y+rwtglQP6Sb1WZST4rT32LWB+sv0= -github.com/go-openapi/swag v0.29.0 h1:vJ8m3Xv7L4VfGgr8nK77CHTQRg2nyFPXySpV0w3xPB8= -github.com/go-openapi/swag v0.29.0/go.mod h1:8FrS8OFgntDRBzpHD7SyqDJTmTDPZo8Kvv0OuQW+Mr4= -github.com/go-openapi/swag/cmdutils v0.29.0 h1:AKt8Q7ZfR2NmnSJD7B1WcnTOfuXHBvLPJc3W65SCM3Y= -github.com/go-openapi/swag/cmdutils v0.29.0/go.mod h1:Sm1MVFMkF6guJJ+pQqHnQA3N0j9qALV3NxzDSv6bETM= -github.com/go-openapi/swag/conv v0.29.0 h1:4+1TogWpOIzMPzVKrvx1BfqBYlApB7D7DW3EAWpwmp4= -github.com/go-openapi/swag/conv v0.29.0/go.mod h1:ch1l7V87F6zQXuLs5s0RFvrro6aFvrVcfVXn2PTZnu8= -github.com/go-openapi/swag/fileutils v0.29.0 h1:meobnn3MsAkF6XmJn6qw3hPeMAOhwf7XD5BOKeFzqWU= -github.com/go-openapi/swag/fileutils v0.29.0/go.mod h1:/wofKYckbtRl2p3+EwQsosie5CT1B38+dQ+PS579BzI= -github.com/go-openapi/swag/jsonutils v0.29.0 h1:Xgnf9g32ycQjQUnDxkhqLraH2FhitcSE3w7ayQB3TgA= -github.com/go-openapi/swag/jsonutils v0.29.0/go.mod h1:5WYmjf6hJcBve+ArzBaUsYy4M1GXsgjIQTmwJKfZHrA= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.0 h1:bpSF6LFkJJVtaRtJCzbZADVPVHQYKPwPdKthOQA2/5o= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.0/go.mod h1:julgTUKZ9/D0j6O7GKajmRs+812FWxQg/mMpGunWSjg= -github.com/go-openapi/swag/loading v0.29.0 h1:r1lg2DQbT1VgBwgiPYXBM059RNswFI6r36CC0QCcRGw= -github.com/go-openapi/swag/loading v0.29.0/go.mod h1:l/Z4MNbom0jSqzvWJqK2VUUWEceBknGEuVbLHLq4KN0= -github.com/go-openapi/swag/mangling v0.29.0 h1:RVKyucZ2rvA/M/sqxuNZGW8Mf0+1qypVX8n2GwV11lM= -github.com/go-openapi/swag/mangling v0.29.0/go.mod h1:SAop9pB7PUjQ/CGCNf/JmCKTRK+GDO+RqE9UHqC/N6s= -github.com/go-openapi/swag/netutils v0.29.0 h1:2Y9tiqzdzRf++Tf5SGVK4Rk1iop2mo1+W3fNdcflMCo= -github.com/go-openapi/swag/netutils v0.29.0/go.mod h1:DUde7x4Bx00k5jYl2AdRpNAO0m7atUvD2x6X+bWkbno= -github.com/go-openapi/swag/pools v0.29.0 h1:uMQcoJeHJ8fWkdfEXJZMMpqk6hpfW8qTL5Q/IoRFFII= -github.com/go-openapi/swag/pools v0.29.0/go.mod h1:leDcaghjkRAhCuCRv9NfJU5f0mjoU3cT/XZObhMk3pc= -github.com/go-openapi/swag/stringutils v0.29.0 h1:/IEOuZ7PGJi6lqgH83dVt7/A9eHsDGEH1459lm+gpEo= -github.com/go-openapi/swag/stringutils v0.29.0/go.mod h1:7fSqZ+z8Qc0tOfAAK0jVa5qFGrnIlRi6n7NeGGrr1vc= -github.com/go-openapi/swag/typeutils v0.29.0 h1:HrWCYZeXVVNDo/7QQPRaYk33XeIDxksbxpalID3bWR8= -github.com/go-openapi/swag/typeutils v0.29.0/go.mod h1:hxpgDZJVBkBsi/d3MIUosafoFdE5exaQRmVp0zwu3YE= -github.com/go-openapi/swag/yamlutils v0.29.0 h1:JOKKuhMnBx4HYTM+kPEYw8S5YKKU9PnC4Mwb+c69BBA= -github.com/go-openapi/swag/yamlutils v0.29.0/go.mod h1:/+FVozjFWZzku6mRz5U/Qmq5Yk8PLFxBLLWA/jHaxYE= +github.com/go-openapi/jsonreference v1.0.1 h1:4zJ7AmYDKNmD3aSpfPnFNCFA5E80/xMHUNKgydaLh38= +github.com/go-openapi/jsonreference v1.0.1/go.mod h1:dYplQXa6p5lXprLcJ8LE2iU7vNpXsAHDQ5ZAgL+Qx3A= +github.com/go-openapi/swag v0.29.1 h1:C6EeWzUwQtcWEhE9eqBdUubGXxhWY4PlzHMLD7kLaiQ= +github.com/go-openapi/swag v0.29.1/go.mod h1:BzxEXKiPlSXRsRTv1KSBF/BpGKHxA/YciCnr4tv9bvA= +github.com/go-openapi/swag/cmdutils v0.29.1 h1:3DorPGfUdE80BogKY22EzoHBcHMrkVomZMoV7kS4ANY= +github.com/go-openapi/swag/cmdutils v0.29.1/go.mod h1:Sm1MVFMkF6guJJ+pQqHnQA3N0j9qALV3NxzDSv6bETM= +github.com/go-openapi/swag/conv v0.29.1 h1:AC4Eh/5c/eUDOUCzzsRC9ghmFgOSBHeRMGIngY0ZUGA= +github.com/go-openapi/swag/conv v0.29.1/go.mod h1:S1X7/ZrBEZOC0Wc8AGxjbcGS92l3WEjA7aPtpl+RaqM= +github.com/go-openapi/swag/fileutils v0.29.1 h1:ZcPzMceVhU1WPbK6N1G6sNQKdd1CWJlf3cA08UHuoM0= +github.com/go-openapi/swag/fileutils v0.29.1/go.mod h1:/wofKYckbtRl2p3+EwQsosie5CT1B38+dQ+PS579BzI= +github.com/go-openapi/swag/jsonutils v0.29.1 h1:AFCxs0eQZ24/QyfhVHM2t49rMz7Vv3XCsZQI6yrNy+c= +github.com/go-openapi/swag/jsonutils v0.29.1/go.mod h1:u3+sCfJpttDpcmS5kpm0yxL6GK0eWgODsx8Yw8fcqNM= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.1 h1:BiiXE31Bx9SfpsMmOQj5KYpUhTZBpLVriVhJDuLuY2o= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.1/go.mod h1:julgTUKZ9/D0j6O7GKajmRs+812FWxQg/mMpGunWSjg= +github.com/go-openapi/swag/loading v0.29.1 h1:FCv5fG8UhTdDJa2R7w+5O9Ekpcbw7tt0nFWvmDKGBjc= +github.com/go-openapi/swag/loading v0.29.1/go.mod h1:N0ESuem4p2oedKal8EJhciqnJ9Q9Wmt83L1CRB3Fouw= +github.com/go-openapi/swag/mangling v0.29.1 h1:lHALtvYCdxVnRl4GrHmFPwfBTZYIObqdGNSKyu/8D6I= +github.com/go-openapi/swag/mangling v0.29.1/go.mod h1:SAop9pB7PUjQ/CGCNf/JmCKTRK+GDO+RqE9UHqC/N6s= +github.com/go-openapi/swag/netutils v0.29.1 h1:IjIvdEP5duKcghFqJEPSUraRnkKYHoM65kTluTu+Jb4= +github.com/go-openapi/swag/netutils v0.29.1/go.mod h1:DUde7x4Bx00k5jYl2AdRpNAO0m7atUvD2x6X+bWkbno= +github.com/go-openapi/swag/pools v0.29.1 h1:NRogYxdEW9SjRM4mkAOji9iefO4MRXq3p/ZJcoQbUKg= +github.com/go-openapi/swag/pools v0.29.1/go.mod h1:leDcaghjkRAhCuCRv9NfJU5f0mjoU3cT/XZObhMk3pc= +github.com/go-openapi/swag/stringutils v0.29.1 h1:1ykunK7iJQk1uOO7+oUH1ukbsK85fFCOiCFMOVSY+F0= +github.com/go-openapi/swag/stringutils v0.29.1/go.mod h1:7fSqZ+z8Qc0tOfAAK0jVa5qFGrnIlRi6n7NeGGrr1vc= +github.com/go-openapi/swag/typeutils v0.29.1 h1:Nzv9nhnlLCRBPQqfOX+7lB6Guju370or8StT+lIOf6M= +github.com/go-openapi/swag/typeutils v0.29.1/go.mod h1:hxpgDZJVBkBsi/d3MIUosafoFdE5exaQRmVp0zwu3YE= +github.com/go-openapi/swag/yamlutils v0.29.1 h1:69w3tsBajm7MR/fejLy7HD/3J68Ys1SeeZMEzZ3w2sk= +github.com/go-openapi/swag/yamlutils v0.29.1/go.mod h1:rgsp3vT/QdWzKwn43CigDwjOGIenPyTZMKnxEM8jZOA= github.com/go-openapi/testify/enable/yaml/v2 v2.6.1 h1:Jm+/ze2rMtbD98yen92AhATGLGREDYXG56Xr4gMjEtE= github.com/go-openapi/testify/enable/yaml/v2 v2.6.1/go.mod h1:YDPnwCRDu38/oJBVMBVXOUDiJ9cIeBHWvfImHaXqnv4= github.com/go-openapi/testify/v2 v2.6.1 h1:6CNJhTjMzgaeaH8WhshcsZNPIvRemiOcFpU7seO/y7Q= @@ -145,8 +145,8 @@ github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4= +github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= @@ -187,8 +187,8 @@ golang.org/x/tools v0.49.0 h1:3NI7VXzL9+1WZD52Dx2ttoPwD5DWrFGpl9mFZDlmisI= golang.org/x/tools v0.49.0/go.mod h1:SJNXV9DBKT0UbdttsQjbfJlAE/q+y36++zo3uL3N0Oo= gomodules.xyz/jsonpatch/v2 v2.5.0 h1:JELs8RLM12qJGXU4u/TO3V25KW8GreMKl9pdkk14RM0= gomodules.xyz/jsonpatch/v2 v2.5.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= -google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 h1:ax2KzoSRIZU/M0cIxri3pKxy99vniH1PVxWC6si/eZI= -google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688/go.mod h1:1RJ9BQGyNdZwkGc1eTqkErfRZ6RJyYPHZo73BZ1vQqI= +google.golang.org/genproto/googleapis/api v0.0.0-20260825221802-da73d73af1c5 h1:izFU9hz7aeLI/Mi1J0991ae+xcwRLr7hTqWnB/9aIIU= +google.golang.org/genproto/googleapis/api v0.0.0-20260825221802-da73d73af1c5/go.mod h1:3LhxRw4YYkf+ylAfgaY9JlVLFKhokkCV8duhLLe7+t0= google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -199,22 +199,22 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -istio.io/api v1.30.3 h1:pPSa0uah/t7CEuwacS4rw5qK/oHGvxC0WO8i4RRGwEU= -istio.io/api v1.30.3/go.mod h1:+brQWcBHoROuyA6fv8rbgg8Kfn0RCGuqoY0duCMuSLA= -istio.io/client-go v1.30.3 h1:hxgxhQXmRP5fgS6mDlol2CGKfx3A2viEjiynkr+PBNU= -istio.io/client-go v1.30.3/go.mod h1:CLKLOY3hpsNuB91cQW9L5p6wqOtnB65xwUgRik67dyI= -k8s.io/api v0.36.4 h1:RxrvqCL6vgH5/+UnTeu1IIFqYmGfy0hnyrod1rn35Oo= -k8s.io/api v0.36.4/go.mod h1:S2B3orCFBDhrgyWbLeuKcT2QdHIpQesBkCYSlWtwUOw= -k8s.io/apiextensions-apiserver v0.36.4 h1:SfvCVt+4CqKWvzuVytYDT5g9hyb9MztoiYELIkPVrFc= -k8s.io/apiextensions-apiserver v0.36.4/go.mod h1:JT9V2Ju7ys1FY4zbSpmX9XOvKB3/BwsODc4hFQEa+Xo= -k8s.io/apimachinery v0.36.4 h1:PT2UzkupGuAx/+xT5XjiMJ1WGpY3fn9/hdAvjweRet4= -k8s.io/apimachinery v0.36.4/go.mod h1:p2I2dipt7JHG+quVwQ1d02d28O4GdDi77RByQ13MTpk= -k8s.io/client-go v0.36.4 h1:MDvfDNvMSt0Br94SK8neviVlwL9qifw9B26hJCpD1K0= -k8s.io/client-go v0.36.4/go.mod h1:pNK4WKELbwlEDvtbE8l22lEZL5THYF61H5EealokZmA= +istio.io/api v1.30.4 h1:P8LBF+1PVXgOp6sh36egf/fx0FJNFSSyFO82ctW6aIc= +istio.io/api v1.30.4/go.mod h1:+brQWcBHoROuyA6fv8rbgg8Kfn0RCGuqoY0duCMuSLA= +istio.io/client-go v1.30.4 h1:jki4dFqwUd4So77N8TFuWvlV/zVGAtZM/plw7LtnOAY= +istio.io/client-go v1.30.4/go.mod h1:SRLV85/XqNX2MUAC/n2hcj+8tUIQEyS0zYMQ6ztEHH0= +k8s.io/api v0.37.0 h1:Z//Vj9N7RA/yS2sDmxyeo7h+RR4zbUrd2vrd3Z0TbB4= +k8s.io/api v0.37.0/go.mod h1:LKXgcJWMc+f4OLbP5SFR8rulEg07zZhpi/zMULiBImk= +k8s.io/apiextensions-apiserver v0.37.0 h1:zRMQ3+/LIE5oZ0tVvXwYHC+dIkSP5cjNWju7AZU1LOI= +k8s.io/apiextensions-apiserver v0.37.0/go.mod h1:HU0PfSBwchHL5iDau6jjt9zU6ryWkDDlaVUiq91NK80= +k8s.io/apimachinery v0.37.0 h1:Np2AbDtf8x6RDHiD8T9LbKJ9gaegeVNa8yNm5FuGKm0= +k8s.io/apimachinery v0.37.0/go.mod h1:RN3nhprFSCxOi5Selxd7oMTXOe/c+ZbcE7Im+TS2zkE= +k8s.io/client-go v0.37.0 h1:nsN31fy8wBySuZ+QRnKmrjRSQLOG2rvoGN0tKd12zhQ= +k8s.io/client-go v0.37.0/go.mod h1:FcGqw+Ll/gNQiq+nPGY1Oyt9y7SgDh1d3MW3RFDEbn0= k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= -k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad h1:oXImqH8mQNk7PmvzKhmN3ddJoY6OnyM225MXwGHPm0A= -k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad/go.mod h1:0/mqHCVhlumdJ3BhCfnjSZQE037nAhNodh1/hK0T8/I= +k8s.io/kube-openapi v0.0.0-20260821135717-be32def86098 h1:z5+pcu1jTyKK5mNTe2/+x+U6Uuv9jRVOJQLaBJJMpeI= +k8s.io/kube-openapi v0.0.0-20260821135717-be32def86098/go.mod h1:0/mqHCVhlumdJ3BhCfnjSZQE037nAhNodh1/hK0T8/I= k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 h1:jVkFFVfXdXP74B/zbO3hM3hpSFD0xvhQ5U686DPurkE= k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3/go.mod h1:M2s5JB1lIYP3jzZdorPLHXIPJzt9vv2muW5a6L9DtNM= sigs.k8s.io/controller-runtime v0.24.1 h1:miPEwrmirImAvgME1L9qebGHrOnGJoVmVdtOU9fRfo4= diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplication.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplication.go index f575110f..99f5ab97 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplication.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplication.go @@ -18,7 +18,7 @@ import ( // // CAPApplication is the schema for capapplications API type CAPApplicationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // CAPApplication spec Spec *CAPApplicationSpecApplyConfiguration `json:"spec,omitempty"` diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationstatus.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationstatus.go index 6322246b..8b6e81df 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationstatus.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationstatus.go @@ -16,7 +16,7 @@ import ( // CAPApplicationStatusApplyConfiguration represents a declarative configuration of the CAPApplicationStatus type for use // with apply. type CAPApplicationStatusApplyConfiguration struct { - GenericStatusApplyConfiguration `json:",inline"` + GenericStatusApplyConfiguration `json:""` // State of CAPApplication State *smesapcomv1alpha1.CAPApplicationState `json:"state,omitempty"` // Represents whether this is a services only scenario diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversion.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversion.go index 12bfce14..82ff9603 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversion.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversion.go @@ -18,7 +18,7 @@ import ( // // CAPApplicationVersion defines the schema for capapplicationversions API type CAPApplicationVersionApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // CAPApplicationVersion spec Spec *CAPApplicationVersionSpecApplyConfiguration `json:"spec,omitempty"` diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversionstatus.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversionstatus.go index 994f2354..739a5cbd 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversionstatus.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversionstatus.go @@ -15,7 +15,7 @@ import ( // CAPApplicationVersionStatusApplyConfiguration represents a declarative configuration of the CAPApplicationVersionStatus type for use // with apply. type CAPApplicationVersionStatusApplyConfiguration struct { - GenericStatusApplyConfiguration `json:",inline"` + GenericStatusApplyConfiguration `json:""` // State of CAPApplicationVersion State *smesapcomv1alpha1.CAPApplicationVersionState `json:"state,omitempty"` // List of finished Content Jobs diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenant.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenant.go index 106fcc9d..b2edf3f6 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenant.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenant.go @@ -18,7 +18,7 @@ import ( // // CAPTenant defines the schema for captenants API type CAPTenantApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // CAPTenant spec Spec *CAPTenantSpecApplyConfiguration `json:"spec,omitempty"` diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperation.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperation.go index 32316ff1..f689b26a 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperation.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperation.go @@ -18,7 +18,7 @@ import ( // // CAPTenantOperation defines the schema for captenantoperations API type CAPTenantOperationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // CAPTenantOperation spec Spec *CAPTenantOperationSpecApplyConfiguration `json:"spec,omitempty"` diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationspec.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationspec.go index 51da8616..6180997f 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationspec.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationspec.go @@ -17,7 +17,7 @@ type CAPTenantOperationSpecApplyConfiguration struct { // Scope of the tenant lifecycle operation. One of 'provisioning', 'deprovisioning' or 'upgrade' Operation *smesapcomv1alpha1.CAPTenantOperationType `json:"operation,omitempty"` // BTP sub-account (tenant) for which request is created - BTPTenantIdentificationApplyConfiguration `json:",inline"` + BTPTenantIdentificationApplyConfiguration `json:""` // Reference to CAPApplicationVersion for executing the operation CAPApplicationVersionInstance *string `json:"capApplicationVersionInstance,omitempty"` // Steps (jobs) to be executed for the operation to complete diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationstatus.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationstatus.go index 9bd683c7..e2a6ac25 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationstatus.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationstatus.go @@ -15,7 +15,7 @@ import ( // CAPTenantOperationStatusApplyConfiguration represents a declarative configuration of the CAPTenantOperationStatus type for use // with apply. type CAPTenantOperationStatusApplyConfiguration struct { - GenericStatusApplyConfiguration `json:",inline"` + GenericStatusApplyConfiguration `json:""` // State of CAPTenantOperation State *smesapcomv1alpha1.CAPTenantOperationState `json:"state,omitempty"` // Current step being processed from the sequence of specified steps diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoutput.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoutput.go index 9f08a118..50934e34 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoutput.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoutput.go @@ -18,7 +18,7 @@ import ( // // CAPTenantOutput is the schema for captenantoutputs API type CAPTenantOutputApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // CAPTenantOutput spec Spec *CAPTenantOutputSpecApplyConfiguration `json:"spec,omitempty"` diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantspec.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantspec.go index 8e384845..8637e57b 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantspec.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantspec.go @@ -19,7 +19,7 @@ type CAPTenantSpecApplyConfiguration struct { // Denotes to which CAPApplication the current tenant belongs CAPApplicationInstance *string `json:"capApplicationInstance,omitempty"` // Details of consumer sub-account subscribing to the application - BTPTenantIdentificationApplyConfiguration `json:",inline"` + BTPTenantIdentificationApplyConfiguration `json:""` // Semver that is used to determine the relevant CAPApplicationVersion that a CAPTenant can be upgraded to (i.e. if it is not already on that version) Version *string `json:"version,omitempty"` // Denotes whether a CAPTenant can be upgraded. One of ('always', 'never') diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantstatus.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantstatus.go index 1afb077d..ffe27f85 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantstatus.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantstatus.go @@ -16,7 +16,7 @@ import ( // CAPTenantStatusApplyConfiguration represents a declarative configuration of the CAPTenantStatus type for use // with apply. type CAPTenantStatusApplyConfiguration struct { - GenericStatusApplyConfiguration `json:",inline"` + GenericStatusApplyConfiguration `json:""` // State of CAPTenant State *smesapcomv1alpha1.CAPTenantState `json:"state,omitempty"` // Specifies the current version of the tenant after provisioning or upgrade diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/clusterdomain.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/clusterdomain.go index 19aa96a1..d332ee80 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/clusterdomain.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/clusterdomain.go @@ -18,7 +18,7 @@ import ( // // ClusterDomain is the schema for clusterdomains API type ClusterDomainApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // ClusterDomains spec Spec *DomainSpecApplyConfiguration `json:"spec,omitempty"` diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/deploymentdetails.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/deploymentdetails.go index eb86926d..64262d97 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/deploymentdetails.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/deploymentdetails.go @@ -18,7 +18,7 @@ import ( // // DeploymentDetails specifies the details of the Deployment type DeploymentDetailsApplyConfiguration struct { - CommonDetailsApplyConfiguration `json:",inline"` + CommonDetailsApplyConfiguration `json:""` // Type of the Deployment Type *smesapcomv1alpha1.DeploymentType `json:"type,omitempty"` // Number of replicas diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domain.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domain.go index 34f54759..55f0fd93 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domain.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domain.go @@ -18,7 +18,7 @@ import ( // // Domain is the schema for domains API type DomainApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` + v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Domains spec Spec *DomainSpecApplyConfiguration `json:"spec,omitempty"` diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainstatus.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainstatus.go index 3bd39ca6..b6dd018f 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainstatus.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainstatus.go @@ -15,7 +15,7 @@ import ( // DomainStatusApplyConfiguration represents a declarative configuration of the DomainStatus type for use // with apply. type DomainStatusApplyConfiguration struct { - GenericStatusApplyConfiguration `json:",inline"` + GenericStatusApplyConfiguration `json:""` // State of the Domain State *smesapcomv1alpha1.DomainState `json:"state,omitempty"` // Effective DNS Target identified for this domain diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/jobdetails.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/jobdetails.go index c115af7c..028c9112 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/jobdetails.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/jobdetails.go @@ -17,7 +17,7 @@ import ( // // JobDetails specifies the details of the Job type JobDetailsApplyConfiguration struct { - CommonDetailsApplyConfiguration `json:",inline"` + CommonDetailsApplyConfiguration `json:""` // Type of Job Type *smesapcomv1alpha1.JobType `json:"type,omitempty"` // Specifies the number of retries before marking this job failed. diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 418b2b2b..05ed2447 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -18,7 +18,7 @@ import ( ) type Interface interface { - Discovery() discovery.DiscoveryInterface + Discovery() discovery.DiscoveryInterfaces SmeV1alpha1() smev1alpha1.SmeV1alpha1Interface } @@ -34,7 +34,7 @@ func (c *Clientset) SmeV1alpha1() smev1alpha1.SmeV1alpha1Interface { } // Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { +func (c *Clientset) Discovery() discovery.DiscoveryInterfaces { if c == nil { return nil } diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 6a5def46..517b9da6 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -61,7 +61,7 @@ type Clientset struct { tracker testing.ObjectTracker } -func (c *Clientset) Discovery() discovery.DiscoveryInterface { +func (c *Clientset) Discovery() discovery.DiscoveryInterfaces { return c.discovery } diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 304a7df9..8c493066 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -242,7 +242,7 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal // ctx, cancel := context.WithCancel(context.Background()) // defer cancel() // factory := NewSharedInformerFactory(client, resyncPeriod) -// defer factory.WaitForStop() // Returns immediately if nothing was started. +// defer factory.Shutdown() // Returns immediately if nothing was started. // genericInformer := factory.ForResource(resource) // typedInformer := factory.SomeAPIGroup().V1().SomeType() // handle, err := typeInformer.Informer().AddEventHandler(...) @@ -300,7 +300,7 @@ type SharedInformerFactory interface { // WaitForCacheSync blocks until all started informers' caches were synced // or the stop channel gets closed. // - // Contextual logging: WaitForCacheSync should be used instead of WaitForCacheSync in code which supports contextual logging. It also returns a more useful result. + // Contextual logging: WaitForCacheSyncWithContext should be used instead of WaitForCacheSync in code which supports contextual logging. It also returns a more useful result. WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool // WaitForCacheSyncWithContext blocks until all started informers' caches were synced diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/capapplication.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/capapplication.go index ad826b94..adc7aedf 100644 --- a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/capapplication.go +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/capapplication.go @@ -23,12 +23,40 @@ import ( ) // CAPApplicationInformer provides access to a shared informer and lister for -// CAPApplications. +// CAPApplications. Prefer using the type-safe variant (see [TypedCAPApplicationInformer]). type CAPApplicationInformer interface { Informer() cache.SharedIndexInformer Lister() smesapcomv1alpha1.CAPApplicationLister } +// TypedCAPApplicationInformer provides access to a shared informer and lister for +// CAPApplications, including the type-safe TypedInformer variant. +// It is a superset of CAPApplicationInformer. +type TypedCAPApplicationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CAPApplicationIndexInformer + Lister() smesapcomv1alpha1.CAPApplicationLister +} + +// CAPApplicationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CAPApplicationIndexInformer cache.TypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPApplication] + +// CAPApplicationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CAPApplication. +type CAPApplicationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apissmesapcomv1alpha1.CAPApplication] + +// CAPApplicationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CAPApplication. +type CAPApplicationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apissmesapcomv1alpha1.CAPApplication] + +// CAPApplicationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CAPApplication. +type CAPApplicationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apissmesapcomv1alpha1.CAPApplication] + +// CAPApplicationIndexers is a specialization of [cache.TypedIndexers] for CAPApplication. +type CAPApplicationIndexers = cache.TypedIndexers[*apissmesapcomv1alpha1.CAPApplication] + +// DeletedCAPApplication is a specialization of [cache.DeletedObject] for CAPApplication. +type DeletedCAPApplication = cache.DeletedObject[*apissmesapcomv1alpha1.CAPApplication] + type cAPApplicationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -38,25 +66,49 @@ type cAPApplicationInformer struct { // NewCAPApplicationInformer constructs a new informer for CAPApplication type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPApplicationInformer]). func NewCAPApplicationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCAPApplicationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCAPApplicationInformer constructs a new informer for CAPApplication type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCAPApplicationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPApplicationIndexers) CAPApplicationIndexInformer { + return NewTypedCAPApplicationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCAPApplicationInformer constructs a new informer for CAPApplication type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCAPApplicationInformer]). func NewFilteredCAPApplicationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCAPApplicationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCAPApplicationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCAPApplicationInformer constructs a new informer for CAPApplication type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCAPApplicationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPApplicationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CAPApplicationIndexInformer { + return NewTypedCAPApplicationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCAPApplicationInformerWithOptions constructs a new informer for CAPApplication type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPApplicationInformerWithOptions]). func NewCAPApplicationInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCAPApplicationInformerWithOptions(client, namespace, options) +} + +// NewTypedCAPApplicationInformerWithOptions constructs a new informer for CAPApplication type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCAPApplicationInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) CAPApplicationIndexInformer { gvr := schema.GroupVersionResource{Group: "sme.sap.com", Version: "v1alpha1", Resource: "capapplications"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPApplication](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -89,17 +141,57 @@ func NewCAPApplicationInformerWithOptions(client versioned.Interface, namespace Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *cAPApplicationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCAPApplicationInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCAPApplicationInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *cAPApplicationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apissmesapcomv1alpha1.CAPApplication{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *cAPApplicationInformer) TypedInformer() CAPApplicationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPApplication](f.factory.InformerFor(&apissmesapcomv1alpha1.CAPApplication{}, f.defaultInformer)) } func (f *cAPApplicationInformer) Lister() smesapcomv1alpha1.CAPApplicationLister { return smesapcomv1alpha1.NewCAPApplicationLister(f.Informer().GetIndexer()) } + +// ToTypedCAPApplicationInformer converts an untyped informer into a TypedCAPApplicationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPApplication. If that is not the case, calling type-safe methods of the returned +// TypedCAPApplicationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCAPApplicationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCAPApplicationInformer(informer CAPApplicationInformer) TypedCAPApplicationInformer { + if informer, ok := informer.(TypedCAPApplicationInformer); ok { + return informer + } + return &cAPApplicationTypedInformerAdapter{informer} +} + +type cAPApplicationTypedInformerAdapter struct { + CAPApplicationInformer +} + +func (a *cAPApplicationTypedInformerAdapter) TypedInformer() CAPApplicationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPApplication](a.Informer()) +} + +// ToCAPApplicationIndexInformer converts an untyped informer into a CAPApplicationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPApplication. If that is not the case, calling type-safe methods of the returned +// CAPApplicationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CAPApplicationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCAPApplicationIndexInformer(informer cache.SharedIndexInformer) CAPApplicationIndexInformer { + if informer, ok := informer.(CAPApplicationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPApplication](informer) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/capapplicationversion.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/capapplicationversion.go index 0b95425a..3f121b1d 100644 --- a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/capapplicationversion.go +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/capapplicationversion.go @@ -23,12 +23,40 @@ import ( ) // CAPApplicationVersionInformer provides access to a shared informer and lister for -// CAPApplicationVersions. +// CAPApplicationVersions. Prefer using the type-safe variant (see [TypedCAPApplicationVersionInformer]). type CAPApplicationVersionInformer interface { Informer() cache.SharedIndexInformer Lister() smesapcomv1alpha1.CAPApplicationVersionLister } +// TypedCAPApplicationVersionInformer provides access to a shared informer and lister for +// CAPApplicationVersions, including the type-safe TypedInformer variant. +// It is a superset of CAPApplicationVersionInformer. +type TypedCAPApplicationVersionInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CAPApplicationVersionIndexInformer + Lister() smesapcomv1alpha1.CAPApplicationVersionLister +} + +// CAPApplicationVersionIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CAPApplicationVersionIndexInformer cache.TypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPApplicationVersion] + +// CAPApplicationVersionHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CAPApplicationVersion. +type CAPApplicationVersionHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apissmesapcomv1alpha1.CAPApplicationVersion] + +// CAPApplicationVersionDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CAPApplicationVersion. +type CAPApplicationVersionDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apissmesapcomv1alpha1.CAPApplicationVersion] + +// CAPApplicationVersionFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CAPApplicationVersion. +type CAPApplicationVersionFilteringHandler = cache.TypedFilteringResourceEventHandler[*apissmesapcomv1alpha1.CAPApplicationVersion] + +// CAPApplicationVersionIndexers is a specialization of [cache.TypedIndexers] for CAPApplicationVersion. +type CAPApplicationVersionIndexers = cache.TypedIndexers[*apissmesapcomv1alpha1.CAPApplicationVersion] + +// DeletedCAPApplicationVersion is a specialization of [cache.DeletedObject] for CAPApplicationVersion. +type DeletedCAPApplicationVersion = cache.DeletedObject[*apissmesapcomv1alpha1.CAPApplicationVersion] + type cAPApplicationVersionInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -38,25 +66,49 @@ type cAPApplicationVersionInformer struct { // NewCAPApplicationVersionInformer constructs a new informer for CAPApplicationVersion type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPApplicationVersionInformer]). func NewCAPApplicationVersionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCAPApplicationVersionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCAPApplicationVersionInformer constructs a new informer for CAPApplicationVersion type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCAPApplicationVersionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPApplicationVersionIndexers) CAPApplicationVersionIndexInformer { + return NewTypedCAPApplicationVersionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCAPApplicationVersionInformer constructs a new informer for CAPApplicationVersion type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCAPApplicationVersionInformer]). func NewFilteredCAPApplicationVersionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCAPApplicationVersionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCAPApplicationVersionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCAPApplicationVersionInformer constructs a new informer for CAPApplicationVersion type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCAPApplicationVersionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPApplicationVersionIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CAPApplicationVersionIndexInformer { + return NewTypedCAPApplicationVersionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCAPApplicationVersionInformerWithOptions constructs a new informer for CAPApplicationVersion type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPApplicationVersionInformerWithOptions]). func NewCAPApplicationVersionInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCAPApplicationVersionInformerWithOptions(client, namespace, options) +} + +// NewTypedCAPApplicationVersionInformerWithOptions constructs a new informer for CAPApplicationVersion type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCAPApplicationVersionInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) CAPApplicationVersionIndexInformer { gvr := schema.GroupVersionResource{Group: "sme.sap.com", Version: "v1alpha1", Resource: "capapplicationversions"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPApplicationVersion](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -89,17 +141,57 @@ func NewCAPApplicationVersionInformerWithOptions(client versioned.Interface, nam Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *cAPApplicationVersionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCAPApplicationVersionInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCAPApplicationVersionInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *cAPApplicationVersionInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apissmesapcomv1alpha1.CAPApplicationVersion{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *cAPApplicationVersionInformer) TypedInformer() CAPApplicationVersionIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPApplicationVersion](f.factory.InformerFor(&apissmesapcomv1alpha1.CAPApplicationVersion{}, f.defaultInformer)) } func (f *cAPApplicationVersionInformer) Lister() smesapcomv1alpha1.CAPApplicationVersionLister { return smesapcomv1alpha1.NewCAPApplicationVersionLister(f.Informer().GetIndexer()) } + +// ToTypedCAPApplicationVersionInformer converts an untyped informer into a TypedCAPApplicationVersionInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPApplicationVersion. If that is not the case, calling type-safe methods of the returned +// TypedCAPApplicationVersionInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCAPApplicationVersionInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCAPApplicationVersionInformer(informer CAPApplicationVersionInformer) TypedCAPApplicationVersionInformer { + if informer, ok := informer.(TypedCAPApplicationVersionInformer); ok { + return informer + } + return &cAPApplicationVersionTypedInformerAdapter{informer} +} + +type cAPApplicationVersionTypedInformerAdapter struct { + CAPApplicationVersionInformer +} + +func (a *cAPApplicationVersionTypedInformerAdapter) TypedInformer() CAPApplicationVersionIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPApplicationVersion](a.Informer()) +} + +// ToCAPApplicationVersionIndexInformer converts an untyped informer into a CAPApplicationVersionIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPApplicationVersion. If that is not the case, calling type-safe methods of the returned +// CAPApplicationVersionIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CAPApplicationVersionIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCAPApplicationVersionIndexInformer(informer cache.SharedIndexInformer) CAPApplicationVersionIndexInformer { + if informer, ok := informer.(CAPApplicationVersionIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPApplicationVersion](informer) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/captenant.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/captenant.go index 8d6b7b0f..0825f972 100644 --- a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/captenant.go +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/captenant.go @@ -23,12 +23,40 @@ import ( ) // CAPTenantInformer provides access to a shared informer and lister for -// CAPTenants. +// CAPTenants. Prefer using the type-safe variant (see [TypedCAPTenantInformer]). type CAPTenantInformer interface { Informer() cache.SharedIndexInformer Lister() smesapcomv1alpha1.CAPTenantLister } +// TypedCAPTenantInformer provides access to a shared informer and lister for +// CAPTenants, including the type-safe TypedInformer variant. +// It is a superset of CAPTenantInformer. +type TypedCAPTenantInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CAPTenantIndexInformer + Lister() smesapcomv1alpha1.CAPTenantLister +} + +// CAPTenantIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CAPTenantIndexInformer cache.TypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPTenant] + +// CAPTenantHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CAPTenant. +type CAPTenantHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apissmesapcomv1alpha1.CAPTenant] + +// CAPTenantDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CAPTenant. +type CAPTenantDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apissmesapcomv1alpha1.CAPTenant] + +// CAPTenantFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CAPTenant. +type CAPTenantFilteringHandler = cache.TypedFilteringResourceEventHandler[*apissmesapcomv1alpha1.CAPTenant] + +// CAPTenantIndexers is a specialization of [cache.TypedIndexers] for CAPTenant. +type CAPTenantIndexers = cache.TypedIndexers[*apissmesapcomv1alpha1.CAPTenant] + +// DeletedCAPTenant is a specialization of [cache.DeletedObject] for CAPTenant. +type DeletedCAPTenant = cache.DeletedObject[*apissmesapcomv1alpha1.CAPTenant] + type cAPTenantInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -38,25 +66,49 @@ type cAPTenantInformer struct { // NewCAPTenantInformer constructs a new informer for CAPTenant type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPTenantInformer]). func NewCAPTenantInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCAPTenantInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCAPTenantInformer constructs a new informer for CAPTenant type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCAPTenantInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPTenantIndexers) CAPTenantIndexInformer { + return NewTypedCAPTenantInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCAPTenantInformer constructs a new informer for CAPTenant type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCAPTenantInformer]). func NewFilteredCAPTenantInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCAPTenantInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCAPTenantInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCAPTenantInformer constructs a new informer for CAPTenant type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCAPTenantInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPTenantIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CAPTenantIndexInformer { + return NewTypedCAPTenantInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCAPTenantInformerWithOptions constructs a new informer for CAPTenant type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPTenantInformerWithOptions]). func NewCAPTenantInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCAPTenantInformerWithOptions(client, namespace, options) +} + +// NewTypedCAPTenantInformerWithOptions constructs a new informer for CAPTenant type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCAPTenantInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) CAPTenantIndexInformer { gvr := schema.GroupVersionResource{Group: "sme.sap.com", Version: "v1alpha1", Resource: "captenants"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPTenant](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -89,17 +141,57 @@ func NewCAPTenantInformerWithOptions(client versioned.Interface, namespace strin Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *cAPTenantInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCAPTenantInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCAPTenantInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *cAPTenantInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apissmesapcomv1alpha1.CAPTenant{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *cAPTenantInformer) TypedInformer() CAPTenantIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPTenant](f.factory.InformerFor(&apissmesapcomv1alpha1.CAPTenant{}, f.defaultInformer)) } func (f *cAPTenantInformer) Lister() smesapcomv1alpha1.CAPTenantLister { return smesapcomv1alpha1.NewCAPTenantLister(f.Informer().GetIndexer()) } + +// ToTypedCAPTenantInformer converts an untyped informer into a TypedCAPTenantInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPTenant. If that is not the case, calling type-safe methods of the returned +// TypedCAPTenantInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCAPTenantInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCAPTenantInformer(informer CAPTenantInformer) TypedCAPTenantInformer { + if informer, ok := informer.(TypedCAPTenantInformer); ok { + return informer + } + return &cAPTenantTypedInformerAdapter{informer} +} + +type cAPTenantTypedInformerAdapter struct { + CAPTenantInformer +} + +func (a *cAPTenantTypedInformerAdapter) TypedInformer() CAPTenantIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPTenant](a.Informer()) +} + +// ToCAPTenantIndexInformer converts an untyped informer into a CAPTenantIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPTenant. If that is not the case, calling type-safe methods of the returned +// CAPTenantIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CAPTenantIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCAPTenantIndexInformer(informer cache.SharedIndexInformer) CAPTenantIndexInformer { + if informer, ok := informer.(CAPTenantIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPTenant](informer) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/captenantoperation.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/captenantoperation.go index a2c028c6..b2624616 100644 --- a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/captenantoperation.go +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/captenantoperation.go @@ -23,12 +23,40 @@ import ( ) // CAPTenantOperationInformer provides access to a shared informer and lister for -// CAPTenantOperations. +// CAPTenantOperations. Prefer using the type-safe variant (see [TypedCAPTenantOperationInformer]). type CAPTenantOperationInformer interface { Informer() cache.SharedIndexInformer Lister() smesapcomv1alpha1.CAPTenantOperationLister } +// TypedCAPTenantOperationInformer provides access to a shared informer and lister for +// CAPTenantOperations, including the type-safe TypedInformer variant. +// It is a superset of CAPTenantOperationInformer. +type TypedCAPTenantOperationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CAPTenantOperationIndexInformer + Lister() smesapcomv1alpha1.CAPTenantOperationLister +} + +// CAPTenantOperationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CAPTenantOperationIndexInformer cache.TypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPTenantOperation] + +// CAPTenantOperationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CAPTenantOperation. +type CAPTenantOperationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apissmesapcomv1alpha1.CAPTenantOperation] + +// CAPTenantOperationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CAPTenantOperation. +type CAPTenantOperationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apissmesapcomv1alpha1.CAPTenantOperation] + +// CAPTenantOperationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CAPTenantOperation. +type CAPTenantOperationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apissmesapcomv1alpha1.CAPTenantOperation] + +// CAPTenantOperationIndexers is a specialization of [cache.TypedIndexers] for CAPTenantOperation. +type CAPTenantOperationIndexers = cache.TypedIndexers[*apissmesapcomv1alpha1.CAPTenantOperation] + +// DeletedCAPTenantOperation is a specialization of [cache.DeletedObject] for CAPTenantOperation. +type DeletedCAPTenantOperation = cache.DeletedObject[*apissmesapcomv1alpha1.CAPTenantOperation] + type cAPTenantOperationInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -38,25 +66,49 @@ type cAPTenantOperationInformer struct { // NewCAPTenantOperationInformer constructs a new informer for CAPTenantOperation type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPTenantOperationInformer]). func NewCAPTenantOperationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCAPTenantOperationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCAPTenantOperationInformer constructs a new informer for CAPTenantOperation type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCAPTenantOperationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPTenantOperationIndexers) CAPTenantOperationIndexInformer { + return NewTypedCAPTenantOperationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCAPTenantOperationInformer constructs a new informer for CAPTenantOperation type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCAPTenantOperationInformer]). func NewFilteredCAPTenantOperationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCAPTenantOperationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCAPTenantOperationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCAPTenantOperationInformer constructs a new informer for CAPTenantOperation type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCAPTenantOperationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPTenantOperationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CAPTenantOperationIndexInformer { + return NewTypedCAPTenantOperationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCAPTenantOperationInformerWithOptions constructs a new informer for CAPTenantOperation type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPTenantOperationInformerWithOptions]). func NewCAPTenantOperationInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCAPTenantOperationInformerWithOptions(client, namespace, options) +} + +// NewTypedCAPTenantOperationInformerWithOptions constructs a new informer for CAPTenantOperation type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCAPTenantOperationInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) CAPTenantOperationIndexInformer { gvr := schema.GroupVersionResource{Group: "sme.sap.com", Version: "v1alpha1", Resource: "captenantoperations"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPTenantOperation](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -89,17 +141,57 @@ func NewCAPTenantOperationInformerWithOptions(client versioned.Interface, namesp Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *cAPTenantOperationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCAPTenantOperationInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCAPTenantOperationInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *cAPTenantOperationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apissmesapcomv1alpha1.CAPTenantOperation{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *cAPTenantOperationInformer) TypedInformer() CAPTenantOperationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPTenantOperation](f.factory.InformerFor(&apissmesapcomv1alpha1.CAPTenantOperation{}, f.defaultInformer)) } func (f *cAPTenantOperationInformer) Lister() smesapcomv1alpha1.CAPTenantOperationLister { return smesapcomv1alpha1.NewCAPTenantOperationLister(f.Informer().GetIndexer()) } + +// ToTypedCAPTenantOperationInformer converts an untyped informer into a TypedCAPTenantOperationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPTenantOperation. If that is not the case, calling type-safe methods of the returned +// TypedCAPTenantOperationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCAPTenantOperationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCAPTenantOperationInformer(informer CAPTenantOperationInformer) TypedCAPTenantOperationInformer { + if informer, ok := informer.(TypedCAPTenantOperationInformer); ok { + return informer + } + return &cAPTenantOperationTypedInformerAdapter{informer} +} + +type cAPTenantOperationTypedInformerAdapter struct { + CAPTenantOperationInformer +} + +func (a *cAPTenantOperationTypedInformerAdapter) TypedInformer() CAPTenantOperationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPTenantOperation](a.Informer()) +} + +// ToCAPTenantOperationIndexInformer converts an untyped informer into a CAPTenantOperationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPTenantOperation. If that is not the case, calling type-safe methods of the returned +// CAPTenantOperationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CAPTenantOperationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCAPTenantOperationIndexInformer(informer cache.SharedIndexInformer) CAPTenantOperationIndexInformer { + if informer, ok := informer.(CAPTenantOperationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPTenantOperation](informer) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/captenantoutput.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/captenantoutput.go index 951eaff6..120d6a9d 100644 --- a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/captenantoutput.go +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/captenantoutput.go @@ -23,12 +23,40 @@ import ( ) // CAPTenantOutputInformer provides access to a shared informer and lister for -// CAPTenantOutputs. +// CAPTenantOutputs. Prefer using the type-safe variant (see [TypedCAPTenantOutputInformer]). type CAPTenantOutputInformer interface { Informer() cache.SharedIndexInformer Lister() smesapcomv1alpha1.CAPTenantOutputLister } +// TypedCAPTenantOutputInformer provides access to a shared informer and lister for +// CAPTenantOutputs, including the type-safe TypedInformer variant. +// It is a superset of CAPTenantOutputInformer. +type TypedCAPTenantOutputInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CAPTenantOutputIndexInformer + Lister() smesapcomv1alpha1.CAPTenantOutputLister +} + +// CAPTenantOutputIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CAPTenantOutputIndexInformer cache.TypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPTenantOutput] + +// CAPTenantOutputHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CAPTenantOutput. +type CAPTenantOutputHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apissmesapcomv1alpha1.CAPTenantOutput] + +// CAPTenantOutputDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CAPTenantOutput. +type CAPTenantOutputDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apissmesapcomv1alpha1.CAPTenantOutput] + +// CAPTenantOutputFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CAPTenantOutput. +type CAPTenantOutputFilteringHandler = cache.TypedFilteringResourceEventHandler[*apissmesapcomv1alpha1.CAPTenantOutput] + +// CAPTenantOutputIndexers is a specialization of [cache.TypedIndexers] for CAPTenantOutput. +type CAPTenantOutputIndexers = cache.TypedIndexers[*apissmesapcomv1alpha1.CAPTenantOutput] + +// DeletedCAPTenantOutput is a specialization of [cache.DeletedObject] for CAPTenantOutput. +type DeletedCAPTenantOutput = cache.DeletedObject[*apissmesapcomv1alpha1.CAPTenantOutput] + type cAPTenantOutputInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -38,25 +66,49 @@ type cAPTenantOutputInformer struct { // NewCAPTenantOutputInformer constructs a new informer for CAPTenantOutput type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPTenantOutputInformer]). func NewCAPTenantOutputInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewCAPTenantOutputInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedCAPTenantOutputInformer constructs a new informer for CAPTenantOutput type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCAPTenantOutputInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPTenantOutputIndexers) CAPTenantOutputIndexInformer { + return NewTypedCAPTenantOutputInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredCAPTenantOutputInformer constructs a new informer for CAPTenantOutput type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCAPTenantOutputInformer]). func NewFilteredCAPTenantOutputInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewCAPTenantOutputInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedCAPTenantOutputInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCAPTenantOutputInformer constructs a new informer for CAPTenantOutput type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredCAPTenantOutputInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPTenantOutputIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CAPTenantOutputIndexInformer { + return NewTypedCAPTenantOutputInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewCAPTenantOutputInformerWithOptions constructs a new informer for CAPTenantOutput type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPTenantOutputInformerWithOptions]). func NewCAPTenantOutputInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCAPTenantOutputInformerWithOptions(client, namespace, options) +} + +// NewTypedCAPTenantOutputInformerWithOptions constructs a new informer for CAPTenantOutput type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedCAPTenantOutputInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) CAPTenantOutputIndexInformer { gvr := schema.GroupVersionResource{Group: "sme.sap.com", Version: "v1alpha1", Resource: "captenantoutputs"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPTenantOutput](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -89,17 +141,57 @@ func NewCAPTenantOutputInformerWithOptions(client versioned.Interface, namespace Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *cAPTenantOutputInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewCAPTenantOutputInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedCAPTenantOutputInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *cAPTenantOutputInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apissmesapcomv1alpha1.CAPTenantOutput{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *cAPTenantOutputInformer) TypedInformer() CAPTenantOutputIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPTenantOutput](f.factory.InformerFor(&apissmesapcomv1alpha1.CAPTenantOutput{}, f.defaultInformer)) } func (f *cAPTenantOutputInformer) Lister() smesapcomv1alpha1.CAPTenantOutputLister { return smesapcomv1alpha1.NewCAPTenantOutputLister(f.Informer().GetIndexer()) } + +// ToTypedCAPTenantOutputInformer converts an untyped informer into a TypedCAPTenantOutputInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPTenantOutput. If that is not the case, calling type-safe methods of the returned +// TypedCAPTenantOutputInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCAPTenantOutputInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCAPTenantOutputInformer(informer CAPTenantOutputInformer) TypedCAPTenantOutputInformer { + if informer, ok := informer.(TypedCAPTenantOutputInformer); ok { + return informer + } + return &cAPTenantOutputTypedInformerAdapter{informer} +} + +type cAPTenantOutputTypedInformerAdapter struct { + CAPTenantOutputInformer +} + +func (a *cAPTenantOutputTypedInformerAdapter) TypedInformer() CAPTenantOutputIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPTenantOutput](a.Informer()) +} + +// ToCAPTenantOutputIndexInformer converts an untyped informer into a CAPTenantOutputIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPTenantOutput. If that is not the case, calling type-safe methods of the returned +// CAPTenantOutputIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CAPTenantOutputIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCAPTenantOutputIndexInformer(informer cache.SharedIndexInformer) CAPTenantOutputIndexInformer { + if informer, ok := informer.(CAPTenantOutputIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.CAPTenantOutput](informer) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/clusterdomain.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/clusterdomain.go index 097634bf..9a9ce696 100644 --- a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/clusterdomain.go +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/clusterdomain.go @@ -23,12 +23,40 @@ import ( ) // ClusterDomainInformer provides access to a shared informer and lister for -// ClusterDomains. +// ClusterDomains. Prefer using the type-safe variant (see [TypedClusterDomainInformer]). type ClusterDomainInformer interface { Informer() cache.SharedIndexInformer Lister() smesapcomv1alpha1.ClusterDomainLister } +// TypedClusterDomainInformer provides access to a shared informer and lister for +// ClusterDomains, including the type-safe TypedInformer variant. +// It is a superset of ClusterDomainInformer. +type TypedClusterDomainInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ClusterDomainIndexInformer + Lister() smesapcomv1alpha1.ClusterDomainLister +} + +// ClusterDomainIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ClusterDomainIndexInformer cache.TypedSharedIndexInformer[*apissmesapcomv1alpha1.ClusterDomain] + +// ClusterDomainHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ClusterDomain. +type ClusterDomainHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apissmesapcomv1alpha1.ClusterDomain] + +// ClusterDomainDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ClusterDomain. +type ClusterDomainDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apissmesapcomv1alpha1.ClusterDomain] + +// ClusterDomainFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ClusterDomain. +type ClusterDomainFilteringHandler = cache.TypedFilteringResourceEventHandler[*apissmesapcomv1alpha1.ClusterDomain] + +// ClusterDomainIndexers is a specialization of [cache.TypedIndexers] for ClusterDomain. +type ClusterDomainIndexers = cache.TypedIndexers[*apissmesapcomv1alpha1.ClusterDomain] + +// DeletedClusterDomain is a specialization of [cache.DeletedObject] for ClusterDomain. +type DeletedClusterDomain = cache.DeletedObject[*apissmesapcomv1alpha1.ClusterDomain] + type clusterDomainInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -38,25 +66,49 @@ type clusterDomainInformer struct { // NewClusterDomainInformer constructs a new informer for ClusterDomain type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterDomainInformer]). func NewClusterDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewClusterDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedClusterDomainInformer constructs a new informer for ClusterDomain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers ClusterDomainIndexers) ClusterDomainIndexInformer { + return NewTypedClusterDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredClusterDomainInformer constructs a new informer for ClusterDomain type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredClusterDomainInformer]). func NewFilteredClusterDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewClusterDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedClusterDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredClusterDomainInformer constructs a new informer for ClusterDomain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredClusterDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers ClusterDomainIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ClusterDomainIndexInformer { + return NewTypedClusterDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewClusterDomainInformerWithOptions constructs a new informer for ClusterDomain type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterDomainInformerWithOptions]). func NewClusterDomainInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedClusterDomainInformerWithOptions(client, namespace, options) +} + +// NewTypedClusterDomainInformerWithOptions constructs a new informer for ClusterDomain type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedClusterDomainInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) ClusterDomainIndexInformer { gvr := schema.GroupVersionResource{Group: "sme.sap.com", Version: "v1alpha1", Resource: "clusterdomains"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.ClusterDomain](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -89,17 +141,57 @@ func NewClusterDomainInformerWithOptions(client versioned.Interface, namespace s Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *clusterDomainInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewClusterDomainInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedClusterDomainInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *clusterDomainInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apissmesapcomv1alpha1.ClusterDomain{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *clusterDomainInformer) TypedInformer() ClusterDomainIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.ClusterDomain](f.factory.InformerFor(&apissmesapcomv1alpha1.ClusterDomain{}, f.defaultInformer)) } func (f *clusterDomainInformer) Lister() smesapcomv1alpha1.ClusterDomainLister { return smesapcomv1alpha1.NewClusterDomainLister(f.Informer().GetIndexer()) } + +// ToTypedClusterDomainInformer converts an untyped informer into a TypedClusterDomainInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterDomain. If that is not the case, calling type-safe methods of the returned +// TypedClusterDomainInformer leads to runtime panics. A safer alternative is to pass +// around a TypedClusterDomainInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedClusterDomainInformer(informer ClusterDomainInformer) TypedClusterDomainInformer { + if informer, ok := informer.(TypedClusterDomainInformer); ok { + return informer + } + return &clusterDomainTypedInformerAdapter{informer} +} + +type clusterDomainTypedInformerAdapter struct { + ClusterDomainInformer +} + +func (a *clusterDomainTypedInformerAdapter) TypedInformer() ClusterDomainIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.ClusterDomain](a.Informer()) +} + +// ToClusterDomainIndexInformer converts an untyped informer into a ClusterDomainIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterDomain. If that is not the case, calling type-safe methods of the returned +// ClusterDomainIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ClusterDomainIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToClusterDomainIndexInformer(informer cache.SharedIndexInformer) ClusterDomainIndexInformer { + if informer, ok := informer.(ClusterDomainIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.ClusterDomain](informer) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/domain.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/domain.go index bc53af60..458f7174 100644 --- a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/domain.go +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/domain.go @@ -23,12 +23,40 @@ import ( ) // DomainInformer provides access to a shared informer and lister for -// Domains. +// Domains. Prefer using the type-safe variant (see [TypedDomainInformer]). type DomainInformer interface { Informer() cache.SharedIndexInformer Lister() smesapcomv1alpha1.DomainLister } +// TypedDomainInformer provides access to a shared informer and lister for +// Domains, including the type-safe TypedInformer variant. +// It is a superset of DomainInformer. +type TypedDomainInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() DomainIndexInformer + Lister() smesapcomv1alpha1.DomainLister +} + +// DomainIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type DomainIndexInformer cache.TypedSharedIndexInformer[*apissmesapcomv1alpha1.Domain] + +// DomainHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Domain. +type DomainHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apissmesapcomv1alpha1.Domain] + +// DomainDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Domain. +type DomainDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apissmesapcomv1alpha1.Domain] + +// DomainFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Domain. +type DomainFilteringHandler = cache.TypedFilteringResourceEventHandler[*apissmesapcomv1alpha1.Domain] + +// DomainIndexers is a specialization of [cache.TypedIndexers] for Domain. +type DomainIndexers = cache.TypedIndexers[*apissmesapcomv1alpha1.Domain] + +// DeletedDomain is a specialization of [cache.DeletedObject] for Domain. +type DeletedDomain = cache.DeletedObject[*apissmesapcomv1alpha1.Domain] + type domainInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc @@ -38,25 +66,49 @@ type domainInformer struct { // NewDomainInformer constructs a new informer for Domain type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDomainInformer]). func NewDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) } +// NewTypedDomainInformer constructs a new informer for Domain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers DomainIndexers) DomainIndexInformer { + return NewTypedDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + // NewFilteredDomainInformer constructs a new informer for Domain type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredDomainInformer]). func NewFilteredDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return NewDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) + return NewTypedDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredDomainInformer constructs a new informer for Domain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedFilteredDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers DomainIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) DomainIndexInformer { + return NewTypedDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) } // NewDomainInformerWithOptions constructs a new informer for Domain type with additional options. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDomainInformerWithOptions]). func NewDomainInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedDomainInformerWithOptions(client, namespace, options) +} + +// NewTypedDomainInformerWithOptions constructs a new informer for Domain type with additional options. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTypedDomainInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) DomainIndexInformer { gvr := schema.GroupVersionResource{Group: "sme.sap.com", Version: "v1alpha1", Resource: "domains"} identifier := options.InformerName.WithResource(gvr) tweakListOptions := options.TweakListOptions - return cache.NewSharedIndexInformerWithOptions( + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.Domain](cache.NewSharedIndexInformerWithOptions( cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { @@ -89,17 +141,57 @@ func NewDomainInformerWithOptions(client versioned.Interface, namespace string, Indexers: options.Indexers, Identifier: identifier, }, - ) + )) } func (f *domainInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewDomainInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) + return NewTypedDomainInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) } func (f *domainInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apissmesapcomv1alpha1.Domain{}, f.defaultInformer) + return f.TypedInformer() +} + +func (f *domainInformer) TypedInformer() DomainIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.Domain](f.factory.InformerFor(&apissmesapcomv1alpha1.Domain{}, f.defaultInformer)) } func (f *domainInformer) Lister() smesapcomv1alpha1.DomainLister { return smesapcomv1alpha1.NewDomainLister(f.Informer().GetIndexer()) } + +// ToTypedDomainInformer converts an untyped informer into a TypedDomainInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Domain. If that is not the case, calling type-safe methods of the returned +// TypedDomainInformer leads to runtime panics. A safer alternative is to pass +// around a TypedDomainInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedDomainInformer(informer DomainInformer) TypedDomainInformer { + if informer, ok := informer.(TypedDomainInformer); ok { + return informer + } + return &domainTypedInformerAdapter{informer} +} + +type domainTypedInformerAdapter struct { + DomainInformer +} + +func (a *domainTypedInformerAdapter) TypedInformer() DomainIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.Domain](a.Informer()) +} + +// ToDomainIndexInformer converts an untyped informer into a DomainIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Domain. If that is not the case, calling type-safe methods of the returned +// DomainIndexInformer leads to runtime panics. A safer alternative is to pass +// around a DomainIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToDomainIndexInformer(informer cache.SharedIndexInformer) DomainIndexInformer { + if informer, ok := informer.(DomainIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha1.Domain](informer) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/interface.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/interface.go index bde41118..a49d3d3f 100644 --- a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/interface.go +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/interface.go @@ -14,19 +14,19 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { // CAPApplications returns a CAPApplicationInformer. - CAPApplications() CAPApplicationInformer + CAPApplications() TypedCAPApplicationInformer // CAPApplicationVersions returns a CAPApplicationVersionInformer. - CAPApplicationVersions() CAPApplicationVersionInformer + CAPApplicationVersions() TypedCAPApplicationVersionInformer // CAPTenants returns a CAPTenantInformer. - CAPTenants() CAPTenantInformer + CAPTenants() TypedCAPTenantInformer // CAPTenantOperations returns a CAPTenantOperationInformer. - CAPTenantOperations() CAPTenantOperationInformer + CAPTenantOperations() TypedCAPTenantOperationInformer // CAPTenantOutputs returns a CAPTenantOutputInformer. - CAPTenantOutputs() CAPTenantOutputInformer + CAPTenantOutputs() TypedCAPTenantOutputInformer // ClusterDomains returns a ClusterDomainInformer. - ClusterDomains() ClusterDomainInformer + ClusterDomains() TypedClusterDomainInformer // Domains returns a DomainInformer. - Domains() DomainInformer + Domains() TypedDomainInformer } type version struct { @@ -40,37 +40,37 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// CAPApplications returns a CAPApplicationInformer. -func (v *version) CAPApplications() CAPApplicationInformer { +// CAPApplications returns a TypedCAPApplicationInformer. +func (v *version) CAPApplications() TypedCAPApplicationInformer { return &cAPApplicationInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// CAPApplicationVersions returns a CAPApplicationVersionInformer. -func (v *version) CAPApplicationVersions() CAPApplicationVersionInformer { +// CAPApplicationVersions returns a TypedCAPApplicationVersionInformer. +func (v *version) CAPApplicationVersions() TypedCAPApplicationVersionInformer { return &cAPApplicationVersionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// CAPTenants returns a CAPTenantInformer. -func (v *version) CAPTenants() CAPTenantInformer { +// CAPTenants returns a TypedCAPTenantInformer. +func (v *version) CAPTenants() TypedCAPTenantInformer { return &cAPTenantInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// CAPTenantOperations returns a CAPTenantOperationInformer. -func (v *version) CAPTenantOperations() CAPTenantOperationInformer { +// CAPTenantOperations returns a TypedCAPTenantOperationInformer. +func (v *version) CAPTenantOperations() TypedCAPTenantOperationInformer { return &cAPTenantOperationInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// CAPTenantOutputs returns a CAPTenantOutputInformer. -func (v *version) CAPTenantOutputs() CAPTenantOutputInformer { +// CAPTenantOutputs returns a TypedCAPTenantOutputInformer. +func (v *version) CAPTenantOutputs() TypedCAPTenantOutputInformer { return &cAPTenantOutputInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ClusterDomains returns a ClusterDomainInformer. -func (v *version) ClusterDomains() ClusterDomainInformer { +// ClusterDomains returns a TypedClusterDomainInformer. +func (v *version) ClusterDomains() TypedClusterDomainInformer { return &clusterDomainInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Domains returns a DomainInformer. -func (v *version) Domains() DomainInformer { +// Domains returns a TypedDomainInformer. +func (v *version) Domains() TypedDomainInformer { return &domainInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} }