From d7b7c7145e8bf1ccba69450ae98e261310cf9ea2 Mon Sep 17 00:00:00 2001 From: dprotaso Date: Mon, 22 Apr 2024 16:21:07 -0400 Subject: [PATCH] bump sigs.k8s.io/gateway-api@main --- go.mod | 22 +- go.sum | 56 +- .../informers/apis/v1/grpcroute/fake/fake.go | 40 + .../apis/v1/grpcroute/filtered/fake/fake.go | 52 + .../apis/v1/grpcroute/filtered/grpcroute.go | 65 + .../informers/apis/v1/grpcroute/grpcroute.go | 52 + test/gatewayapi/go.mod | 4 +- test/gatewayapi/go.sum | 3 + .../emicklei/go-restful/v3/README.md | 3 +- .../go-restful/v3/entity_accessors.go | 7 + .../github.com/emicklei/go-restful/v3/json.go | 11 - .../emicklei/go-restful/v3/jsoniter.go | 12 - .../go-openapi/jsonpointer/.golangci.yml | 61 + .../go-openapi/jsonpointer/README.md | 8 +- .../go-openapi/jsonpointer/pointer.go | 68 +- .../go-openapi/jsonreference/.golangci.yml | 57 +- .../go-openapi/jsonreference/README.md | 14 +- vendor/github.com/go-openapi/swag/.gitignore | 1 + .../github.com/go-openapi/swag/.golangci.yml | 54 +- vendor/github.com/go-openapi/swag/README.md | 8 +- .../{post_go19.go => initialism_index.go} | 3 - vendor/github.com/go-openapi/swag/loading.go | 105 +- .../github.com/go-openapi/swag/post_go18.go | 24 - vendor/github.com/go-openapi/swag/pre_go18.go | 24 - vendor/github.com/go-openapi/swag/pre_go19.go | 70 - vendor/github.com/go-openapi/swag/util.go | 12 +- vendor/github.com/go-openapi/swag/yaml.go | 36 +- .../generate-internal-groups.sh | 148 +- .../k8s.io/kube-openapi/pkg/common/common.go | 3 + .../kube-openapi/pkg/generators/markers.go | 345 ++++ .../kube-openapi/pkg/generators/openapi.go | 115 +- .../pkg/generators/rules/idl_tag.go | 3 +- .../pkg/generators/rules/names_match.go | 2 +- .../k8s.io/kube-openapi/pkg/schemaconv/smd.go | 3 - vendor/modules.txt | 40 +- .../apis/v1/allowedroutes.go | 53 + .../apis/v1/backendobjectreference.go | 79 + .../applyconfiguration/apis/v1/backendref.go | 84 + .../apis/v1/commonroutespec.go | 44 + .../apis/v1/cookieconfig.go | 43 + .../apis/v1/frontendtlsvalidation.go | 44 + .../applyconfiguration/apis/v1/gateway.go | 258 +++ .../apis/v1/gatewayaddress.go | 52 + .../apis/v1/gatewayclass.go | 256 +++ .../apis/v1/gatewayclassspec.go | 61 + .../apis/v1/gatewayclassstatus.go | 57 + .../apis/v1/gatewayinfrastructure.go | 73 + .../applyconfiguration/apis/v1/gatewayspec.go | 80 + .../apis/v1/gatewaystatus.go | 73 + .../apis/v1/gatewaystatusaddress.go | 52 + .../apis/v1/gatewaytlsconfig.go | 81 + .../apis/v1/grpcbackendref.go | 97 + .../apis/v1/grpcheadermatch.go | 61 + .../apis/v1/grpcmethodmatch.go | 61 + .../applyconfiguration/apis/v1/grpcroute.go | 258 +++ .../apis/v1/grpcroutefilter.go | 79 + .../apis/v1/grpcroutematch.go | 53 + .../apis/v1/grpcrouterule.go | 81 + .../apis/v1/grpcroutespec.go | 73 + .../apis/v1/grpcroutestatus.go | 44 + .../apis/v1/httpbackendref.go | 97 + .../applyconfiguration/apis/v1/httpheader.go | 52 + .../apis/v1/httpheaderfilter.go | 69 + .../apis/v1/httpheadermatch.go | 61 + .../apis/v1/httppathmatch.go | 52 + .../apis/v1/httppathmodifier.go | 61 + .../apis/v1/httpqueryparammatch.go | 61 + .../apis/v1/httprequestmirrorfilter.go | 39 + .../apis/v1/httprequestredirectfilter.go | 79 + .../applyconfiguration/apis/v1/httproute.go | 258 +++ .../apis/v1/httproutefilter.go | 97 + .../apis/v1/httproutematch.go | 80 + .../apis/v1/httprouterule.go | 90 + .../apis/v1/httproutespec.go | 73 + .../apis/v1/httproutestatus.go | 44 + .../apis/v1/httproutetimeouts.go | 52 + .../apis/v1/httpurlrewritefilter.go | 52 + .../applyconfiguration/apis/v1/listener.go | 88 + .../apis/v1/listenerstatus.go | 78 + .../apis/v1/localobjectreference.go | 61 + .../apis/v1/localparametersreference.go | 61 + .../apis/v1/objectreference.go | 70 + .../apis/v1/parametersreference.go | 70 + .../apis/v1/parentreference.go | 88 + .../apis/v1/routegroupkind.go | 52 + .../apis/v1/routenamespaces.go | 53 + .../apis/v1/routeparentstatus.go | 64 + .../applyconfiguration/apis/v1/routestatus.go | 44 + .../apis/v1/secretobjectreference.go | 70 + .../apis/v1/sessionpersistence.go | 79 + .../apis/v1alpha2/backendlbpolicy.go | 258 +++ .../apis/v1alpha2/backendlbpolicyspec.go | 57 + .../apis/v1alpha2/grpcroute.go | 259 +++ .../v1alpha2/localpolicytargetreference.go | 61 + ...calpolicytargetreferencewithsectionname.go | 68 + .../apis/v1alpha2/policyancestorstatus.go | 65 + .../apis/v1alpha2/policystatus.go | 44 + .../apis/v1alpha2/policytargetreference.go | 70 + .../policytargetreferencewithsectionname.go | 76 + .../apis/v1alpha2/referencegrant.go | 250 +++ .../apis/v1alpha2/tcproute.go | 258 +++ .../apis/v1alpha2/tcprouterule.go | 48 + .../apis/v1alpha2/tcproutespec.go | 62 + .../apis/v1alpha2/tcproutestatus.go | 48 + .../apis/v1alpha2/tlsroute.go | 258 +++ .../apis/v1alpha2/tlsrouterule.go | 48 + .../apis/v1alpha2/tlsroutespec.go | 74 + .../apis/v1alpha2/tlsroutestatus.go | 48 + .../apis/v1alpha2/udproute.go | 258 +++ .../apis/v1alpha2/udprouterule.go | 48 + .../apis/v1alpha2/udproutespec.go | 62 + .../apis/v1alpha2/udproutestatus.go | 48 + .../apis/v1alpha3/backendtlspolicy.go | 259 +++ .../apis/v1alpha3/backendtlspolicyspec.go | 57 + .../v1alpha3/backendtlspolicyvalidation.go | 68 + .../apis/v1beta1/gateway.go | 259 +++ .../apis/v1beta1/gatewayclass.go | 257 +++ .../apis/v1beta1/httproute.go | 259 +++ .../apis/v1beta1/referencegrant.go | 249 +++ .../apis/v1beta1/referencegrantfrom.go | 61 + .../apis/v1beta1/referencegrantspec.go | 58 + .../apis/v1beta1/referencegrantto.go | 61 + .../applyconfiguration/internal/internal.go | 1625 +++++++++++++++++ vendor/sigs.k8s.io/gateway-api/apis/v1/doc.go | 1 + .../gateway-api/apis/v1/gateway_types.go | 105 +- .../gateway-api/apis/v1/gatewayclass_types.go | 6 +- .../gateway-api/apis/v1/grpcroute_types.go | 627 +++++++ .../gateway-api/apis/v1/httproute_types.go | 27 +- .../apis/v1/object_reference_types.go | 33 + .../gateway-api/apis/v1/shared_types.go | 143 +- .../apis/v1/zz_generated.deepcopy.go | 411 +++++ .../apis/v1/zz_generated.register.go | 2 + .../apis/v1alpha2/backendlbpolicy_types.go | 74 + .../gateway-api/apis/v1alpha2/doc.go | 1 + .../apis/v1alpha2/gateway_types.go | 168 -- .../apis/v1alpha2/gatewayclass_types.go | 87 - .../apis/v1alpha2/grpcroute_types.go | 589 +----- .../apis/v1alpha2/httproute_types.go | 243 --- .../gateway-api/apis/v1alpha2/policy_types.go | 44 +- .../gateway-api/apis/v1alpha2/shared_types.go | 16 + .../apis/v1alpha2/zz_generated.deepcopy.go | 482 +---- .../apis/v1alpha2/zz_generated.register.go | 10 +- .../backendtlspolicy_types.go | 66 +- .../gateway-api/apis/v1alpha3/doc.go | 23 + .../apis/v1alpha3/zz_generated.deepcopy.go | 134 ++ .../apis/v1alpha3/zz_generated.register.go | 67 + .../gateway-api/apis/v1beta1/doc.go | 1 + .../gateway-api/apis/v1beta1/gateway_types.go | 5 +- .../apis/v1beta1/gatewayclass_types.go | 1 - .../apis/v1beta1/httproute_types.go | 1 - .../gateway-api/apis/v1beta1/shared_types.go | 13 +- .../client/clientset/versioned/clientset.go | 13 + .../versioned/fake/clientset_generated.go | 7 + .../clientset/versioned/fake/register.go | 2 + .../clientset/versioned/scheme/register.go | 2 + .../versioned/typed/apis/v1/apis_client.go | 5 + .../typed/apis/v1/fake/fake_apis_client.go | 4 + .../typed/apis/v1/fake/fake_gateway.go | 48 + .../typed/apis/v1/fake/fake_gatewayclass.go | 46 + .../typed/apis/v1/fake/fake_grpcroute.go | 189 ++ .../typed/apis/v1/fake/fake_httproute.go | 48 + .../versioned/typed/apis/v1/gateway.go | 61 + .../versioned/typed/apis/v1/gatewayclass.go | 59 + .../typed/apis/v1/generated_expansion.go | 2 + .../versioned/typed/apis/v1/grpcroute.go | 256 +++ .../versioned/typed/apis/v1/httproute.go | 61 + .../typed/apis/v1alpha2/apis_client.go | 21 +- .../typed/apis/v1alpha2/backendlbpolicy.go | 256 +++ .../apis/v1alpha2/fake/fake_apis_client.go | 16 +- .../v1alpha2/fake/fake_backendlbpolicy.go | 189 ++ .../typed/apis/v1alpha2/fake/fake_gateway.go | 141 -- .../apis/v1alpha2/fake/fake_gatewayclass.go | 132 -- .../apis/v1alpha2/fake/fake_grpcroute.go | 48 + .../apis/v1alpha2/fake/fake_httproute.go | 141 -- .../apis/v1alpha2/fake/fake_referencegrant.go | 25 + .../typed/apis/v1alpha2/fake/fake_tcproute.go | 48 + .../typed/apis/v1alpha2/fake/fake_tlsroute.go | 48 + .../typed/apis/v1alpha2/fake/fake_udproute.go | 48 + .../versioned/typed/apis/v1alpha2/gateway.go | 195 -- .../typed/apis/v1alpha2/gatewayclass.go | 184 -- .../apis/v1alpha2/generated_expansion.go | 8 +- .../typed/apis/v1alpha2/grpcroute.go | 61 + .../typed/apis/v1alpha2/httproute.go | 195 -- .../typed/apis/v1alpha2/referencegrant.go | 30 + .../versioned/typed/apis/v1alpha2/tcproute.go | 61 + .../versioned/typed/apis/v1alpha2/tlsroute.go | 61 + .../versioned/typed/apis/v1alpha2/udproute.go | 61 + .../typed/apis/v1alpha3/apis_client.go | 107 ++ .../backendtlspolicy.go | 103 +- .../versioned/typed/apis/v1alpha3/doc.go | 20 + .../{ => typed/apis/v1alpha3/fake}/doc.go | 4 +- .../apis/v1alpha3/fake/fake_apis_client.go | 40 + .../fake/fake_backendtlspolicy.go | 98 +- .../apis/v1alpha3/generated_expansion.go | 21 + .../typed/apis/v1beta1/fake/fake_gateway.go | 48 + .../apis/v1beta1/fake/fake_gatewayclass.go | 46 + .../typed/apis/v1beta1/fake/fake_httproute.go | 48 + .../apis/v1beta1/fake/fake_referencegrant.go | 25 + .../versioned/typed/apis/v1beta1/gateway.go | 61 + .../typed/apis/v1beta1/gatewayclass.go | 59 + .../versioned/typed/apis/v1beta1/httproute.go | 61 + .../typed/apis/v1beta1/referencegrant.go | 30 + .../externalversions/apis/interface.go | 8 + .../httproute.go => v1/grpcroute.go} | 50 +- .../externalversions/apis/v1/interface.go | 7 + .../{gateway.go => backendlbpolicy.go} | 38 +- .../apis/v1alpha2/gatewayclass.go | 89 - .../apis/v1alpha2/interface.go | 31 +- .../backendtlspolicy.go | 20 +- .../apis/v1alpha3/interface.go | 45 + .../informers/externalversions/factory.go | 10 + .../informers/externalversions/generic.go | 17 +- .../listers/apis/v1/expansion_generated.go | 8 + .../pkg/client/listers/apis/v1/grpcroute.go | 99 + .../listers/apis/v1alpha2/backendlbpolicy.go | 99 + .../apis/v1alpha2/expansion_generated.go | 32 +- .../client/listers/apis/v1alpha2/gateway.go | 99 - .../listers/apis/v1alpha2/gatewayclass.go | 68 - .../client/listers/apis/v1alpha2/httproute.go | 99 - .../backendtlspolicy.go | 24 +- .../apis/v1alpha3/expansion_generated.go | 27 + 221 files changed, 15838 insertions(+), 3559 deletions(-) create mode 100644 pkg/client/injection/informers/apis/v1/grpcroute/fake/fake.go create mode 100644 pkg/client/injection/informers/apis/v1/grpcroute/filtered/fake/fake.go create mode 100644 pkg/client/injection/informers/apis/v1/grpcroute/filtered/grpcroute.go create mode 100644 pkg/client/injection/informers/apis/v1/grpcroute/grpcroute.go delete mode 100644 vendor/github.com/emicklei/go-restful/v3/json.go delete mode 100644 vendor/github.com/emicklei/go-restful/v3/jsoniter.go create mode 100644 vendor/github.com/go-openapi/jsonpointer/.golangci.yml rename vendor/github.com/go-openapi/swag/{post_go19.go => initialism_index.go} (98%) delete mode 100644 vendor/github.com/go-openapi/swag/post_go18.go delete mode 100644 vendor/github.com/go-openapi/swag/pre_go18.go delete mode 100644 vendor/github.com/go-openapi/swag/pre_go19.go create mode 100644 vendor/k8s.io/kube-openapi/pkg/generators/markers.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/allowedroutes.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendobjectreference.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendref.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/commonroutespec.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/cookieconfig.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/frontendtlsvalidation.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gateway.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayaddress.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclass.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassspec.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassstatus.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayinfrastructure.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayspec.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatus.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatusaddress.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaytlsconfig.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcbackendref.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcheadermatch.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcmethodmatch.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroute.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutefilter.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutematch.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcrouterule.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutespec.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutestatus.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpbackendref.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheader.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheaderfilter.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheadermatch.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmatch.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmodifier.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpqueryparammatch.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestmirrorfilter.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestredirectfilter.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproute.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutefilter.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutematch.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprouterule.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutespec.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutestatus.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutetimeouts.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpurlrewritefilter.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listener.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listenerstatus.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localobjectreference.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localparametersreference.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/objectreference.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parametersreference.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parentreference.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routegroupkind.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routenamespaces.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routeparentstatus.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routestatus.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/secretobjectreference.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/sessionpersistence.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicy.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicyspec.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/grpcroute.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreference.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreferencewithsectionname.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policyancestorstatus.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policystatus.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policytargetreference.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policytargetreferencewithsectionname.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/referencegrant.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproute.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcprouterule.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutespec.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutestatus.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroute.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsrouterule.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutespec.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutestatus.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproute.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udprouterule.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutespec.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutestatus.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicy.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyspec.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyvalidation.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gateway.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gatewayclass.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/httproute.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrant.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantfrom.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantspec.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantto.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/internal/internal.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/v1/grpcroute_types.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/backendlbpolicy_types.go delete mode 100644 vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/gateway_types.go delete mode 100644 vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/gatewayclass_types.go delete mode 100644 vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/httproute_types.go rename vendor/sigs.k8s.io/gateway-api/apis/{v1alpha2 => v1alpha3}/backendtlspolicy_types.go (57%) create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/doc.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/zz_generated.deepcopy.go create mode 100644 vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/zz_generated.register.go create mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_grpcroute.go create mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/grpcroute.go create mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendlbpolicy.go create mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendlbpolicy.go delete mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_gateway.go delete mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_gatewayclass.go delete mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_httproute.go delete mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/gateway.go delete mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/gatewayclass.go delete mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/httproute.go create mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/apis_client.go rename vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/{v1alpha2 => v1alpha3}/backendtlspolicy.go (61%) create mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/doc.go rename vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/{ => typed/apis/v1alpha3/fake}/doc.go (88%) create mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/fake_apis_client.go rename vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/{v1alpha2 => v1alpha3}/fake/fake_backendtlspolicy.go (54%) create mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/generated_expansion.go rename vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/{v1alpha2/httproute.go => v1/grpcroute.go} (60%) rename vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/{gateway.go => backendlbpolicy.go} (56%) delete mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/gatewayclass.go rename vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/{v1alpha2 => v1alpha3}/backendtlspolicy.go (85%) create mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha3/interface.go create mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/grpcroute.go create mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/backendlbpolicy.go delete mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/gateway.go delete mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/gatewayclass.go delete mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/httproute.go rename vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/{v1alpha2 => v1alpha3}/backendtlspolicy.go (84%) create mode 100644 vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha3/expansion_generated.go diff --git a/go.mod b/go.mod index 7077bc96a..d91440461 100644 --- a/go.mod +++ b/go.mod @@ -8,15 +8,15 @@ require ( go.uber.org/zap v1.27.0 golang.org/x/time v0.5.0 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.29.2 - k8s.io/apimachinery v0.29.2 - k8s.io/client-go v0.29.2 - k8s.io/code-generator v0.29.2 + k8s.io/api v0.29.3 + k8s.io/apimachinery v0.29.3 + k8s.io/client-go v0.29.3 + k8s.io/code-generator v0.29.3 k8s.io/utils v0.0.0-20240102154912-e7106e64919e knative.dev/hack v0.0.0-20240404013450-1133b37da8d7 knative.dev/networking v0.0.0-20240418213116-979f63728302 knative.dev/pkg v0.0.0-20240416145024-0f34a8815650 - sigs.k8s.io/gateway-api v1.0.0 + sigs.k8s.io/gateway-api v1.0.1-0.20240422224228-29e68bffffb9 sigs.k8s.io/yaml v1.4.0 ) @@ -29,15 +29,15 @@ require ( github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/emicklei/go-restful/v3 v3.11.2 // indirect github.com/evanphx/json-patch v5.7.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-logr/logr v1.4.1 // indirect - github.com/go-openapi/jsonpointer v0.20.0 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-openapi/jsonpointer v0.20.2 // indirect + github.com/go-openapi/jsonreference v0.20.4 // indirect + github.com/go-openapi/swag v0.22.7 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -83,10 +83,10 @@ require ( google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.29.2 // indirect + k8s.io/apiextensions-apiserver v0.29.3 // indirect k8s.io/gengo v0.0.0-20240129211411-f967bbeff4b4 // indirect k8s.io/klog/v2 v2.120.1 // indirect - k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect + k8s.io/kube-openapi v0.0.0-20240105020646-a37d4de58910 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) diff --git a/go.sum b/go.sum index 7ebddc126..50a44bbc8 100644 --- a/go.sum +++ b/go.sum @@ -64,12 +64,11 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= -github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.11.2 h1:1onLa9DcsMYO9P+CXaL0dStDqQ2EHHXLiz+BtnqkLAU= +github.com/emicklei/go-restful/v3 v3.11.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -96,14 +95,12 @@ github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= -github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= -github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= +github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= +github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU= +github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4= +github.com/go-openapi/swag v0.22.7 h1:JWrc1uc/P9cSomxfnsFSVWoE1FW6bNbrVPmpQYpCcR8= +github.com/go-openapi/swag v0.22.7/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= @@ -215,7 +212,6 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -285,8 +281,8 @@ github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9dFqnUakOjnEuMPJJJnI= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417 h1:Lt9DzQALzHoDwMBGJ6v8ObDPR0dzr2a6sXTB1Fq7IHs= github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417/go.mod h1:qe5TWALJ8/a1Lqznoc5BDHpYX/8HU60Hm2AwRmqzxqA= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -305,8 +301,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ 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.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807/go.mod h1:7jxmlfBCDBXRzr0eAQJ48XC1hBu1np4CS5+cHEYfwpc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -660,23 +656,23 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.29.2 h1:hBC7B9+MU+ptchxEqTNW2DkUosJpp1P+Wn6YncZ474A= -k8s.io/api v0.29.2/go.mod h1:sdIaaKuU7P44aoyyLlikSLayT6Vb7bvJNCX105xZXY0= -k8s.io/apiextensions-apiserver v0.29.2 h1:UK3xB5lOWSnhaCk0RFZ0LUacPZz9RY4wi/yt2Iu+btg= -k8s.io/apiextensions-apiserver v0.29.2/go.mod h1:aLfYjpA5p3OwtqNXQFkhJ56TB+spV8Gc4wfMhUA3/b8= -k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8= -k8s.io/apimachinery v0.29.2/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= -k8s.io/client-go v0.29.2 h1:FEg85el1TeZp+/vYJM7hkDlSTFZ+c5nnK44DJ4FyoRg= -k8s.io/client-go v0.29.2/go.mod h1:knlvFZE58VpqbQpJNbCbctTVXcd35mMyAAwBdpt4jrA= -k8s.io/code-generator v0.29.2 h1:c9/iw2KnNpw2IRV+wwuG/Wns2TjPSgjWzbbjTevyiHI= -k8s.io/code-generator v0.29.2/go.mod h1:FwFi3C9jCrmbPjekhaCYcYG1n07CYiW1+PAPCockaos= +k8s.io/api v0.29.3 h1:2ORfZ7+bGC3YJqGpV0KSDDEVf8hdGQ6A03/50vj8pmw= +k8s.io/api v0.29.3/go.mod h1:y2yg2NTyHUUkIoTC+phinTnEa3KFM6RZ3szxt014a80= +k8s.io/apiextensions-apiserver v0.29.3 h1:9HF+EtZaVpFjStakF4yVufnXGPRppWFEQ87qnO91YeI= +k8s.io/apiextensions-apiserver v0.29.3/go.mod h1:po0XiY5scnpJfFizNGo6puNU6Fq6D70UJY2Cb2KwAVc= +k8s.io/apimachinery v0.29.3 h1:2tbx+5L7RNvqJjn7RIuIKu9XTsIZ9Z5wX2G22XAa5EU= +k8s.io/apimachinery v0.29.3/go.mod h1:hx/S4V2PNW4OMg3WizRrHutyB5la0iCUbZym+W0EQIU= +k8s.io/client-go v0.29.3 h1:R/zaZbEAxqComZ9FHeQwOh3Y1ZUs7FaHKZdQtIc2WZg= +k8s.io/client-go v0.29.3/go.mod h1:tkDisCvgPfiRpxGnOORfkljmS+UrW+WtXAy2fTvXJB0= +k8s.io/code-generator v0.29.3 h1:m7E25/t9R9NvejspO2zBdyu+/Gl0Z5m7dCRc680KS14= +k8s.io/code-generator v0.29.3/go.mod h1:x47ofBhN4gxYFcxeKA1PYXeaPreAGaDN85Y/lNUsPoM= k8s.io/gengo v0.0.0-20240129211411-f967bbeff4b4 h1:izq7u3SJBdOAuA5YYe1/PIp9jczrih/jGlKRRt0G7bQ= k8s.io/gengo v0.0.0-20240129211411-f967bbeff4b4/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/kube-openapi v0.0.0-20240105020646-a37d4de58910 h1:1Rp/XEKP5uxPs6QrsngEHAxBjaAR78iJRiJq5Fi7LSU= +k8s.io/kube-openapi v0.0.0-20240105020646-a37d4de58910/go.mod h1:Pa1PvrP7ACSkuX6I7KYomY6cmMA0Tx86waBhDUgoKPw= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= knative.dev/hack v0.0.0-20240404013450-1133b37da8d7 h1:fkWYWvdHm1mVHevKW2vVJnZtxH0NzOlux8imesweKwE= @@ -688,8 +684,8 @@ knative.dev/pkg v0.0.0-20240416145024-0f34a8815650/go.mod h1:soFw5ss08G4PU3JiFDK rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/gateway-api v1.0.0 h1:iPTStSv41+d9p0xFydll6d7f7MOBGuqXM6p2/zVYMAs= -sigs.k8s.io/gateway-api v1.0.0/go.mod h1:4cUgr0Lnp5FZ0Cdq8FdRwCvpiWws7LVhLHGIudLlf4c= +sigs.k8s.io/gateway-api v1.0.1-0.20240422224228-29e68bffffb9 h1:GNZSULVSxk/Ur6qcaZuDLfHOxmbsGv8KLQnozYUbsMQ= +sigs.k8s.io/gateway-api v1.0.1-0.20240422224228-29e68bffffb9/go.mod h1:ECVx/vt9VVr7xoaG+IWb0KHNKFLi2GrEnPPAlfnBvFE= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/pkg/client/injection/informers/apis/v1/grpcroute/fake/fake.go b/pkg/client/injection/informers/apis/v1/grpcroute/fake/fake.go new file mode 100644 index 000000000..06914f167 --- /dev/null +++ b/pkg/client/injection/informers/apis/v1/grpcroute/fake/fake.go @@ -0,0 +1,40 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + grpcroute "knative.dev/net-gateway-api/pkg/client/injection/informers/apis/v1/grpcroute" + fake "knative.dev/net-gateway-api/pkg/client/injection/informers/factory/fake" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" +) + +var Get = grpcroute.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Gateway().V1().GRPCRoutes() + return context.WithValue(ctx, grpcroute.Key{}, inf), inf.Informer() +} diff --git a/pkg/client/injection/informers/apis/v1/grpcroute/filtered/fake/fake.go b/pkg/client/injection/informers/apis/v1/grpcroute/filtered/fake/fake.go new file mode 100644 index 000000000..d3d19a498 --- /dev/null +++ b/pkg/client/injection/informers/apis/v1/grpcroute/filtered/fake/fake.go @@ -0,0 +1,52 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + filtered "knative.dev/net-gateway-api/pkg/client/injection/informers/apis/v1/grpcroute/filtered" + factoryfiltered "knative.dev/net-gateway-api/pkg/client/injection/informers/factory/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +var Get = filtered.Get + +func init() { + injection.Fake.RegisterFilteredInformers(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(factoryfiltered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := factoryfiltered.Get(ctx, selector) + inf := f.Gateway().V1().GRPCRoutes() + ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} diff --git a/pkg/client/injection/informers/apis/v1/grpcroute/filtered/grpcroute.go b/pkg/client/injection/informers/apis/v1/grpcroute/filtered/grpcroute.go new file mode 100644 index 000000000..c2af565f2 --- /dev/null +++ b/pkg/client/injection/informers/apis/v1/grpcroute/filtered/grpcroute.go @@ -0,0 +1,65 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by injection-gen. DO NOT EDIT. + +package filtered + +import ( + context "context" + + filtered "knative.dev/net-gateway-api/pkg/client/injection/informers/factory/filtered" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" + v1 "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1" +) + +func init() { + injection.Default.RegisterFilteredInformers(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct { + Selector string +} + +func withInformer(ctx context.Context) (context.Context, []controller.Informer) { + untyped := ctx.Value(filtered.LabelKey{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch labelkey from context.") + } + labelSelectors := untyped.([]string) + infs := []controller.Informer{} + for _, selector := range labelSelectors { + f := filtered.Get(ctx, selector) + inf := f.Gateway().V1().GRPCRoutes() + ctx = context.WithValue(ctx, Key{Selector: selector}, inf) + infs = append(infs, inf.Informer()) + } + return ctx, infs +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context, selector string) v1.GRPCRouteInformer { + untyped := ctx.Value(Key{Selector: selector}) + if untyped == nil { + logging.FromContext(ctx).Panicf( + "Unable to fetch sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1.GRPCRouteInformer with selector %s from context.", selector) + } + return untyped.(v1.GRPCRouteInformer) +} diff --git a/pkg/client/injection/informers/apis/v1/grpcroute/grpcroute.go b/pkg/client/injection/informers/apis/v1/grpcroute/grpcroute.go new file mode 100644 index 000000000..7300dbabe --- /dev/null +++ b/pkg/client/injection/informers/apis/v1/grpcroute/grpcroute.go @@ -0,0 +1,52 @@ +/* +Copyright 2021 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by injection-gen. DO NOT EDIT. + +package grpcroute + +import ( + context "context" + + factory "knative.dev/net-gateway-api/pkg/client/injection/informers/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" + v1 "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Gateway().V1().GRPCRoutes() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context) v1.GRPCRouteInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1.GRPCRouteInformer from context.") + } + return untyped.(v1.GRPCRouteInformer) +} diff --git a/test/gatewayapi/go.mod b/test/gatewayapi/go.mod index 4d0f28af6..928c74f33 100644 --- a/test/gatewayapi/go.mod +++ b/test/gatewayapi/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( k8s.io/apimachinery v0.29.3 - sigs.k8s.io/gateway-api v1.0.1-0.20240418002011-7f9f51098f40 + sigs.k8s.io/gateway-api v1.0.1-0.20240422224228-29e68bffffb9 ) require ( @@ -39,7 +39,7 @@ require ( golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.20.0 // indirect golang.org/x/oauth2 v0.16.0 // indirect - golang.org/x/sync v0.6.0 // indirect + golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.16.0 // indirect golang.org/x/term v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/test/gatewayapi/go.sum b/test/gatewayapi/go.sum index 071c77b15..8ef364d7c 100644 --- a/test/gatewayapi/go.sum +++ b/test/gatewayapi/go.sum @@ -134,6 +134,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -206,6 +207,8 @@ sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigw sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0= sigs.k8s.io/gateway-api v1.0.1-0.20240418002011-7f9f51098f40 h1:gH4Z10+yqcxTJ52r1Spk8rhj3Kv0IevbdPPvPgEcqbA= sigs.k8s.io/gateway-api v1.0.1-0.20240418002011-7f9f51098f40/go.mod h1:pOW7gKjeVN1xDfoPYkzI1b3v0XtgTcIx/CJ8cQAbOCA= +sigs.k8s.io/gateway-api v1.0.1-0.20240422224228-29e68bffffb9 h1:GNZSULVSxk/Ur6qcaZuDLfHOxmbsGv8KLQnozYUbsMQ= +sigs.k8s.io/gateway-api v1.0.1-0.20240422224228-29e68bffffb9/go.mod h1:ECVx/vt9VVr7xoaG+IWb0KHNKFLi2GrEnPPAlfnBvFE= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/vendor/github.com/emicklei/go-restful/v3/README.md b/vendor/github.com/emicklei/go-restful/v3/README.md index e3e30080e..95a05a089 100644 --- a/vendor/github.com/emicklei/go-restful/v3/README.md +++ b/vendor/github.com/emicklei/go-restful/v3/README.md @@ -95,8 +95,7 @@ There are several hooks to customize the behavior of the go-restful package. - Trace logging - Compression - Encoders for other serializers -- Use [jsoniter](https://github.com/json-iterator/go) by building this package using a build tag, e.g. `go build -tags=jsoniter .` -- Use the package variable `TrimRightSlashEnabled` (default true) to control the behavior of matching routes that end with a slash `/` +- Use the package variable `TrimRightSlashEnabled` (default true) to control the behavior of matching routes that end with a slash `/` ## Resources diff --git a/vendor/github.com/emicklei/go-restful/v3/entity_accessors.go b/vendor/github.com/emicklei/go-restful/v3/entity_accessors.go index 66dfc824f..9808752ac 100644 --- a/vendor/github.com/emicklei/go-restful/v3/entity_accessors.go +++ b/vendor/github.com/emicklei/go-restful/v3/entity_accessors.go @@ -5,11 +5,18 @@ package restful // that can be found in the LICENSE file. import ( + "encoding/json" "encoding/xml" "strings" "sync" ) +var ( + MarshalIndent = json.MarshalIndent + NewDecoder = json.NewDecoder + NewEncoder = json.NewEncoder +) + // EntityReaderWriter can read and write values using an encoding such as JSON,XML. type EntityReaderWriter interface { // Read a serialized version of the value from the request. diff --git a/vendor/github.com/emicklei/go-restful/v3/json.go b/vendor/github.com/emicklei/go-restful/v3/json.go deleted file mode 100644 index 871165166..000000000 --- a/vendor/github.com/emicklei/go-restful/v3/json.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !jsoniter - -package restful - -import "encoding/json" - -var ( - MarshalIndent = json.MarshalIndent - NewDecoder = json.NewDecoder - NewEncoder = json.NewEncoder -) diff --git a/vendor/github.com/emicklei/go-restful/v3/jsoniter.go b/vendor/github.com/emicklei/go-restful/v3/jsoniter.go deleted file mode 100644 index 11b8f8ae7..000000000 --- a/vendor/github.com/emicklei/go-restful/v3/jsoniter.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build jsoniter - -package restful - -import "github.com/json-iterator/go" - -var ( - json = jsoniter.ConfigCompatibleWithStandardLibrary - MarshalIndent = json.MarshalIndent - NewDecoder = json.NewDecoder - NewEncoder = json.NewEncoder -) diff --git a/vendor/github.com/go-openapi/jsonpointer/.golangci.yml b/vendor/github.com/go-openapi/jsonpointer/.golangci.yml new file mode 100644 index 000000000..22f8d21cc --- /dev/null +++ b/vendor/github.com/go-openapi/jsonpointer/.golangci.yml @@ -0,0 +1,61 @@ +linters-settings: + govet: + check-shadowing: true + golint: + min-confidence: 0 + gocyclo: + min-complexity: 45 + maligned: + suggest-new: true + dupl: + threshold: 200 + goconst: + min-len: 2 + min-occurrences: 3 + +linters: + enable-all: true + disable: + - maligned + - unparam + - lll + - gochecknoinits + - gochecknoglobals + - funlen + - godox + - gocognit + - whitespace + - wsl + - wrapcheck + - testpackage + - nlreturn + - gomnd + - exhaustivestruct + - goerr113 + - errorlint + - nestif + - godot + - gofumpt + - paralleltest + - tparallel + - thelper + - ifshort + - exhaustruct + - varnamelen + - gci + - depguard + - errchkjson + - inamedparam + - nonamedreturns + - musttag + - ireturn + - forcetypeassert + - cyclop + # deprecated linters + - deadcode + - interfacer + - scopelint + - varcheck + - structcheck + - golint + - nosnakecase diff --git a/vendor/github.com/go-openapi/jsonpointer/README.md b/vendor/github.com/go-openapi/jsonpointer/README.md index 813788aff..0108f1d57 100644 --- a/vendor/github.com/go-openapi/jsonpointer/README.md +++ b/vendor/github.com/go-openapi/jsonpointer/README.md @@ -1,6 +1,10 @@ -# gojsonpointer [![Build Status](https://travis-ci.org/go-openapi/jsonpointer.svg?branch=master)](https://travis-ci.org/go-openapi/jsonpointer) [![codecov](https://codecov.io/gh/go-openapi/jsonpointer/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonpointer) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) +# gojsonpointer [![Build Status](https://github.com/go-openapi/jsonpointer/actions/workflows/go-test.yml/badge.svg)](https://github.com/go-openapi/jsonpointer/actions?query=workflow%3A"go+test") [![codecov](https://codecov.io/gh/go-openapi/jsonpointer/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonpointer) + +[![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) +[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/jsonpointer/master/LICENSE) +[![Go Reference](https://pkg.go.dev/badge/github.com/go-openapi/jsonpointer.svg)](https://pkg.go.dev/github.com/go-openapi/jsonpointer) +[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/jsonpointer)](https://goreportcard.com/report/github.com/go-openapi/jsonpointer) -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/jsonpointer/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/jsonpointer?status.svg)](http://godoc.org/github.com/go-openapi/jsonpointer) An implementation of JSON Pointer - Go language ## Status diff --git a/vendor/github.com/go-openapi/jsonpointer/pointer.go b/vendor/github.com/go-openapi/jsonpointer/pointer.go index de60dc7dd..d975773d4 100644 --- a/vendor/github.com/go-openapi/jsonpointer/pointer.go +++ b/vendor/github.com/go-openapi/jsonpointer/pointer.go @@ -110,19 +110,39 @@ func SetForToken(document any, decodedToken string, value any) (any, error) { return document, setSingleImpl(document, value, decodedToken, swag.DefaultJSONNameProvider) } +func isNil(input any) bool { + if input == nil { + return true + } + + kind := reflect.TypeOf(input).Kind() + switch kind { //nolint:exhaustive + case reflect.Ptr, reflect.Map, reflect.Slice, reflect.Chan: + return reflect.ValueOf(input).IsNil() + default: + return false + } +} + func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvider) (any, reflect.Kind, error) { rValue := reflect.Indirect(reflect.ValueOf(node)) kind := rValue.Kind() + if isNil(node) { + return nil, kind, fmt.Errorf("nil value has not field %q", decodedToken) + } - if rValue.Type().Implements(jsonPointableType) { - r, err := node.(JSONPointable).JSONLookup(decodedToken) + switch typed := node.(type) { + case JSONPointable: + r, err := typed.JSONLookup(decodedToken) if err != nil { return nil, kind, err } return r, kind, nil + case *any: // case of a pointer to interface, that is not resolved by reflect.Indirect + return getSingleImpl(*typed, decodedToken, nameProvider) } - switch kind { + switch kind { //nolint:exhaustive case reflect.Struct: nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) if !ok { @@ -170,7 +190,7 @@ func setSingleImpl(node, data any, decodedToken string, nameProvider *swag.NameP return node.(JSONSetable).JSONSet(decodedToken, data) } - switch rValue.Kind() { + switch rValue.Kind() { //nolint:exhaustive case reflect.Struct: nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) if !ok { @@ -231,8 +251,7 @@ func (p *Pointer) get(node any, nameProvider *swag.NameProvider) (any, reflect.K if err != nil { return nil, knd, err } - node, kind = r, knd - + node = r } rValue := reflect.ValueOf(node) @@ -284,7 +303,7 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error { continue } - switch kind { + switch kind { //nolint:exhaustive case reflect.Struct: nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) if !ok { @@ -405,11 +424,11 @@ func offsetSingleObject(dec *json.Decoder, decodedToken string) (int64, error) { case json.Delim: switch tk { case '{': - if err := drainSingle(dec); err != nil { + if err = drainSingle(dec); err != nil { return 0, err } case '[': - if err := drainSingle(dec); err != nil { + if err = drainSingle(dec); err != nil { return 0, err } } @@ -435,20 +454,21 @@ func offsetSingleArray(dec *json.Decoder, decodedToken string) (int64, error) { if err != nil { return 0, err } - switch tk := tk.(type) { - case json.Delim: - switch tk { + + if delim, isDelim := tk.(json.Delim); isDelim { + switch delim { case '{': - if err := drainSingle(dec); err != nil { + if err = drainSingle(dec); err != nil { return 0, err } case '[': - if err := drainSingle(dec); err != nil { + if err = drainSingle(dec); err != nil { return 0, err } } } } + if !dec.More() { return 0, fmt.Errorf("token reference %q not found", decodedToken) } @@ -456,27 +476,27 @@ func offsetSingleArray(dec *json.Decoder, decodedToken string) (int64, error) { } // drainSingle drains a single level of object or array. -// The decoder has to guarantee the begining delim (i.e. '{' or '[') has been consumed. +// The decoder has to guarantee the beginning delim (i.e. '{' or '[') has been consumed. func drainSingle(dec *json.Decoder) error { for dec.More() { tk, err := dec.Token() if err != nil { return err } - switch tk := tk.(type) { - case json.Delim: - switch tk { + if delim, isDelim := tk.(json.Delim); isDelim { + switch delim { case '{': - if err := drainSingle(dec); err != nil { + if err = drainSingle(dec); err != nil { return err } case '[': - if err := drainSingle(dec); err != nil { + if err = drainSingle(dec); err != nil { return err } } } } + // Consumes the ending delim if _, err := dec.Token(); err != nil { return err @@ -498,14 +518,14 @@ const ( // Unescape unescapes a json pointer reference token string to the original representation func Unescape(token string) string { - step1 := strings.Replace(token, encRefTok1, decRefTok1, -1) - step2 := strings.Replace(step1, encRefTok0, decRefTok0, -1) + step1 := strings.ReplaceAll(token, encRefTok1, decRefTok1) + step2 := strings.ReplaceAll(step1, encRefTok0, decRefTok0) return step2 } // Escape escapes a pointer reference token string func Escape(token string) string { - step1 := strings.Replace(token, decRefTok0, encRefTok0, -1) - step2 := strings.Replace(step1, decRefTok1, encRefTok1, -1) + step1 := strings.ReplaceAll(token, decRefTok0, encRefTok0) + step2 := strings.ReplaceAll(step1, decRefTok1, encRefTok1) return step2 } diff --git a/vendor/github.com/go-openapi/jsonreference/.golangci.yml b/vendor/github.com/go-openapi/jsonreference/.golangci.yml index 013fc1943..22f8d21cc 100644 --- a/vendor/github.com/go-openapi/jsonreference/.golangci.yml +++ b/vendor/github.com/go-openapi/jsonreference/.golangci.yml @@ -1,50 +1,61 @@ linters-settings: govet: check-shadowing: true + golint: + min-confidence: 0 gocyclo: - min-complexity: 30 + min-complexity: 45 maligned: suggest-new: true dupl: - threshold: 100 + threshold: 200 goconst: min-len: 2 - min-occurrences: 4 - paralleltest: - ignore-missing: true + min-occurrences: 3 + linters: enable-all: true disable: - maligned + - unparam - lll + - gochecknoinits - gochecknoglobals + - funlen - godox - gocognit - whitespace - wsl - - funlen - - gochecknoglobals - - gochecknoinits - - scopelint - wrapcheck - - exhaustivestruct - - exhaustive - - nlreturn - testpackage - - gci - - gofumpt - - goerr113 + - nlreturn - gomnd - - tparallel + - exhaustivestruct + - goerr113 + - errorlint - nestif - godot - - errorlint - - varcheck - - interfacer - - deadcode - - golint + - gofumpt + - paralleltest + - tparallel + - thelper - ifshort + - exhaustruct + - varnamelen + - gci + - depguard + - errchkjson + - inamedparam + - nonamedreturns + - musttag + - ireturn + - forcetypeassert + - cyclop + # deprecated linters + - deadcode + - interfacer + - scopelint + - varcheck - structcheck + - golint - nosnakecase - - varnamelen - - exhaustruct diff --git a/vendor/github.com/go-openapi/jsonreference/README.md b/vendor/github.com/go-openapi/jsonreference/README.md index b94753aa5..c7fc2049c 100644 --- a/vendor/github.com/go-openapi/jsonreference/README.md +++ b/vendor/github.com/go-openapi/jsonreference/README.md @@ -1,15 +1,19 @@ -# gojsonreference [![Build Status](https://travis-ci.org/go-openapi/jsonreference.svg?branch=master)](https://travis-ci.org/go-openapi/jsonreference) [![codecov](https://codecov.io/gh/go-openapi/jsonreference/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonreference) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) +# gojsonreference [![Build Status](https://github.com/go-openapi/jsonreference/actions/workflows/go-test.yml/badge.svg)](https://github.com/go-openapi/jsonreference/actions?query=workflow%3A"go+test") [![codecov](https://codecov.io/gh/go-openapi/jsonreference/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonreference) + +[![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) +[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/jsonreference/master/LICENSE) +[![Go Reference](https://pkg.go.dev/badge/github.com/go-openapi/jsonreference.svg)](https://pkg.go.dev/github.com/go-openapi/jsonreference) +[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/jsonreference)](https://goreportcard.com/report/github.com/go-openapi/jsonreference) -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/jsonreference/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/jsonreference?status.svg)](http://godoc.org/github.com/go-openapi/jsonreference) An implementation of JSON Reference - Go language ## Status Feature complete. Stable API ## Dependencies -https://github.com/go-openapi/jsonpointer +* https://github.com/go-openapi/jsonpointer ## References -http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07 -http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03 +* http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07 +* http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03 diff --git a/vendor/github.com/go-openapi/swag/.gitignore b/vendor/github.com/go-openapi/swag/.gitignore index d69b53acc..c4b1b64f0 100644 --- a/vendor/github.com/go-openapi/swag/.gitignore +++ b/vendor/github.com/go-openapi/swag/.gitignore @@ -2,3 +2,4 @@ secrets.yml vendor Godeps .idea +*.out diff --git a/vendor/github.com/go-openapi/swag/.golangci.yml b/vendor/github.com/go-openapi/swag/.golangci.yml index bf503e400..80e2be004 100644 --- a/vendor/github.com/go-openapi/swag/.golangci.yml +++ b/vendor/github.com/go-openapi/swag/.golangci.yml @@ -4,14 +4,14 @@ linters-settings: golint: min-confidence: 0 gocyclo: - min-complexity: 25 + min-complexity: 45 maligned: suggest-new: true dupl: - threshold: 100 + threshold: 200 goconst: min-len: 3 - min-occurrences: 2 + min-occurrences: 3 linters: enable-all: true @@ -20,35 +20,41 @@ linters: - lll - gochecknoinits - gochecknoglobals - - nlreturn - - testpackage + - funlen + - godox + - gocognit + - whitespace + - wsl - wrapcheck + - testpackage + - nlreturn - gomnd - - exhaustive - exhaustivestruct - goerr113 - - wsl - - whitespace - - gofumpt - - godot + - errorlint - nestif - - godox - - funlen - - gci - - gocognit + - godot + - gofumpt - paralleltest + - tparallel - thelper - ifshort - - gomoddirectives - - cyclop - - forcetypeassert - - ireturn - - tagliatelle - - varnamelen - - goimports - - tenv - - golint - exhaustruct - - nilnil + - varnamelen + - gci + - depguard + - errchkjson + - inamedparam - nonamedreturns + - musttag + - ireturn + - forcetypeassert + - cyclop + # deprecated linters + - deadcode + - interfacer + - scopelint + - varcheck + - structcheck + - golint - nosnakecase diff --git a/vendor/github.com/go-openapi/swag/README.md b/vendor/github.com/go-openapi/swag/README.md index 217f6fa50..a72922299 100644 --- a/vendor/github.com/go-openapi/swag/README.md +++ b/vendor/github.com/go-openapi/swag/README.md @@ -1,7 +1,8 @@ -# Swag [![Build Status](https://travis-ci.org/go-openapi/swag.svg?branch=master)](https://travis-ci.org/go-openapi/swag) [![codecov](https://codecov.io/gh/go-openapi/swag/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/swag) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) +# Swag [![Build Status](https://github.com/go-openapi/swag/actions/workflows/go-test.yml/badge.svg)](https://github.com/go-openapi/swag/actions?query=workflow%3A"go+test") [![codecov](https://codecov.io/gh/go-openapi/swag/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/swag) +[![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) [![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/swag/master/LICENSE) -[![GoDoc](https://godoc.org/github.com/go-openapi/swag?status.svg)](http://godoc.org/github.com/go-openapi/swag) +[![Go Reference](https://pkg.go.dev/badge/github.com/go-openapi/swag.svg)](https://pkg.go.dev/github.com/go-openapi/swag) [![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/swag)](https://goreportcard.com/report/github.com/go-openapi/swag) Contains a bunch of helper functions for go-openapi and go-swagger projects. @@ -18,4 +19,5 @@ You may also use it standalone for your projects. This repo has only few dependencies outside of the standard library: -* YAML utilities depend on gopkg.in/yaml.v2 +* YAML utilities depend on `gopkg.in/yaml.v3` +* `github.com/mailru/easyjson v0.7.7` diff --git a/vendor/github.com/go-openapi/swag/post_go19.go b/vendor/github.com/go-openapi/swag/initialism_index.go similarity index 98% rename from vendor/github.com/go-openapi/swag/post_go19.go rename to vendor/github.com/go-openapi/swag/initialism_index.go index 7c7da9c08..03555184d 100644 --- a/vendor/github.com/go-openapi/swag/post_go19.go +++ b/vendor/github.com/go-openapi/swag/initialism_index.go @@ -12,9 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build go1.9 -// +build go1.9 - package swag import ( diff --git a/vendor/github.com/go-openapi/swag/loading.go b/vendor/github.com/go-openapi/swag/loading.go index 00038c377..783442fdd 100644 --- a/vendor/github.com/go-openapi/swag/loading.go +++ b/vendor/github.com/go-openapi/swag/loading.go @@ -21,6 +21,7 @@ import ( "net/http" "net/url" "os" + "path" "path/filepath" "runtime" "strings" @@ -40,43 +41,97 @@ var LoadHTTPBasicAuthPassword = "" var LoadHTTPCustomHeaders = map[string]string{} // LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the path passed in -func LoadFromFileOrHTTP(path string) ([]byte, error) { - return LoadStrategy(path, os.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(path) +func LoadFromFileOrHTTP(pth string) ([]byte, error) { + return LoadStrategy(pth, os.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(pth) } // LoadFromFileOrHTTPWithTimeout loads the bytes from a file or a remote http server based on the path passed in // timeout arg allows for per request overriding of the request timeout -func LoadFromFileOrHTTPWithTimeout(path string, timeout time.Duration) ([]byte, error) { - return LoadStrategy(path, os.ReadFile, loadHTTPBytes(timeout))(path) +func LoadFromFileOrHTTPWithTimeout(pth string, timeout time.Duration) ([]byte, error) { + return LoadStrategy(pth, os.ReadFile, loadHTTPBytes(timeout))(pth) } -// LoadStrategy returns a loader function for a given path or uri -func LoadStrategy(path string, local, remote func(string) ([]byte, error)) func(string) ([]byte, error) { - if strings.HasPrefix(path, "http") { +// LoadStrategy returns a loader function for a given path or URI. +// +// The load strategy returns the remote load for any path starting with `http`. +// So this works for any URI with a scheme `http` or `https`. +// +// The fallback strategy is to call the local loader. +// +// The local loader takes a local file system path (absolute or relative) as argument, +// or alternatively a `file://...` URI, **without host** (see also below for windows). +// +// There are a few liberalities, initially intended to be tolerant regarding the URI syntax, +// especially on windows. +// +// Before the local loader is called, the given path is transformed: +// - percent-encoded characters are unescaped +// - simple paths (e.g. `./folder/file`) are passed as-is +// - on windows, occurrences of `/` are replaced by `\`, so providing a relative path such a `folder/file` works too. +// +// For paths provided as URIs with the "file" scheme, please note that: +// - `file://` is simply stripped. +// This means that the host part of the URI is not parsed at all. +// For example, `file:///folder/file" becomes "/folder/file`, +// but `file://localhost/folder/file` becomes `localhost/folder/file` on unix systems. +// Similarly, `file://./folder/file` yields `./folder/file`. +// - on windows, `file://...` can take a host so as to specify an UNC share location. +// +// Reminder about windows-specifics: +// - `file://host/folder/file` becomes an UNC path like `\\host\folder\file` (no port specification is supported) +// - `file:///c:/folder/file` becomes `C:\folder\file` +// - `file://c:/folder/file` is tolerated (without leading `/`) and becomes `c:\folder\file` +func LoadStrategy(pth string, local, remote func(string) ([]byte, error)) func(string) ([]byte, error) { + if strings.HasPrefix(pth, "http") { return remote } - return func(pth string) ([]byte, error) { - upth, err := pathUnescape(pth) + + return func(p string) ([]byte, error) { + upth, err := url.PathUnescape(p) if err != nil { return nil, err } - if strings.HasPrefix(pth, `file://`) { - if runtime.GOOS == "windows" { - // support for canonical file URIs on windows. - // Zero tolerance here for dodgy URIs. - u, _ := url.Parse(upth) - if u.Host != "" { - // assume UNC name (volume share) - // file://host/share/folder\... ==> \\host\share\path\folder - // NOTE: UNC port not yet supported - upth = strings.Join([]string{`\`, u.Host, u.Path}, `\`) - } else { - // file:///c:/folder/... ==> just remove the leading slash - upth = strings.TrimPrefix(upth, `file:///`) - } - } else { - upth = strings.TrimPrefix(upth, `file://`) + if !strings.HasPrefix(p, `file://`) { + // regular file path provided: just normalize slashes + return local(filepath.FromSlash(upth)) + } + + if runtime.GOOS != "windows" { + // crude processing: this leaves full URIs with a host with a (mostly) unexpected result + upth = strings.TrimPrefix(upth, `file://`) + + return local(filepath.FromSlash(upth)) + } + + // windows-only pre-processing of file://... URIs + + // support for canonical file URIs on windows. + u, err := url.Parse(filepath.ToSlash(upth)) + if err != nil { + return nil, err + } + + if u.Host != "" { + // assume UNC name (volume share) + // NOTE: UNC port not yet supported + + // when the "host" segment is a drive letter: + // file://C:/folder/... => C:\folder + upth = path.Clean(strings.Join([]string{u.Host, u.Path}, `/`)) + if !strings.HasSuffix(u.Host, ":") && u.Host[0] != '.' { + // tolerance: if we have a leading dot, this can't be a host + // file://host/share/folder\... ==> \\host\share\path\folder + upth = "//" + upth + } + } else { + // no host, let's figure out if this is a drive letter + upth = strings.TrimPrefix(upth, `file://`) + first, _, _ := strings.Cut(strings.TrimPrefix(u.Path, "/"), "/") + if strings.HasSuffix(first, ":") { + // drive letter in the first segment: + // file:///c:/folder/... ==> strip the leading slash + upth = strings.TrimPrefix(upth, `/`) } } diff --git a/vendor/github.com/go-openapi/swag/post_go18.go b/vendor/github.com/go-openapi/swag/post_go18.go deleted file mode 100644 index f5228b82c..000000000 --- a/vendor/github.com/go-openapi/swag/post_go18.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build go1.8 -// +build go1.8 - -package swag - -import "net/url" - -func pathUnescape(path string) (string, error) { - return url.PathUnescape(path) -} diff --git a/vendor/github.com/go-openapi/swag/pre_go18.go b/vendor/github.com/go-openapi/swag/pre_go18.go deleted file mode 100644 index 2757d9b95..000000000 --- a/vendor/github.com/go-openapi/swag/pre_go18.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !go1.8 -// +build !go1.8 - -package swag - -import "net/url" - -func pathUnescape(path string) (string, error) { - return url.QueryUnescape(path) -} diff --git a/vendor/github.com/go-openapi/swag/pre_go19.go b/vendor/github.com/go-openapi/swag/pre_go19.go deleted file mode 100644 index 0565db377..000000000 --- a/vendor/github.com/go-openapi/swag/pre_go19.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !go1.9 -// +build !go1.9 - -package swag - -import ( - "sort" - "sync" -) - -// indexOfInitialisms is a thread-safe implementation of the sorted index of initialisms. -// Before go1.9, this may be implemented with a mutex on the map. -type indexOfInitialisms struct { - getMutex *sync.Mutex - index map[string]bool -} - -func newIndexOfInitialisms() *indexOfInitialisms { - return &indexOfInitialisms{ - getMutex: new(sync.Mutex), - index: make(map[string]bool, 50), - } -} - -func (m *indexOfInitialisms) load(initial map[string]bool) *indexOfInitialisms { - m.getMutex.Lock() - defer m.getMutex.Unlock() - for k, v := range initial { - m.index[k] = v - } - return m -} - -func (m *indexOfInitialisms) isInitialism(key string) bool { - m.getMutex.Lock() - defer m.getMutex.Unlock() - _, ok := m.index[key] - return ok -} - -func (m *indexOfInitialisms) add(key string) *indexOfInitialisms { - m.getMutex.Lock() - defer m.getMutex.Unlock() - m.index[key] = true - return m -} - -func (m *indexOfInitialisms) sorted() (result []string) { - m.getMutex.Lock() - defer m.getMutex.Unlock() - for k := range m.index { - result = append(result, k) - } - sort.Sort(sort.Reverse(byInitialism(result))) - return -} diff --git a/vendor/github.com/go-openapi/swag/util.go b/vendor/github.com/go-openapi/swag/util.go index d971fbe34..0413f7447 100644 --- a/vendor/github.com/go-openapi/swag/util.go +++ b/vendor/github.com/go-openapi/swag/util.go @@ -174,7 +174,7 @@ func (s byInitialism) Less(i, j int) bool { // Removes leading whitespaces func trim(str string) string { - return strings.Trim(str, " ") + return strings.TrimSpace(str) } // Shortcut to strings.ToUpper() @@ -231,7 +231,7 @@ func ToHumanNameLower(name string) string { if !w.IsInitialism() { out = append(out, lower(w.GetOriginal())) } else { - out = append(out, w.GetOriginal()) + out = append(out, trim(w.GetOriginal())) } } @@ -244,7 +244,7 @@ func ToHumanNameTitle(name string) string { out := make([]string, 0, len(in)) for _, w := range in { - original := w.GetOriginal() + original := trim(w.GetOriginal()) if !w.IsInitialism() { out = append(out, Camelize(original)) } else { @@ -264,7 +264,7 @@ func ToJSONName(name string) string { out = append(out, lower(w)) continue } - out = append(out, Camelize(w)) + out = append(out, Camelize(trim(w))) } return strings.Join(out, "") } @@ -343,7 +343,7 @@ type zeroable interface { func IsZero(data interface{}) bool { v := reflect.ValueOf(data) // check for nil data - switch v.Kind() { + switch v.Kind() { //nolint:exhaustive case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: if v.IsNil() { return true @@ -356,7 +356,7 @@ func IsZero(data interface{}) bool { } // continue with slightly more complex reflection - switch v.Kind() { + switch v.Kind() { //nolint:exhaustive case reflect.String: return v.Len() == 0 case reflect.Bool: diff --git a/vendor/github.com/go-openapi/swag/yaml.go b/vendor/github.com/go-openapi/swag/yaml.go index f09ee609f..a8c4e359e 100644 --- a/vendor/github.com/go-openapi/swag/yaml.go +++ b/vendor/github.com/go-openapi/swag/yaml.go @@ -18,6 +18,8 @@ import ( "encoding/json" "fmt" "path/filepath" + "reflect" + "sort" "strconv" "github.com/mailru/easyjson/jlexer" @@ -147,7 +149,7 @@ func yamlScalar(node *yaml.Node) (interface{}, error) { case yamlTimestamp: return node.Value, nil case yamlNull: - return nil, nil + return nil, nil //nolint:nilnil default: return nil, fmt.Errorf("YAML tag %q is not supported", node.LongTag()) } @@ -245,7 +247,27 @@ func (s JSONMapSlice) MarshalYAML() (interface{}, error) { return yaml.Marshal(&n) } +func isNil(input interface{}) bool { + if input == nil { + return true + } + kind := reflect.TypeOf(input).Kind() + switch kind { //nolint:exhaustive + case reflect.Ptr, reflect.Map, reflect.Slice, reflect.Chan: + return reflect.ValueOf(input).IsNil() + default: + return false + } +} + func json2yaml(item interface{}) (*yaml.Node, error) { + if isNil(item) { + return &yaml.Node{ + Kind: yaml.ScalarNode, + Value: "null", + }, nil + } + switch val := item.(type) { case JSONMapSlice: var n yaml.Node @@ -265,7 +287,14 @@ func json2yaml(item interface{}) (*yaml.Node, error) { case map[string]interface{}: var n yaml.Node n.Kind = yaml.MappingNode - for k, v := range val { + keys := make([]string, 0, len(val)) + for k := range val { + keys = append(keys, k) + } + sort.Strings(keys) + + for _, k := range keys { + v := val[k] childNode, err := json2yaml(v) if err != nil { return nil, err @@ -318,8 +347,9 @@ func json2yaml(item interface{}) (*yaml.Node, error) { Tag: yamlBoolScalar, Value: strconv.FormatBool(val), }, nil + default: + return nil, fmt.Errorf("unhandled type: %T", val) } - return nil, nil } // JSONMapItem represents the value of a key in a JSON object held by JSONMapSlice diff --git a/vendor/k8s.io/code-generator/generate-internal-groups.sh b/vendor/k8s.io/code-generator/generate-internal-groups.sh index 9676fac31..415b0b67c 100644 --- a/vendor/k8s.io/code-generator/generate-internal-groups.sh +++ b/vendor/k8s.io/code-generator/generate-internal-groups.sh @@ -55,6 +55,12 @@ echo "WARNING: $(basename "$0") is deprecated." echo "WARNING: Please use k8s.io/code-generator/kube_codegen.sh instead." echo +# If verification only is requested, avoid deleting files +verify_only="" +for ((i = 1; i <= $#; i++)); do + if [ "${!i}" = --verify-only ]; then verify_only=1; fi +done + if [ "${GENS}" = "all" ] || grep -qw "all" <<<"${GENS}"; then ALL="client,conversion,deepcopy,defaulter,informer,lister,openapi" echo "WARNING: Specifying \"all\" as a generator is deprecated." @@ -124,12 +130,14 @@ CLIENTSET_PKG="${CLIENTSET_PKG_NAME:-clientset}" CLIENTSET_NAME="${CLIENTSET_NAME_VERSIONED:-versioned}" if grep -qw "deepcopy" <<<"${GENS}"; then - # Nuke existing files - for dir in $(GO111MODULE=on go list -f '{{.Dir}}' "${ALL_FQ_APIS[@]}"); do - pushd "${dir}" >/dev/null - git_find -z ':(glob)**'/zz_generated.deepcopy.go | xargs -0 rm -f - popd >/dev/null - done + if [ ! "$verify_only" ]; then + # Nuke existing files + for dir in $(GO111MODULE=on go list -f '{{.Dir}}' "${ALL_FQ_APIS[@]}"); do + pushd "${dir}" >/dev/null + git_find -z ':(glob)**'/zz_generated.deepcopy.go | xargs -0 rm -f + popd >/dev/null + done + fi echo "Generating deepcopy funcs" "${gobin}/deepcopy-gen" \ @@ -139,12 +147,14 @@ if grep -qw "deepcopy" <<<"${GENS}"; then fi if grep -qw "defaulter" <<<"${GENS}"; then - # Nuke existing files - for dir in $(GO111MODULE=on go list -f '{{.Dir}}' "${ALL_FQ_APIS[@]}"); do - pushd "${dir}" >/dev/null - git_find -z ':(glob)**'/zz_generated.defaults.go | xargs -0 rm -f - popd >/dev/null - done + if [ ! "$verify_only" ]; then + # Nuke existing files + for dir in $(GO111MODULE=on go list -f '{{.Dir}}' "${ALL_FQ_APIS[@]}"); do + pushd "${dir}" >/dev/null + git_find -z ':(glob)**'/zz_generated.defaults.go | xargs -0 rm -f + popd >/dev/null + done + fi echo "Generating defaulters" "${gobin}/defaulter-gen" \ @@ -154,12 +164,14 @@ if grep -qw "defaulter" <<<"${GENS}"; then fi if grep -qw "conversion" <<<"${GENS}"; then - # Nuke existing files - for dir in $(GO111MODULE=on go list -f '{{.Dir}}' "${ALL_FQ_APIS[@]}"); do - pushd "${dir}" >/dev/null - git_find -z ':(glob)**'/zz_generated.conversion.go | xargs -0 rm -f - popd >/dev/null - done + if [ ! "$verify_only" ]; then + # Nuke existing files + for dir in $(GO111MODULE=on go list -f '{{.Dir}}' "${ALL_FQ_APIS[@]}"); do + pushd "${dir}" >/dev/null + git_find -z ':(glob)**'/zz_generated.conversion.go | xargs -0 rm -f + popd >/dev/null + done + fi echo "Generating conversions" "${gobin}/conversion-gen" \ @@ -171,15 +183,17 @@ fi if grep -qw "applyconfiguration" <<<"${GENS}"; then APPLY_CONFIGURATION_PACKAGE="${OUTPUT_PKG}/${APPLYCONFIGURATION_PKG_NAME:-applyconfiguration}" - # Nuke existing files - root="$(GO111MODULE=on go list -f '{{.Dir}}' "${APPLY_CONFIGURATION_PACKAGE}" 2>/dev/null || true)" - if [ -n "${root}" ]; then - pushd "${root}" >/dev/null - git_grep -l --null \ - -e '^// Code generated by applyconfiguration-gen. DO NOT EDIT.$' \ - ':(glob)**/*.go' \ - | xargs -0 rm -f - popd >/dev/null + if [ ! "$verify_only" ]; then + # Nuke existing files + root="$(GO111MODULE=on go list -f '{{.Dir}}' "${APPLY_CONFIGURATION_PACKAGE}" 2>/dev/null || true)" + if [ -n "${root}" ]; then + pushd "${root}" >/dev/null + git_grep -l --null \ + -e '^// Code generated by applyconfiguration-gen. DO NOT EDIT.$' \ + ':(glob)**/*.go' \ + | xargs -0 rm -f + popd >/dev/null + fi fi echo "Generating apply configuration for ${GROUPS_WITH_VERSIONS} at ${APPLY_CONFIGURATION_PACKAGE}" @@ -190,15 +204,17 @@ if grep -qw "applyconfiguration" <<<"${GENS}"; then fi if grep -qw "client" <<<"${GENS}"; then - # Nuke existing files - root="$(GO111MODULE=on go list -f '{{.Dir}}' "${OUTPUT_PKG}/${CLIENTSET_PKG}/${CLIENTSET_NAME}" 2>/dev/null || true)" - if [ -n "${root}" ]; then - pushd "${root}" >/dev/null - git_grep -l --null \ - -e '^// Code generated by client-gen. DO NOT EDIT.$' \ - ':(glob)**/*.go' \ - | xargs -0 rm -f - popd >/dev/null + if [ ! "$verify_only" ]; then + # Nuke existing files + root="$(GO111MODULE=on go list -f '{{.Dir}}' "${OUTPUT_PKG}/${CLIENTSET_PKG}/${CLIENTSET_NAME}" 2>/dev/null || true)" + if [ -n "${root}" ]; then + pushd "${root}" >/dev/null + git_grep -l --null \ + -e '^// Code generated by client-gen. DO NOT EDIT.$' \ + ':(glob)**/*.go' \ + | xargs -0 rm -f + popd >/dev/null + fi fi echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG}" @@ -212,18 +228,20 @@ if grep -qw "client" <<<"${GENS}"; then fi if grep -qw "lister" <<<"${GENS}"; then - # Nuke existing files - for gv in "${GROUP_VERSIONS[@]}"; do - root="$(GO111MODULE=on go list -f '{{.Dir}}' "${OUTPUT_PKG}/listers/${gv}" 2>/dev/null || true)" - if [ -n "${root}" ]; then - pushd "${root}" >/dev/null - git_grep -l --null \ - -e '^// Code generated by lister-gen. DO NOT EDIT.$' \ - ':(glob)**/*.go' \ - | xargs -0 rm -f - popd >/dev/null - fi - done + if [ ! "$verify_only" ]; then + # Nuke existing files + for gv in "${GROUP_VERSIONS[@]}"; do + root="$(GO111MODULE=on go list -f '{{.Dir}}' "${OUTPUT_PKG}/listers/${gv}" 2>/dev/null || true)" + if [ -n "${root}" ]; then + pushd "${root}" >/dev/null + git_grep -l --null \ + -e '^// Code generated by lister-gen. DO NOT EDIT.$' \ + ':(glob)**/*.go' \ + | xargs -0 rm -f + popd >/dev/null + fi + done + fi echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers" "${gobin}/lister-gen" \ @@ -233,15 +251,17 @@ if grep -qw "lister" <<<"${GENS}"; then fi if grep -qw "informer" <<<"${GENS}"; then - # Nuke existing files - root="$(GO111MODULE=on go list -f '{{.Dir}}' "${OUTPUT_PKG}/informers/externalversions" 2>/dev/null || true)" - if [ -n "${root}" ]; then - pushd "${root}" >/dev/null - git_grep -l --null \ - -e '^// Code generated by informer-gen. DO NOT EDIT.$' \ - ':(glob)**/*.go' \ - | xargs -0 rm -f - popd >/dev/null + if [ ! "$verify_only" ]; then + # Nuke existing files + root="$(GO111MODULE=on go list -f '{{.Dir}}' "${OUTPUT_PKG}/informers/externalversions" 2>/dev/null || true)" + if [ -n "${root}" ]; then + pushd "${root}" >/dev/null + git_grep -l --null \ + -e '^// Code generated by informer-gen. DO NOT EDIT.$' \ + ':(glob)**/*.go' \ + | xargs -0 rm -f + popd >/dev/null + fi fi echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers" @@ -254,12 +274,14 @@ if grep -qw "informer" <<<"${GENS}"; then fi if grep -qw "openapi" <<<"${GENS}"; then - # Nuke existing files - for dir in $(GO111MODULE=on go list -f '{{.Dir}}' "${FQ_APIS[@]}"); do - pushd "${dir}" >/dev/null - git_find -z ':(glob)**'/zz_generated.openapi.go | xargs -0 rm -f - popd >/dev/null - done + if [ ! "$verify_only" ]; then + # Nuke existing files + for dir in $(GO111MODULE=on go list -f '{{.Dir}}' "${FQ_APIS[@]}"); do + pushd "${dir}" >/dev/null + git_find -z ':(glob)**'/zz_generated.openapi.go | xargs -0 rm -f + popd >/dev/null + done + fi echo "Generating OpenAPI definitions for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/openapi" declare -a OPENAPI_EXTRA_PACKAGES diff --git a/vendor/k8s.io/kube-openapi/pkg/common/common.go b/vendor/k8s.io/kube-openapi/pkg/common/common.go index 2e15e163c..e4ce843b0 100644 --- a/vendor/k8s.io/kube-openapi/pkg/common/common.go +++ b/vendor/k8s.io/kube-openapi/pkg/common/common.go @@ -164,6 +164,9 @@ type OpenAPIV3Config struct { // It is an optional function to customize model names. GetDefinitionName func(name string) (string, spec.Extensions) + // PostProcessSpec runs after the spec is ready to serve. It allows a final modification to the spec before serving. + PostProcessSpec func(*spec3.OpenAPI) (*spec3.OpenAPI, error) + // SecuritySchemes is list of all security schemes for OpenAPI service. SecuritySchemes spec3.SecuritySchemes diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/markers.go b/vendor/k8s.io/kube-openapi/pkg/generators/markers.go new file mode 100644 index 000000000..9294728ce --- /dev/null +++ b/vendor/k8s.io/kube-openapi/pkg/generators/markers.go @@ -0,0 +1,345 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "encoding/json" + "errors" + "fmt" + "regexp" + "strconv" + "strings" + + defaultergen "k8s.io/gengo/examples/defaulter-gen/generators" + "k8s.io/gengo/types" + openapi "k8s.io/kube-openapi/pkg/common" + "k8s.io/kube-openapi/pkg/validation/spec" +) + +// CommentTags represents the parsed comment tags for a given type. These types are then used to generate schema validations. +type CommentTags struct { + spec.SchemaProps + + // Future markers can all be parsed into this centralized struct... + // Optional bool `json:"optional,omitempty"` + // Default any `json:"default,omitempty"` +} + +// validates the parameters in a CommentTags instance. Returns any errors encountered. +func (c CommentTags) Validate() error { + + var err error + + if c.MinLength != nil && *c.MinLength < 0 { + err = errors.Join(err, fmt.Errorf("minLength cannot be negative")) + } + if c.MaxLength != nil && *c.MaxLength < 0 { + err = errors.Join(err, fmt.Errorf("maxLength cannot be negative")) + } + if c.MinItems != nil && *c.MinItems < 0 { + err = errors.Join(err, fmt.Errorf("minItems cannot be negative")) + } + if c.MaxItems != nil && *c.MaxItems < 0 { + err = errors.Join(err, fmt.Errorf("maxItems cannot be negative")) + } + if c.MinProperties != nil && *c.MinProperties < 0 { + err = errors.Join(err, fmt.Errorf("minProperties cannot be negative")) + } + if c.MaxProperties != nil && *c.MaxProperties < 0 { + err = errors.Join(err, fmt.Errorf("maxProperties cannot be negative")) + } + if c.Minimum != nil && c.Maximum != nil && *c.Minimum > *c.Maximum { + err = errors.Join(err, fmt.Errorf("minimum %f is greater than maximum %f", *c.Minimum, *c.Maximum)) + } + if (c.ExclusiveMinimum || c.ExclusiveMaximum) && c.Minimum != nil && c.Maximum != nil && *c.Minimum == *c.Maximum { + err = errors.Join(err, fmt.Errorf("exclusiveMinimum/Maximum cannot be set when minimum == maximum")) + } + if c.MinLength != nil && c.MaxLength != nil && *c.MinLength > *c.MaxLength { + err = errors.Join(err, fmt.Errorf("minLength %d is greater than maxLength %d", *c.MinLength, *c.MaxLength)) + } + if c.MinItems != nil && c.MaxItems != nil && *c.MinItems > *c.MaxItems { + err = errors.Join(err, fmt.Errorf("minItems %d is greater than maxItems %d", *c.MinItems, *c.MaxItems)) + } + if c.MinProperties != nil && c.MaxProperties != nil && *c.MinProperties > *c.MaxProperties { + err = errors.Join(err, fmt.Errorf("minProperties %d is greater than maxProperties %d", *c.MinProperties, *c.MaxProperties)) + } + if c.Pattern != "" { + _, e := regexp.Compile(c.Pattern) + if e != nil { + err = errors.Join(err, fmt.Errorf("invalid pattern %q: %v", c.Pattern, e)) + } + } + if c.MultipleOf != nil && *c.MultipleOf == 0 { + err = errors.Join(err, fmt.Errorf("multipleOf cannot be 0")) + } + + return err +} + +// Performs type-specific validation for CommentTags porameters. Accepts a Type instance and returns any errors encountered during validation. +func (c CommentTags) ValidateType(t *types.Type) error { + var err error + + resolvedType := resolveAliasAndPtrType(t) + typeString, _ := openapi.OpenAPITypeFormat(resolvedType.String()) // will be empty for complicated types + isNoValidate := resolvedType.Kind == types.Interface || resolvedType.Kind == types.Struct + + if !isNoValidate { + + isArray := resolvedType.Kind == types.Slice || resolvedType.Kind == types.Array + isMap := resolvedType.Kind == types.Map + isString := typeString == "string" + isInt := typeString == "integer" + isFloat := typeString == "number" + + if c.MaxItems != nil && !isArray { + err = errors.Join(err, fmt.Errorf("maxItems can only be used on array types")) + } + if c.MinItems != nil && !isArray { + err = errors.Join(err, fmt.Errorf("minItems can only be used on array types")) + } + if c.UniqueItems && !isArray { + err = errors.Join(err, fmt.Errorf("uniqueItems can only be used on array types")) + } + if c.MaxProperties != nil && !isMap { + err = errors.Join(err, fmt.Errorf("maxProperties can only be used on map types")) + } + if c.MinProperties != nil && !isMap { + err = errors.Join(err, fmt.Errorf("minProperties can only be used on map types")) + } + if c.MinLength != nil && !isString { + err = errors.Join(err, fmt.Errorf("minLength can only be used on string types")) + } + if c.MaxLength != nil && !isString { + err = errors.Join(err, fmt.Errorf("maxLength can only be used on string types")) + } + if c.Pattern != "" && !isString { + err = errors.Join(err, fmt.Errorf("pattern can only be used on string types")) + } + if c.Minimum != nil && !isInt && !isFloat { + err = errors.Join(err, fmt.Errorf("minimum can only be used on numeric types")) + } + if c.Maximum != nil && !isInt && !isFloat { + err = errors.Join(err, fmt.Errorf("maximum can only be used on numeric types")) + } + if c.MultipleOf != nil && !isInt && !isFloat { + err = errors.Join(err, fmt.Errorf("multipleOf can only be used on numeric types")) + } + if c.ExclusiveMinimum && !isInt && !isFloat { + err = errors.Join(err, fmt.Errorf("exclusiveMinimum can only be used on numeric types")) + } + if c.ExclusiveMaximum && !isInt && !isFloat { + err = errors.Join(err, fmt.Errorf("exclusiveMaximum can only be used on numeric types")) + } + } + + return err +} + +// Parses the given comments into a CommentTags type. Validates the parsed comment tags, and returns the result. +// Accepts an optional type to validate against, and a prefix to filter out markers not related to validation. +// Accepts a prefix to filter out markers not related to validation. +// Returns any errors encountered while parsing or validating the comment tags. +func ParseCommentTags(t *types.Type, comments []string, prefix string) (CommentTags, error) { + + markers, err := parseMarkers(comments, prefix) + if err != nil { + return CommentTags{}, fmt.Errorf("failed to parse marker comments: %w", err) + } + nested, err := nestMarkers(markers) + if err != nil { + return CommentTags{}, fmt.Errorf("invalid marker comments: %w", err) + } + + // Parse the map into a CommentTags type by marshalling and unmarshalling + // as JSON in leiu of an unstructured converter. + out, err := json.Marshal(nested) + if err != nil { + return CommentTags{}, fmt.Errorf("failed to marshal marker comments: %w", err) + } + + var commentTags CommentTags + if err = json.Unmarshal(out, &commentTags); err != nil { + return CommentTags{}, fmt.Errorf("failed to unmarshal marker comments: %w", err) + } + + // Validate the parsed comment tags + validationErrors := commentTags.Validate() + + if t != nil { + validationErrors = errors.Join(validationErrors, commentTags.ValidateType(t)) + } + + if validationErrors != nil { + return CommentTags{}, fmt.Errorf("invalid marker comments: %w", validationErrors) + } + + return commentTags, nil +} + +// Extracts and parses the given marker comments into a map of key -> value. +// Accepts a prefix to filter out markers not related to validation. +// The prefix is removed from the key in the returned map. +// Empty keys and invalid values will return errors, refs are currently unsupported and will be skipped. +func parseMarkers(markerComments []string, prefix string) (map[string]any, error) { + markers := types.ExtractCommentTags("+", markerComments) + + // Parse the values as JSON + result := map[string]any{} + for key, value := range markers { + if !strings.HasPrefix(key, prefix) { + // we only care about validation markers for now + continue + } + + newKey := strings.TrimPrefix(key, prefix) + + // Skip ref markers + if len(value) == 1 { + _, ok := defaultergen.ParseSymbolReference(value[0], "") + if ok { + continue + } + } + if len(newKey) == 0 { + return nil, fmt.Errorf("cannot have empty key for marker comment") + } else if len(value) == 0 || (len(value) == 1 && len(value[0]) == 0) { + // Empty value means key is implicitly a bool + result[newKey] = true + continue + } + + newVal := []any{} + for _, v := range value { + var unmarshalled interface{} + err := json.Unmarshal([]byte(v), &unmarshalled) + if err != nil { + return nil, fmt.Errorf("invalid value for key %v: %w", key, err) + } + + newVal = append(newVal, unmarshalled) + } + + if len(newVal) == 1 { + result[newKey] = newVal[0] + } else { + result[newKey] = newVal + } + } + return result, nil +} + +// Converts a map of: +// +// "a:b:c": 1 +// "a:b:d": 2 +// "a:e": 3 +// "f": 4 +// +// Into: +// +// map[string]any{ +// "a": map[string]any{ +// "b": map[string]any{ +// "c": 1, +// "d": 2, +// }, +// "e": 3, +// }, +// "f": 4, +// } +// +// Returns a list of joined errors for any invalid keys. See putNestedValue for more details. +func nestMarkers(markers map[string]any) (map[string]any, error) { + nested := make(map[string]any) + var errs []error + for key, value := range markers { + var err error + keys := strings.Split(key, ":") + nested, err = putNestedValue(nested, keys, value) + if err != nil { + errs = append(errs, err) + } + } + + if len(errs) > 0 { + return nil, errors.Join(errs...) + } + + return nested, nil +} + +// Recursively puts a value into the given keypath, creating intermediate maps +// and slices as needed. If a key is of the form `foo[bar]`, then bar will be +// treated as an index into the array foo. If bar is not a valid integer, putNestedValue returns an error. +func putNestedValue(m map[string]any, k []string, v any) (map[string]any, error) { + if len(k) == 0 { + return m, nil + } + + key := k[0] + rest := k[1:] + + if idxIdx := strings.Index(key, "["); idxIdx > -1 { + key := key[:idxIdx] + index, err := strconv.Atoi(strings.Split(key[idxIdx+1:], "]")[0]) + if err != nil { + // Ignore key + return nil, fmt.Errorf("expected integer index in key %v, got %v", key, key[idxIdx+1:]) + } + + var arrayDestination []any + if existing, ok := m[key]; !ok { + arrayDestination = make([]any, index+1) + } else { + // Ensure array is big enough + arrayDestination = append(existing.([]any), make([]any, index-len(existing.([]any))+1)...) + } + + m[key] = arrayDestination + if arrayDestination[index] == nil { + // Doesn't exist case + destination := make(map[string]any) + arrayDestination[index] = destination + return putNestedValue(destination, rest, v) + } else if dst, ok := arrayDestination[index].(map[string]any); ok { + // Already exists case, correct type + return putNestedValue(dst, rest, v) + } + + // Already exists, incorrect type. Error + // This can happen if you referred to this field without the [] in + // a past comment + return m, nil + } else if len(rest) == 0 { + // Base case. Single key. Just set into destination + m[key] = v + return m, nil + } + + if existing, ok := m[key]; !ok { + destination := make(map[string]any) + m[key] = destination + return putNestedValue(destination, rest, v) + } else if destination, ok := existing.(map[string]any); ok { + return putNestedValue(destination, rest, v) + } else { + // Error case. Existing isn't of correct type. Can happen if prior comment + // referred to value as an error + return nil, fmt.Errorf("expected map[string]any at key %v, got %T", key, existing) + } +} diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go b/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go index a4bbe8b5e..9980a15d4 100644 --- a/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go +++ b/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go @@ -31,12 +31,14 @@ import ( "k8s.io/gengo/namer" "k8s.io/gengo/types" openapi "k8s.io/kube-openapi/pkg/common" + "k8s.io/kube-openapi/pkg/validation/spec" "k8s.io/klog/v2" ) // This is the comment tag that carries parameters for open API generation. const tagName = "k8s:openapi-gen" +const markerPrefix = "k8s:validation:" const tagOptional = "optional" const tagDefault = "default" @@ -353,10 +355,75 @@ func (g openAPITypeWriter) generateCall(t *types.Type) error { return g.Error() } +func (g openAPITypeWriter) generateValueValidations(vs *spec.SchemaProps) error { + + if vs == nil { + return nil + } + args := generator.Args{ + "ptrTo": &types.Type{ + Name: types.Name{ + Package: "k8s.io/utils/ptr", + Name: "To", + }}, + "spec": vs, + } + if vs.Minimum != nil { + g.Do("Minimum: $.ptrTo|raw$[float64]($.spec.Minimum$),\n", args) + } + if vs.Maximum != nil { + g.Do("Maximum: $.ptrTo|raw$[float64]($.spec.Maximum$),\n", args) + } + if vs.ExclusiveMinimum { + g.Do("ExclusiveMinimum: true,\n", args) + } + if vs.ExclusiveMaximum { + g.Do("ExclusiveMaximum: true,\n", args) + } + if vs.MinLength != nil { + g.Do("MinLength: $.ptrTo|raw$[int64]($.spec.MinLength$),\n", args) + } + if vs.MaxLength != nil { + g.Do("MaxLength: $.ptrTo|raw$[int64]($.spec.MaxLength$),\n", args) + } + + if vs.MinProperties != nil { + g.Do("MinProperties: $.ptrTo|raw$[int64]($.spec.MinProperties$),\n", args) + } + if vs.MaxProperties != nil { + g.Do("MaxProperties: $.ptrTo|raw$[int64]($.spec.MaxProperties$),\n", args) + } + if len(vs.Pattern) > 0 { + p, err := json.Marshal(vs.Pattern) + if err != nil { + return err + } + g.Do("Pattern: $.$,\n", string(p)) + } + if vs.MultipleOf != nil { + g.Do("MultipleOf: $.ptrTo|raw$[float64]($.spec.MultipleOf$),\n", args) + } + if vs.MinItems != nil { + g.Do("MinItems: $.ptrTo|raw$[int64]($.spec.MinItems$),\n", args) + } + if vs.MaxItems != nil { + g.Do("MaxItems: $.ptrTo|raw$[int64]($.spec.MaxItems$),\n", args) + } + if vs.UniqueItems { + g.Do("UniqueItems: true,\n", nil) + } + return nil +} + func (g openAPITypeWriter) generate(t *types.Type) error { // Only generate for struct type and ignore the rest switch t.Kind { case types.Struct: + overrides, err := ParseCommentTags(t, t.CommentLines, markerPrefix) + if err != nil { + return err + } + hasV2Definition := hasOpenAPIDefinitionMethod(t) hasV2DefinitionTypeAndFormat := hasOpenAPIDefinitionMethods(t) hasV3OneOfTypes := hasOpenAPIV3OneOfMethod(t) @@ -376,8 +443,12 @@ func (g openAPITypeWriter) generate(t *types.Type) error { "SchemaProps: spec.SchemaProps{\n", args) g.generateDescription(t.CommentLines) g.Do("Type:$.type|raw${}.OpenAPISchemaType(),\n"+ - "Format:$.type|raw${}.OpenAPISchemaFormat(),\n"+ - "},\n"+ + "Format:$.type|raw${}.OpenAPISchemaFormat(),\n", args) + err = g.generateValueValidations(&overrides.SchemaProps) + if err != nil { + return err + } + g.Do("},\n"+ "},\n"+ "})\n}\n\n", args) return nil @@ -388,18 +459,27 @@ func (g openAPITypeWriter) generate(t *types.Type) error { "SchemaProps: spec.SchemaProps{\n", args) g.generateDescription(t.CommentLines) g.Do("OneOf:common.GenerateOpenAPIV3OneOfSchema($.type|raw${}.OpenAPIV3OneOfTypes()),\n"+ - "Format:$.type|raw${}.OpenAPISchemaFormat(),\n"+ - "},\n"+ + "Format:$.type|raw${}.OpenAPISchemaFormat(),\n", args) + err = g.generateValueValidations(&overrides.SchemaProps) + if err != nil { + return err + } + g.Do( "},\n"+ - "},", args) + "},\n"+ + "},", args) // generate v2 def. g.Do("$.OpenAPIDefinition|raw${\n"+ "Schema: spec.Schema{\n"+ "SchemaProps: spec.SchemaProps{\n", args) g.generateDescription(t.CommentLines) g.Do("Type:$.type|raw${}.OpenAPISchemaType(),\n"+ - "Format:$.type|raw${}.OpenAPISchemaFormat(),\n"+ - "},\n"+ + "Format:$.type|raw${}.OpenAPISchemaFormat(),\n", args) + err = g.generateValueValidations(&overrides.SchemaProps) + if err != nil { + return err + } + g.Do("},\n"+ "},\n"+ "})\n}\n\n", args) return nil @@ -409,8 +489,12 @@ func (g openAPITypeWriter) generate(t *types.Type) error { "SchemaProps: spec.SchemaProps{\n", args) g.generateDescription(t.CommentLines) g.Do("Type:$.type|raw${}.OpenAPISchemaType(),\n"+ - "Format:$.type|raw${}.OpenAPISchemaFormat(),\n"+ - "},\n"+ + "Format:$.type|raw${}.OpenAPISchemaFormat(),\n", args) + err = g.generateValueValidations(&overrides.SchemaProps) + if err != nil { + return err + } + g.Do("},\n"+ "},\n"+ "}\n}\n\n", args) return nil @@ -418,9 +502,14 @@ func (g openAPITypeWriter) generate(t *types.Type) error { // having v3 oneOf types without custom v2 type or format does not make sense. return fmt.Errorf("type %q has v3 one of types but not v2 type or format", t.Name) } + g.Do("return $.OpenAPIDefinition|raw${\nSchema: spec.Schema{\nSchemaProps: spec.SchemaProps{\n", args) g.generateDescription(t.CommentLines) g.Do("Type: []string{\"object\"},\n", nil) + err = g.generateValueValidations(&overrides.SchemaProps) + if err != nil { + return err + } // write members into a temporary buffer, in order to postpone writing out the Properties field. We only do // that if it is not empty. @@ -741,6 +830,14 @@ func (g openAPITypeWriter) generateProperty(m *types.Member, parent *types.Type) if err := g.generateDefault(m.CommentLines, m.Type, omitEmpty, parent); err != nil { return fmt.Errorf("failed to generate default in %v: %v: %v", parent, m.Name, err) } + overrides, err := ParseCommentTags(m.Type, m.CommentLines, markerPrefix) + if err != nil { + return err + } + err = g.generateValueValidations(&overrides.SchemaProps) + if err != nil { + return err + } t := resolveAliasAndPtrType(m.Type) // If we can get a openAPI type and format for this type, we consider it to be simple property typeString, format := openapi.OpenAPITypeFormat(t.String()) diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/rules/idl_tag.go b/vendor/k8s.io/kube-openapi/pkg/generators/rules/idl_tag.go index 474d79e89..0abe0aa07 100644 --- a/vendor/k8s.io/kube-openapi/pkg/generators/rules/idl_tag.go +++ b/vendor/k8s.io/kube-openapi/pkg/generators/rules/idl_tag.go @@ -33,7 +33,8 @@ func (l *ListTypeMissing) Validate(t *types.Type) ([]string, error) { continue } - if m.Type.Kind == types.Slice && !hasListType { + // All slice fields must have a list-type tag except []byte + if m.Type.Kind == types.Slice && m.Type.Elem != types.Byte && !hasListType { fields = append(fields, m.Name) continue } diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/rules/names_match.go b/vendor/k8s.io/kube-openapi/pkg/generators/rules/names_match.go index 581722257..53e870c1a 100644 --- a/vendor/k8s.io/kube-openapi/pkg/generators/rules/names_match.go +++ b/vendor/k8s.io/kube-openapi/pkg/generators/rules/names_match.go @@ -135,7 +135,7 @@ func namesMatch(goName, jsonName string) bool { if !isAllowedName(goName) || !isAllowedName(jsonName) { return false } - if strings.ToLower(goName) != strings.ToLower(jsonName) { + if !strings.EqualFold(goName, jsonName) { return false } // Go field names must be CamelCase. JSON field names must be camelCase. diff --git a/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go b/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go index 799d866d5..9887d185b 100644 --- a/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go +++ b/vendor/k8s.io/kube-openapi/pkg/schemaconv/smd.go @@ -214,9 +214,6 @@ func makeUnion(extensions map[string]interface{}) (schema.Union, error) { } } - if union.Discriminator != nil && len(union.Fields) == 0 { - return schema.Union{}, fmt.Errorf("discriminator set to %v, but no fields in union", *union.Discriminator) - } return union, nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index 60a456cd9..76f611ca6 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -27,7 +27,7 @@ github.com/cespare/xxhash/v2 # github.com/davecgh/go-spew v1.1.1 ## explicit github.com/davecgh/go-spew/spew -# github.com/emicklei/go-restful/v3 v3.11.0 +# github.com/emicklei/go-restful/v3 v3.11.2 ## explicit; go 1.13 github.com/emicklei/go-restful/v3 github.com/emicklei/go-restful/v3/log @@ -48,15 +48,15 @@ github.com/go-logfmt/logfmt # github.com/go-logr/logr v1.4.1 ## explicit; go 1.18 github.com/go-logr/logr -# github.com/go-openapi/jsonpointer v0.20.0 -## explicit; go 1.18 +# github.com/go-openapi/jsonpointer v0.20.2 +## explicit; go 1.19 github.com/go-openapi/jsonpointer -# github.com/go-openapi/jsonreference v0.20.2 -## explicit; go 1.13 +# github.com/go-openapi/jsonreference v0.20.4 +## explicit; go 1.19 github.com/go-openapi/jsonreference github.com/go-openapi/jsonreference/internal -# github.com/go-openapi/swag v0.22.4 -## explicit; go 1.18 +# github.com/go-openapi/swag v0.22.7 +## explicit; go 1.19 github.com/go-openapi/swag # github.com/gogo/protobuf v1.3.2 ## explicit; go 1.15 @@ -383,7 +383,7 @@ gopkg.in/yaml.v2 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/api v0.29.2 +# k8s.io/api v0.29.3 ## explicit; go 1.21 k8s.io/api/admission/v1 k8s.io/api/admissionregistration/v1 @@ -438,11 +438,11 @@ k8s.io/api/scheduling/v1beta1 k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 -# k8s.io/apiextensions-apiserver v0.29.2 +# k8s.io/apiextensions-apiserver v0.29.3 ## explicit; go 1.21 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 -# k8s.io/apimachinery v0.29.2 +# k8s.io/apimachinery v0.29.3 ## explicit; go 1.21 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -492,7 +492,7 @@ k8s.io/apimachinery/pkg/version k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/client-go v0.29.2 +# k8s.io/client-go v0.29.3 ## explicit; go 1.21 k8s.io/client-go/applyconfigurations/admissionregistration/v1 k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1 @@ -799,7 +799,7 @@ k8s.io/client-go/util/homedir k8s.io/client-go/util/keyutil k8s.io/client-go/util/retry k8s.io/client-go/util/workqueue -# k8s.io/code-generator v0.29.2 +# k8s.io/code-generator v0.29.3 ## explicit; go 1.21 k8s.io/code-generator k8s.io/code-generator/cmd/applyconfiguration-gen @@ -858,8 +858,8 @@ k8s.io/klog/v2/internal/dbg k8s.io/klog/v2/internal/serialize k8s.io/klog/v2/internal/severity k8s.io/klog/v2/internal/sloghandler -# k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 -## explicit; go 1.19 +# k8s.io/kube-openapi v0.0.0-20240105020646-a37d4de58910 +## explicit; go 1.21 k8s.io/kube-openapi/cmd/openapi-gen/args k8s.io/kube-openapi/pkg/cached k8s.io/kube-openapi/pkg/common @@ -1004,10 +1004,16 @@ knative.dev/pkg/webhook knative.dev/pkg/webhook/certificates knative.dev/pkg/webhook/certificates/resources knative.dev/pkg/webhook/configmaps -# sigs.k8s.io/gateway-api v1.0.0 +# sigs.k8s.io/gateway-api v1.0.1-0.20240422224228-29e68bffffb9 ## explicit; go 1.21 +sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1 +sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2 +sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3 +sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1 +sigs.k8s.io/gateway-api/apis/applyconfiguration/internal sigs.k8s.io/gateway-api/apis/v1 sigs.k8s.io/gateway-api/apis/v1alpha2 +sigs.k8s.io/gateway-api/apis/v1alpha3 sigs.k8s.io/gateway-api/apis/v1beta1 sigs.k8s.io/gateway-api/pkg/client/clientset/versioned sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/fake @@ -1016,16 +1022,20 @@ sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1 sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2 sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake +sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3 +sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1 sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake sigs.k8s.io/gateway-api/pkg/client/informers/externalversions sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1 sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2 +sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha3 sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1beta1 sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/internalinterfaces sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1 sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2 +sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha3 sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1beta1 # sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd ## explicit; go 1.18 diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/allowedroutes.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/allowedroutes.go new file mode 100644 index 000000000..630e24ff2 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/allowedroutes.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AllowedRoutesApplyConfiguration represents an declarative configuration of the AllowedRoutes type for use +// with apply. +type AllowedRoutesApplyConfiguration struct { + Namespaces *RouteNamespacesApplyConfiguration `json:"namespaces,omitempty"` + Kinds []RouteGroupKindApplyConfiguration `json:"kinds,omitempty"` +} + +// AllowedRoutesApplyConfiguration constructs an declarative configuration of the AllowedRoutes type for use with +// apply. +func AllowedRoutes() *AllowedRoutesApplyConfiguration { + return &AllowedRoutesApplyConfiguration{} +} + +// WithNamespaces sets the Namespaces field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespaces field is set to the value of the last call. +func (b *AllowedRoutesApplyConfiguration) WithNamespaces(value *RouteNamespacesApplyConfiguration) *AllowedRoutesApplyConfiguration { + b.Namespaces = value + return b +} + +// WithKinds adds the given value to the Kinds field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Kinds field. +func (b *AllowedRoutesApplyConfiguration) WithKinds(values ...*RouteGroupKindApplyConfiguration) *AllowedRoutesApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithKinds") + } + b.Kinds = append(b.Kinds, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendobjectreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendobjectreference.go new file mode 100644 index 000000000..49487ef72 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendobjectreference.go @@ -0,0 +1,79 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// BackendObjectReferenceApplyConfiguration represents an declarative configuration of the BackendObjectReference type for use +// with apply. +type BackendObjectReferenceApplyConfiguration struct { + Group *v1.Group `json:"group,omitempty"` + Kind *v1.Kind `json:"kind,omitempty"` + Name *v1.ObjectName `json:"name,omitempty"` + Namespace *v1.Namespace `json:"namespace,omitempty"` + Port *v1.PortNumber `json:"port,omitempty"` +} + +// BackendObjectReferenceApplyConfiguration constructs an declarative configuration of the BackendObjectReference type for use with +// apply. +func BackendObjectReference() *BackendObjectReferenceApplyConfiguration { + return &BackendObjectReferenceApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *BackendObjectReferenceApplyConfiguration) WithGroup(value v1.Group) *BackendObjectReferenceApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *BackendObjectReferenceApplyConfiguration) WithKind(value v1.Kind) *BackendObjectReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *BackendObjectReferenceApplyConfiguration) WithName(value v1.ObjectName) *BackendObjectReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *BackendObjectReferenceApplyConfiguration) WithNamespace(value v1.Namespace) *BackendObjectReferenceApplyConfiguration { + b.Namespace = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *BackendObjectReferenceApplyConfiguration) WithPort(value v1.PortNumber) *BackendObjectReferenceApplyConfiguration { + b.Port = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendref.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendref.go new file mode 100644 index 000000000..cbbc24c25 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/backendref.go @@ -0,0 +1,84 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apisv1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// BackendRefApplyConfiguration represents an declarative configuration of the BackendRef type for use +// with apply. +type BackendRefApplyConfiguration struct { + BackendObjectReferenceApplyConfiguration `json:",inline"` + Weight *int32 `json:"weight,omitempty"` +} + +// BackendRefApplyConfiguration constructs an declarative configuration of the BackendRef type for use with +// apply. +func BackendRef() *BackendRefApplyConfiguration { + return &BackendRefApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *BackendRefApplyConfiguration) WithGroup(value apisv1.Group) *BackendRefApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *BackendRefApplyConfiguration) WithKind(value apisv1.Kind) *BackendRefApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *BackendRefApplyConfiguration) WithName(value apisv1.ObjectName) *BackendRefApplyConfiguration { + b.Name = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *BackendRefApplyConfiguration) WithNamespace(value apisv1.Namespace) *BackendRefApplyConfiguration { + b.Namespace = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *BackendRefApplyConfiguration) WithPort(value apisv1.PortNumber) *BackendRefApplyConfiguration { + b.Port = &value + return b +} + +// WithWeight sets the Weight field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Weight field is set to the value of the last call. +func (b *BackendRefApplyConfiguration) WithWeight(value int32) *BackendRefApplyConfiguration { + b.Weight = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/commonroutespec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/commonroutespec.go new file mode 100644 index 000000000..faa727cce --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/commonroutespec.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CommonRouteSpecApplyConfiguration represents an declarative configuration of the CommonRouteSpec type for use +// with apply. +type CommonRouteSpecApplyConfiguration struct { + ParentRefs []ParentReferenceApplyConfiguration `json:"parentRefs,omitempty"` +} + +// CommonRouteSpecApplyConfiguration constructs an declarative configuration of the CommonRouteSpec type for use with +// apply. +func CommonRouteSpec() *CommonRouteSpecApplyConfiguration { + return &CommonRouteSpecApplyConfiguration{} +} + +// WithParentRefs adds the given value to the ParentRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ParentRefs field. +func (b *CommonRouteSpecApplyConfiguration) WithParentRefs(values ...*ParentReferenceApplyConfiguration) *CommonRouteSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithParentRefs") + } + b.ParentRefs = append(b.ParentRefs, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/cookieconfig.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/cookieconfig.go new file mode 100644 index 000000000..7702c69a5 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/cookieconfig.go @@ -0,0 +1,43 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// CookieConfigApplyConfiguration represents an declarative configuration of the CookieConfig type for use +// with apply. +type CookieConfigApplyConfiguration struct { + LifetimeType *v1.CookieLifetimeType `json:"lifetimeType,omitempty"` +} + +// CookieConfigApplyConfiguration constructs an declarative configuration of the CookieConfig type for use with +// apply. +func CookieConfig() *CookieConfigApplyConfiguration { + return &CookieConfigApplyConfiguration{} +} + +// WithLifetimeType sets the LifetimeType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LifetimeType field is set to the value of the last call. +func (b *CookieConfigApplyConfiguration) WithLifetimeType(value v1.CookieLifetimeType) *CookieConfigApplyConfiguration { + b.LifetimeType = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/frontendtlsvalidation.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/frontendtlsvalidation.go new file mode 100644 index 000000000..7fafdf8ce --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/frontendtlsvalidation.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// FrontendTLSValidationApplyConfiguration represents an declarative configuration of the FrontendTLSValidation type for use +// with apply. +type FrontendTLSValidationApplyConfiguration struct { + CACertificateRefs []ObjectReferenceApplyConfiguration `json:"caCertificateRefs,omitempty"` +} + +// FrontendTLSValidationApplyConfiguration constructs an declarative configuration of the FrontendTLSValidation type for use with +// apply. +func FrontendTLSValidation() *FrontendTLSValidationApplyConfiguration { + return &FrontendTLSValidationApplyConfiguration{} +} + +// WithCACertificateRefs adds the given value to the CACertificateRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CACertificateRefs field. +func (b *FrontendTLSValidationApplyConfiguration) WithCACertificateRefs(values ...*ObjectReferenceApplyConfiguration) *FrontendTLSValidationApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithCACertificateRefs") + } + b.CACertificateRefs = append(b.CACertificateRefs, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gateway.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gateway.go new file mode 100644 index 000000000..0c0d3a5d4 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gateway.go @@ -0,0 +1,258 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + gatewayapiapisv1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GatewayApplyConfiguration represents an declarative configuration of the Gateway type for use +// with apply. +type GatewayApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *GatewaySpecApplyConfiguration `json:"spec,omitempty"` + Status *GatewayStatusApplyConfiguration `json:"status,omitempty"` +} + +// Gateway constructs an declarative configuration of the Gateway type for use with +// apply. +func Gateway(name, namespace string) *GatewayApplyConfiguration { + b := &GatewayApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Gateway") + b.WithAPIVersion("gateway.networking.k8s.io/v1") + return b +} + +// ExtractGateway extracts the applied configuration owned by fieldManager from +// gateway. If no managedFields are found in gateway for fieldManager, a +// GatewayApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// gateway must be a unmodified Gateway API object that was retrieved from the Kubernetes API. +// ExtractGateway provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractGateway(gateway *gatewayapiapisv1.Gateway, fieldManager string) (*GatewayApplyConfiguration, error) { + return extractGateway(gateway, fieldManager, "") +} + +// ExtractGatewayStatus is the same as ExtractGateway except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractGatewayStatus(gateway *gatewayapiapisv1.Gateway, fieldManager string) (*GatewayApplyConfiguration, error) { + return extractGateway(gateway, fieldManager, "status") +} + +func extractGateway(gateway *gatewayapiapisv1.Gateway, fieldManager string, subresource string) (*GatewayApplyConfiguration, error) { + b := &GatewayApplyConfiguration{} + err := managedfields.ExtractInto(gateway, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1.Gateway"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(gateway.Name) + b.WithNamespace(gateway.Namespace) + + b.WithKind("Gateway") + b.WithAPIVersion("gateway.networking.k8s.io/v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithKind(value string) *GatewayApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithAPIVersion(value string) *GatewayApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithName(value string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithGenerateName(value string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithNamespace(value string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithUID(value types.UID) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithResourceVersion(value string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithGeneration(value int64) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithCreationTimestamp(value metav1.Time) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *GatewayApplyConfiguration) WithLabels(entries map[string]string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *GatewayApplyConfiguration) WithAnnotations(entries map[string]string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *GatewayApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *GatewayApplyConfiguration) WithFinalizers(values ...string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *GatewayApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithSpec(value *GatewaySpecApplyConfiguration) *GatewayApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithStatus(value *GatewayStatusApplyConfiguration) *GatewayApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayaddress.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayaddress.go new file mode 100644 index 000000000..e810a109d --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayaddress.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GatewayAddressApplyConfiguration represents an declarative configuration of the GatewayAddress type for use +// with apply. +type GatewayAddressApplyConfiguration struct { + Type *v1.AddressType `json:"type,omitempty"` + Value *string `json:"value,omitempty"` +} + +// GatewayAddressApplyConfiguration constructs an declarative configuration of the GatewayAddress type for use with +// apply. +func GatewayAddress() *GatewayAddressApplyConfiguration { + return &GatewayAddressApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *GatewayAddressApplyConfiguration) WithType(value v1.AddressType) *GatewayAddressApplyConfiguration { + b.Type = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *GatewayAddressApplyConfiguration) WithValue(value string) *GatewayAddressApplyConfiguration { + b.Value = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclass.go new file mode 100644 index 000000000..37b057948 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclass.go @@ -0,0 +1,256 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + gatewayapiapisv1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GatewayClassApplyConfiguration represents an declarative configuration of the GatewayClass type for use +// with apply. +type GatewayClassApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *GatewayClassSpecApplyConfiguration `json:"spec,omitempty"` + Status *GatewayClassStatusApplyConfiguration `json:"status,omitempty"` +} + +// GatewayClass constructs an declarative configuration of the GatewayClass type for use with +// apply. +func GatewayClass(name string) *GatewayClassApplyConfiguration { + b := &GatewayClassApplyConfiguration{} + b.WithName(name) + b.WithKind("GatewayClass") + b.WithAPIVersion("gateway.networking.k8s.io/v1") + return b +} + +// ExtractGatewayClass extracts the applied configuration owned by fieldManager from +// gatewayClass. If no managedFields are found in gatewayClass for fieldManager, a +// GatewayClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// gatewayClass must be a unmodified GatewayClass API object that was retrieved from the Kubernetes API. +// ExtractGatewayClass provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractGatewayClass(gatewayClass *gatewayapiapisv1.GatewayClass, fieldManager string) (*GatewayClassApplyConfiguration, error) { + return extractGatewayClass(gatewayClass, fieldManager, "") +} + +// ExtractGatewayClassStatus is the same as ExtractGatewayClass except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractGatewayClassStatus(gatewayClass *gatewayapiapisv1.GatewayClass, fieldManager string) (*GatewayClassApplyConfiguration, error) { + return extractGatewayClass(gatewayClass, fieldManager, "status") +} + +func extractGatewayClass(gatewayClass *gatewayapiapisv1.GatewayClass, fieldManager string, subresource string) (*GatewayClassApplyConfiguration, error) { + b := &GatewayClassApplyConfiguration{} + err := managedfields.ExtractInto(gatewayClass, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1.GatewayClass"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(gatewayClass.Name) + + b.WithKind("GatewayClass") + b.WithAPIVersion("gateway.networking.k8s.io/v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithKind(value string) *GatewayClassApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithAPIVersion(value string) *GatewayClassApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithName(value string) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithGenerateName(value string) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithNamespace(value string) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithUID(value types.UID) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithResourceVersion(value string) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithGeneration(value int64) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *GatewayClassApplyConfiguration) WithLabels(entries map[string]string) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *GatewayClassApplyConfiguration) WithAnnotations(entries map[string]string) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *GatewayClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *GatewayClassApplyConfiguration) WithFinalizers(values ...string) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *GatewayClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithSpec(value *GatewayClassSpecApplyConfiguration) *GatewayClassApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithStatus(value *GatewayClassStatusApplyConfiguration) *GatewayClassApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassspec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassspec.go new file mode 100644 index 000000000..460724ff7 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassspec.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GatewayClassSpecApplyConfiguration represents an declarative configuration of the GatewayClassSpec type for use +// with apply. +type GatewayClassSpecApplyConfiguration struct { + ControllerName *v1.GatewayController `json:"controllerName,omitempty"` + ParametersRef *ParametersReferenceApplyConfiguration `json:"parametersRef,omitempty"` + Description *string `json:"description,omitempty"` +} + +// GatewayClassSpecApplyConfiguration constructs an declarative configuration of the GatewayClassSpec type for use with +// apply. +func GatewayClassSpec() *GatewayClassSpecApplyConfiguration { + return &GatewayClassSpecApplyConfiguration{} +} + +// WithControllerName sets the ControllerName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControllerName field is set to the value of the last call. +func (b *GatewayClassSpecApplyConfiguration) WithControllerName(value v1.GatewayController) *GatewayClassSpecApplyConfiguration { + b.ControllerName = &value + return b +} + +// WithParametersRef sets the ParametersRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ParametersRef field is set to the value of the last call. +func (b *GatewayClassSpecApplyConfiguration) WithParametersRef(value *ParametersReferenceApplyConfiguration) *GatewayClassSpecApplyConfiguration { + b.ParametersRef = value + return b +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *GatewayClassSpecApplyConfiguration) WithDescription(value string) *GatewayClassSpecApplyConfiguration { + b.Description = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassstatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassstatus.go new file mode 100644 index 000000000..b9248fbd5 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayclassstatus.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + apisv1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GatewayClassStatusApplyConfiguration represents an declarative configuration of the GatewayClassStatus type for use +// with apply. +type GatewayClassStatusApplyConfiguration struct { + Conditions []v1.Condition `json:"conditions,omitempty"` + SupportedFeatures []apisv1.SupportedFeature `json:"supportedFeatures,omitempty"` +} + +// GatewayClassStatusApplyConfiguration constructs an declarative configuration of the GatewayClassStatus type for use with +// apply. +func GatewayClassStatus() *GatewayClassStatusApplyConfiguration { + return &GatewayClassStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *GatewayClassStatusApplyConfiguration) WithConditions(values ...v1.Condition) *GatewayClassStatusApplyConfiguration { + for i := range values { + b.Conditions = append(b.Conditions, values[i]) + } + return b +} + +// WithSupportedFeatures adds the given value to the SupportedFeatures field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SupportedFeatures field. +func (b *GatewayClassStatusApplyConfiguration) WithSupportedFeatures(values ...apisv1.SupportedFeature) *GatewayClassStatusApplyConfiguration { + for i := range values { + b.SupportedFeatures = append(b.SupportedFeatures, values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayinfrastructure.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayinfrastructure.go new file mode 100644 index 000000000..43ca7e63e --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayinfrastructure.go @@ -0,0 +1,73 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GatewayInfrastructureApplyConfiguration represents an declarative configuration of the GatewayInfrastructure type for use +// with apply. +type GatewayInfrastructureApplyConfiguration struct { + Labels map[v1.AnnotationKey]v1.AnnotationValue `json:"labels,omitempty"` + Annotations map[v1.AnnotationKey]v1.AnnotationValue `json:"annotations,omitempty"` + ParametersRef *LocalParametersReferenceApplyConfiguration `json:"parametersRef,omitempty"` +} + +// GatewayInfrastructureApplyConfiguration constructs an declarative configuration of the GatewayInfrastructure type for use with +// apply. +func GatewayInfrastructure() *GatewayInfrastructureApplyConfiguration { + return &GatewayInfrastructureApplyConfiguration{} +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *GatewayInfrastructureApplyConfiguration) WithLabels(entries map[v1.AnnotationKey]v1.AnnotationValue) *GatewayInfrastructureApplyConfiguration { + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[v1.AnnotationKey]v1.AnnotationValue, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *GatewayInfrastructureApplyConfiguration) WithAnnotations(entries map[v1.AnnotationKey]v1.AnnotationValue) *GatewayInfrastructureApplyConfiguration { + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[v1.AnnotationKey]v1.AnnotationValue, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithParametersRef sets the ParametersRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ParametersRef field is set to the value of the last call. +func (b *GatewayInfrastructureApplyConfiguration) WithParametersRef(value *LocalParametersReferenceApplyConfiguration) *GatewayInfrastructureApplyConfiguration { + b.ParametersRef = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayspec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayspec.go new file mode 100644 index 000000000..a3f935f65 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewayspec.go @@ -0,0 +1,80 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GatewaySpecApplyConfiguration represents an declarative configuration of the GatewaySpec type for use +// with apply. +type GatewaySpecApplyConfiguration struct { + GatewayClassName *v1.ObjectName `json:"gatewayClassName,omitempty"` + Listeners []ListenerApplyConfiguration `json:"listeners,omitempty"` + Addresses []GatewayAddressApplyConfiguration `json:"addresses,omitempty"` + Infrastructure *GatewayInfrastructureApplyConfiguration `json:"infrastructure,omitempty"` +} + +// GatewaySpecApplyConfiguration constructs an declarative configuration of the GatewaySpec type for use with +// apply. +func GatewaySpec() *GatewaySpecApplyConfiguration { + return &GatewaySpecApplyConfiguration{} +} + +// WithGatewayClassName sets the GatewayClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GatewayClassName field is set to the value of the last call. +func (b *GatewaySpecApplyConfiguration) WithGatewayClassName(value v1.ObjectName) *GatewaySpecApplyConfiguration { + b.GatewayClassName = &value + return b +} + +// WithListeners adds the given value to the Listeners field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Listeners field. +func (b *GatewaySpecApplyConfiguration) WithListeners(values ...*ListenerApplyConfiguration) *GatewaySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithListeners") + } + b.Listeners = append(b.Listeners, *values[i]) + } + return b +} + +// WithAddresses adds the given value to the Addresses field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Addresses field. +func (b *GatewaySpecApplyConfiguration) WithAddresses(values ...*GatewayAddressApplyConfiguration) *GatewaySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAddresses") + } + b.Addresses = append(b.Addresses, *values[i]) + } + return b +} + +// WithInfrastructure sets the Infrastructure field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Infrastructure field is set to the value of the last call. +func (b *GatewaySpecApplyConfiguration) WithInfrastructure(value *GatewayInfrastructureApplyConfiguration) *GatewaySpecApplyConfiguration { + b.Infrastructure = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatus.go new file mode 100644 index 000000000..94732086a --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatus.go @@ -0,0 +1,73 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// GatewayStatusApplyConfiguration represents an declarative configuration of the GatewayStatus type for use +// with apply. +type GatewayStatusApplyConfiguration struct { + Addresses []GatewayStatusAddressApplyConfiguration `json:"addresses,omitempty"` + Conditions []metav1.Condition `json:"conditions,omitempty"` + Listeners []ListenerStatusApplyConfiguration `json:"listeners,omitempty"` +} + +// GatewayStatusApplyConfiguration constructs an declarative configuration of the GatewayStatus type for use with +// apply. +func GatewayStatus() *GatewayStatusApplyConfiguration { + return &GatewayStatusApplyConfiguration{} +} + +// WithAddresses adds the given value to the Addresses field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Addresses field. +func (b *GatewayStatusApplyConfiguration) WithAddresses(values ...*GatewayStatusAddressApplyConfiguration) *GatewayStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAddresses") + } + b.Addresses = append(b.Addresses, *values[i]) + } + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *GatewayStatusApplyConfiguration) WithConditions(values ...metav1.Condition) *GatewayStatusApplyConfiguration { + for i := range values { + b.Conditions = append(b.Conditions, values[i]) + } + return b +} + +// WithListeners adds the given value to the Listeners field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Listeners field. +func (b *GatewayStatusApplyConfiguration) WithListeners(values ...*ListenerStatusApplyConfiguration) *GatewayStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithListeners") + } + b.Listeners = append(b.Listeners, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatusaddress.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatusaddress.go new file mode 100644 index 000000000..b21251e10 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaystatusaddress.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GatewayStatusAddressApplyConfiguration represents an declarative configuration of the GatewayStatusAddress type for use +// with apply. +type GatewayStatusAddressApplyConfiguration struct { + Type *v1.AddressType `json:"type,omitempty"` + Value *string `json:"value,omitempty"` +} + +// GatewayStatusAddressApplyConfiguration constructs an declarative configuration of the GatewayStatusAddress type for use with +// apply. +func GatewayStatusAddress() *GatewayStatusAddressApplyConfiguration { + return &GatewayStatusAddressApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *GatewayStatusAddressApplyConfiguration) WithType(value v1.AddressType) *GatewayStatusAddressApplyConfiguration { + b.Type = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *GatewayStatusAddressApplyConfiguration) WithValue(value string) *GatewayStatusAddressApplyConfiguration { + b.Value = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaytlsconfig.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaytlsconfig.go new file mode 100644 index 000000000..706243019 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/gatewaytlsconfig.go @@ -0,0 +1,81 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GatewayTLSConfigApplyConfiguration represents an declarative configuration of the GatewayTLSConfig type for use +// with apply. +type GatewayTLSConfigApplyConfiguration struct { + Mode *v1.TLSModeType `json:"mode,omitempty"` + CertificateRefs []SecretObjectReferenceApplyConfiguration `json:"certificateRefs,omitempty"` + FrontendValidation *FrontendTLSValidationApplyConfiguration `json:"frontendValidation,omitempty"` + Options map[v1.AnnotationKey]v1.AnnotationValue `json:"options,omitempty"` +} + +// GatewayTLSConfigApplyConfiguration constructs an declarative configuration of the GatewayTLSConfig type for use with +// apply. +func GatewayTLSConfig() *GatewayTLSConfigApplyConfiguration { + return &GatewayTLSConfigApplyConfiguration{} +} + +// WithMode sets the Mode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Mode field is set to the value of the last call. +func (b *GatewayTLSConfigApplyConfiguration) WithMode(value v1.TLSModeType) *GatewayTLSConfigApplyConfiguration { + b.Mode = &value + return b +} + +// WithCertificateRefs adds the given value to the CertificateRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CertificateRefs field. +func (b *GatewayTLSConfigApplyConfiguration) WithCertificateRefs(values ...*SecretObjectReferenceApplyConfiguration) *GatewayTLSConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithCertificateRefs") + } + b.CertificateRefs = append(b.CertificateRefs, *values[i]) + } + return b +} + +// WithFrontendValidation sets the FrontendValidation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FrontendValidation field is set to the value of the last call. +func (b *GatewayTLSConfigApplyConfiguration) WithFrontendValidation(value *FrontendTLSValidationApplyConfiguration) *GatewayTLSConfigApplyConfiguration { + b.FrontendValidation = value + return b +} + +// WithOptions puts the entries into the Options field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Options field, +// overwriting an existing map entries in Options field with the same key. +func (b *GatewayTLSConfigApplyConfiguration) WithOptions(entries map[v1.AnnotationKey]v1.AnnotationValue) *GatewayTLSConfigApplyConfiguration { + if b.Options == nil && len(entries) > 0 { + b.Options = make(map[v1.AnnotationKey]v1.AnnotationValue, len(entries)) + } + for k, v := range entries { + b.Options[k] = v + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcbackendref.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcbackendref.go new file mode 100644 index 000000000..d3d457bb6 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcbackendref.go @@ -0,0 +1,97 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apisv1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GRPCBackendRefApplyConfiguration represents an declarative configuration of the GRPCBackendRef type for use +// with apply. +type GRPCBackendRefApplyConfiguration struct { + BackendRefApplyConfiguration `json:",inline"` + Filters []GRPCRouteFilterApplyConfiguration `json:"filters,omitempty"` +} + +// GRPCBackendRefApplyConfiguration constructs an declarative configuration of the GRPCBackendRef type for use with +// apply. +func GRPCBackendRef() *GRPCBackendRefApplyConfiguration { + return &GRPCBackendRefApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *GRPCBackendRefApplyConfiguration) WithGroup(value apisv1.Group) *GRPCBackendRefApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *GRPCBackendRefApplyConfiguration) WithKind(value apisv1.Kind) *GRPCBackendRefApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GRPCBackendRefApplyConfiguration) WithName(value apisv1.ObjectName) *GRPCBackendRefApplyConfiguration { + b.Name = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *GRPCBackendRefApplyConfiguration) WithNamespace(value apisv1.Namespace) *GRPCBackendRefApplyConfiguration { + b.Namespace = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *GRPCBackendRefApplyConfiguration) WithPort(value apisv1.PortNumber) *GRPCBackendRefApplyConfiguration { + b.Port = &value + return b +} + +// WithWeight sets the Weight field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Weight field is set to the value of the last call. +func (b *GRPCBackendRefApplyConfiguration) WithWeight(value int32) *GRPCBackendRefApplyConfiguration { + b.Weight = &value + return b +} + +// WithFilters adds the given value to the Filters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Filters field. +func (b *GRPCBackendRefApplyConfiguration) WithFilters(values ...*GRPCRouteFilterApplyConfiguration) *GRPCBackendRefApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFilters") + } + b.Filters = append(b.Filters, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcheadermatch.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcheadermatch.go new file mode 100644 index 000000000..16b6ee4dc --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcheadermatch.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GRPCHeaderMatchApplyConfiguration represents an declarative configuration of the GRPCHeaderMatch type for use +// with apply. +type GRPCHeaderMatchApplyConfiguration struct { + Type *v1.HeaderMatchType `json:"type,omitempty"` + Name *v1.GRPCHeaderName `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +// GRPCHeaderMatchApplyConfiguration constructs an declarative configuration of the GRPCHeaderMatch type for use with +// apply. +func GRPCHeaderMatch() *GRPCHeaderMatchApplyConfiguration { + return &GRPCHeaderMatchApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *GRPCHeaderMatchApplyConfiguration) WithType(value v1.HeaderMatchType) *GRPCHeaderMatchApplyConfiguration { + b.Type = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GRPCHeaderMatchApplyConfiguration) WithName(value v1.GRPCHeaderName) *GRPCHeaderMatchApplyConfiguration { + b.Name = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *GRPCHeaderMatchApplyConfiguration) WithValue(value string) *GRPCHeaderMatchApplyConfiguration { + b.Value = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcmethodmatch.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcmethodmatch.go new file mode 100644 index 000000000..7eefe9beb --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcmethodmatch.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GRPCMethodMatchApplyConfiguration represents an declarative configuration of the GRPCMethodMatch type for use +// with apply. +type GRPCMethodMatchApplyConfiguration struct { + Type *v1.GRPCMethodMatchType `json:"type,omitempty"` + Service *string `json:"service,omitempty"` + Method *string `json:"method,omitempty"` +} + +// GRPCMethodMatchApplyConfiguration constructs an declarative configuration of the GRPCMethodMatch type for use with +// apply. +func GRPCMethodMatch() *GRPCMethodMatchApplyConfiguration { + return &GRPCMethodMatchApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *GRPCMethodMatchApplyConfiguration) WithType(value v1.GRPCMethodMatchType) *GRPCMethodMatchApplyConfiguration { + b.Type = &value + return b +} + +// WithService sets the Service field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Service field is set to the value of the last call. +func (b *GRPCMethodMatchApplyConfiguration) WithService(value string) *GRPCMethodMatchApplyConfiguration { + b.Service = &value + return b +} + +// WithMethod sets the Method field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Method field is set to the value of the last call. +func (b *GRPCMethodMatchApplyConfiguration) WithMethod(value string) *GRPCMethodMatchApplyConfiguration { + b.Method = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroute.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroute.go new file mode 100644 index 000000000..288b8d3e2 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroute.go @@ -0,0 +1,258 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + gatewayapiapisv1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GRPCRouteApplyConfiguration represents an declarative configuration of the GRPCRoute type for use +// with apply. +type GRPCRouteApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *GRPCRouteSpecApplyConfiguration `json:"spec,omitempty"` + Status *GRPCRouteStatusApplyConfiguration `json:"status,omitempty"` +} + +// GRPCRoute constructs an declarative configuration of the GRPCRoute type for use with +// apply. +func GRPCRoute(name, namespace string) *GRPCRouteApplyConfiguration { + b := &GRPCRouteApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("GRPCRoute") + b.WithAPIVersion("gateway.networking.k8s.io/v1") + return b +} + +// ExtractGRPCRoute extracts the applied configuration owned by fieldManager from +// gRPCRoute. If no managedFields are found in gRPCRoute for fieldManager, a +// GRPCRouteApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// gRPCRoute must be a unmodified GRPCRoute API object that was retrieved from the Kubernetes API. +// ExtractGRPCRoute provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractGRPCRoute(gRPCRoute *gatewayapiapisv1.GRPCRoute, fieldManager string) (*GRPCRouteApplyConfiguration, error) { + return extractGRPCRoute(gRPCRoute, fieldManager, "") +} + +// ExtractGRPCRouteStatus is the same as ExtractGRPCRoute except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractGRPCRouteStatus(gRPCRoute *gatewayapiapisv1.GRPCRoute, fieldManager string) (*GRPCRouteApplyConfiguration, error) { + return extractGRPCRoute(gRPCRoute, fieldManager, "status") +} + +func extractGRPCRoute(gRPCRoute *gatewayapiapisv1.GRPCRoute, fieldManager string, subresource string) (*GRPCRouteApplyConfiguration, error) { + b := &GRPCRouteApplyConfiguration{} + err := managedfields.ExtractInto(gRPCRoute, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1.GRPCRoute"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(gRPCRoute.Name) + b.WithNamespace(gRPCRoute.Namespace) + + b.WithKind("GRPCRoute") + b.WithAPIVersion("gateway.networking.k8s.io/v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithKind(value string) *GRPCRouteApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithAPIVersion(value string) *GRPCRouteApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithName(value string) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithGenerateName(value string) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithNamespace(value string) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithUID(value types.UID) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithResourceVersion(value string) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithGeneration(value int64) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithCreationTimestamp(value metav1.Time) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *GRPCRouteApplyConfiguration) WithLabels(entries map[string]string) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *GRPCRouteApplyConfiguration) WithAnnotations(entries map[string]string) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *GRPCRouteApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *GRPCRouteApplyConfiguration) WithFinalizers(values ...string) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *GRPCRouteApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithSpec(value *GRPCRouteSpecApplyConfiguration) *GRPCRouteApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithStatus(value *GRPCRouteStatusApplyConfiguration) *GRPCRouteApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutefilter.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutefilter.go new file mode 100644 index 000000000..f7292af6d --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutefilter.go @@ -0,0 +1,79 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GRPCRouteFilterApplyConfiguration represents an declarative configuration of the GRPCRouteFilter type for use +// with apply. +type GRPCRouteFilterApplyConfiguration struct { + Type *v1.GRPCRouteFilterType `json:"type,omitempty"` + RequestHeaderModifier *HTTPHeaderFilterApplyConfiguration `json:"requestHeaderModifier,omitempty"` + ResponseHeaderModifier *HTTPHeaderFilterApplyConfiguration `json:"responseHeaderModifier,omitempty"` + RequestMirror *HTTPRequestMirrorFilterApplyConfiguration `json:"requestMirror,omitempty"` + ExtensionRef *LocalObjectReferenceApplyConfiguration `json:"extensionRef,omitempty"` +} + +// GRPCRouteFilterApplyConfiguration constructs an declarative configuration of the GRPCRouteFilter type for use with +// apply. +func GRPCRouteFilter() *GRPCRouteFilterApplyConfiguration { + return &GRPCRouteFilterApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *GRPCRouteFilterApplyConfiguration) WithType(value v1.GRPCRouteFilterType) *GRPCRouteFilterApplyConfiguration { + b.Type = &value + return b +} + +// WithRequestHeaderModifier sets the RequestHeaderModifier field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RequestHeaderModifier field is set to the value of the last call. +func (b *GRPCRouteFilterApplyConfiguration) WithRequestHeaderModifier(value *HTTPHeaderFilterApplyConfiguration) *GRPCRouteFilterApplyConfiguration { + b.RequestHeaderModifier = value + return b +} + +// WithResponseHeaderModifier sets the ResponseHeaderModifier field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResponseHeaderModifier field is set to the value of the last call. +func (b *GRPCRouteFilterApplyConfiguration) WithResponseHeaderModifier(value *HTTPHeaderFilterApplyConfiguration) *GRPCRouteFilterApplyConfiguration { + b.ResponseHeaderModifier = value + return b +} + +// WithRequestMirror sets the RequestMirror field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RequestMirror field is set to the value of the last call. +func (b *GRPCRouteFilterApplyConfiguration) WithRequestMirror(value *HTTPRequestMirrorFilterApplyConfiguration) *GRPCRouteFilterApplyConfiguration { + b.RequestMirror = value + return b +} + +// WithExtensionRef sets the ExtensionRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExtensionRef field is set to the value of the last call. +func (b *GRPCRouteFilterApplyConfiguration) WithExtensionRef(value *LocalObjectReferenceApplyConfiguration) *GRPCRouteFilterApplyConfiguration { + b.ExtensionRef = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutematch.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutematch.go new file mode 100644 index 000000000..cddaef383 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutematch.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// GRPCRouteMatchApplyConfiguration represents an declarative configuration of the GRPCRouteMatch type for use +// with apply. +type GRPCRouteMatchApplyConfiguration struct { + Method *GRPCMethodMatchApplyConfiguration `json:"method,omitempty"` + Headers []GRPCHeaderMatchApplyConfiguration `json:"headers,omitempty"` +} + +// GRPCRouteMatchApplyConfiguration constructs an declarative configuration of the GRPCRouteMatch type for use with +// apply. +func GRPCRouteMatch() *GRPCRouteMatchApplyConfiguration { + return &GRPCRouteMatchApplyConfiguration{} +} + +// WithMethod sets the Method field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Method field is set to the value of the last call. +func (b *GRPCRouteMatchApplyConfiguration) WithMethod(value *GRPCMethodMatchApplyConfiguration) *GRPCRouteMatchApplyConfiguration { + b.Method = value + return b +} + +// WithHeaders adds the given value to the Headers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Headers field. +func (b *GRPCRouteMatchApplyConfiguration) WithHeaders(values ...*GRPCHeaderMatchApplyConfiguration) *GRPCRouteMatchApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHeaders") + } + b.Headers = append(b.Headers, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcrouterule.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcrouterule.go new file mode 100644 index 000000000..367fe3726 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcrouterule.go @@ -0,0 +1,81 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// GRPCRouteRuleApplyConfiguration represents an declarative configuration of the GRPCRouteRule type for use +// with apply. +type GRPCRouteRuleApplyConfiguration struct { + Matches []GRPCRouteMatchApplyConfiguration `json:"matches,omitempty"` + Filters []GRPCRouteFilterApplyConfiguration `json:"filters,omitempty"` + BackendRefs []GRPCBackendRefApplyConfiguration `json:"backendRefs,omitempty"` + SessionPersistence *SessionPersistenceApplyConfiguration `json:"sessionPersistence,omitempty"` +} + +// GRPCRouteRuleApplyConfiguration constructs an declarative configuration of the GRPCRouteRule type for use with +// apply. +func GRPCRouteRule() *GRPCRouteRuleApplyConfiguration { + return &GRPCRouteRuleApplyConfiguration{} +} + +// WithMatches adds the given value to the Matches field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Matches field. +func (b *GRPCRouteRuleApplyConfiguration) WithMatches(values ...*GRPCRouteMatchApplyConfiguration) *GRPCRouteRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMatches") + } + b.Matches = append(b.Matches, *values[i]) + } + return b +} + +// WithFilters adds the given value to the Filters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Filters field. +func (b *GRPCRouteRuleApplyConfiguration) WithFilters(values ...*GRPCRouteFilterApplyConfiguration) *GRPCRouteRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFilters") + } + b.Filters = append(b.Filters, *values[i]) + } + return b +} + +// WithBackendRefs adds the given value to the BackendRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the BackendRefs field. +func (b *GRPCRouteRuleApplyConfiguration) WithBackendRefs(values ...*GRPCBackendRefApplyConfiguration) *GRPCRouteRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithBackendRefs") + } + b.BackendRefs = append(b.BackendRefs, *values[i]) + } + return b +} + +// WithSessionPersistence sets the SessionPersistence field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SessionPersistence field is set to the value of the last call. +func (b *GRPCRouteRuleApplyConfiguration) WithSessionPersistence(value *SessionPersistenceApplyConfiguration) *GRPCRouteRuleApplyConfiguration { + b.SessionPersistence = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutespec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutespec.go new file mode 100644 index 000000000..666f502d1 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutespec.go @@ -0,0 +1,73 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apisv1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GRPCRouteSpecApplyConfiguration represents an declarative configuration of the GRPCRouteSpec type for use +// with apply. +type GRPCRouteSpecApplyConfiguration struct { + CommonRouteSpecApplyConfiguration `json:",inline"` + Hostnames []apisv1.Hostname `json:"hostnames,omitempty"` + Rules []GRPCRouteRuleApplyConfiguration `json:"rules,omitempty"` +} + +// GRPCRouteSpecApplyConfiguration constructs an declarative configuration of the GRPCRouteSpec type for use with +// apply. +func GRPCRouteSpec() *GRPCRouteSpecApplyConfiguration { + return &GRPCRouteSpecApplyConfiguration{} +} + +// WithParentRefs adds the given value to the ParentRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ParentRefs field. +func (b *GRPCRouteSpecApplyConfiguration) WithParentRefs(values ...*ParentReferenceApplyConfiguration) *GRPCRouteSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithParentRefs") + } + b.ParentRefs = append(b.ParentRefs, *values[i]) + } + return b +} + +// WithHostnames adds the given value to the Hostnames field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Hostnames field. +func (b *GRPCRouteSpecApplyConfiguration) WithHostnames(values ...apisv1.Hostname) *GRPCRouteSpecApplyConfiguration { + for i := range values { + b.Hostnames = append(b.Hostnames, values[i]) + } + return b +} + +// WithRules adds the given value to the Rules field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Rules field. +func (b *GRPCRouteSpecApplyConfiguration) WithRules(values ...*GRPCRouteRuleApplyConfiguration) *GRPCRouteSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRules") + } + b.Rules = append(b.Rules, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutestatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutestatus.go new file mode 100644 index 000000000..3a5473b8b --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/grpcroutestatus.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// GRPCRouteStatusApplyConfiguration represents an declarative configuration of the GRPCRouteStatus type for use +// with apply. +type GRPCRouteStatusApplyConfiguration struct { + RouteStatusApplyConfiguration `json:",inline"` +} + +// GRPCRouteStatusApplyConfiguration constructs an declarative configuration of the GRPCRouteStatus type for use with +// apply. +func GRPCRouteStatus() *GRPCRouteStatusApplyConfiguration { + return &GRPCRouteStatusApplyConfiguration{} +} + +// WithParents adds the given value to the Parents field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Parents field. +func (b *GRPCRouteStatusApplyConfiguration) WithParents(values ...*RouteParentStatusApplyConfiguration) *GRPCRouteStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithParents") + } + b.Parents = append(b.Parents, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpbackendref.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpbackendref.go new file mode 100644 index 000000000..4041d9bc6 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpbackendref.go @@ -0,0 +1,97 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apisv1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// HTTPBackendRefApplyConfiguration represents an declarative configuration of the HTTPBackendRef type for use +// with apply. +type HTTPBackendRefApplyConfiguration struct { + BackendRefApplyConfiguration `json:",inline"` + Filters []HTTPRouteFilterApplyConfiguration `json:"filters,omitempty"` +} + +// HTTPBackendRefApplyConfiguration constructs an declarative configuration of the HTTPBackendRef type for use with +// apply. +func HTTPBackendRef() *HTTPBackendRefApplyConfiguration { + return &HTTPBackendRefApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *HTTPBackendRefApplyConfiguration) WithGroup(value apisv1.Group) *HTTPBackendRefApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *HTTPBackendRefApplyConfiguration) WithKind(value apisv1.Kind) *HTTPBackendRefApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *HTTPBackendRefApplyConfiguration) WithName(value apisv1.ObjectName) *HTTPBackendRefApplyConfiguration { + b.Name = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *HTTPBackendRefApplyConfiguration) WithNamespace(value apisv1.Namespace) *HTTPBackendRefApplyConfiguration { + b.Namespace = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *HTTPBackendRefApplyConfiguration) WithPort(value apisv1.PortNumber) *HTTPBackendRefApplyConfiguration { + b.Port = &value + return b +} + +// WithWeight sets the Weight field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Weight field is set to the value of the last call. +func (b *HTTPBackendRefApplyConfiguration) WithWeight(value int32) *HTTPBackendRefApplyConfiguration { + b.Weight = &value + return b +} + +// WithFilters adds the given value to the Filters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Filters field. +func (b *HTTPBackendRefApplyConfiguration) WithFilters(values ...*HTTPRouteFilterApplyConfiguration) *HTTPBackendRefApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFilters") + } + b.Filters = append(b.Filters, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheader.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheader.go new file mode 100644 index 000000000..a1c9cc915 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheader.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// HTTPHeaderApplyConfiguration represents an declarative configuration of the HTTPHeader type for use +// with apply. +type HTTPHeaderApplyConfiguration struct { + Name *v1.HTTPHeaderName `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +// HTTPHeaderApplyConfiguration constructs an declarative configuration of the HTTPHeader type for use with +// apply. +func HTTPHeader() *HTTPHeaderApplyConfiguration { + return &HTTPHeaderApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *HTTPHeaderApplyConfiguration) WithName(value v1.HTTPHeaderName) *HTTPHeaderApplyConfiguration { + b.Name = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *HTTPHeaderApplyConfiguration) WithValue(value string) *HTTPHeaderApplyConfiguration { + b.Value = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheaderfilter.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheaderfilter.go new file mode 100644 index 000000000..f6cc5f24c --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheaderfilter.go @@ -0,0 +1,69 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// HTTPHeaderFilterApplyConfiguration represents an declarative configuration of the HTTPHeaderFilter type for use +// with apply. +type HTTPHeaderFilterApplyConfiguration struct { + Set []HTTPHeaderApplyConfiguration `json:"set,omitempty"` + Add []HTTPHeaderApplyConfiguration `json:"add,omitempty"` + Remove []string `json:"remove,omitempty"` +} + +// HTTPHeaderFilterApplyConfiguration constructs an declarative configuration of the HTTPHeaderFilter type for use with +// apply. +func HTTPHeaderFilter() *HTTPHeaderFilterApplyConfiguration { + return &HTTPHeaderFilterApplyConfiguration{} +} + +// WithSet adds the given value to the Set field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Set field. +func (b *HTTPHeaderFilterApplyConfiguration) WithSet(values ...*HTTPHeaderApplyConfiguration) *HTTPHeaderFilterApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSet") + } + b.Set = append(b.Set, *values[i]) + } + return b +} + +// WithAdd adds the given value to the Add field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Add field. +func (b *HTTPHeaderFilterApplyConfiguration) WithAdd(values ...*HTTPHeaderApplyConfiguration) *HTTPHeaderFilterApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAdd") + } + b.Add = append(b.Add, *values[i]) + } + return b +} + +// WithRemove adds the given value to the Remove field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Remove field. +func (b *HTTPHeaderFilterApplyConfiguration) WithRemove(values ...string) *HTTPHeaderFilterApplyConfiguration { + for i := range values { + b.Remove = append(b.Remove, values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheadermatch.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheadermatch.go new file mode 100644 index 000000000..96abbb4f1 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpheadermatch.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// HTTPHeaderMatchApplyConfiguration represents an declarative configuration of the HTTPHeaderMatch type for use +// with apply. +type HTTPHeaderMatchApplyConfiguration struct { + Type *v1.HeaderMatchType `json:"type,omitempty"` + Name *v1.HTTPHeaderName `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +// HTTPHeaderMatchApplyConfiguration constructs an declarative configuration of the HTTPHeaderMatch type for use with +// apply. +func HTTPHeaderMatch() *HTTPHeaderMatchApplyConfiguration { + return &HTTPHeaderMatchApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *HTTPHeaderMatchApplyConfiguration) WithType(value v1.HeaderMatchType) *HTTPHeaderMatchApplyConfiguration { + b.Type = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *HTTPHeaderMatchApplyConfiguration) WithName(value v1.HTTPHeaderName) *HTTPHeaderMatchApplyConfiguration { + b.Name = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *HTTPHeaderMatchApplyConfiguration) WithValue(value string) *HTTPHeaderMatchApplyConfiguration { + b.Value = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmatch.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmatch.go new file mode 100644 index 000000000..985121b31 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmatch.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// HTTPPathMatchApplyConfiguration represents an declarative configuration of the HTTPPathMatch type for use +// with apply. +type HTTPPathMatchApplyConfiguration struct { + Type *v1.PathMatchType `json:"type,omitempty"` + Value *string `json:"value,omitempty"` +} + +// HTTPPathMatchApplyConfiguration constructs an declarative configuration of the HTTPPathMatch type for use with +// apply. +func HTTPPathMatch() *HTTPPathMatchApplyConfiguration { + return &HTTPPathMatchApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *HTTPPathMatchApplyConfiguration) WithType(value v1.PathMatchType) *HTTPPathMatchApplyConfiguration { + b.Type = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *HTTPPathMatchApplyConfiguration) WithValue(value string) *HTTPPathMatchApplyConfiguration { + b.Value = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmodifier.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmodifier.go new file mode 100644 index 000000000..e675cadb0 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httppathmodifier.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// HTTPPathModifierApplyConfiguration represents an declarative configuration of the HTTPPathModifier type for use +// with apply. +type HTTPPathModifierApplyConfiguration struct { + Type *v1.HTTPPathModifierType `json:"type,omitempty"` + ReplaceFullPath *string `json:"replaceFullPath,omitempty"` + ReplacePrefixMatch *string `json:"replacePrefixMatch,omitempty"` +} + +// HTTPPathModifierApplyConfiguration constructs an declarative configuration of the HTTPPathModifier type for use with +// apply. +func HTTPPathModifier() *HTTPPathModifierApplyConfiguration { + return &HTTPPathModifierApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *HTTPPathModifierApplyConfiguration) WithType(value v1.HTTPPathModifierType) *HTTPPathModifierApplyConfiguration { + b.Type = &value + return b +} + +// WithReplaceFullPath sets the ReplaceFullPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReplaceFullPath field is set to the value of the last call. +func (b *HTTPPathModifierApplyConfiguration) WithReplaceFullPath(value string) *HTTPPathModifierApplyConfiguration { + b.ReplaceFullPath = &value + return b +} + +// WithReplacePrefixMatch sets the ReplacePrefixMatch field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReplacePrefixMatch field is set to the value of the last call. +func (b *HTTPPathModifierApplyConfiguration) WithReplacePrefixMatch(value string) *HTTPPathModifierApplyConfiguration { + b.ReplacePrefixMatch = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpqueryparammatch.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpqueryparammatch.go new file mode 100644 index 000000000..3bc97e21b --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpqueryparammatch.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// HTTPQueryParamMatchApplyConfiguration represents an declarative configuration of the HTTPQueryParamMatch type for use +// with apply. +type HTTPQueryParamMatchApplyConfiguration struct { + Type *v1.QueryParamMatchType `json:"type,omitempty"` + Name *v1.HTTPHeaderName `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +// HTTPQueryParamMatchApplyConfiguration constructs an declarative configuration of the HTTPQueryParamMatch type for use with +// apply. +func HTTPQueryParamMatch() *HTTPQueryParamMatchApplyConfiguration { + return &HTTPQueryParamMatchApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *HTTPQueryParamMatchApplyConfiguration) WithType(value v1.QueryParamMatchType) *HTTPQueryParamMatchApplyConfiguration { + b.Type = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *HTTPQueryParamMatchApplyConfiguration) WithName(value v1.HTTPHeaderName) *HTTPQueryParamMatchApplyConfiguration { + b.Name = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *HTTPQueryParamMatchApplyConfiguration) WithValue(value string) *HTTPQueryParamMatchApplyConfiguration { + b.Value = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestmirrorfilter.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestmirrorfilter.go new file mode 100644 index 000000000..1809ff078 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestmirrorfilter.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// HTTPRequestMirrorFilterApplyConfiguration represents an declarative configuration of the HTTPRequestMirrorFilter type for use +// with apply. +type HTTPRequestMirrorFilterApplyConfiguration struct { + BackendRef *BackendObjectReferenceApplyConfiguration `json:"backendRef,omitempty"` +} + +// HTTPRequestMirrorFilterApplyConfiguration constructs an declarative configuration of the HTTPRequestMirrorFilter type for use with +// apply. +func HTTPRequestMirrorFilter() *HTTPRequestMirrorFilterApplyConfiguration { + return &HTTPRequestMirrorFilterApplyConfiguration{} +} + +// WithBackendRef sets the BackendRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BackendRef field is set to the value of the last call. +func (b *HTTPRequestMirrorFilterApplyConfiguration) WithBackendRef(value *BackendObjectReferenceApplyConfiguration) *HTTPRequestMirrorFilterApplyConfiguration { + b.BackendRef = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestredirectfilter.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestredirectfilter.go new file mode 100644 index 000000000..c4a08c60c --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprequestredirectfilter.go @@ -0,0 +1,79 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// HTTPRequestRedirectFilterApplyConfiguration represents an declarative configuration of the HTTPRequestRedirectFilter type for use +// with apply. +type HTTPRequestRedirectFilterApplyConfiguration struct { + Scheme *string `json:"scheme,omitempty"` + Hostname *v1.PreciseHostname `json:"hostname,omitempty"` + Path *HTTPPathModifierApplyConfiguration `json:"path,omitempty"` + Port *v1.PortNumber `json:"port,omitempty"` + StatusCode *int `json:"statusCode,omitempty"` +} + +// HTTPRequestRedirectFilterApplyConfiguration constructs an declarative configuration of the HTTPRequestRedirectFilter type for use with +// apply. +func HTTPRequestRedirectFilter() *HTTPRequestRedirectFilterApplyConfiguration { + return &HTTPRequestRedirectFilterApplyConfiguration{} +} + +// WithScheme sets the Scheme field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Scheme field is set to the value of the last call. +func (b *HTTPRequestRedirectFilterApplyConfiguration) WithScheme(value string) *HTTPRequestRedirectFilterApplyConfiguration { + b.Scheme = &value + return b +} + +// WithHostname sets the Hostname field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Hostname field is set to the value of the last call. +func (b *HTTPRequestRedirectFilterApplyConfiguration) WithHostname(value v1.PreciseHostname) *HTTPRequestRedirectFilterApplyConfiguration { + b.Hostname = &value + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *HTTPRequestRedirectFilterApplyConfiguration) WithPath(value *HTTPPathModifierApplyConfiguration) *HTTPRequestRedirectFilterApplyConfiguration { + b.Path = value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *HTTPRequestRedirectFilterApplyConfiguration) WithPort(value v1.PortNumber) *HTTPRequestRedirectFilterApplyConfiguration { + b.Port = &value + return b +} + +// WithStatusCode sets the StatusCode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StatusCode field is set to the value of the last call. +func (b *HTTPRequestRedirectFilterApplyConfiguration) WithStatusCode(value int) *HTTPRequestRedirectFilterApplyConfiguration { + b.StatusCode = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproute.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproute.go new file mode 100644 index 000000000..6d0729a8a --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproute.go @@ -0,0 +1,258 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + gatewayapiapisv1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// HTTPRouteApplyConfiguration represents an declarative configuration of the HTTPRoute type for use +// with apply. +type HTTPRouteApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *HTTPRouteSpecApplyConfiguration `json:"spec,omitempty"` + Status *HTTPRouteStatusApplyConfiguration `json:"status,omitempty"` +} + +// HTTPRoute constructs an declarative configuration of the HTTPRoute type for use with +// apply. +func HTTPRoute(name, namespace string) *HTTPRouteApplyConfiguration { + b := &HTTPRouteApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("HTTPRoute") + b.WithAPIVersion("gateway.networking.k8s.io/v1") + return b +} + +// ExtractHTTPRoute extracts the applied configuration owned by fieldManager from +// hTTPRoute. If no managedFields are found in hTTPRoute for fieldManager, a +// HTTPRouteApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// hTTPRoute must be a unmodified HTTPRoute API object that was retrieved from the Kubernetes API. +// ExtractHTTPRoute provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractHTTPRoute(hTTPRoute *gatewayapiapisv1.HTTPRoute, fieldManager string) (*HTTPRouteApplyConfiguration, error) { + return extractHTTPRoute(hTTPRoute, fieldManager, "") +} + +// ExtractHTTPRouteStatus is the same as ExtractHTTPRoute except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractHTTPRouteStatus(hTTPRoute *gatewayapiapisv1.HTTPRoute, fieldManager string) (*HTTPRouteApplyConfiguration, error) { + return extractHTTPRoute(hTTPRoute, fieldManager, "status") +} + +func extractHTTPRoute(hTTPRoute *gatewayapiapisv1.HTTPRoute, fieldManager string, subresource string) (*HTTPRouteApplyConfiguration, error) { + b := &HTTPRouteApplyConfiguration{} + err := managedfields.ExtractInto(hTTPRoute, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1.HTTPRoute"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(hTTPRoute.Name) + b.WithNamespace(hTTPRoute.Namespace) + + b.WithKind("HTTPRoute") + b.WithAPIVersion("gateway.networking.k8s.io/v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithKind(value string) *HTTPRouteApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithAPIVersion(value string) *HTTPRouteApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithName(value string) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithGenerateName(value string) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithNamespace(value string) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithUID(value types.UID) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithResourceVersion(value string) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithGeneration(value int64) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithCreationTimestamp(value metav1.Time) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *HTTPRouteApplyConfiguration) WithLabels(entries map[string]string) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *HTTPRouteApplyConfiguration) WithAnnotations(entries map[string]string) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *HTTPRouteApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *HTTPRouteApplyConfiguration) WithFinalizers(values ...string) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *HTTPRouteApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithSpec(value *HTTPRouteSpecApplyConfiguration) *HTTPRouteApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithStatus(value *HTTPRouteStatusApplyConfiguration) *HTTPRouteApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutefilter.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutefilter.go new file mode 100644 index 000000000..9943ebd43 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutefilter.go @@ -0,0 +1,97 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// HTTPRouteFilterApplyConfiguration represents an declarative configuration of the HTTPRouteFilter type for use +// with apply. +type HTTPRouteFilterApplyConfiguration struct { + Type *v1.HTTPRouteFilterType `json:"type,omitempty"` + RequestHeaderModifier *HTTPHeaderFilterApplyConfiguration `json:"requestHeaderModifier,omitempty"` + ResponseHeaderModifier *HTTPHeaderFilterApplyConfiguration `json:"responseHeaderModifier,omitempty"` + RequestMirror *HTTPRequestMirrorFilterApplyConfiguration `json:"requestMirror,omitempty"` + RequestRedirect *HTTPRequestRedirectFilterApplyConfiguration `json:"requestRedirect,omitempty"` + URLRewrite *HTTPURLRewriteFilterApplyConfiguration `json:"urlRewrite,omitempty"` + ExtensionRef *LocalObjectReferenceApplyConfiguration `json:"extensionRef,omitempty"` +} + +// HTTPRouteFilterApplyConfiguration constructs an declarative configuration of the HTTPRouteFilter type for use with +// apply. +func HTTPRouteFilter() *HTTPRouteFilterApplyConfiguration { + return &HTTPRouteFilterApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *HTTPRouteFilterApplyConfiguration) WithType(value v1.HTTPRouteFilterType) *HTTPRouteFilterApplyConfiguration { + b.Type = &value + return b +} + +// WithRequestHeaderModifier sets the RequestHeaderModifier field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RequestHeaderModifier field is set to the value of the last call. +func (b *HTTPRouteFilterApplyConfiguration) WithRequestHeaderModifier(value *HTTPHeaderFilterApplyConfiguration) *HTTPRouteFilterApplyConfiguration { + b.RequestHeaderModifier = value + return b +} + +// WithResponseHeaderModifier sets the ResponseHeaderModifier field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResponseHeaderModifier field is set to the value of the last call. +func (b *HTTPRouteFilterApplyConfiguration) WithResponseHeaderModifier(value *HTTPHeaderFilterApplyConfiguration) *HTTPRouteFilterApplyConfiguration { + b.ResponseHeaderModifier = value + return b +} + +// WithRequestMirror sets the RequestMirror field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RequestMirror field is set to the value of the last call. +func (b *HTTPRouteFilterApplyConfiguration) WithRequestMirror(value *HTTPRequestMirrorFilterApplyConfiguration) *HTTPRouteFilterApplyConfiguration { + b.RequestMirror = value + return b +} + +// WithRequestRedirect sets the RequestRedirect field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RequestRedirect field is set to the value of the last call. +func (b *HTTPRouteFilterApplyConfiguration) WithRequestRedirect(value *HTTPRequestRedirectFilterApplyConfiguration) *HTTPRouteFilterApplyConfiguration { + b.RequestRedirect = value + return b +} + +// WithURLRewrite sets the URLRewrite field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URLRewrite field is set to the value of the last call. +func (b *HTTPRouteFilterApplyConfiguration) WithURLRewrite(value *HTTPURLRewriteFilterApplyConfiguration) *HTTPRouteFilterApplyConfiguration { + b.URLRewrite = value + return b +} + +// WithExtensionRef sets the ExtensionRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExtensionRef field is set to the value of the last call. +func (b *HTTPRouteFilterApplyConfiguration) WithExtensionRef(value *LocalObjectReferenceApplyConfiguration) *HTTPRouteFilterApplyConfiguration { + b.ExtensionRef = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutematch.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutematch.go new file mode 100644 index 000000000..cfc1e0fbe --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutematch.go @@ -0,0 +1,80 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apisv1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// HTTPRouteMatchApplyConfiguration represents an declarative configuration of the HTTPRouteMatch type for use +// with apply. +type HTTPRouteMatchApplyConfiguration struct { + Path *HTTPPathMatchApplyConfiguration `json:"path,omitempty"` + Headers []HTTPHeaderMatchApplyConfiguration `json:"headers,omitempty"` + QueryParams []HTTPQueryParamMatchApplyConfiguration `json:"queryParams,omitempty"` + Method *apisv1.HTTPMethod `json:"method,omitempty"` +} + +// HTTPRouteMatchApplyConfiguration constructs an declarative configuration of the HTTPRouteMatch type for use with +// apply. +func HTTPRouteMatch() *HTTPRouteMatchApplyConfiguration { + return &HTTPRouteMatchApplyConfiguration{} +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *HTTPRouteMatchApplyConfiguration) WithPath(value *HTTPPathMatchApplyConfiguration) *HTTPRouteMatchApplyConfiguration { + b.Path = value + return b +} + +// WithHeaders adds the given value to the Headers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Headers field. +func (b *HTTPRouteMatchApplyConfiguration) WithHeaders(values ...*HTTPHeaderMatchApplyConfiguration) *HTTPRouteMatchApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHeaders") + } + b.Headers = append(b.Headers, *values[i]) + } + return b +} + +// WithQueryParams adds the given value to the QueryParams field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the QueryParams field. +func (b *HTTPRouteMatchApplyConfiguration) WithQueryParams(values ...*HTTPQueryParamMatchApplyConfiguration) *HTTPRouteMatchApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithQueryParams") + } + b.QueryParams = append(b.QueryParams, *values[i]) + } + return b +} + +// WithMethod sets the Method field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Method field is set to the value of the last call. +func (b *HTTPRouteMatchApplyConfiguration) WithMethod(value apisv1.HTTPMethod) *HTTPRouteMatchApplyConfiguration { + b.Method = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprouterule.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprouterule.go new file mode 100644 index 000000000..dcef6b12e --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httprouterule.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// HTTPRouteRuleApplyConfiguration represents an declarative configuration of the HTTPRouteRule type for use +// with apply. +type HTTPRouteRuleApplyConfiguration struct { + Matches []HTTPRouteMatchApplyConfiguration `json:"matches,omitempty"` + Filters []HTTPRouteFilterApplyConfiguration `json:"filters,omitempty"` + BackendRefs []HTTPBackendRefApplyConfiguration `json:"backendRefs,omitempty"` + Timeouts *HTTPRouteTimeoutsApplyConfiguration `json:"timeouts,omitempty"` + SessionPersistence *SessionPersistenceApplyConfiguration `json:"sessionPersistence,omitempty"` +} + +// HTTPRouteRuleApplyConfiguration constructs an declarative configuration of the HTTPRouteRule type for use with +// apply. +func HTTPRouteRule() *HTTPRouteRuleApplyConfiguration { + return &HTTPRouteRuleApplyConfiguration{} +} + +// WithMatches adds the given value to the Matches field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Matches field. +func (b *HTTPRouteRuleApplyConfiguration) WithMatches(values ...*HTTPRouteMatchApplyConfiguration) *HTTPRouteRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMatches") + } + b.Matches = append(b.Matches, *values[i]) + } + return b +} + +// WithFilters adds the given value to the Filters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Filters field. +func (b *HTTPRouteRuleApplyConfiguration) WithFilters(values ...*HTTPRouteFilterApplyConfiguration) *HTTPRouteRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFilters") + } + b.Filters = append(b.Filters, *values[i]) + } + return b +} + +// WithBackendRefs adds the given value to the BackendRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the BackendRefs field. +func (b *HTTPRouteRuleApplyConfiguration) WithBackendRefs(values ...*HTTPBackendRefApplyConfiguration) *HTTPRouteRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithBackendRefs") + } + b.BackendRefs = append(b.BackendRefs, *values[i]) + } + return b +} + +// WithTimeouts sets the Timeouts field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Timeouts field is set to the value of the last call. +func (b *HTTPRouteRuleApplyConfiguration) WithTimeouts(value *HTTPRouteTimeoutsApplyConfiguration) *HTTPRouteRuleApplyConfiguration { + b.Timeouts = value + return b +} + +// WithSessionPersistence sets the SessionPersistence field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SessionPersistence field is set to the value of the last call. +func (b *HTTPRouteRuleApplyConfiguration) WithSessionPersistence(value *SessionPersistenceApplyConfiguration) *HTTPRouteRuleApplyConfiguration { + b.SessionPersistence = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutespec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutespec.go new file mode 100644 index 000000000..21c9dfd86 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutespec.go @@ -0,0 +1,73 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apisv1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// HTTPRouteSpecApplyConfiguration represents an declarative configuration of the HTTPRouteSpec type for use +// with apply. +type HTTPRouteSpecApplyConfiguration struct { + CommonRouteSpecApplyConfiguration `json:",inline"` + Hostnames []apisv1.Hostname `json:"hostnames,omitempty"` + Rules []HTTPRouteRuleApplyConfiguration `json:"rules,omitempty"` +} + +// HTTPRouteSpecApplyConfiguration constructs an declarative configuration of the HTTPRouteSpec type for use with +// apply. +func HTTPRouteSpec() *HTTPRouteSpecApplyConfiguration { + return &HTTPRouteSpecApplyConfiguration{} +} + +// WithParentRefs adds the given value to the ParentRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ParentRefs field. +func (b *HTTPRouteSpecApplyConfiguration) WithParentRefs(values ...*ParentReferenceApplyConfiguration) *HTTPRouteSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithParentRefs") + } + b.ParentRefs = append(b.ParentRefs, *values[i]) + } + return b +} + +// WithHostnames adds the given value to the Hostnames field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Hostnames field. +func (b *HTTPRouteSpecApplyConfiguration) WithHostnames(values ...apisv1.Hostname) *HTTPRouteSpecApplyConfiguration { + for i := range values { + b.Hostnames = append(b.Hostnames, values[i]) + } + return b +} + +// WithRules adds the given value to the Rules field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Rules field. +func (b *HTTPRouteSpecApplyConfiguration) WithRules(values ...*HTTPRouteRuleApplyConfiguration) *HTTPRouteSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRules") + } + b.Rules = append(b.Rules, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutestatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutestatus.go new file mode 100644 index 000000000..5d87f89ec --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutestatus.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// HTTPRouteStatusApplyConfiguration represents an declarative configuration of the HTTPRouteStatus type for use +// with apply. +type HTTPRouteStatusApplyConfiguration struct { + RouteStatusApplyConfiguration `json:",inline"` +} + +// HTTPRouteStatusApplyConfiguration constructs an declarative configuration of the HTTPRouteStatus type for use with +// apply. +func HTTPRouteStatus() *HTTPRouteStatusApplyConfiguration { + return &HTTPRouteStatusApplyConfiguration{} +} + +// WithParents adds the given value to the Parents field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Parents field. +func (b *HTTPRouteStatusApplyConfiguration) WithParents(values ...*RouteParentStatusApplyConfiguration) *HTTPRouteStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithParents") + } + b.Parents = append(b.Parents, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutetimeouts.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutetimeouts.go new file mode 100644 index 000000000..4594ff17d --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httproutetimeouts.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// HTTPRouteTimeoutsApplyConfiguration represents an declarative configuration of the HTTPRouteTimeouts type for use +// with apply. +type HTTPRouteTimeoutsApplyConfiguration struct { + Request *v1.Duration `json:"request,omitempty"` + BackendRequest *v1.Duration `json:"backendRequest,omitempty"` +} + +// HTTPRouteTimeoutsApplyConfiguration constructs an declarative configuration of the HTTPRouteTimeouts type for use with +// apply. +func HTTPRouteTimeouts() *HTTPRouteTimeoutsApplyConfiguration { + return &HTTPRouteTimeoutsApplyConfiguration{} +} + +// WithRequest sets the Request field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Request field is set to the value of the last call. +func (b *HTTPRouteTimeoutsApplyConfiguration) WithRequest(value v1.Duration) *HTTPRouteTimeoutsApplyConfiguration { + b.Request = &value + return b +} + +// WithBackendRequest sets the BackendRequest field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BackendRequest field is set to the value of the last call. +func (b *HTTPRouteTimeoutsApplyConfiguration) WithBackendRequest(value v1.Duration) *HTTPRouteTimeoutsApplyConfiguration { + b.BackendRequest = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpurlrewritefilter.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpurlrewritefilter.go new file mode 100644 index 000000000..cf8e0130c --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/httpurlrewritefilter.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// HTTPURLRewriteFilterApplyConfiguration represents an declarative configuration of the HTTPURLRewriteFilter type for use +// with apply. +type HTTPURLRewriteFilterApplyConfiguration struct { + Hostname *v1.PreciseHostname `json:"hostname,omitempty"` + Path *HTTPPathModifierApplyConfiguration `json:"path,omitempty"` +} + +// HTTPURLRewriteFilterApplyConfiguration constructs an declarative configuration of the HTTPURLRewriteFilter type for use with +// apply. +func HTTPURLRewriteFilter() *HTTPURLRewriteFilterApplyConfiguration { + return &HTTPURLRewriteFilterApplyConfiguration{} +} + +// WithHostname sets the Hostname field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Hostname field is set to the value of the last call. +func (b *HTTPURLRewriteFilterApplyConfiguration) WithHostname(value v1.PreciseHostname) *HTTPURLRewriteFilterApplyConfiguration { + b.Hostname = &value + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *HTTPURLRewriteFilterApplyConfiguration) WithPath(value *HTTPPathModifierApplyConfiguration) *HTTPURLRewriteFilterApplyConfiguration { + b.Path = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listener.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listener.go new file mode 100644 index 000000000..b65c09030 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listener.go @@ -0,0 +1,88 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// ListenerApplyConfiguration represents an declarative configuration of the Listener type for use +// with apply. +type ListenerApplyConfiguration struct { + Name *v1.SectionName `json:"name,omitempty"` + Hostname *v1.Hostname `json:"hostname,omitempty"` + Port *v1.PortNumber `json:"port,omitempty"` + Protocol *v1.ProtocolType `json:"protocol,omitempty"` + TLS *GatewayTLSConfigApplyConfiguration `json:"tls,omitempty"` + AllowedRoutes *AllowedRoutesApplyConfiguration `json:"allowedRoutes,omitempty"` +} + +// ListenerApplyConfiguration constructs an declarative configuration of the Listener type for use with +// apply. +func Listener() *ListenerApplyConfiguration { + return &ListenerApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ListenerApplyConfiguration) WithName(value v1.SectionName) *ListenerApplyConfiguration { + b.Name = &value + return b +} + +// WithHostname sets the Hostname field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Hostname field is set to the value of the last call. +func (b *ListenerApplyConfiguration) WithHostname(value v1.Hostname) *ListenerApplyConfiguration { + b.Hostname = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *ListenerApplyConfiguration) WithPort(value v1.PortNumber) *ListenerApplyConfiguration { + b.Port = &value + return b +} + +// WithProtocol sets the Protocol field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Protocol field is set to the value of the last call. +func (b *ListenerApplyConfiguration) WithProtocol(value v1.ProtocolType) *ListenerApplyConfiguration { + b.Protocol = &value + return b +} + +// WithTLS sets the TLS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLS field is set to the value of the last call. +func (b *ListenerApplyConfiguration) WithTLS(value *GatewayTLSConfigApplyConfiguration) *ListenerApplyConfiguration { + b.TLS = value + return b +} + +// WithAllowedRoutes sets the AllowedRoutes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllowedRoutes field is set to the value of the last call. +func (b *ListenerApplyConfiguration) WithAllowedRoutes(value *AllowedRoutesApplyConfiguration) *ListenerApplyConfiguration { + b.AllowedRoutes = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listenerstatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listenerstatus.go new file mode 100644 index 000000000..25e7e5cef --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/listenerstatus.go @@ -0,0 +1,78 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// ListenerStatusApplyConfiguration represents an declarative configuration of the ListenerStatus type for use +// with apply. +type ListenerStatusApplyConfiguration struct { + Name *v1.SectionName `json:"name,omitempty"` + SupportedKinds []RouteGroupKindApplyConfiguration `json:"supportedKinds,omitempty"` + AttachedRoutes *int32 `json:"attachedRoutes,omitempty"` + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// ListenerStatusApplyConfiguration constructs an declarative configuration of the ListenerStatus type for use with +// apply. +func ListenerStatus() *ListenerStatusApplyConfiguration { + return &ListenerStatusApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ListenerStatusApplyConfiguration) WithName(value v1.SectionName) *ListenerStatusApplyConfiguration { + b.Name = &value + return b +} + +// WithSupportedKinds adds the given value to the SupportedKinds field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SupportedKinds field. +func (b *ListenerStatusApplyConfiguration) WithSupportedKinds(values ...*RouteGroupKindApplyConfiguration) *ListenerStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSupportedKinds") + } + b.SupportedKinds = append(b.SupportedKinds, *values[i]) + } + return b +} + +// WithAttachedRoutes sets the AttachedRoutes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AttachedRoutes field is set to the value of the last call. +func (b *ListenerStatusApplyConfiguration) WithAttachedRoutes(value int32) *ListenerStatusApplyConfiguration { + b.AttachedRoutes = &value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *ListenerStatusApplyConfiguration) WithConditions(values ...metav1.Condition) *ListenerStatusApplyConfiguration { + for i := range values { + b.Conditions = append(b.Conditions, values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localobjectreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localobjectreference.go new file mode 100644 index 000000000..1bb4b9a81 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localobjectreference.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// LocalObjectReferenceApplyConfiguration represents an declarative configuration of the LocalObjectReference type for use +// with apply. +type LocalObjectReferenceApplyConfiguration struct { + Group *v1.Group `json:"group,omitempty"` + Kind *v1.Kind `json:"kind,omitempty"` + Name *v1.ObjectName `json:"name,omitempty"` +} + +// LocalObjectReferenceApplyConfiguration constructs an declarative configuration of the LocalObjectReference type for use with +// apply. +func LocalObjectReference() *LocalObjectReferenceApplyConfiguration { + return &LocalObjectReferenceApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *LocalObjectReferenceApplyConfiguration) WithGroup(value v1.Group) *LocalObjectReferenceApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *LocalObjectReferenceApplyConfiguration) WithKind(value v1.Kind) *LocalObjectReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *LocalObjectReferenceApplyConfiguration) WithName(value v1.ObjectName) *LocalObjectReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localparametersreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localparametersreference.go new file mode 100644 index 000000000..d15c55b77 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/localparametersreference.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// LocalParametersReferenceApplyConfiguration represents an declarative configuration of the LocalParametersReference type for use +// with apply. +type LocalParametersReferenceApplyConfiguration struct { + Group *v1.Group `json:"group,omitempty"` + Kind *v1.Kind `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` +} + +// LocalParametersReferenceApplyConfiguration constructs an declarative configuration of the LocalParametersReference type for use with +// apply. +func LocalParametersReference() *LocalParametersReferenceApplyConfiguration { + return &LocalParametersReferenceApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *LocalParametersReferenceApplyConfiguration) WithGroup(value v1.Group) *LocalParametersReferenceApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *LocalParametersReferenceApplyConfiguration) WithKind(value v1.Kind) *LocalParametersReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *LocalParametersReferenceApplyConfiguration) WithName(value string) *LocalParametersReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/objectreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/objectreference.go new file mode 100644 index 000000000..4580fe61a --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/objectreference.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// ObjectReferenceApplyConfiguration represents an declarative configuration of the ObjectReference type for use +// with apply. +type ObjectReferenceApplyConfiguration struct { + Group *v1.Group `json:"group,omitempty"` + Kind *v1.Kind `json:"kind,omitempty"` + Name *v1.ObjectName `json:"name,omitempty"` + Namespace *v1.Namespace `json:"namespace,omitempty"` +} + +// ObjectReferenceApplyConfiguration constructs an declarative configuration of the ObjectReference type for use with +// apply. +func ObjectReference() *ObjectReferenceApplyConfiguration { + return &ObjectReferenceApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithGroup(value v1.Group) *ObjectReferenceApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithKind(value v1.Kind) *ObjectReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithName(value v1.ObjectName) *ObjectReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithNamespace(value v1.Namespace) *ObjectReferenceApplyConfiguration { + b.Namespace = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parametersreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parametersreference.go new file mode 100644 index 000000000..b7a3ae27d --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parametersreference.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// ParametersReferenceApplyConfiguration represents an declarative configuration of the ParametersReference type for use +// with apply. +type ParametersReferenceApplyConfiguration struct { + Group *v1.Group `json:"group,omitempty"` + Kind *v1.Kind `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Namespace *v1.Namespace `json:"namespace,omitempty"` +} + +// ParametersReferenceApplyConfiguration constructs an declarative configuration of the ParametersReference type for use with +// apply. +func ParametersReference() *ParametersReferenceApplyConfiguration { + return &ParametersReferenceApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *ParametersReferenceApplyConfiguration) WithGroup(value v1.Group) *ParametersReferenceApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ParametersReferenceApplyConfiguration) WithKind(value v1.Kind) *ParametersReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ParametersReferenceApplyConfiguration) WithName(value string) *ParametersReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ParametersReferenceApplyConfiguration) WithNamespace(value v1.Namespace) *ParametersReferenceApplyConfiguration { + b.Namespace = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parentreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parentreference.go new file mode 100644 index 000000000..2c39a8344 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/parentreference.go @@ -0,0 +1,88 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// ParentReferenceApplyConfiguration represents an declarative configuration of the ParentReference type for use +// with apply. +type ParentReferenceApplyConfiguration struct { + Group *v1.Group `json:"group,omitempty"` + Kind *v1.Kind `json:"kind,omitempty"` + Namespace *v1.Namespace `json:"namespace,omitempty"` + Name *v1.ObjectName `json:"name,omitempty"` + SectionName *v1.SectionName `json:"sectionName,omitempty"` + Port *v1.PortNumber `json:"port,omitempty"` +} + +// ParentReferenceApplyConfiguration constructs an declarative configuration of the ParentReference type for use with +// apply. +func ParentReference() *ParentReferenceApplyConfiguration { + return &ParentReferenceApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *ParentReferenceApplyConfiguration) WithGroup(value v1.Group) *ParentReferenceApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ParentReferenceApplyConfiguration) WithKind(value v1.Kind) *ParentReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ParentReferenceApplyConfiguration) WithNamespace(value v1.Namespace) *ParentReferenceApplyConfiguration { + b.Namespace = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ParentReferenceApplyConfiguration) WithName(value v1.ObjectName) *ParentReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithSectionName sets the SectionName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SectionName field is set to the value of the last call. +func (b *ParentReferenceApplyConfiguration) WithSectionName(value v1.SectionName) *ParentReferenceApplyConfiguration { + b.SectionName = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *ParentReferenceApplyConfiguration) WithPort(value v1.PortNumber) *ParentReferenceApplyConfiguration { + b.Port = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routegroupkind.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routegroupkind.go new file mode 100644 index 000000000..84a9b57a2 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routegroupkind.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// RouteGroupKindApplyConfiguration represents an declarative configuration of the RouteGroupKind type for use +// with apply. +type RouteGroupKindApplyConfiguration struct { + Group *v1.Group `json:"group,omitempty"` + Kind *v1.Kind `json:"kind,omitempty"` +} + +// RouteGroupKindApplyConfiguration constructs an declarative configuration of the RouteGroupKind type for use with +// apply. +func RouteGroupKind() *RouteGroupKindApplyConfiguration { + return &RouteGroupKindApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *RouteGroupKindApplyConfiguration) WithGroup(value v1.Group) *RouteGroupKindApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *RouteGroupKindApplyConfiguration) WithKind(value v1.Kind) *RouteGroupKindApplyConfiguration { + b.Kind = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routenamespaces.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routenamespaces.go new file mode 100644 index 000000000..9c3b6eb65 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routenamespaces.go @@ -0,0 +1,53 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// RouteNamespacesApplyConfiguration represents an declarative configuration of the RouteNamespaces type for use +// with apply. +type RouteNamespacesApplyConfiguration struct { + From *v1.FromNamespaces `json:"from,omitempty"` + Selector *metav1.LabelSelector `json:"selector,omitempty"` +} + +// RouteNamespacesApplyConfiguration constructs an declarative configuration of the RouteNamespaces type for use with +// apply. +func RouteNamespaces() *RouteNamespacesApplyConfiguration { + return &RouteNamespacesApplyConfiguration{} +} + +// WithFrom sets the From field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the From field is set to the value of the last call. +func (b *RouteNamespacesApplyConfiguration) WithFrom(value v1.FromNamespaces) *RouteNamespacesApplyConfiguration { + b.From = &value + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *RouteNamespacesApplyConfiguration) WithSelector(value metav1.LabelSelector) *RouteNamespacesApplyConfiguration { + b.Selector = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routeparentstatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routeparentstatus.go new file mode 100644 index 000000000..38a4e3832 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routeparentstatus.go @@ -0,0 +1,64 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + apisv1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// RouteParentStatusApplyConfiguration represents an declarative configuration of the RouteParentStatus type for use +// with apply. +type RouteParentStatusApplyConfiguration struct { + ParentRef *ParentReferenceApplyConfiguration `json:"parentRef,omitempty"` + ControllerName *apisv1.GatewayController `json:"controllerName,omitempty"` + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// RouteParentStatusApplyConfiguration constructs an declarative configuration of the RouteParentStatus type for use with +// apply. +func RouteParentStatus() *RouteParentStatusApplyConfiguration { + return &RouteParentStatusApplyConfiguration{} +} + +// WithParentRef sets the ParentRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ParentRef field is set to the value of the last call. +func (b *RouteParentStatusApplyConfiguration) WithParentRef(value *ParentReferenceApplyConfiguration) *RouteParentStatusApplyConfiguration { + b.ParentRef = value + return b +} + +// WithControllerName sets the ControllerName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControllerName field is set to the value of the last call. +func (b *RouteParentStatusApplyConfiguration) WithControllerName(value apisv1.GatewayController) *RouteParentStatusApplyConfiguration { + b.ControllerName = &value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *RouteParentStatusApplyConfiguration) WithConditions(values ...metav1.Condition) *RouteParentStatusApplyConfiguration { + for i := range values { + b.Conditions = append(b.Conditions, values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routestatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routestatus.go new file mode 100644 index 000000000..5ef84f802 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/routestatus.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// RouteStatusApplyConfiguration represents an declarative configuration of the RouteStatus type for use +// with apply. +type RouteStatusApplyConfiguration struct { + Parents []RouteParentStatusApplyConfiguration `json:"parents,omitempty"` +} + +// RouteStatusApplyConfiguration constructs an declarative configuration of the RouteStatus type for use with +// apply. +func RouteStatus() *RouteStatusApplyConfiguration { + return &RouteStatusApplyConfiguration{} +} + +// WithParents adds the given value to the Parents field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Parents field. +func (b *RouteStatusApplyConfiguration) WithParents(values ...*RouteParentStatusApplyConfiguration) *RouteStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithParents") + } + b.Parents = append(b.Parents, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/secretobjectreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/secretobjectreference.go new file mode 100644 index 000000000..771fdb0ab --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/secretobjectreference.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// SecretObjectReferenceApplyConfiguration represents an declarative configuration of the SecretObjectReference type for use +// with apply. +type SecretObjectReferenceApplyConfiguration struct { + Group *v1.Group `json:"group,omitempty"` + Kind *v1.Kind `json:"kind,omitempty"` + Name *v1.ObjectName `json:"name,omitempty"` + Namespace *v1.Namespace `json:"namespace,omitempty"` +} + +// SecretObjectReferenceApplyConfiguration constructs an declarative configuration of the SecretObjectReference type for use with +// apply. +func SecretObjectReference() *SecretObjectReferenceApplyConfiguration { + return &SecretObjectReferenceApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *SecretObjectReferenceApplyConfiguration) WithGroup(value v1.Group) *SecretObjectReferenceApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *SecretObjectReferenceApplyConfiguration) WithKind(value v1.Kind) *SecretObjectReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *SecretObjectReferenceApplyConfiguration) WithName(value v1.ObjectName) *SecretObjectReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *SecretObjectReferenceApplyConfiguration) WithNamespace(value v1.Namespace) *SecretObjectReferenceApplyConfiguration { + b.Namespace = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/sessionpersistence.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/sessionpersistence.go new file mode 100644 index 000000000..7b9de44e3 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1/sessionpersistence.go @@ -0,0 +1,79 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// SessionPersistenceApplyConfiguration represents an declarative configuration of the SessionPersistence type for use +// with apply. +type SessionPersistenceApplyConfiguration struct { + SessionName *string `json:"sessionName,omitempty"` + AbsoluteTimeout *v1.Duration `json:"absoluteTimeout,omitempty"` + IdleTimeout *v1.Duration `json:"idleTimeout,omitempty"` + Type *v1.SessionPersistenceType `json:"type,omitempty"` + CookieConfig *CookieConfigApplyConfiguration `json:"cookieConfig,omitempty"` +} + +// SessionPersistenceApplyConfiguration constructs an declarative configuration of the SessionPersistence type for use with +// apply. +func SessionPersistence() *SessionPersistenceApplyConfiguration { + return &SessionPersistenceApplyConfiguration{} +} + +// WithSessionName sets the SessionName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SessionName field is set to the value of the last call. +func (b *SessionPersistenceApplyConfiguration) WithSessionName(value string) *SessionPersistenceApplyConfiguration { + b.SessionName = &value + return b +} + +// WithAbsoluteTimeout sets the AbsoluteTimeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AbsoluteTimeout field is set to the value of the last call. +func (b *SessionPersistenceApplyConfiguration) WithAbsoluteTimeout(value v1.Duration) *SessionPersistenceApplyConfiguration { + b.AbsoluteTimeout = &value + return b +} + +// WithIdleTimeout sets the IdleTimeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IdleTimeout field is set to the value of the last call. +func (b *SessionPersistenceApplyConfiguration) WithIdleTimeout(value v1.Duration) *SessionPersistenceApplyConfiguration { + b.IdleTimeout = &value + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *SessionPersistenceApplyConfiguration) WithType(value v1.SessionPersistenceType) *SessionPersistenceApplyConfiguration { + b.Type = &value + return b +} + +// WithCookieConfig sets the CookieConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CookieConfig field is set to the value of the last call. +func (b *SessionPersistenceApplyConfiguration) WithCookieConfig(value *CookieConfigApplyConfiguration) *SessionPersistenceApplyConfiguration { + b.CookieConfig = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicy.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicy.go new file mode 100644 index 000000000..fd340bd01 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicy.go @@ -0,0 +1,258 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +) + +// BackendLBPolicyApplyConfiguration represents an declarative configuration of the BackendLBPolicy type for use +// with apply. +type BackendLBPolicyApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *BackendLBPolicySpecApplyConfiguration `json:"spec,omitempty"` + Status *PolicyStatusApplyConfiguration `json:"status,omitempty"` +} + +// BackendLBPolicy constructs an declarative configuration of the BackendLBPolicy type for use with +// apply. +func BackendLBPolicy(name, namespace string) *BackendLBPolicyApplyConfiguration { + b := &BackendLBPolicyApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("BackendLBPolicy") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") + return b +} + +// ExtractBackendLBPolicy extracts the applied configuration owned by fieldManager from +// backendLBPolicy. If no managedFields are found in backendLBPolicy for fieldManager, a +// BackendLBPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// backendLBPolicy must be a unmodified BackendLBPolicy API object that was retrieved from the Kubernetes API. +// ExtractBackendLBPolicy provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractBackendLBPolicy(backendLBPolicy *apisv1alpha2.BackendLBPolicy, fieldManager string) (*BackendLBPolicyApplyConfiguration, error) { + return extractBackendLBPolicy(backendLBPolicy, fieldManager, "") +} + +// ExtractBackendLBPolicyStatus is the same as ExtractBackendLBPolicy except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractBackendLBPolicyStatus(backendLBPolicy *apisv1alpha2.BackendLBPolicy, fieldManager string) (*BackendLBPolicyApplyConfiguration, error) { + return extractBackendLBPolicy(backendLBPolicy, fieldManager, "status") +} + +func extractBackendLBPolicy(backendLBPolicy *apisv1alpha2.BackendLBPolicy, fieldManager string, subresource string) (*BackendLBPolicyApplyConfiguration, error) { + b := &BackendLBPolicyApplyConfiguration{} + err := managedfields.ExtractInto(backendLBPolicy, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1alpha2.BackendLBPolicy"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(backendLBPolicy.Name) + b.WithNamespace(backendLBPolicy.Namespace) + + b.WithKind("BackendLBPolicy") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *BackendLBPolicyApplyConfiguration) WithKind(value string) *BackendLBPolicyApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *BackendLBPolicyApplyConfiguration) WithAPIVersion(value string) *BackendLBPolicyApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *BackendLBPolicyApplyConfiguration) WithName(value string) *BackendLBPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *BackendLBPolicyApplyConfiguration) WithGenerateName(value string) *BackendLBPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *BackendLBPolicyApplyConfiguration) WithNamespace(value string) *BackendLBPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *BackendLBPolicyApplyConfiguration) WithUID(value types.UID) *BackendLBPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *BackendLBPolicyApplyConfiguration) WithResourceVersion(value string) *BackendLBPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *BackendLBPolicyApplyConfiguration) WithGeneration(value int64) *BackendLBPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *BackendLBPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *BackendLBPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *BackendLBPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *BackendLBPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *BackendLBPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *BackendLBPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *BackendLBPolicyApplyConfiguration) WithLabels(entries map[string]string) *BackendLBPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *BackendLBPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *BackendLBPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *BackendLBPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *BackendLBPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *BackendLBPolicyApplyConfiguration) WithFinalizers(values ...string) *BackendLBPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *BackendLBPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *BackendLBPolicyApplyConfiguration) WithSpec(value *BackendLBPolicySpecApplyConfiguration) *BackendLBPolicyApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *BackendLBPolicyApplyConfiguration) WithStatus(value *PolicyStatusApplyConfiguration) *BackendLBPolicyApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicyspec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicyspec.go new file mode 100644 index 000000000..c233994c6 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/backendlbpolicyspec.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" +) + +// BackendLBPolicySpecApplyConfiguration represents an declarative configuration of the BackendLBPolicySpec type for use +// with apply. +type BackendLBPolicySpecApplyConfiguration struct { + TargetRefs []LocalPolicyTargetReferenceApplyConfiguration `json:"targetRefs,omitempty"` + SessionPersistence *v1.SessionPersistenceApplyConfiguration `json:"sessionPersistence,omitempty"` +} + +// BackendLBPolicySpecApplyConfiguration constructs an declarative configuration of the BackendLBPolicySpec type for use with +// apply. +func BackendLBPolicySpec() *BackendLBPolicySpecApplyConfiguration { + return &BackendLBPolicySpecApplyConfiguration{} +} + +// WithTargetRefs adds the given value to the TargetRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TargetRefs field. +func (b *BackendLBPolicySpecApplyConfiguration) WithTargetRefs(values ...*LocalPolicyTargetReferenceApplyConfiguration) *BackendLBPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTargetRefs") + } + b.TargetRefs = append(b.TargetRefs, *values[i]) + } + return b +} + +// WithSessionPersistence sets the SessionPersistence field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SessionPersistence field is set to the value of the last call. +func (b *BackendLBPolicySpecApplyConfiguration) WithSessionPersistence(value *v1.SessionPersistenceApplyConfiguration) *BackendLBPolicySpecApplyConfiguration { + b.SessionPersistence = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/grpcroute.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/grpcroute.go new file mode 100644 index 000000000..cc095e08c --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/grpcroute.go @@ -0,0 +1,259 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +) + +// GRPCRouteApplyConfiguration represents an declarative configuration of the GRPCRoute type for use +// with apply. +type GRPCRouteApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *apisv1.GRPCRouteSpecApplyConfiguration `json:"spec,omitempty"` + Status *apisv1.GRPCRouteStatusApplyConfiguration `json:"status,omitempty"` +} + +// GRPCRoute constructs an declarative configuration of the GRPCRoute type for use with +// apply. +func GRPCRoute(name, namespace string) *GRPCRouteApplyConfiguration { + b := &GRPCRouteApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("GRPCRoute") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") + return b +} + +// ExtractGRPCRoute extracts the applied configuration owned by fieldManager from +// gRPCRoute. If no managedFields are found in gRPCRoute for fieldManager, a +// GRPCRouteApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// gRPCRoute must be a unmodified GRPCRoute API object that was retrieved from the Kubernetes API. +// ExtractGRPCRoute provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractGRPCRoute(gRPCRoute *v1alpha2.GRPCRoute, fieldManager string) (*GRPCRouteApplyConfiguration, error) { + return extractGRPCRoute(gRPCRoute, fieldManager, "") +} + +// ExtractGRPCRouteStatus is the same as ExtractGRPCRoute except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractGRPCRouteStatus(gRPCRoute *v1alpha2.GRPCRoute, fieldManager string) (*GRPCRouteApplyConfiguration, error) { + return extractGRPCRoute(gRPCRoute, fieldManager, "status") +} + +func extractGRPCRoute(gRPCRoute *v1alpha2.GRPCRoute, fieldManager string, subresource string) (*GRPCRouteApplyConfiguration, error) { + b := &GRPCRouteApplyConfiguration{} + err := managedfields.ExtractInto(gRPCRoute, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1alpha2.GRPCRoute"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(gRPCRoute.Name) + b.WithNamespace(gRPCRoute.Namespace) + + b.WithKind("GRPCRoute") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithKind(value string) *GRPCRouteApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithAPIVersion(value string) *GRPCRouteApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithName(value string) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithGenerateName(value string) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithNamespace(value string) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithUID(value types.UID) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithResourceVersion(value string) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithGeneration(value int64) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithCreationTimestamp(value metav1.Time) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *GRPCRouteApplyConfiguration) WithLabels(entries map[string]string) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *GRPCRouteApplyConfiguration) WithAnnotations(entries map[string]string) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *GRPCRouteApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *GRPCRouteApplyConfiguration) WithFinalizers(values ...string) *GRPCRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *GRPCRouteApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithSpec(value *apisv1.GRPCRouteSpecApplyConfiguration) *GRPCRouteApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *GRPCRouteApplyConfiguration) WithStatus(value *apisv1.GRPCRouteStatusApplyConfiguration) *GRPCRouteApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreference.go new file mode 100644 index 000000000..b4999d79c --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreference.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// LocalPolicyTargetReferenceApplyConfiguration represents an declarative configuration of the LocalPolicyTargetReference type for use +// with apply. +type LocalPolicyTargetReferenceApplyConfiguration struct { + Group *v1.Group `json:"group,omitempty"` + Kind *v1.Kind `json:"kind,omitempty"` + Name *v1.ObjectName `json:"name,omitempty"` +} + +// LocalPolicyTargetReferenceApplyConfiguration constructs an declarative configuration of the LocalPolicyTargetReference type for use with +// apply. +func LocalPolicyTargetReference() *LocalPolicyTargetReferenceApplyConfiguration { + return &LocalPolicyTargetReferenceApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *LocalPolicyTargetReferenceApplyConfiguration) WithGroup(value v1.Group) *LocalPolicyTargetReferenceApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *LocalPolicyTargetReferenceApplyConfiguration) WithKind(value v1.Kind) *LocalPolicyTargetReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *LocalPolicyTargetReferenceApplyConfiguration) WithName(value v1.ObjectName) *LocalPolicyTargetReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreferencewithsectionname.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreferencewithsectionname.go new file mode 100644 index 000000000..259da87bc --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreferencewithsectionname.go @@ -0,0 +1,68 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// LocalPolicyTargetReferenceWithSectionNameApplyConfiguration represents an declarative configuration of the LocalPolicyTargetReferenceWithSectionName type for use +// with apply. +type LocalPolicyTargetReferenceWithSectionNameApplyConfiguration struct { + LocalPolicyTargetReferenceApplyConfiguration `json:",inline"` + SectionName *v1.SectionName `json:"sectionName,omitempty"` +} + +// LocalPolicyTargetReferenceWithSectionNameApplyConfiguration constructs an declarative configuration of the LocalPolicyTargetReferenceWithSectionName type for use with +// apply. +func LocalPolicyTargetReferenceWithSectionName() *LocalPolicyTargetReferenceWithSectionNameApplyConfiguration { + return &LocalPolicyTargetReferenceWithSectionNameApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *LocalPolicyTargetReferenceWithSectionNameApplyConfiguration) WithGroup(value v1.Group) *LocalPolicyTargetReferenceWithSectionNameApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *LocalPolicyTargetReferenceWithSectionNameApplyConfiguration) WithKind(value v1.Kind) *LocalPolicyTargetReferenceWithSectionNameApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *LocalPolicyTargetReferenceWithSectionNameApplyConfiguration) WithName(value v1.ObjectName) *LocalPolicyTargetReferenceWithSectionNameApplyConfiguration { + b.Name = &value + return b +} + +// WithSectionName sets the SectionName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SectionName field is set to the value of the last call. +func (b *LocalPolicyTargetReferenceWithSectionNameApplyConfiguration) WithSectionName(value v1.SectionName) *LocalPolicyTargetReferenceWithSectionNameApplyConfiguration { + b.SectionName = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policyancestorstatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policyancestorstatus.go new file mode 100644 index 000000000..7757e8b3e --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policyancestorstatus.go @@ -0,0 +1,65 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// PolicyAncestorStatusApplyConfiguration represents an declarative configuration of the PolicyAncestorStatus type for use +// with apply. +type PolicyAncestorStatusApplyConfiguration struct { + AncestorRef *v1.ParentReferenceApplyConfiguration `json:"ancestorRef,omitempty"` + ControllerName *apisv1.GatewayController `json:"controllerName,omitempty"` + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// PolicyAncestorStatusApplyConfiguration constructs an declarative configuration of the PolicyAncestorStatus type for use with +// apply. +func PolicyAncestorStatus() *PolicyAncestorStatusApplyConfiguration { + return &PolicyAncestorStatusApplyConfiguration{} +} + +// WithAncestorRef sets the AncestorRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AncestorRef field is set to the value of the last call. +func (b *PolicyAncestorStatusApplyConfiguration) WithAncestorRef(value *v1.ParentReferenceApplyConfiguration) *PolicyAncestorStatusApplyConfiguration { + b.AncestorRef = value + return b +} + +// WithControllerName sets the ControllerName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControllerName field is set to the value of the last call. +func (b *PolicyAncestorStatusApplyConfiguration) WithControllerName(value apisv1.GatewayController) *PolicyAncestorStatusApplyConfiguration { + b.ControllerName = &value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *PolicyAncestorStatusApplyConfiguration) WithConditions(values ...metav1.Condition) *PolicyAncestorStatusApplyConfiguration { + for i := range values { + b.Conditions = append(b.Conditions, values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policystatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policystatus.go new file mode 100644 index 000000000..86063588f --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policystatus.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +// PolicyStatusApplyConfiguration represents an declarative configuration of the PolicyStatus type for use +// with apply. +type PolicyStatusApplyConfiguration struct { + Ancestors []PolicyAncestorStatusApplyConfiguration `json:"ancestors,omitempty"` +} + +// PolicyStatusApplyConfiguration constructs an declarative configuration of the PolicyStatus type for use with +// apply. +func PolicyStatus() *PolicyStatusApplyConfiguration { + return &PolicyStatusApplyConfiguration{} +} + +// WithAncestors adds the given value to the Ancestors field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ancestors field. +func (b *PolicyStatusApplyConfiguration) WithAncestors(values ...*PolicyAncestorStatusApplyConfiguration) *PolicyStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAncestors") + } + b.Ancestors = append(b.Ancestors, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policytargetreference.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policytargetreference.go new file mode 100644 index 000000000..2c3f53999 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policytargetreference.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// PolicyTargetReferenceApplyConfiguration represents an declarative configuration of the PolicyTargetReference type for use +// with apply. +type PolicyTargetReferenceApplyConfiguration struct { + Group *v1.Group `json:"group,omitempty"` + Kind *v1.Kind `json:"kind,omitempty"` + Name *v1.ObjectName `json:"name,omitempty"` + Namespace *v1.Namespace `json:"namespace,omitempty"` +} + +// PolicyTargetReferenceApplyConfiguration constructs an declarative configuration of the PolicyTargetReference type for use with +// apply. +func PolicyTargetReference() *PolicyTargetReferenceApplyConfiguration { + return &PolicyTargetReferenceApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *PolicyTargetReferenceApplyConfiguration) WithGroup(value v1.Group) *PolicyTargetReferenceApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *PolicyTargetReferenceApplyConfiguration) WithKind(value v1.Kind) *PolicyTargetReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PolicyTargetReferenceApplyConfiguration) WithName(value v1.ObjectName) *PolicyTargetReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *PolicyTargetReferenceApplyConfiguration) WithNamespace(value v1.Namespace) *PolicyTargetReferenceApplyConfiguration { + b.Namespace = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policytargetreferencewithsectionname.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policytargetreferencewithsectionname.go new file mode 100644 index 000000000..81b30045a --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/policytargetreferencewithsectionname.go @@ -0,0 +1,76 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// PolicyTargetReferenceWithSectionNameApplyConfiguration represents an declarative configuration of the PolicyTargetReferenceWithSectionName type for use +// with apply. +type PolicyTargetReferenceWithSectionNameApplyConfiguration struct { + PolicyTargetReferenceApplyConfiguration `json:",inline"` + SectionName *v1.SectionName `json:"sectionName,omitempty"` +} + +// PolicyTargetReferenceWithSectionNameApplyConfiguration constructs an declarative configuration of the PolicyTargetReferenceWithSectionName type for use with +// apply. +func PolicyTargetReferenceWithSectionName() *PolicyTargetReferenceWithSectionNameApplyConfiguration { + return &PolicyTargetReferenceWithSectionNameApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *PolicyTargetReferenceWithSectionNameApplyConfiguration) WithGroup(value v1.Group) *PolicyTargetReferenceWithSectionNameApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *PolicyTargetReferenceWithSectionNameApplyConfiguration) WithKind(value v1.Kind) *PolicyTargetReferenceWithSectionNameApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PolicyTargetReferenceWithSectionNameApplyConfiguration) WithName(value v1.ObjectName) *PolicyTargetReferenceWithSectionNameApplyConfiguration { + b.Name = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *PolicyTargetReferenceWithSectionNameApplyConfiguration) WithNamespace(value v1.Namespace) *PolicyTargetReferenceWithSectionNameApplyConfiguration { + b.Namespace = &value + return b +} + +// WithSectionName sets the SectionName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SectionName field is set to the value of the last call. +func (b *PolicyTargetReferenceWithSectionNameApplyConfiguration) WithSectionName(value v1.SectionName) *PolicyTargetReferenceWithSectionNameApplyConfiguration { + b.SectionName = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/referencegrant.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/referencegrant.go new file mode 100644 index 000000000..f7a7f4d1a --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/referencegrant.go @@ -0,0 +1,250 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + v1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +) + +// ReferenceGrantApplyConfiguration represents an declarative configuration of the ReferenceGrant type for use +// with apply. +type ReferenceGrantApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *v1beta1.ReferenceGrantSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ReferenceGrant constructs an declarative configuration of the ReferenceGrant type for use with +// apply. +func ReferenceGrant(name, namespace string) *ReferenceGrantApplyConfiguration { + b := &ReferenceGrantApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ReferenceGrant") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") + return b +} + +// ExtractReferenceGrant extracts the applied configuration owned by fieldManager from +// referenceGrant. If no managedFields are found in referenceGrant for fieldManager, a +// ReferenceGrantApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// referenceGrant must be a unmodified ReferenceGrant API object that was retrieved from the Kubernetes API. +// ExtractReferenceGrant provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractReferenceGrant(referenceGrant *v1alpha2.ReferenceGrant, fieldManager string) (*ReferenceGrantApplyConfiguration, error) { + return extractReferenceGrant(referenceGrant, fieldManager, "") +} + +// ExtractReferenceGrantStatus is the same as ExtractReferenceGrant except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractReferenceGrantStatus(referenceGrant *v1alpha2.ReferenceGrant, fieldManager string) (*ReferenceGrantApplyConfiguration, error) { + return extractReferenceGrant(referenceGrant, fieldManager, "status") +} + +func extractReferenceGrant(referenceGrant *v1alpha2.ReferenceGrant, fieldManager string, subresource string) (*ReferenceGrantApplyConfiguration, error) { + b := &ReferenceGrantApplyConfiguration{} + err := managedfields.ExtractInto(referenceGrant, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1alpha2.ReferenceGrant"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(referenceGrant.Name) + b.WithNamespace(referenceGrant.Namespace) + + b.WithKind("ReferenceGrant") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithKind(value string) *ReferenceGrantApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithAPIVersion(value string) *ReferenceGrantApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithName(value string) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithGenerateName(value string) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithNamespace(value string) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithUID(value types.UID) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithResourceVersion(value string) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithGeneration(value int64) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ReferenceGrantApplyConfiguration) WithLabels(entries map[string]string) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ReferenceGrantApplyConfiguration) WithAnnotations(entries map[string]string) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ReferenceGrantApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ReferenceGrantApplyConfiguration) WithFinalizers(values ...string) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ReferenceGrantApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithSpec(value *v1beta1.ReferenceGrantSpecApplyConfiguration) *ReferenceGrantApplyConfiguration { + b.Spec = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproute.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproute.go new file mode 100644 index 000000000..97556f798 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproute.go @@ -0,0 +1,258 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +) + +// TCPRouteApplyConfiguration represents an declarative configuration of the TCPRoute type for use +// with apply. +type TCPRouteApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *TCPRouteSpecApplyConfiguration `json:"spec,omitempty"` + Status *TCPRouteStatusApplyConfiguration `json:"status,omitempty"` +} + +// TCPRoute constructs an declarative configuration of the TCPRoute type for use with +// apply. +func TCPRoute(name, namespace string) *TCPRouteApplyConfiguration { + b := &TCPRouteApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("TCPRoute") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") + return b +} + +// ExtractTCPRoute extracts the applied configuration owned by fieldManager from +// tCPRoute. If no managedFields are found in tCPRoute for fieldManager, a +// TCPRouteApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// tCPRoute must be a unmodified TCPRoute API object that was retrieved from the Kubernetes API. +// ExtractTCPRoute provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractTCPRoute(tCPRoute *apisv1alpha2.TCPRoute, fieldManager string) (*TCPRouteApplyConfiguration, error) { + return extractTCPRoute(tCPRoute, fieldManager, "") +} + +// ExtractTCPRouteStatus is the same as ExtractTCPRoute except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractTCPRouteStatus(tCPRoute *apisv1alpha2.TCPRoute, fieldManager string) (*TCPRouteApplyConfiguration, error) { + return extractTCPRoute(tCPRoute, fieldManager, "status") +} + +func extractTCPRoute(tCPRoute *apisv1alpha2.TCPRoute, fieldManager string, subresource string) (*TCPRouteApplyConfiguration, error) { + b := &TCPRouteApplyConfiguration{} + err := managedfields.ExtractInto(tCPRoute, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1alpha2.TCPRoute"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(tCPRoute.Name) + b.WithNamespace(tCPRoute.Namespace) + + b.WithKind("TCPRoute") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *TCPRouteApplyConfiguration) WithKind(value string) *TCPRouteApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *TCPRouteApplyConfiguration) WithAPIVersion(value string) *TCPRouteApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *TCPRouteApplyConfiguration) WithName(value string) *TCPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *TCPRouteApplyConfiguration) WithGenerateName(value string) *TCPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *TCPRouteApplyConfiguration) WithNamespace(value string) *TCPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *TCPRouteApplyConfiguration) WithUID(value types.UID) *TCPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *TCPRouteApplyConfiguration) WithResourceVersion(value string) *TCPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *TCPRouteApplyConfiguration) WithGeneration(value int64) *TCPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *TCPRouteApplyConfiguration) WithCreationTimestamp(value metav1.Time) *TCPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *TCPRouteApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *TCPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *TCPRouteApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *TCPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *TCPRouteApplyConfiguration) WithLabels(entries map[string]string) *TCPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *TCPRouteApplyConfiguration) WithAnnotations(entries map[string]string) *TCPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *TCPRouteApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *TCPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *TCPRouteApplyConfiguration) WithFinalizers(values ...string) *TCPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *TCPRouteApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *TCPRouteApplyConfiguration) WithSpec(value *TCPRouteSpecApplyConfiguration) *TCPRouteApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *TCPRouteApplyConfiguration) WithStatus(value *TCPRouteStatusApplyConfiguration) *TCPRouteApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcprouterule.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcprouterule.go new file mode 100644 index 000000000..3c6e418c2 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcprouterule.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" +) + +// TCPRouteRuleApplyConfiguration represents an declarative configuration of the TCPRouteRule type for use +// with apply. +type TCPRouteRuleApplyConfiguration struct { + BackendRefs []v1.BackendRefApplyConfiguration `json:"backendRefs,omitempty"` +} + +// TCPRouteRuleApplyConfiguration constructs an declarative configuration of the TCPRouteRule type for use with +// apply. +func TCPRouteRule() *TCPRouteRuleApplyConfiguration { + return &TCPRouteRuleApplyConfiguration{} +} + +// WithBackendRefs adds the given value to the BackendRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the BackendRefs field. +func (b *TCPRouteRuleApplyConfiguration) WithBackendRefs(values ...*v1.BackendRefApplyConfiguration) *TCPRouteRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithBackendRefs") + } + b.BackendRefs = append(b.BackendRefs, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutespec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutespec.go new file mode 100644 index 000000000..62fdffc7c --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutespec.go @@ -0,0 +1,62 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" +) + +// TCPRouteSpecApplyConfiguration represents an declarative configuration of the TCPRouteSpec type for use +// with apply. +type TCPRouteSpecApplyConfiguration struct { + v1.CommonRouteSpecApplyConfiguration `json:",inline"` + Rules []TCPRouteRuleApplyConfiguration `json:"rules,omitempty"` +} + +// TCPRouteSpecApplyConfiguration constructs an declarative configuration of the TCPRouteSpec type for use with +// apply. +func TCPRouteSpec() *TCPRouteSpecApplyConfiguration { + return &TCPRouteSpecApplyConfiguration{} +} + +// WithParentRefs adds the given value to the ParentRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ParentRefs field. +func (b *TCPRouteSpecApplyConfiguration) WithParentRefs(values ...*v1.ParentReferenceApplyConfiguration) *TCPRouteSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithParentRefs") + } + b.ParentRefs = append(b.ParentRefs, *values[i]) + } + return b +} + +// WithRules adds the given value to the Rules field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Rules field. +func (b *TCPRouteSpecApplyConfiguration) WithRules(values ...*TCPRouteRuleApplyConfiguration) *TCPRouteSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRules") + } + b.Rules = append(b.Rules, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutestatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutestatus.go new file mode 100644 index 000000000..74be49a17 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tcproutestatus.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" +) + +// TCPRouteStatusApplyConfiguration represents an declarative configuration of the TCPRouteStatus type for use +// with apply. +type TCPRouteStatusApplyConfiguration struct { + v1.RouteStatusApplyConfiguration `json:",inline"` +} + +// TCPRouteStatusApplyConfiguration constructs an declarative configuration of the TCPRouteStatus type for use with +// apply. +func TCPRouteStatus() *TCPRouteStatusApplyConfiguration { + return &TCPRouteStatusApplyConfiguration{} +} + +// WithParents adds the given value to the Parents field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Parents field. +func (b *TCPRouteStatusApplyConfiguration) WithParents(values ...*v1.RouteParentStatusApplyConfiguration) *TCPRouteStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithParents") + } + b.Parents = append(b.Parents, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroute.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroute.go new file mode 100644 index 000000000..fba887c1e --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroute.go @@ -0,0 +1,258 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +) + +// TLSRouteApplyConfiguration represents an declarative configuration of the TLSRoute type for use +// with apply. +type TLSRouteApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *TLSRouteSpecApplyConfiguration `json:"spec,omitempty"` + Status *TLSRouteStatusApplyConfiguration `json:"status,omitempty"` +} + +// TLSRoute constructs an declarative configuration of the TLSRoute type for use with +// apply. +func TLSRoute(name, namespace string) *TLSRouteApplyConfiguration { + b := &TLSRouteApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("TLSRoute") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") + return b +} + +// ExtractTLSRoute extracts the applied configuration owned by fieldManager from +// tLSRoute. If no managedFields are found in tLSRoute for fieldManager, a +// TLSRouteApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// tLSRoute must be a unmodified TLSRoute API object that was retrieved from the Kubernetes API. +// ExtractTLSRoute provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractTLSRoute(tLSRoute *apisv1alpha2.TLSRoute, fieldManager string) (*TLSRouteApplyConfiguration, error) { + return extractTLSRoute(tLSRoute, fieldManager, "") +} + +// ExtractTLSRouteStatus is the same as ExtractTLSRoute except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractTLSRouteStatus(tLSRoute *apisv1alpha2.TLSRoute, fieldManager string) (*TLSRouteApplyConfiguration, error) { + return extractTLSRoute(tLSRoute, fieldManager, "status") +} + +func extractTLSRoute(tLSRoute *apisv1alpha2.TLSRoute, fieldManager string, subresource string) (*TLSRouteApplyConfiguration, error) { + b := &TLSRouteApplyConfiguration{} + err := managedfields.ExtractInto(tLSRoute, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1alpha2.TLSRoute"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(tLSRoute.Name) + b.WithNamespace(tLSRoute.Namespace) + + b.WithKind("TLSRoute") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *TLSRouteApplyConfiguration) WithKind(value string) *TLSRouteApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *TLSRouteApplyConfiguration) WithAPIVersion(value string) *TLSRouteApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *TLSRouteApplyConfiguration) WithName(value string) *TLSRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *TLSRouteApplyConfiguration) WithGenerateName(value string) *TLSRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *TLSRouteApplyConfiguration) WithNamespace(value string) *TLSRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *TLSRouteApplyConfiguration) WithUID(value types.UID) *TLSRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *TLSRouteApplyConfiguration) WithResourceVersion(value string) *TLSRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *TLSRouteApplyConfiguration) WithGeneration(value int64) *TLSRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *TLSRouteApplyConfiguration) WithCreationTimestamp(value metav1.Time) *TLSRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *TLSRouteApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *TLSRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *TLSRouteApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *TLSRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *TLSRouteApplyConfiguration) WithLabels(entries map[string]string) *TLSRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *TLSRouteApplyConfiguration) WithAnnotations(entries map[string]string) *TLSRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *TLSRouteApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *TLSRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *TLSRouteApplyConfiguration) WithFinalizers(values ...string) *TLSRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *TLSRouteApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *TLSRouteApplyConfiguration) WithSpec(value *TLSRouteSpecApplyConfiguration) *TLSRouteApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *TLSRouteApplyConfiguration) WithStatus(value *TLSRouteStatusApplyConfiguration) *TLSRouteApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsrouterule.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsrouterule.go new file mode 100644 index 000000000..a2dacdf9b --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsrouterule.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" +) + +// TLSRouteRuleApplyConfiguration represents an declarative configuration of the TLSRouteRule type for use +// with apply. +type TLSRouteRuleApplyConfiguration struct { + BackendRefs []v1.BackendRefApplyConfiguration `json:"backendRefs,omitempty"` +} + +// TLSRouteRuleApplyConfiguration constructs an declarative configuration of the TLSRouteRule type for use with +// apply. +func TLSRouteRule() *TLSRouteRuleApplyConfiguration { + return &TLSRouteRuleApplyConfiguration{} +} + +// WithBackendRefs adds the given value to the BackendRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the BackendRefs field. +func (b *TLSRouteRuleApplyConfiguration) WithBackendRefs(values ...*v1.BackendRefApplyConfiguration) *TLSRouteRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithBackendRefs") + } + b.BackendRefs = append(b.BackendRefs, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutespec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutespec.go new file mode 100644 index 000000000..0f0eb1bbe --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutespec.go @@ -0,0 +1,74 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// TLSRouteSpecApplyConfiguration represents an declarative configuration of the TLSRouteSpec type for use +// with apply. +type TLSRouteSpecApplyConfiguration struct { + v1.CommonRouteSpecApplyConfiguration `json:",inline"` + Hostnames []apisv1.Hostname `json:"hostnames,omitempty"` + Rules []TLSRouteRuleApplyConfiguration `json:"rules,omitempty"` +} + +// TLSRouteSpecApplyConfiguration constructs an declarative configuration of the TLSRouteSpec type for use with +// apply. +func TLSRouteSpec() *TLSRouteSpecApplyConfiguration { + return &TLSRouteSpecApplyConfiguration{} +} + +// WithParentRefs adds the given value to the ParentRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ParentRefs field. +func (b *TLSRouteSpecApplyConfiguration) WithParentRefs(values ...*v1.ParentReferenceApplyConfiguration) *TLSRouteSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithParentRefs") + } + b.ParentRefs = append(b.ParentRefs, *values[i]) + } + return b +} + +// WithHostnames adds the given value to the Hostnames field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Hostnames field. +func (b *TLSRouteSpecApplyConfiguration) WithHostnames(values ...apisv1.Hostname) *TLSRouteSpecApplyConfiguration { + for i := range values { + b.Hostnames = append(b.Hostnames, values[i]) + } + return b +} + +// WithRules adds the given value to the Rules field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Rules field. +func (b *TLSRouteSpecApplyConfiguration) WithRules(values ...*TLSRouteRuleApplyConfiguration) *TLSRouteSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRules") + } + b.Rules = append(b.Rules, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutestatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutestatus.go new file mode 100644 index 000000000..f8677962c --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/tlsroutestatus.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" +) + +// TLSRouteStatusApplyConfiguration represents an declarative configuration of the TLSRouteStatus type for use +// with apply. +type TLSRouteStatusApplyConfiguration struct { + v1.RouteStatusApplyConfiguration `json:",inline"` +} + +// TLSRouteStatusApplyConfiguration constructs an declarative configuration of the TLSRouteStatus type for use with +// apply. +func TLSRouteStatus() *TLSRouteStatusApplyConfiguration { + return &TLSRouteStatusApplyConfiguration{} +} + +// WithParents adds the given value to the Parents field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Parents field. +func (b *TLSRouteStatusApplyConfiguration) WithParents(values ...*v1.RouteParentStatusApplyConfiguration) *TLSRouteStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithParents") + } + b.Parents = append(b.Parents, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproute.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproute.go new file mode 100644 index 000000000..0c8f046c5 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproute.go @@ -0,0 +1,258 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +) + +// UDPRouteApplyConfiguration represents an declarative configuration of the UDPRoute type for use +// with apply. +type UDPRouteApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *UDPRouteSpecApplyConfiguration `json:"spec,omitempty"` + Status *UDPRouteStatusApplyConfiguration `json:"status,omitempty"` +} + +// UDPRoute constructs an declarative configuration of the UDPRoute type for use with +// apply. +func UDPRoute(name, namespace string) *UDPRouteApplyConfiguration { + b := &UDPRouteApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("UDPRoute") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") + return b +} + +// ExtractUDPRoute extracts the applied configuration owned by fieldManager from +// uDPRoute. If no managedFields are found in uDPRoute for fieldManager, a +// UDPRouteApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// uDPRoute must be a unmodified UDPRoute API object that was retrieved from the Kubernetes API. +// ExtractUDPRoute provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractUDPRoute(uDPRoute *apisv1alpha2.UDPRoute, fieldManager string) (*UDPRouteApplyConfiguration, error) { + return extractUDPRoute(uDPRoute, fieldManager, "") +} + +// ExtractUDPRouteStatus is the same as ExtractUDPRoute except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractUDPRouteStatus(uDPRoute *apisv1alpha2.UDPRoute, fieldManager string) (*UDPRouteApplyConfiguration, error) { + return extractUDPRoute(uDPRoute, fieldManager, "status") +} + +func extractUDPRoute(uDPRoute *apisv1alpha2.UDPRoute, fieldManager string, subresource string) (*UDPRouteApplyConfiguration, error) { + b := &UDPRouteApplyConfiguration{} + err := managedfields.ExtractInto(uDPRoute, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1alpha2.UDPRoute"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(uDPRoute.Name) + b.WithNamespace(uDPRoute.Namespace) + + b.WithKind("UDPRoute") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *UDPRouteApplyConfiguration) WithKind(value string) *UDPRouteApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *UDPRouteApplyConfiguration) WithAPIVersion(value string) *UDPRouteApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *UDPRouteApplyConfiguration) WithName(value string) *UDPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *UDPRouteApplyConfiguration) WithGenerateName(value string) *UDPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *UDPRouteApplyConfiguration) WithNamespace(value string) *UDPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *UDPRouteApplyConfiguration) WithUID(value types.UID) *UDPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *UDPRouteApplyConfiguration) WithResourceVersion(value string) *UDPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *UDPRouteApplyConfiguration) WithGeneration(value int64) *UDPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *UDPRouteApplyConfiguration) WithCreationTimestamp(value metav1.Time) *UDPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *UDPRouteApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *UDPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *UDPRouteApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *UDPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *UDPRouteApplyConfiguration) WithLabels(entries map[string]string) *UDPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *UDPRouteApplyConfiguration) WithAnnotations(entries map[string]string) *UDPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *UDPRouteApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *UDPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *UDPRouteApplyConfiguration) WithFinalizers(values ...string) *UDPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *UDPRouteApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *UDPRouteApplyConfiguration) WithSpec(value *UDPRouteSpecApplyConfiguration) *UDPRouteApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *UDPRouteApplyConfiguration) WithStatus(value *UDPRouteStatusApplyConfiguration) *UDPRouteApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udprouterule.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udprouterule.go new file mode 100644 index 000000000..8cc077ecc --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udprouterule.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" +) + +// UDPRouteRuleApplyConfiguration represents an declarative configuration of the UDPRouteRule type for use +// with apply. +type UDPRouteRuleApplyConfiguration struct { + BackendRefs []v1.BackendRefApplyConfiguration `json:"backendRefs,omitempty"` +} + +// UDPRouteRuleApplyConfiguration constructs an declarative configuration of the UDPRouteRule type for use with +// apply. +func UDPRouteRule() *UDPRouteRuleApplyConfiguration { + return &UDPRouteRuleApplyConfiguration{} +} + +// WithBackendRefs adds the given value to the BackendRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the BackendRefs field. +func (b *UDPRouteRuleApplyConfiguration) WithBackendRefs(values ...*v1.BackendRefApplyConfiguration) *UDPRouteRuleApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithBackendRefs") + } + b.BackendRefs = append(b.BackendRefs, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutespec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutespec.go new file mode 100644 index 000000000..e73fb75d3 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutespec.go @@ -0,0 +1,62 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" +) + +// UDPRouteSpecApplyConfiguration represents an declarative configuration of the UDPRouteSpec type for use +// with apply. +type UDPRouteSpecApplyConfiguration struct { + v1.CommonRouteSpecApplyConfiguration `json:",inline"` + Rules []UDPRouteRuleApplyConfiguration `json:"rules,omitempty"` +} + +// UDPRouteSpecApplyConfiguration constructs an declarative configuration of the UDPRouteSpec type for use with +// apply. +func UDPRouteSpec() *UDPRouteSpecApplyConfiguration { + return &UDPRouteSpecApplyConfiguration{} +} + +// WithParentRefs adds the given value to the ParentRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ParentRefs field. +func (b *UDPRouteSpecApplyConfiguration) WithParentRefs(values ...*v1.ParentReferenceApplyConfiguration) *UDPRouteSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithParentRefs") + } + b.ParentRefs = append(b.ParentRefs, *values[i]) + } + return b +} + +// WithRules adds the given value to the Rules field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Rules field. +func (b *UDPRouteSpecApplyConfiguration) WithRules(values ...*UDPRouteRuleApplyConfiguration) *UDPRouteSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRules") + } + b.Rules = append(b.Rules, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutestatus.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutestatus.go new file mode 100644 index 000000000..453004a65 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2/udproutestatus.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" +) + +// UDPRouteStatusApplyConfiguration represents an declarative configuration of the UDPRouteStatus type for use +// with apply. +type UDPRouteStatusApplyConfiguration struct { + v1.RouteStatusApplyConfiguration `json:",inline"` +} + +// UDPRouteStatusApplyConfiguration constructs an declarative configuration of the UDPRouteStatus type for use with +// apply. +func UDPRouteStatus() *UDPRouteStatusApplyConfiguration { + return &UDPRouteStatusApplyConfiguration{} +} + +// WithParents adds the given value to the Parents field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Parents field. +func (b *UDPRouteStatusApplyConfiguration) WithParents(values ...*v1.RouteParentStatusApplyConfiguration) *UDPRouteStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithParents") + } + b.Parents = append(b.Parents, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicy.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicy.go new file mode 100644 index 000000000..9ba8b1f04 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicy.go @@ -0,0 +1,259 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + v1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + apisv1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" +) + +// BackendTLSPolicyApplyConfiguration represents an declarative configuration of the BackendTLSPolicy type for use +// with apply. +type BackendTLSPolicyApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *BackendTLSPolicySpecApplyConfiguration `json:"spec,omitempty"` + Status *v1alpha2.PolicyStatusApplyConfiguration `json:"status,omitempty"` +} + +// BackendTLSPolicy constructs an declarative configuration of the BackendTLSPolicy type for use with +// apply. +func BackendTLSPolicy(name, namespace string) *BackendTLSPolicyApplyConfiguration { + b := &BackendTLSPolicyApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("BackendTLSPolicy") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha3") + return b +} + +// ExtractBackendTLSPolicy extracts the applied configuration owned by fieldManager from +// backendTLSPolicy. If no managedFields are found in backendTLSPolicy for fieldManager, a +// BackendTLSPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// backendTLSPolicy must be a unmodified BackendTLSPolicy API object that was retrieved from the Kubernetes API. +// ExtractBackendTLSPolicy provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractBackendTLSPolicy(backendTLSPolicy *apisv1alpha3.BackendTLSPolicy, fieldManager string) (*BackendTLSPolicyApplyConfiguration, error) { + return extractBackendTLSPolicy(backendTLSPolicy, fieldManager, "") +} + +// ExtractBackendTLSPolicyStatus is the same as ExtractBackendTLSPolicy except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractBackendTLSPolicyStatus(backendTLSPolicy *apisv1alpha3.BackendTLSPolicy, fieldManager string) (*BackendTLSPolicyApplyConfiguration, error) { + return extractBackendTLSPolicy(backendTLSPolicy, fieldManager, "status") +} + +func extractBackendTLSPolicy(backendTLSPolicy *apisv1alpha3.BackendTLSPolicy, fieldManager string, subresource string) (*BackendTLSPolicyApplyConfiguration, error) { + b := &BackendTLSPolicyApplyConfiguration{} + err := managedfields.ExtractInto(backendTLSPolicy, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1alpha3.BackendTLSPolicy"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(backendTLSPolicy.Name) + b.WithNamespace(backendTLSPolicy.Namespace) + + b.WithKind("BackendTLSPolicy") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha3") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *BackendTLSPolicyApplyConfiguration) WithKind(value string) *BackendTLSPolicyApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *BackendTLSPolicyApplyConfiguration) WithAPIVersion(value string) *BackendTLSPolicyApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *BackendTLSPolicyApplyConfiguration) WithName(value string) *BackendTLSPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *BackendTLSPolicyApplyConfiguration) WithGenerateName(value string) *BackendTLSPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *BackendTLSPolicyApplyConfiguration) WithNamespace(value string) *BackendTLSPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *BackendTLSPolicyApplyConfiguration) WithUID(value types.UID) *BackendTLSPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *BackendTLSPolicyApplyConfiguration) WithResourceVersion(value string) *BackendTLSPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *BackendTLSPolicyApplyConfiguration) WithGeneration(value int64) *BackendTLSPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *BackendTLSPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *BackendTLSPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *BackendTLSPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *BackendTLSPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *BackendTLSPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *BackendTLSPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *BackendTLSPolicyApplyConfiguration) WithLabels(entries map[string]string) *BackendTLSPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *BackendTLSPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *BackendTLSPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *BackendTLSPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *BackendTLSPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *BackendTLSPolicyApplyConfiguration) WithFinalizers(values ...string) *BackendTLSPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *BackendTLSPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *BackendTLSPolicyApplyConfiguration) WithSpec(value *BackendTLSPolicySpecApplyConfiguration) *BackendTLSPolicyApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *BackendTLSPolicyApplyConfiguration) WithStatus(value *v1alpha2.PolicyStatusApplyConfiguration) *BackendTLSPolicyApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyspec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyspec.go new file mode 100644 index 000000000..16b16a8cb --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyspec.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" +) + +// BackendTLSPolicySpecApplyConfiguration represents an declarative configuration of the BackendTLSPolicySpec type for use +// with apply. +type BackendTLSPolicySpecApplyConfiguration struct { + TargetRefs []v1alpha2.LocalPolicyTargetReferenceWithSectionNameApplyConfiguration `json:"targetRefs,omitempty"` + Validation *BackendTLSPolicyValidationApplyConfiguration `json:"validation,omitempty"` +} + +// BackendTLSPolicySpecApplyConfiguration constructs an declarative configuration of the BackendTLSPolicySpec type for use with +// apply. +func BackendTLSPolicySpec() *BackendTLSPolicySpecApplyConfiguration { + return &BackendTLSPolicySpecApplyConfiguration{} +} + +// WithTargetRefs adds the given value to the TargetRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TargetRefs field. +func (b *BackendTLSPolicySpecApplyConfiguration) WithTargetRefs(values ...*v1alpha2.LocalPolicyTargetReferenceWithSectionNameApplyConfiguration) *BackendTLSPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTargetRefs") + } + b.TargetRefs = append(b.TargetRefs, *values[i]) + } + return b +} + +// WithValidation sets the Validation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Validation field is set to the value of the last call. +func (b *BackendTLSPolicySpecApplyConfiguration) WithValidation(value *BackendTLSPolicyValidationApplyConfiguration) *BackendTLSPolicySpecApplyConfiguration { + b.Validation = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyvalidation.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyvalidation.go new file mode 100644 index 000000000..952c5926b --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyvalidation.go @@ -0,0 +1,68 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/apis/v1" + v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" +) + +// BackendTLSPolicyValidationApplyConfiguration represents an declarative configuration of the BackendTLSPolicyValidation type for use +// with apply. +type BackendTLSPolicyValidationApplyConfiguration struct { + CACertificateRefs []v1.LocalObjectReferenceApplyConfiguration `json:"caCertificateRefs,omitempty"` + WellKnownCACertificates *v1alpha3.WellKnownCACertificatesType `json:"wellKnownCACertificates,omitempty"` + Hostname *apisv1.PreciseHostname `json:"hostname,omitempty"` +} + +// BackendTLSPolicyValidationApplyConfiguration constructs an declarative configuration of the BackendTLSPolicyValidation type for use with +// apply. +func BackendTLSPolicyValidation() *BackendTLSPolicyValidationApplyConfiguration { + return &BackendTLSPolicyValidationApplyConfiguration{} +} + +// WithCACertificateRefs adds the given value to the CACertificateRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CACertificateRefs field. +func (b *BackendTLSPolicyValidationApplyConfiguration) WithCACertificateRefs(values ...*v1.LocalObjectReferenceApplyConfiguration) *BackendTLSPolicyValidationApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithCACertificateRefs") + } + b.CACertificateRefs = append(b.CACertificateRefs, *values[i]) + } + return b +} + +// WithWellKnownCACertificates sets the WellKnownCACertificates field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WellKnownCACertificates field is set to the value of the last call. +func (b *BackendTLSPolicyValidationApplyConfiguration) WithWellKnownCACertificates(value v1alpha3.WellKnownCACertificatesType) *BackendTLSPolicyValidationApplyConfiguration { + b.WellKnownCACertificates = &value + return b +} + +// WithHostname sets the Hostname field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Hostname field is set to the value of the last call. +func (b *BackendTLSPolicyValidationApplyConfiguration) WithHostname(value apisv1.PreciseHostname) *BackendTLSPolicyValidationApplyConfiguration { + b.Hostname = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gateway.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gateway.go new file mode 100644 index 000000000..ced36f358 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gateway.go @@ -0,0 +1,259 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" +) + +// GatewayApplyConfiguration represents an declarative configuration of the Gateway type for use +// with apply. +type GatewayApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *apisv1.GatewaySpecApplyConfiguration `json:"spec,omitempty"` + Status *apisv1.GatewayStatusApplyConfiguration `json:"status,omitempty"` +} + +// Gateway constructs an declarative configuration of the Gateway type for use with +// apply. +func Gateway(name, namespace string) *GatewayApplyConfiguration { + b := &GatewayApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Gateway") + b.WithAPIVersion("gateway.networking.k8s.io/v1beta1") + return b +} + +// ExtractGateway extracts the applied configuration owned by fieldManager from +// gateway. If no managedFields are found in gateway for fieldManager, a +// GatewayApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// gateway must be a unmodified Gateway API object that was retrieved from the Kubernetes API. +// ExtractGateway provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractGateway(gateway *v1beta1.Gateway, fieldManager string) (*GatewayApplyConfiguration, error) { + return extractGateway(gateway, fieldManager, "") +} + +// ExtractGatewayStatus is the same as ExtractGateway except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractGatewayStatus(gateway *v1beta1.Gateway, fieldManager string) (*GatewayApplyConfiguration, error) { + return extractGateway(gateway, fieldManager, "status") +} + +func extractGateway(gateway *v1beta1.Gateway, fieldManager string, subresource string) (*GatewayApplyConfiguration, error) { + b := &GatewayApplyConfiguration{} + err := managedfields.ExtractInto(gateway, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1beta1.Gateway"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(gateway.Name) + b.WithNamespace(gateway.Namespace) + + b.WithKind("Gateway") + b.WithAPIVersion("gateway.networking.k8s.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithKind(value string) *GatewayApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithAPIVersion(value string) *GatewayApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithName(value string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithGenerateName(value string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithNamespace(value string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithUID(value types.UID) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithResourceVersion(value string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithGeneration(value int64) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithCreationTimestamp(value metav1.Time) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *GatewayApplyConfiguration) WithLabels(entries map[string]string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *GatewayApplyConfiguration) WithAnnotations(entries map[string]string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *GatewayApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *GatewayApplyConfiguration) WithFinalizers(values ...string) *GatewayApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *GatewayApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithSpec(value *apisv1.GatewaySpecApplyConfiguration) *GatewayApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *GatewayApplyConfiguration) WithStatus(value *apisv1.GatewayStatusApplyConfiguration) *GatewayApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gatewayclass.go new file mode 100644 index 000000000..6b3c5856c --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/gatewayclass.go @@ -0,0 +1,257 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" +) + +// GatewayClassApplyConfiguration represents an declarative configuration of the GatewayClass type for use +// with apply. +type GatewayClassApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *apisv1.GatewayClassSpecApplyConfiguration `json:"spec,omitempty"` + Status *apisv1.GatewayClassStatusApplyConfiguration `json:"status,omitempty"` +} + +// GatewayClass constructs an declarative configuration of the GatewayClass type for use with +// apply. +func GatewayClass(name string) *GatewayClassApplyConfiguration { + b := &GatewayClassApplyConfiguration{} + b.WithName(name) + b.WithKind("GatewayClass") + b.WithAPIVersion("gateway.networking.k8s.io/v1beta1") + return b +} + +// ExtractGatewayClass extracts the applied configuration owned by fieldManager from +// gatewayClass. If no managedFields are found in gatewayClass for fieldManager, a +// GatewayClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// gatewayClass must be a unmodified GatewayClass API object that was retrieved from the Kubernetes API. +// ExtractGatewayClass provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractGatewayClass(gatewayClass *v1beta1.GatewayClass, fieldManager string) (*GatewayClassApplyConfiguration, error) { + return extractGatewayClass(gatewayClass, fieldManager, "") +} + +// ExtractGatewayClassStatus is the same as ExtractGatewayClass except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractGatewayClassStatus(gatewayClass *v1beta1.GatewayClass, fieldManager string) (*GatewayClassApplyConfiguration, error) { + return extractGatewayClass(gatewayClass, fieldManager, "status") +} + +func extractGatewayClass(gatewayClass *v1beta1.GatewayClass, fieldManager string, subresource string) (*GatewayClassApplyConfiguration, error) { + b := &GatewayClassApplyConfiguration{} + err := managedfields.ExtractInto(gatewayClass, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1beta1.GatewayClass"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(gatewayClass.Name) + + b.WithKind("GatewayClass") + b.WithAPIVersion("gateway.networking.k8s.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithKind(value string) *GatewayClassApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithAPIVersion(value string) *GatewayClassApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithName(value string) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithGenerateName(value string) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithNamespace(value string) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithUID(value types.UID) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithResourceVersion(value string) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithGeneration(value int64) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *GatewayClassApplyConfiguration) WithLabels(entries map[string]string) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *GatewayClassApplyConfiguration) WithAnnotations(entries map[string]string) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *GatewayClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *GatewayClassApplyConfiguration) WithFinalizers(values ...string) *GatewayClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *GatewayClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithSpec(value *apisv1.GatewayClassSpecApplyConfiguration) *GatewayClassApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *GatewayClassApplyConfiguration) WithStatus(value *apisv1.GatewayClassStatusApplyConfiguration) *GatewayClassApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/httproute.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/httproute.go new file mode 100644 index 000000000..221b2fd18 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/httproute.go @@ -0,0 +1,259 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" +) + +// HTTPRouteApplyConfiguration represents an declarative configuration of the HTTPRoute type for use +// with apply. +type HTTPRouteApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *apisv1.HTTPRouteSpecApplyConfiguration `json:"spec,omitempty"` + Status *apisv1.HTTPRouteStatusApplyConfiguration `json:"status,omitempty"` +} + +// HTTPRoute constructs an declarative configuration of the HTTPRoute type for use with +// apply. +func HTTPRoute(name, namespace string) *HTTPRouteApplyConfiguration { + b := &HTTPRouteApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("HTTPRoute") + b.WithAPIVersion("gateway.networking.k8s.io/v1beta1") + return b +} + +// ExtractHTTPRoute extracts the applied configuration owned by fieldManager from +// hTTPRoute. If no managedFields are found in hTTPRoute for fieldManager, a +// HTTPRouteApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// hTTPRoute must be a unmodified HTTPRoute API object that was retrieved from the Kubernetes API. +// ExtractHTTPRoute provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractHTTPRoute(hTTPRoute *v1beta1.HTTPRoute, fieldManager string) (*HTTPRouteApplyConfiguration, error) { + return extractHTTPRoute(hTTPRoute, fieldManager, "") +} + +// ExtractHTTPRouteStatus is the same as ExtractHTTPRoute except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractHTTPRouteStatus(hTTPRoute *v1beta1.HTTPRoute, fieldManager string) (*HTTPRouteApplyConfiguration, error) { + return extractHTTPRoute(hTTPRoute, fieldManager, "status") +} + +func extractHTTPRoute(hTTPRoute *v1beta1.HTTPRoute, fieldManager string, subresource string) (*HTTPRouteApplyConfiguration, error) { + b := &HTTPRouteApplyConfiguration{} + err := managedfields.ExtractInto(hTTPRoute, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1beta1.HTTPRoute"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(hTTPRoute.Name) + b.WithNamespace(hTTPRoute.Namespace) + + b.WithKind("HTTPRoute") + b.WithAPIVersion("gateway.networking.k8s.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithKind(value string) *HTTPRouteApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithAPIVersion(value string) *HTTPRouteApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithName(value string) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithGenerateName(value string) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithNamespace(value string) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithUID(value types.UID) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithResourceVersion(value string) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithGeneration(value int64) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithCreationTimestamp(value metav1.Time) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *HTTPRouteApplyConfiguration) WithLabels(entries map[string]string) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *HTTPRouteApplyConfiguration) WithAnnotations(entries map[string]string) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *HTTPRouteApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *HTTPRouteApplyConfiguration) WithFinalizers(values ...string) *HTTPRouteApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *HTTPRouteApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithSpec(value *apisv1.HTTPRouteSpecApplyConfiguration) *HTTPRouteApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *HTTPRouteApplyConfiguration) WithStatus(value *apisv1.HTTPRouteStatusApplyConfiguration) *HTTPRouteApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrant.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrant.go new file mode 100644 index 000000000..12b09aee5 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrant.go @@ -0,0 +1,249 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + apisv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" +) + +// ReferenceGrantApplyConfiguration represents an declarative configuration of the ReferenceGrant type for use +// with apply. +type ReferenceGrantApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ReferenceGrantSpecApplyConfiguration `json:"spec,omitempty"` +} + +// ReferenceGrant constructs an declarative configuration of the ReferenceGrant type for use with +// apply. +func ReferenceGrant(name, namespace string) *ReferenceGrantApplyConfiguration { + b := &ReferenceGrantApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ReferenceGrant") + b.WithAPIVersion("gateway.networking.k8s.io/v1beta1") + return b +} + +// ExtractReferenceGrant extracts the applied configuration owned by fieldManager from +// referenceGrant. If no managedFields are found in referenceGrant for fieldManager, a +// ReferenceGrantApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// referenceGrant must be a unmodified ReferenceGrant API object that was retrieved from the Kubernetes API. +// ExtractReferenceGrant provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractReferenceGrant(referenceGrant *apisv1beta1.ReferenceGrant, fieldManager string) (*ReferenceGrantApplyConfiguration, error) { + return extractReferenceGrant(referenceGrant, fieldManager, "") +} + +// ExtractReferenceGrantStatus is the same as ExtractReferenceGrant except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractReferenceGrantStatus(referenceGrant *apisv1beta1.ReferenceGrant, fieldManager string) (*ReferenceGrantApplyConfiguration, error) { + return extractReferenceGrant(referenceGrant, fieldManager, "status") +} + +func extractReferenceGrant(referenceGrant *apisv1beta1.ReferenceGrant, fieldManager string, subresource string) (*ReferenceGrantApplyConfiguration, error) { + b := &ReferenceGrantApplyConfiguration{} + err := managedfields.ExtractInto(referenceGrant, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1beta1.ReferenceGrant"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(referenceGrant.Name) + b.WithNamespace(referenceGrant.Namespace) + + b.WithKind("ReferenceGrant") + b.WithAPIVersion("gateway.networking.k8s.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithKind(value string) *ReferenceGrantApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithAPIVersion(value string) *ReferenceGrantApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithName(value string) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithGenerateName(value string) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithNamespace(value string) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithUID(value types.UID) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithResourceVersion(value string) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithGeneration(value int64) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ReferenceGrantApplyConfiguration) WithLabels(entries map[string]string) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ReferenceGrantApplyConfiguration) WithAnnotations(entries map[string]string) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ReferenceGrantApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ReferenceGrantApplyConfiguration) WithFinalizers(values ...string) *ReferenceGrantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ReferenceGrantApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ReferenceGrantApplyConfiguration) WithSpec(value *ReferenceGrantSpecApplyConfiguration) *ReferenceGrantApplyConfiguration { + b.Spec = value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantfrom.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantfrom.go new file mode 100644 index 000000000..fa494a540 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantfrom.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// ReferenceGrantFromApplyConfiguration represents an declarative configuration of the ReferenceGrantFrom type for use +// with apply. +type ReferenceGrantFromApplyConfiguration struct { + Group *v1.Group `json:"group,omitempty"` + Kind *v1.Kind `json:"kind,omitempty"` + Namespace *v1.Namespace `json:"namespace,omitempty"` +} + +// ReferenceGrantFromApplyConfiguration constructs an declarative configuration of the ReferenceGrantFrom type for use with +// apply. +func ReferenceGrantFrom() *ReferenceGrantFromApplyConfiguration { + return &ReferenceGrantFromApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *ReferenceGrantFromApplyConfiguration) WithGroup(value v1.Group) *ReferenceGrantFromApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ReferenceGrantFromApplyConfiguration) WithKind(value v1.Kind) *ReferenceGrantFromApplyConfiguration { + b.Kind = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ReferenceGrantFromApplyConfiguration) WithNamespace(value v1.Namespace) *ReferenceGrantFromApplyConfiguration { + b.Namespace = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantspec.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantspec.go new file mode 100644 index 000000000..9fc339fcd --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantspec.go @@ -0,0 +1,58 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// ReferenceGrantSpecApplyConfiguration represents an declarative configuration of the ReferenceGrantSpec type for use +// with apply. +type ReferenceGrantSpecApplyConfiguration struct { + From []ReferenceGrantFromApplyConfiguration `json:"from,omitempty"` + To []ReferenceGrantToApplyConfiguration `json:"to,omitempty"` +} + +// ReferenceGrantSpecApplyConfiguration constructs an declarative configuration of the ReferenceGrantSpec type for use with +// apply. +func ReferenceGrantSpec() *ReferenceGrantSpecApplyConfiguration { + return &ReferenceGrantSpecApplyConfiguration{} +} + +// WithFrom adds the given value to the From field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the From field. +func (b *ReferenceGrantSpecApplyConfiguration) WithFrom(values ...*ReferenceGrantFromApplyConfiguration) *ReferenceGrantSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFrom") + } + b.From = append(b.From, *values[i]) + } + return b +} + +// WithTo adds the given value to the To field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the To field. +func (b *ReferenceGrantSpecApplyConfiguration) WithTo(values ...*ReferenceGrantToApplyConfiguration) *ReferenceGrantSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTo") + } + b.To = append(b.To, *values[i]) + } + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantto.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantto.go new file mode 100644 index 000000000..c1e0ba760 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1/referencegrantto.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// ReferenceGrantToApplyConfiguration represents an declarative configuration of the ReferenceGrantTo type for use +// with apply. +type ReferenceGrantToApplyConfiguration struct { + Group *v1.Group `json:"group,omitempty"` + Kind *v1.Kind `json:"kind,omitempty"` + Name *v1.ObjectName `json:"name,omitempty"` +} + +// ReferenceGrantToApplyConfiguration constructs an declarative configuration of the ReferenceGrantTo type for use with +// apply. +func ReferenceGrantTo() *ReferenceGrantToApplyConfiguration { + return &ReferenceGrantToApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *ReferenceGrantToApplyConfiguration) WithGroup(value v1.Group) *ReferenceGrantToApplyConfiguration { + b.Group = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ReferenceGrantToApplyConfiguration) WithKind(value v1.Kind) *ReferenceGrantToApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ReferenceGrantToApplyConfiguration) WithName(value v1.ObjectName) *ReferenceGrantToApplyConfiguration { + b.Name = &value + return b +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/internal/internal.go b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/internal/internal.go new file mode 100644 index 000000000..21866f542 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/applyconfiguration/internal/internal.go @@ -0,0 +1,1625 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package internal + +import ( + "fmt" + "sync" + + typed "sigs.k8s.io/structured-merge-diff/v4/typed" +) + +func Parser() *typed.Parser { + parserOnce.Do(func() { + var err error + parser, err = typed.NewParser(schemaYAML) + if err != nil { + panic(fmt.Sprintf("Failed to parse schema: %v", err)) + } + }) + return parser +} + +var parserOnce sync.Once +var parser *typed.Parser +var schemaYAML = typed.YAMLObject(`types: +- name: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + default: "" + - name: observedGeneration + type: + scalar: numeric + - name: reason + type: + scalar: string + default: "" + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + map: + fields: + - name: matchExpressions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement + elementRelationship: atomic + - name: matchLabels + type: + map: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: operator + type: + scalar: string + default: "" + - name: values + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry + map: + fields: + - name: apiVersion + type: + scalar: string + - name: fieldsType + type: + scalar: string + - name: fieldsV1 + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 + - name: manager + type: + scalar: string + - name: operation + type: + scalar: string + - name: subresource + type: + scalar: string + - name: time + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + map: + fields: + - name: annotations + type: + map: + elementType: + scalar: string + - name: creationTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: deletionGracePeriodSeconds + type: + scalar: numeric + - name: deletionTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: finalizers + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: generateName + type: + scalar: string + - name: generation + type: + scalar: numeric + - name: labels + type: + map: + elementType: + scalar: string + - name: managedFields + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry + elementRelationship: atomic + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + - name: ownerReferences + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference + elementRelationship: associative + keys: + - uid + - name: resourceVersion + type: + scalar: string + - name: selfLink + type: + scalar: string + - name: uid + type: + scalar: string +- name: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference + map: + fields: + - name: apiVersion + type: + scalar: string + default: "" + - name: blockOwnerDeletion + type: + scalar: boolean + - name: controller + type: + scalar: boolean + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: uid + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.Time + scalar: untyped +- name: io.k8s.sigs.gateway-api.apis.v1.AllowedRoutes + map: + fields: + - name: kinds + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.RouteGroupKind + elementRelationship: atomic + - name: namespaces + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.RouteNamespaces +- name: io.k8s.sigs.gateway-api.apis.v1.BackendObjectReference + map: + fields: + - name: group + type: + scalar: string + - name: kind + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + - name: port + type: + scalar: numeric +- name: io.k8s.sigs.gateway-api.apis.v1.BackendRef + map: + fields: + - name: group + type: + scalar: string + - name: kind + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + - name: port + type: + scalar: numeric + - name: weight + type: + scalar: numeric +- name: io.k8s.sigs.gateway-api.apis.v1.CookieConfig + map: + fields: + - name: lifetimeType + type: + scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1.FrontendTLSValidation + map: + fields: + - name: caCertificateRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.ObjectReference + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1.GRPCBackendRef + map: + fields: + - name: filters + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.GRPCRouteFilter + elementRelationship: atomic + - name: group + type: + scalar: string + - name: kind + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + - name: port + type: + scalar: numeric + - name: weight + type: + scalar: numeric +- name: io.k8s.sigs.gateway-api.apis.v1.GRPCHeaderMatch + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: type + type: + scalar: string + - name: value + type: + scalar: string + default: "" +- name: io.k8s.sigs.gateway-api.apis.v1.GRPCMethodMatch + map: + fields: + - name: method + type: + scalar: string + - name: service + type: + scalar: string + - name: type + type: + scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1.GRPCRoute + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GRPCRouteSpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GRPCRouteStatus + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1.GRPCRouteFilter + map: + fields: + - name: extensionRef + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.LocalObjectReference + - name: requestHeaderModifier + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPHeaderFilter + - name: requestMirror + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPRequestMirrorFilter + - name: responseHeaderModifier + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPHeaderFilter + - name: type + type: + scalar: string + default: "" +- name: io.k8s.sigs.gateway-api.apis.v1.GRPCRouteMatch + map: + fields: + - name: headers + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.GRPCHeaderMatch + elementRelationship: associative + keys: + - name + - name: method + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GRPCMethodMatch +- name: io.k8s.sigs.gateway-api.apis.v1.GRPCRouteRule + map: + fields: + - name: backendRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.GRPCBackendRef + elementRelationship: atomic + - name: filters + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.GRPCRouteFilter + elementRelationship: atomic + - name: matches + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.GRPCRouteMatch + elementRelationship: atomic + - name: sessionPersistence + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.SessionPersistence +- name: io.k8s.sigs.gateway-api.apis.v1.GRPCRouteSpec + map: + fields: + - name: hostnames + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: parentRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.ParentReference + elementRelationship: atomic + - name: rules + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.GRPCRouteRule + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1.GRPCRouteStatus + map: + fields: + - name: parents + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.RouteParentStatus + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1.Gateway + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GatewaySpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayStatus + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1.GatewayAddress + map: + fields: + - name: type + type: + scalar: string + - name: value + type: + scalar: string + default: "" +- name: io.k8s.sigs.gateway-api.apis.v1.GatewayClass + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayClassSpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayClassStatus + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1.GatewayClassSpec + map: + fields: + - name: controllerName + type: + scalar: string + default: "" + - name: description + type: + scalar: string + - name: parametersRef + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.ParametersReference +- name: io.k8s.sigs.gateway-api.apis.v1.GatewayClassStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: supportedFeatures + type: + list: + elementType: + scalar: string + elementRelationship: associative +- name: io.k8s.sigs.gateway-api.apis.v1.GatewayInfrastructure + map: + fields: + - name: annotations + type: + map: + elementType: + scalar: string + - name: labels + type: + map: + elementType: + scalar: string + - name: parametersRef + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.LocalParametersReference +- name: io.k8s.sigs.gateway-api.apis.v1.GatewaySpec + map: + fields: + - name: addresses + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayAddress + elementRelationship: atomic + - name: gatewayClassName + type: + scalar: string + default: "" + - name: infrastructure + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayInfrastructure + - name: listeners + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.Listener + elementRelationship: associative + keys: + - name +- name: io.k8s.sigs.gateway-api.apis.v1.GatewayStatus + map: + fields: + - name: addresses + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayStatusAddress + elementRelationship: atomic + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: listeners + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.ListenerStatus + elementRelationship: associative + keys: + - name +- name: io.k8s.sigs.gateway-api.apis.v1.GatewayStatusAddress + map: + fields: + - name: type + type: + scalar: string + - name: value + type: + scalar: string + default: "" +- name: io.k8s.sigs.gateway-api.apis.v1.GatewayTLSConfig + map: + fields: + - name: certificateRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.SecretObjectReference + elementRelationship: atomic + - name: frontendValidation + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.FrontendTLSValidation + - name: mode + type: + scalar: string + - name: options + type: + map: + elementType: + scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPBackendRef + map: + fields: + - name: filters + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteFilter + elementRelationship: atomic + - name: group + type: + scalar: string + - name: kind + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + - name: port + type: + scalar: numeric + - name: weight + type: + scalar: numeric +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPHeader + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: value + type: + scalar: string + default: "" +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPHeaderFilter + map: + fields: + - name: add + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPHeader + elementRelationship: associative + keys: + - name + - name: remove + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: set + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPHeader + elementRelationship: associative + keys: + - name +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPHeaderMatch + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: type + type: + scalar: string + - name: value + type: + scalar: string + default: "" +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPPathMatch + map: + fields: + - name: type + type: + scalar: string + - name: value + type: + scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPPathModifier + map: + fields: + - name: replaceFullPath + type: + scalar: string + - name: replacePrefixMatch + type: + scalar: string + - name: type + type: + scalar: string + default: "" +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPQueryParamMatch + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: type + type: + scalar: string + - name: value + type: + scalar: string + default: "" +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPRequestMirrorFilter + map: + fields: + - name: backendRef + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.BackendObjectReference + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPRequestRedirectFilter + map: + fields: + - name: hostname + type: + scalar: string + - name: path + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPPathModifier + - name: port + type: + scalar: numeric + - name: scheme + type: + scalar: string + - name: statusCode + type: + scalar: numeric +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPRoute + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteSpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteStatus + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteFilter + map: + fields: + - name: extensionRef + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.LocalObjectReference + - name: requestHeaderModifier + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPHeaderFilter + - name: requestMirror + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPRequestMirrorFilter + - name: requestRedirect + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPRequestRedirectFilter + - name: responseHeaderModifier + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPHeaderFilter + - name: type + type: + scalar: string + default: "" + - name: urlRewrite + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPURLRewriteFilter +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteMatch + map: + fields: + - name: headers + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPHeaderMatch + elementRelationship: associative + keys: + - name + - name: method + type: + scalar: string + - name: path + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPPathMatch + - name: queryParams + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPQueryParamMatch + elementRelationship: associative + keys: + - name +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteRule + map: + fields: + - name: backendRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPBackendRef + elementRelationship: atomic + - name: filters + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteFilter + elementRelationship: atomic + - name: matches + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteMatch + elementRelationship: atomic + - name: sessionPersistence + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.SessionPersistence + - name: timeouts + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteTimeouts +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteSpec + map: + fields: + - name: hostnames + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: parentRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.ParentReference + elementRelationship: atomic + - name: rules + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteRule + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteStatus + map: + fields: + - name: parents + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.RouteParentStatus + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteTimeouts + map: + fields: + - name: backendRequest + type: + scalar: string + - name: request + type: + scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1.HTTPURLRewriteFilter + map: + fields: + - name: hostname + type: + scalar: string + - name: path + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPPathModifier +- name: io.k8s.sigs.gateway-api.apis.v1.Listener + map: + fields: + - name: allowedRoutes + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.AllowedRoutes + - name: hostname + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: port + type: + scalar: numeric + default: 0 + - name: protocol + type: + scalar: string + default: "" + - name: tls + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayTLSConfig +- name: io.k8s.sigs.gateway-api.apis.v1.ListenerStatus + map: + fields: + - name: attachedRoutes + type: + scalar: numeric + default: 0 + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: name + type: + scalar: string + default: "" + - name: supportedKinds + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.RouteGroupKind + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1.LocalObjectReference + map: + fields: + - name: group + type: + scalar: string + default: "" + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" +- name: io.k8s.sigs.gateway-api.apis.v1.LocalParametersReference + map: + fields: + - name: group + type: + scalar: string + default: "" + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" +- name: io.k8s.sigs.gateway-api.apis.v1.ObjectReference + map: + fields: + - name: group + type: + scalar: string + default: "" + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1.ParametersReference + map: + fields: + - name: group + type: + scalar: string + default: "" + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1.ParentReference + map: + fields: + - name: group + type: + scalar: string + - name: kind + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + - name: port + type: + scalar: numeric + - name: sectionName + type: + scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1.RouteGroupKind + map: + fields: + - name: group + type: + scalar: string + - name: kind + type: + scalar: string + default: "" +- name: io.k8s.sigs.gateway-api.apis.v1.RouteNamespaces + map: + fields: + - name: from + type: + scalar: string + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector +- name: io.k8s.sigs.gateway-api.apis.v1.RouteParentStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: controllerName + type: + scalar: string + default: "" + - name: parentRef + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.ParentReference + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1.SecretObjectReference + map: + fields: + - name: group + type: + scalar: string + - name: kind + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1.SessionPersistence + map: + fields: + - name: absoluteTimeout + type: + scalar: string + - name: cookieConfig + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.CookieConfig + - name: idleTimeout + type: + scalar: string + - name: sessionName + type: + scalar: string + - name: type + type: + scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.BackendLBPolicy + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.BackendLBPolicySpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.PolicyStatus + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.BackendLBPolicySpec + map: + fields: + - name: sessionPersistence + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.SessionPersistence + - name: targetRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.LocalPolicyTargetReference + elementRelationship: associative + keys: + - group + - kind + - name +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.GRPCRoute + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GRPCRouteSpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GRPCRouteStatus + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.LocalPolicyTargetReference + map: + fields: + - name: group + type: + scalar: string + default: "" + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.LocalPolicyTargetReferenceWithSectionName + map: + fields: + - name: group + type: + scalar: string + default: "" + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: sectionName + type: + scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.PolicyAncestorStatus + map: + fields: + - name: ancestorRef + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.ParentReference + default: {} + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: controllerName + type: + scalar: string + default: "" +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.PolicyStatus + map: + fields: + - name: ancestors + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.PolicyAncestorStatus + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.ReferenceGrant + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1beta1.ReferenceGrantSpec + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.TCPRoute + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.TCPRouteSpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.TCPRouteStatus + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.TCPRouteRule + map: + fields: + - name: backendRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.BackendRef + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.TCPRouteSpec + map: + fields: + - name: parentRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.ParentReference + elementRelationship: atomic + - name: rules + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.TCPRouteRule + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.TCPRouteStatus + map: + fields: + - name: parents + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.RouteParentStatus + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.TLSRoute + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.TLSRouteSpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.TLSRouteStatus + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.TLSRouteRule + map: + fields: + - name: backendRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.BackendRef + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.TLSRouteSpec + map: + fields: + - name: hostnames + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: parentRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.ParentReference + elementRelationship: atomic + - name: rules + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.TLSRouteRule + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.TLSRouteStatus + map: + fields: + - name: parents + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.RouteParentStatus + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.UDPRoute + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.UDPRouteSpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.UDPRouteStatus + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.UDPRouteRule + map: + fields: + - name: backendRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.BackendRef + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.UDPRouteSpec + map: + fields: + - name: parentRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.ParentReference + elementRelationship: atomic + - name: rules + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.UDPRouteRule + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.UDPRouteStatus + map: + fields: + - name: parents + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.RouteParentStatus + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1alpha3.BackendTLSPolicy + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha3.BackendTLSPolicySpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.PolicyStatus + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1alpha3.BackendTLSPolicySpec + map: + fields: + - name: targetRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.LocalPolicyTargetReferenceWithSectionName + elementRelationship: atomic + - name: validation + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha3.BackendTLSPolicyValidation + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1alpha3.BackendTLSPolicyValidation + map: + fields: + - name: caCertificateRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.LocalObjectReference + elementRelationship: atomic + - name: hostname + type: + scalar: string + default: "" + - name: wellKnownCACertificates + type: + scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1beta1.Gateway + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GatewaySpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayStatus + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1beta1.GatewayClass + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayClassSpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayClassStatus + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1beta1.HTTPRoute + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteSpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.HTTPRouteStatus + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1beta1.ReferenceGrant + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1beta1.ReferenceGrantSpec + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1beta1.ReferenceGrantFrom + map: + fields: + - name: group + type: + scalar: string + default: "" + - name: kind + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + default: "" +- name: io.k8s.sigs.gateway-api.apis.v1beta1.ReferenceGrantSpec + map: + fields: + - name: from + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1beta1.ReferenceGrantFrom + elementRelationship: atomic + - name: to + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1beta1.ReferenceGrantTo + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apis.v1beta1.ReferenceGrantTo + map: + fields: + - name: group + type: + scalar: string + default: "" + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string +- name: __untyped_atomic_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: __untyped_deduced_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +`) diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1/doc.go b/vendor/sigs.k8s.io/gateway-api/apis/v1/doc.go index bd223cd9a..f2c7aa2b5 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1/doc.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1/doc.go @@ -17,6 +17,7 @@ limitations under the License. // Package v1 contains API Schema definitions for the gateway.networking.k8s.io // API group. // +// +k8s:openapi-gen=true // +kubebuilder:object:generate=true // +groupName=gateway.networking.k8s.io package v1 diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1/gateway_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1/gateway_types.go index 20cca8eca..caa5e96bf 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1/gateway_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1/gateway_types.go @@ -24,6 +24,7 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:categories=gateway-api,shortName=gtw // +kubebuilder:subresource:status +// +kubebuilder:storageversion // +kubebuilder:printcolumn:name="Class",type=string,JSONPath=`.spec.gatewayClassName` // +kubebuilder:printcolumn:name="Address",type=string,JSONPath=`.status.addresses[*].value` // +kubebuilder:printcolumn:name="Programmed",type=string,JSONPath=`.status.conditions[?(@.type=="Programmed")].status` @@ -56,8 +57,8 @@ type GatewayList struct { // GatewaySpec defines the desired state of Gateway. // // Not all possible combinations of options specified in the Spec are -// valid. Some invalid configurations can be caught synchronously via a -// webhook, but there are many cases that will require asynchronous +// valid. Some invalid configurations can be caught synchronously via CRD +// validation, but there are many cases that will require asynchronous // signaling via the GatewayStatus block. type GatewaySpec struct { // GatewayClassName used for this Gateway. This is the name of a @@ -186,8 +187,8 @@ type GatewaySpec struct { // +listMapKey=name // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:MaxItems=64 - // +kubebuilder:validation:XValidation:message="tls must be specified for protocols ['HTTPS', 'TLS']",rule="self.all(l, l.protocol in ['HTTPS', 'TLS'] ? has(l.tls) : true)" // +kubebuilder:validation:XValidation:message="tls must not be specified for protocols ['HTTP', 'TCP', 'UDP']",rule="self.all(l, l.protocol in ['HTTP', 'TCP', 'UDP'] ? !has(l.tls) : true)" + // +kubebuilder:validation:XValidation:message="tls mode must be Terminate for protocol HTTPS",rule="self.all(l, (l.protocol == 'HTTPS' && has(l.tls)) ? (l.tls.mode == '' || l.tls.mode == 'Terminate') : true)" // +kubebuilder:validation:XValidation:message="hostname must not be specified for protocols ['TCP', 'UDP']",rule="self.all(l, l.protocol in ['TCP', 'UDP'] ? (!has(l.hostname) || l.hostname == '') : true)" // +kubebuilder:validation:XValidation:message="Listener name must be unique within the Gateway",rule="self.all(l1, self.exists_one(l2, l1.name == l2.name))" // +kubebuilder:validation:XValidation:message="Combination of port, protocol and hostname must be unique for each listener",rule="self.all(l1, self.exists_one(l2, l1.port == l2.port && l1.protocol == l2.protocol && (has(l1.hostname) && has(l2.hostname) ? l1.hostname == l2.hostname : !has(l1.hostname) && !has(l2.hostname))))" @@ -375,18 +376,19 @@ const ( // GatewayTLSConfig describes a TLS configuration. // -// +kubebuilder:validation:XValidation:message="certificateRefs must be specified when TLSModeType is Terminate",rule="self.mode == 'Terminate' ? size(self.certificateRefs) > 0 : true" +// +kubebuilder:validation:XValidation:message="certificateRefs or options must be specified when mode is Terminate",rule="self.mode == 'Terminate' ? size(self.certificateRefs) > 0 || size(self.options) > 0 : true" type GatewayTLSConfig struct { // Mode defines the TLS behavior for the TLS session initiated by the client. // There are two possible modes: // - // - Terminate: The TLS session between the downstream client - // and the Gateway is terminated at the Gateway. This mode requires - // certificateRefs to be set and contain at least one element. + // - Terminate: The TLS session between the downstream client and the + // Gateway is terminated at the Gateway. This mode requires certificates + // to be specified in some way, such as populating the certificateRefs + // field. // - Passthrough: The TLS session is NOT terminated by the Gateway. This // implies that the Gateway can't decipher the TLS stream except for - // the ClientHello message of the TLS protocol. - // CertificateRefs field is ignored in this mode. + // the ClientHello message of the TLS protocol. The certificateRefs field + // is ignored in this mode. // // Support: Core // @@ -423,6 +425,18 @@ type GatewayTLSConfig struct { // +kubebuilder:validation:MaxItems=64 CertificateRefs []SecretObjectReference `json:"certificateRefs,omitempty"` + // FrontendValidation holds configuration information for validating the frontend (client). + // Setting this field will require clients to send a client certificate + // required for validation during the TLS handshake. In browsers this may result in a dialog appearing + // that requests a user to specify the client certificate. + // The maximum depth of a certificate chain accepted in verification is Implementation specific. + // + // Support: Extended + // + // +optional + // + FrontendValidation *FrontendTLSValidation `json:"frontendValidation,omitempty"` + // Options are a list of key/value pairs to enable extended TLS // configuration for each implementation. For example, configuring the // minimum TLS version or supported cipher suites. @@ -457,6 +471,36 @@ const ( TLSModePassthrough TLSModeType = "Passthrough" ) +// FrontendTLSValidation holds configuration information that can be used to validate +// the frontend initiating the TLS connection +type FrontendTLSValidation struct { + // CACertificateRefs contains one or more references to + // Kubernetes objects that contain TLS certificates of + // the Certificate Authorities that can be used + // as a trust anchor to validate the certificates presented by the client. + // + // A single CA certificate reference to a Kubernetes ConfigMap + // has "Core" support. + // Implementations MAY choose to support attaching multiple CA certificates to + // a Listener, but this behavior is implementation-specific. + // + // Support: Core - A single reference to a Kubernetes ConfigMap + // with the CA certificate in a key named `ca.crt`. + // + // Support: Implementation-specific (More than one reference, or other kinds + // of resources). + // + // References to a resource in a different namespace are invalid UNLESS there + // is a ReferenceGrant in the target namespace that allows the certificate + // to be attached. If a ReferenceGrant does not allow this reference, the + // "ResolvedRefs" condition MUST be set to False for this listener with the + // "RefNotPermitted" reason. + // + // +kubebuilder:validation:MaxItems=8 + // +kubebuilder:validation:MinItems=1 + CACertificateRefs []ObjectReference `json:"caCertificateRefs,omitempty"` +} + // AllowedRoutes defines which Routes may be attached to this Listener. type AllowedRoutes struct { // Namespaces indicates namespaces from which Routes may be attached to this @@ -653,6 +697,37 @@ type GatewayInfrastructure struct { // +optional // +kubebuilder:validation:MaxProperties=8 Annotations map[AnnotationKey]AnnotationValue `json:"annotations,omitempty"` + + // ParametersRef is a reference to a resource that contains the configuration + // parameters corresponding to the Gateway. This is optional if the + // controller does not require any additional configuration. + // + // This follows the same semantics as GatewayClass's `parametersRef`, but on a per-Gateway basis + // + // The Gateway's GatewayClass may provide its own `parametersRef`. When both are specified, + // the merging behavior is implementation specific. + // It is generally recommended that GatewayClass provides defaults that can be overridden by a Gateway. + // + // Support: Implementation-specific + // + // +optional + ParametersRef *LocalParametersReference `json:"parametersRef,omitempty"` +} + +// LocalParametersReference identifies an API object containing controller-specific +// configuration resource within the namespace. +type LocalParametersReference struct { + // Group is the group of the referent. + Group Group `json:"group"` + + // Kind is kind of the referent. + Kind Kind `json:"kind"` + + // Name is the name of the referent. + // + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + Name string `json:"name"` } // GatewayConditionType is a type of condition associated with a @@ -700,8 +775,10 @@ const ( // true. GatewayReasonProgrammed GatewayConditionReason = "Programmed" - // This reason is used with the "Programmed" and "Accepted" conditions when the Gateway is - // syntactically or semantically invalid. + // This reason is used with the "Programmed" and "Accepted" conditions when + // the Gateway is syntactically or semantically invalid. For example, this + // could include unspecified TLS configuration, or some unrecognized or + // invalid values in the TLS configuration. GatewayReasonInvalid GatewayConditionReason = "Invalid" // This reason is used with the "Programmed" condition when the @@ -753,6 +830,7 @@ const ( // Possible reasons for this condition to be False are: // // * "Invalid" + // * "InvalidParameters" // * "NotReconciled" // * "UnsupportedAddress" // * "ListenersNotValid" @@ -786,6 +864,11 @@ const ( // Gateway could not be accepted because an address that was provided is a // type which is not supported by the implementation. GatewayReasonUnsupportedAddress GatewayConditionReason = "UnsupportedAddress" + + // This reason is used with the "Accepted" condition when the + // Gateway was not accepted because the parametersRef field + // was invalid, with more detail in the message. + GatewayReasonInvalidParameters GatewayConditionReason = "InvalidParameters" ) const ( diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1/gatewayclass_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1/gatewayclass_types.go index becbc14b2..21875dce1 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1/gatewayclass_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1/gatewayclass_types.go @@ -25,6 +25,7 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:categories=gateway-api,scope=Cluster,shortName=gc // +kubebuilder:subresource:status +// +kubebuilder:storageversion // +kubebuilder:printcolumn:name="Controller",type=string,JSONPath=`.spec.controllerName` // +kubebuilder:printcolumn:name="Accepted",type=string,JSONPath=`.status.conditions[?(@.type=="Accepted")].status` // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` @@ -95,6 +96,10 @@ type GatewayClassSpec struct { // If the referent cannot be found, the GatewayClass's "InvalidParameters" // status condition will be true. // + // A Gateway for this GatewayClass may provide its own `parametersRef`. When both are specified, + // the merging behavior is implementation specific. + // It is generally recommended that GatewayClass provides defaults that can be overridden by a Gateway. + // // Support: Implementation-specific // // +optional @@ -266,5 +271,4 @@ type GatewayClassList struct { // SupportedFeature is used to describe distinct features that are covered by // conformance tests. -// +kubebuilder:validation:Enum=Gateway;GatewayPort8080;GatewayStaticAddresses;HTTPRoute;HTTPRouteDestinationPortMatching;HTTPRouteHostRewrite;HTTPRouteMethodMatching;HTTPRoutePathRedirect;HTTPRoutePathRewrite;HTTPRoutePortRedirect;HTTPRouteQueryParamMatching;HTTPRouteRequestMirror;HTTPRouteRequestMultipleMirrors;HTTPRouteResponseHeaderModification;HTTPRouteSchemeRedirect;Mesh;ReferenceGrant;TLSRoute type SupportedFeature string diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1/grpcroute_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1/grpcroute_types.go new file mode 100644 index 000000000..f67bc4cd7 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1/grpcroute_types.go @@ -0,0 +1,627 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:resource:categories=gateway-api +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Hostnames",type=string,JSONPath=`.spec.hostnames` +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` + +// GRPCRoute provides a way to route gRPC requests. This includes the capability +// to match requests by hostname, gRPC service, gRPC method, or HTTP/2 header. +// Filters can be used to specify additional processing steps. Backends specify +// where matching requests will be routed. +// +// GRPCRoute falls under extended support within the Gateway API. Within the +// following specification, the word "MUST" indicates that an implementation +// supporting GRPCRoute must conform to the indicated requirement, but an +// implementation not supporting this route type need not follow the requirement +// unless explicitly indicated. +// +// Implementations supporting `GRPCRoute` with the `HTTPS` `ProtocolType` MUST +// accept HTTP/2 connections without an initial upgrade from HTTP/1.1, i.e. via +// ALPN. If the implementation does not support this, then it MUST set the +// "Accepted" condition to "False" for the affected listener with a reason of +// "UnsupportedProtocol". Implementations MAY also accept HTTP/2 connections +// with an upgrade from HTTP/1. +// +// Implementations supporting `GRPCRoute` with the `HTTP` `ProtocolType` MUST +// support HTTP/2 over cleartext TCP (h2c, +// https://www.rfc-editor.org/rfc/rfc7540#section-3.1) without an initial +// upgrade from HTTP/1.1, i.e. with prior knowledge +// (https://www.rfc-editor.org/rfc/rfc7540#section-3.4). If the implementation +// does not support this, then it MUST set the "Accepted" condition to "False" +// for the affected listener with a reason of "UnsupportedProtocol". +// Implementations MAY also accept HTTP/2 connections with an upgrade from +// HTTP/1, i.e. without prior knowledge. +type GRPCRoute struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec defines the desired state of GRPCRoute. + Spec GRPCRouteSpec `json:"spec,omitempty"` + + // Status defines the current state of GRPCRoute. + Status GRPCRouteStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// GRPCRouteList contains a list of GRPCRoute. +type GRPCRouteList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []GRPCRoute `json:"items"` +} + +// GRPCRouteStatus defines the observed state of GRPCRoute. +type GRPCRouteStatus struct { + RouteStatus `json:",inline"` +} + +// GRPCRouteSpec defines the desired state of GRPCRoute +type GRPCRouteSpec struct { + CommonRouteSpec `json:",inline"` + + // Hostnames defines a set of hostnames to match against the GRPC + // Host header to select a GRPCRoute to process the request. This matches + // the RFC 1123 definition of a hostname with 2 notable exceptions: + // + // 1. IPs are not allowed. + // 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard + // label MUST appear by itself as the first label. + // + // If a hostname is specified by both the Listener and GRPCRoute, there + // MUST be at least one intersecting hostname for the GRPCRoute to be + // attached to the Listener. For example: + // + // * A Listener with `test.example.com` as the hostname matches GRPCRoutes + // that have either not specified any hostnames, or have specified at + // least one of `test.example.com` or `*.example.com`. + // * A Listener with `*.example.com` as the hostname matches GRPCRoutes + // that have either not specified any hostnames or have specified at least + // one hostname that matches the Listener hostname. For example, + // `test.example.com` and `*.example.com` would both match. On the other + // hand, `example.com` and `test.example.net` would not match. + // + // Hostnames that are prefixed with a wildcard label (`*.`) are interpreted + // as a suffix match. That means that a match for `*.example.com` would match + // both `test.example.com`, and `foo.test.example.com`, but not `example.com`. + // + // If both the Listener and GRPCRoute have specified hostnames, any + // GRPCRoute hostnames that do not match the Listener hostname MUST be + // ignored. For example, if a Listener specified `*.example.com`, and the + // GRPCRoute specified `test.example.com` and `test.example.net`, + // `test.example.net` MUST NOT be considered for a match. + // + // If both the Listener and GRPCRoute have specified hostnames, and none + // match with the criteria above, then the GRPCRoute MUST NOT be accepted by + // the implementation. The implementation MUST raise an 'Accepted' Condition + // with a status of `False` in the corresponding RouteParentStatus. + // + // If a Route (A) of type HTTPRoute or GRPCRoute is attached to a + // Listener and that listener already has another Route (B) of the other + // type attached and the intersection of the hostnames of A and B is + // non-empty, then the implementation MUST accept exactly one of these two + // routes, determined by the following criteria, in order: + // + // * The oldest Route based on creation timestamp. + // * The Route appearing first in alphabetical order by + // "{namespace}/{name}". + // + // The rejected Route MUST raise an 'Accepted' condition with a status of + // 'False' in the corresponding RouteParentStatus. + // + // Support: Core + // + // +optional + // +kubebuilder:validation:MaxItems=16 + Hostnames []Hostname `json:"hostnames,omitempty"` + + // Rules are a list of GRPC matchers, filters and actions. + // + // +optional + // +kubebuilder:validation:MaxItems=16 + Rules []GRPCRouteRule `json:"rules,omitempty"` +} + +// GRPCRouteRule defines the semantics for matching a gRPC request based on +// conditions (matches), processing it (filters), and forwarding the request to +// an API object (backendRefs). +type GRPCRouteRule struct { + // Matches define conditions used for matching the rule against incoming + // gRPC requests. Each match is independent, i.e. this rule will be matched + // if **any** one of the matches is satisfied. + // + // For example, take the following matches configuration: + // + // ``` + // matches: + // - method: + // service: foo.bar + // headers: + // values: + // version: 2 + // - method: + // service: foo.bar.v2 + // ``` + // + // For a request to match against this rule, it MUST satisfy + // EITHER of the two conditions: + // + // - service of foo.bar AND contains the header `version: 2` + // - service of foo.bar.v2 + // + // See the documentation for GRPCRouteMatch on how to specify multiple + // match conditions to be ANDed together. + // + // If no matches are specified, the implementation MUST match every gRPC request. + // + // Proxy or Load Balancer routing configuration generated from GRPCRoutes + // MUST prioritize rules based on the following criteria, continuing on + // ties. Merging MUST not be done between GRPCRoutes and HTTPRoutes. + // Precedence MUST be given to the rule with the largest number of: + // + // * Characters in a matching non-wildcard hostname. + // * Characters in a matching hostname. + // * Characters in a matching service. + // * Characters in a matching method. + // * Header matches. + // + // If ties still exist across multiple Routes, matching precedence MUST be + // determined in order of the following criteria, continuing on ties: + // + // * The oldest Route based on creation timestamp. + // * The Route appearing first in alphabetical order by + // "{namespace}/{name}". + // + // If ties still exist within the Route that has been given precedence, + // matching precedence MUST be granted to the first matching rule meeting + // the above criteria. + // + // +optional + // +kubebuilder:validation:MaxItems=8 + Matches []GRPCRouteMatch `json:"matches,omitempty"` + + // Filters define the filters that are applied to requests that match + // this rule. + // + // The effects of ordering of multiple behaviors are currently unspecified. + // This can change in the future based on feedback during the alpha stage. + // + // Conformance-levels at this level are defined based on the type of filter: + // + // - ALL core filters MUST be supported by all implementations that support + // GRPCRoute. + // - Implementers are encouraged to support extended filters. + // - Implementation-specific custom filters have no API guarantees across + // implementations. + // + // Specifying the same filter multiple times is not supported unless explicitly + // indicated in the filter. + // + // If an implementation can not support a combination of filters, it must clearly + // document that limitation. In cases where incompatible or unsupported + // filters are specified and cause the `Accepted` condition to be set to status + // `False`, implementations may use the `IncompatibleFilters` reason to specify + // this configuration error. + // + // Support: Core + // + // +optional + // +kubebuilder:validation:MaxItems=16 + // +kubebuilder:validation:XValidation:message="RequestHeaderModifier filter cannot be repeated",rule="self.filter(f, f.type == 'RequestHeaderModifier').size() <= 1" + // +kubebuilder:validation:XValidation:message="ResponseHeaderModifier filter cannot be repeated",rule="self.filter(f, f.type == 'ResponseHeaderModifier').size() <= 1" + Filters []GRPCRouteFilter `json:"filters,omitempty"` + + // BackendRefs defines the backend(s) where matching requests should be + // sent. + // + // Failure behavior here depends on how many BackendRefs are specified and + // how many are invalid. + // + // If *all* entries in BackendRefs are invalid, and there are also no filters + // specified in this route rule, *all* traffic which matches this rule MUST + // receive an `UNAVAILABLE` status. + // + // See the GRPCBackendRef definition for the rules about what makes a single + // GRPCBackendRef invalid. + // + // When a GRPCBackendRef is invalid, `UNAVAILABLE` statuses MUST be returned for + // requests that would have otherwise been routed to an invalid backend. If + // multiple backends are specified, and some are invalid, the proportion of + // requests that would otherwise have been routed to an invalid backend + // MUST receive an `UNAVAILABLE` status. + // + // For example, if two backends are specified with equal weights, and one is + // invalid, 50 percent of traffic MUST receive an `UNAVAILABLE` status. + // Implementations may choose how that 50 percent is determined. + // + // Support: Core for Kubernetes Service + // + // Support: Implementation-specific for any other resource + // + // Support for weight: Core + // + // +optional + // +kubebuilder:validation:MaxItems=16 + BackendRefs []GRPCBackendRef `json:"backendRefs,omitempty"` + + // SessionPersistence defines and configures session persistence + // for the route rule. + // + // Support: Extended + // + // +optional + // + SessionPersistence *SessionPersistence `json:"sessionPersistence"` +} + +// GRPCRouteMatch defines the predicate used to match requests to a given +// action. Multiple match types are ANDed together, i.e. the match will +// evaluate to true only if all conditions are satisfied. +// +// For example, the match below will match a gRPC request only if its service +// is `foo` AND it contains the `version: v1` header: +// +// ``` +// matches: +// - method: +// type: Exact +// service: "foo" +// headers: +// - name: "version" +// value "v1" +// +// ``` +type GRPCRouteMatch struct { + // Method specifies a gRPC request service/method matcher. If this field is + // not specified, all services and methods will match. + // + // +optional + Method *GRPCMethodMatch `json:"method,omitempty"` + + // Headers specifies gRPC request header matchers. Multiple match values are + // ANDed together, meaning, a request MUST match all the specified headers + // to select the route. + // + // +listType=map + // +listMapKey=name + // +optional + // +kubebuilder:validation:MaxItems=16 + Headers []GRPCHeaderMatch `json:"headers,omitempty"` +} + +// GRPCMethodMatch describes how to select a gRPC route by matching the gRPC +// request service and/or method. +// +// At least one of Service and Method MUST be a non-empty string. +// +// +kubebuilder:validation:XValidation:message="One or both of 'service' or 'method' must be specified",rule="has(self.type) ? has(self.service) || has(self.method) : true" +// +kubebuilder:validation:XValidation:message="service must only contain valid characters (matching ^(?i)\\.?[a-z_][a-z_0-9]*(\\.[a-z_][a-z_0-9]*)*$)",rule="(!has(self.type) || self.type == 'Exact') && has(self.service) ? self.service.matches(r\"\"\"^(?i)\\.?[a-z_][a-z_0-9]*(\\.[a-z_][a-z_0-9]*)*$\"\"\"): true" +// +kubebuilder:validation:XValidation:message="method must only contain valid characters (matching ^[A-Za-z_][A-Za-z_0-9]*$)",rule="(!has(self.type) || self.type == 'Exact') && has(self.method) ? self.method.matches(r\"\"\"^[A-Za-z_][A-Za-z_0-9]*$\"\"\"): true" +type GRPCMethodMatch struct { + // Type specifies how to match against the service and/or method. + // Support: Core (Exact with service and method specified) + // + // Support: Implementation-specific (Exact with method specified but no service specified) + // + // Support: Implementation-specific (RegularExpression) + // + // +optional + // +kubebuilder:default=Exact + Type *GRPCMethodMatchType `json:"type,omitempty"` + + // Value of the service to match against. If left empty or omitted, will + // match any service. + // + // At least one of Service and Method MUST be a non-empty string. + // + // +optional + // +kubebuilder:validation:MaxLength=1024 + Service *string `json:"service,omitempty"` + + // Value of the method to match against. If left empty or omitted, will + // match all services. + // + // At least one of Service and Method MUST be a non-empty string. + // + // +optional + // +kubebuilder:validation:MaxLength=1024 + Method *string `json:"method,omitempty"` +} + +// MethodMatchType specifies the semantics of how gRPC methods and services are compared. +// Valid MethodMatchType values, along with their conformance levels, are: +// +// * "Exact" - Core +// * "RegularExpression" - Implementation Specific +// +// Exact methods MUST be syntactically valid: +// +// - Must not contain `/` character +// +// +kubebuilder:validation:Enum=Exact;RegularExpression +type GRPCMethodMatchType string + +const ( + // Matches the method or service exactly and with case sensitivity. + GRPCMethodMatchExact GRPCMethodMatchType = "Exact" + + // Matches if the method or service matches the given regular expression with + // case sensitivity. + // + // Since `"RegularExpression"` has implementation-specific conformance, + // implementations can support POSIX, PCRE, RE2 or any other regular expression + // dialect. + // Please read the implementation's documentation to determine the supported + // dialect. + GRPCMethodMatchRegularExpression GRPCMethodMatchType = "RegularExpression" +) + +// GRPCHeaderMatch describes how to select a gRPC route by matching gRPC request +// headers. +type GRPCHeaderMatch struct { + // Type specifies how to match against the value of the header. + // + // +optional + // +kubebuilder:default=Exact + Type *HeaderMatchType `json:"type,omitempty"` + + // Name is the name of the gRPC Header to be matched. + // + // If multiple entries specify equivalent header names, only the first + // entry with an equivalent name MUST be considered for a match. Subsequent + // entries with an equivalent header name MUST be ignored. Due to the + // case-insensitivity of header names, "foo" and "Foo" are considered + // equivalent. + Name GRPCHeaderName `json:"name"` + + // Value is the value of the gRPC Header to be matched. + // + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=4096 + Value string `json:"value"` +} + +// GRPCHeaderMatchType specifies the semantics of how GRPC header values should +// be compared. Valid GRPCHeaderMatchType values, along with their conformance +// levels, are: +// +// * "Exact" - Core +// * "RegularExpression" - Implementation Specific +// +// Note that new values may be added to this enum in future releases of the API, +// implementations MUST ensure that unknown values will not cause a crash. +// +// Unknown values here MUST result in the implementation setting the Accepted +// Condition for the Route to `status: False`, with a Reason of +// `UnsupportedValue`. +// +// +kubebuilder:validation:Enum=Exact;RegularExpression +type GRPCHeaderMatchType string + +// GRPCHeaderMatchType constants. +const ( + GRPCHeaderMatchExact GRPCHeaderMatchType = "Exact" + GRPCHeaderMatchRegularExpression GRPCHeaderMatchType = "RegularExpression" +) + +type GRPCHeaderName HeaderName + +// GRPCRouteFilterType identifies a type of GRPCRoute filter. +type GRPCRouteFilterType string + +const ( + // GRPCRouteFilterRequestHeaderModifier can be used to add or remove a gRPC + // header from a gRPC request before it is sent to the upstream target. + // + // Support in GRPCRouteRule: Core + // + // Support in GRPCBackendRef: Extended + GRPCRouteFilterRequestHeaderModifier GRPCRouteFilterType = "RequestHeaderModifier" + + // GRPCRouteFilterRequestHeaderModifier can be used to add or remove a gRPC + // header from a gRPC response before it is sent to the client. + // + // Support in GRPCRouteRule: Core + // + // Support in GRPCBackendRef: Extended + GRPCRouteFilterResponseHeaderModifier GRPCRouteFilterType = "ResponseHeaderModifier" + + // GRPCRouteFilterRequestMirror can be used to mirror gRPC requests to a + // different backend. The responses from this backend MUST be ignored by + // the Gateway. + // + // Support in GRPCRouteRule: Extended + // + // Support in GRPCBackendRef: Extended + GRPCRouteFilterRequestMirror GRPCRouteFilterType = "RequestMirror" + + // GRPCRouteFilterExtensionRef should be used for configuring custom + // gRPC filters. + // + // Support in GRPCRouteRule: Implementation-specific + // + // Support in GRPCBackendRef: Implementation-specific + GRPCRouteFilterExtensionRef GRPCRouteFilterType = "ExtensionRef" +) + +// GRPCRouteFilter defines processing steps that must be completed during the +// request or response lifecycle. GRPCRouteFilters are meant as an extension +// point to express processing that may be done in Gateway implementations. Some +// examples include request or response modification, implementing +// authentication strategies, rate-limiting, and traffic shaping. API +// guarantee/conformance is defined based on the type of the filter. +// +// +kubebuilder:validation:XValidation:message="filter.requestHeaderModifier must be nil if the filter.type is not RequestHeaderModifier",rule="!(has(self.requestHeaderModifier) && self.type != 'RequestHeaderModifier')" +// +kubebuilder:validation:XValidation:message="filter.requestHeaderModifier must be specified for RequestHeaderModifier filter.type",rule="!(!has(self.requestHeaderModifier) && self.type == 'RequestHeaderModifier')" +// +kubebuilder:validation:XValidation:message="filter.responseHeaderModifier must be nil if the filter.type is not ResponseHeaderModifier",rule="!(has(self.responseHeaderModifier) && self.type != 'ResponseHeaderModifier')" +// +kubebuilder:validation:XValidation:message="filter.responseHeaderModifier must be specified for ResponseHeaderModifier filter.type",rule="!(!has(self.responseHeaderModifier) && self.type == 'ResponseHeaderModifier')" +// +kubebuilder:validation:XValidation:message="filter.requestMirror must be nil if the filter.type is not RequestMirror",rule="!(has(self.requestMirror) && self.type != 'RequestMirror')" +// +kubebuilder:validation:XValidation:message="filter.requestMirror must be specified for RequestMirror filter.type",rule="!(!has(self.requestMirror) && self.type == 'RequestMirror')" +// +kubebuilder:validation:XValidation:message="filter.extensionRef must be nil if the filter.type is not ExtensionRef",rule="!(has(self.extensionRef) && self.type != 'ExtensionRef')" +// +kubebuilder:validation:XValidation:message="filter.extensionRef must be specified for ExtensionRef filter.type",rule="!(!has(self.extensionRef) && self.type == 'ExtensionRef')" +type GRPCRouteFilter struct { + // Type identifies the type of filter to apply. As with other API fields, + // types are classified into three conformance levels: + // + // - Core: Filter types and their corresponding configuration defined by + // "Support: Core" in this package, e.g. "RequestHeaderModifier". All + // implementations supporting GRPCRoute MUST support core filters. + // + // - Extended: Filter types and their corresponding configuration defined by + // "Support: Extended" in this package, e.g. "RequestMirror". Implementers + // are encouraged to support extended filters. + // + // - Implementation-specific: Filters that are defined and supported by specific vendors. + // In the future, filters showing convergence in behavior across multiple + // implementations will be considered for inclusion in extended or core + // conformance levels. Filter-specific configuration for such filters + // is specified using the ExtensionRef field. `Type` MUST be set to + // "ExtensionRef" for custom filters. + // + // Implementers are encouraged to define custom implementation types to + // extend the core API with implementation-specific behavior. + // + // If a reference to a custom filter type cannot be resolved, the filter + // MUST NOT be skipped. Instead, requests that would have been processed by + // that filter MUST receive a HTTP error response. + // + // +unionDiscriminator + // +kubebuilder:validation:Enum=ResponseHeaderModifier;RequestHeaderModifier;RequestMirror;ExtensionRef + // + Type GRPCRouteFilterType `json:"type"` + + // RequestHeaderModifier defines a schema for a filter that modifies request + // headers. + // + // Support: Core + // + // +optional + RequestHeaderModifier *HTTPHeaderFilter `json:"requestHeaderModifier,omitempty"` + + // ResponseHeaderModifier defines a schema for a filter that modifies response + // headers. + // + // Support: Extended + // + // +optional + ResponseHeaderModifier *HTTPHeaderFilter `json:"responseHeaderModifier,omitempty"` + + // RequestMirror defines a schema for a filter that mirrors requests. + // Requests are sent to the specified destination, but responses from + // that destination are ignored. + // + // This filter can be used multiple times within the same rule. Note that + // not all implementations will be able to support mirroring to multiple + // backends. + // + // Support: Extended + // + // +optional + RequestMirror *HTTPRequestMirrorFilter `json:"requestMirror,omitempty"` + + // ExtensionRef is an optional, implementation-specific extension to the + // "filter" behavior. For example, resource "myroutefilter" in group + // "networking.example.net"). ExtensionRef MUST NOT be used for core and + // extended filters. + // + // Support: Implementation-specific + // + // This filter can be used multiple times within the same rule. + // +optional + ExtensionRef *LocalObjectReference `json:"extensionRef,omitempty"` +} + +// GRPCBackendRef defines how a GRPCRoute forwards a gRPC request. +// +// Note that when a namespace different than the local namespace is specified, a +// ReferenceGrant object is required in the referent namespace to allow that +// namespace's owner to accept the reference. See the ReferenceGrant +// documentation for details. +// +// +// +// When the BackendRef points to a Kubernetes Service, implementations SHOULD +// honor the appProtocol field if it is set for the target Service Port. +// +// Implementations supporting appProtocol SHOULD recognize the Kubernetes +// Standard Application Protocols defined in KEP-3726. +// +// If a Service appProtocol isn't specified, an implementation MAY infer the +// backend protocol through its own means. Implementations MAY infer the +// protocol from the Route type referring to the backend Service. +// +// If a Route is not able to send traffic to the backend using the specified +// protocol then the backend is considered invalid. Implementations MUST set the +// "ResolvedRefs" condition to "False" with the "UnsupportedProtocol" reason. +// +// +type GRPCBackendRef struct { + // BackendRef is a reference to a backend to forward matched requests to. + // + // A BackendRef can be invalid for the following reasons. In all cases, the + // implementation MUST ensure the `ResolvedRefs` Condition on the Route + // is set to `status: False`, with a Reason and Message that indicate + // what is the cause of the error. + // + // A BackendRef is invalid if: + // + // * It refers to an unknown or unsupported kind of resource. In this + // case, the Reason MUST be set to `InvalidKind` and Message of the + // Condition MUST explain which kind of resource is unknown or unsupported. + // + // * It refers to a resource that does not exist. In this case, the Reason MUST + // be set to `BackendNotFound` and the Message of the Condition MUST explain + // which resource does not exist. + // + // * It refers a resource in another namespace when the reference has not been + // explicitly allowed by a ReferenceGrant (or equivalent concept). In this + // case, the Reason MUST be set to `RefNotPermitted` and the Message of the + // Condition MUST explain which cross-namespace reference is not allowed. + // + // Support: Core for Kubernetes Service + // + // Support: Extended for Kubernetes ServiceImport + // + // Support: Implementation-specific for any other resource + // + // Support for weight: Core + // + // +optional + BackendRef `json:",inline"` + + // Filters defined at this level MUST be executed if and only if the + // request is being forwarded to the backend defined here. + // + // Support: Implementation-specific (For broader support of filters, use the + // Filters field in GRPCRouteRule.) + // + // +optional + // +kubebuilder:validation:MaxItems=16 + // +kubebuilder:validation:XValidation:message="RequestHeaderModifier filter cannot be repeated",rule="self.filter(f, f.type == 'RequestHeaderModifier').size() <= 1" + // +kubebuilder:validation:XValidation:message="ResponseHeaderModifier filter cannot be repeated",rule="self.filter(f, f.type == 'ResponseHeaderModifier').size() <= 1" + Filters []GRPCRouteFilter `json:"filters,omitempty"` +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1/httproute_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1/httproute_types.go index 816551edf..0f2092c04 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1/httproute_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1/httproute_types.go @@ -24,6 +24,7 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:categories=gateway-api // +kubebuilder:subresource:status +// +kubebuilder:storageversion // +kubebuilder:printcolumn:name="Hostnames",type=string,JSONPath=`.spec.hostnames` // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` @@ -196,8 +197,19 @@ type HTTPRouteRule struct { // Filters define the filters that are applied to requests that match // this rule. // - // The effects of ordering of multiple behaviors are currently unspecified. - // This can change in the future based on feedback during the alpha stage. + // Wherever possible, implementations SHOULD implement filters in the order + // they are specified. + // + // Implementations MAY choose to implement this ordering strictly, rejecting + // any combination or order of filters that can not be supported. If implementations + // choose a strict interpretation of filter ordering, they MUST clearly document + // that behavior. + // + // To reject an invalid combination or order of filters, implementations SHOULD + // consider the Route Rules with this configuration invalid. If all Route Rules + // in a Route are invalid, the entire Route would be considered invalid. If only + // a portion of Route Rules are invalid, implementations MUST set the + // "PartiallyInvalid" condition for the Route. // // Conformance-levels at this level are defined based on the type of filter: // @@ -270,6 +282,15 @@ type HTTPRouteRule struct { // +optional // Timeouts *HTTPRouteTimeouts `json:"timeouts,omitempty"` + + // SessionPersistence defines and configures session persistence + // for the route rule. + // + // Support: Extended + // + // +optional + // + SessionPersistence *SessionPersistence `json:"sessionPersistence"` } // HTTPRouteTimeouts defines timeouts that can be configured for an HTTPRoute. @@ -821,7 +842,7 @@ type HTTPHeader struct { // HTTPHeaderFilter defines a filter that modifies the headers of an HTTP // request or response. Only one action for a given header name is permitted. // Filters specifying multiple actions of the same or different type for any one -// header name are invalid and will be rejected by the webhook if installed. +// header name are invalid and will be rejected by CRD validation. // Configuration to set or add multiple values for a header must use RFC 7230 // header value formatting, separating each value with a comma. type HTTPHeaderFilter struct { diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1/object_reference_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1/object_reference_types.go index c9a58b15f..421572ace 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1/object_reference_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1/object_reference_types.go @@ -145,3 +145,36 @@ type BackendObjectReference struct { // +optional Port *PortNumber `json:"port,omitempty"` } + +// ObjectReference identifies an API object including its namespace. +// +// The API object must be valid in the cluster; the Group and Kind must +// be registered in the cluster for this reference to be valid. +// +// References to objects with invalid Group and Kind are not valid, and must +// be rejected by the implementation, with appropriate Conditions set +// on the containing object. +type ObjectReference struct { + // Group is the group of the referent. For example, "gateway.networking.k8s.io". + // When unspecified or empty string, core API group is inferred. + Group Group `json:"group"` + + // Kind is kind of the referent. For example "ConfigMap" or "Service". + Kind Kind `json:"kind"` + + // Name is the name of the referent. + Name ObjectName `json:"name"` + + // Namespace is the namespace of the referenced object. When unspecified, the local + // namespace is inferred. + // + // Note that when a namespace different than the local namespace is specified, + // a ReferenceGrant object is required in the referent namespace to allow that + // namespace's owner to accept the reference. See the ReferenceGrant + // documentation for details. + // + // Support: Core + // + // +optional + Namespace *Namespace `json:"namespace,omitempty"` +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1/shared_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1/shared_types.go index 21de37b5d..bed2cc8b8 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1/shared_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1/shared_types.go @@ -25,7 +25,7 @@ import ( // with "Core" support: // // * Gateway (Gateway conformance profile) -// * Service (Mesh conformance profile, experimental, ClusterIP Services only) +// * Service (Mesh conformance profile, ClusterIP Services only) // // This API may be extended in the future to support additional kinds of parent // resources. @@ -49,7 +49,7 @@ type ParentReference struct { // There are two kinds of parent resources with "Core" support: // // * Gateway (Gateway conformance profile) - // * Service (Mesh conformance profile, experimental, ClusterIP Services only) + // * Service (Mesh conformance profile, ClusterIP Services only) // // Support for other resources is Implementation-Specific. // @@ -91,14 +91,12 @@ type ParentReference struct { // SectionName is the name of a section within the target resource. In the // following resources, SectionName is interpreted as the following: // - // * Gateway: Listener Name. When both Port (experimental) and SectionName + // * Gateway: Listener name. When both Port (experimental) and SectionName // are specified, the name and port of the selected listener must match // both specified values. - // * Service: Port Name. When both Port (experimental) and SectionName + // * Service: Port name. When both Port (experimental) and SectionName // are specified, the name and port of the selected listener must match - // both specified values. Note that attaching Routes to Services as Parents - // is part of experimental Mesh support and is not supported for any other - // purpose. + // both specified values. // // Implementations MAY choose to support attaching Routes to other resources. // If that is the case, they MUST clearly document how SectionName is @@ -150,7 +148,6 @@ type ParentReference struct { // Support: Extended // // +optional - // Port *PortNumber `json:"port,omitempty"` } @@ -171,9 +168,8 @@ type CommonRouteSpec struct { // There are two kinds of parent resources with "Core" support: // // * Gateway (Gateway conformance profile) - // - // * Service (Mesh conformance profile, experimental, ClusterIP Services only) - // + // * Service (Mesh conformance profile, ClusterIP Services only) + // // This API may be extended in the future to support additional kinds of parent // resources. // @@ -576,7 +572,7 @@ type Group string type Kind string // ObjectName refers to the name of a Kubernetes object. -// Object names can have a variety of forms, including RFC1123 subdomains, +// Object names can have a variety of forms, including RFC 1123 subdomains, // RFC 1123 labels, or RFC 1035 labels. // // +kubebuilder:validation:MinLength=1 @@ -606,11 +602,22 @@ type Namespace string // SectionName is the name of a section in a Kubernetes resource. // +// In the following resources, SectionName is interpreted as the following: +// +// * Gateway: Listener name +// * HTTPRoute: HTTPRouteRule name +// * Service: Port name +// +// Section names can have a variety of forms, including RFC 1123 subdomains, +// RFC 1123 labels, or RFC 1035 labels. +// // This validation is based off of the corresponding Kubernetes validation: // https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L208 // // Valid values include: // +// * "example" +// * "foo-example" // * "example.com" // * "foo.example.com" // @@ -736,3 +743,115 @@ const ( // Support: Implementation-specific NamedAddressType AddressType = "NamedAddress" ) + +// SessionPersistence defines the desired state of SessionPersistence. +// +kubebuilder:validation:XValidation:message="AbsoluteTimeout must be specified when cookie lifetimeType is Permanent",rule="!has(self.cookieConfig.lifetimeType) || self.cookieConfig.lifetimeType != 'Permanent' || has(self.absoluteTimeout)" +type SessionPersistence struct { + // SessionName defines the name of the persistent session token + // which may be reflected in the cookie or the header. Users + // should avoid reusing session names to prevent unintended + // consequences, such as rejection or unpredictable behavior. + // + // Support: Implementation-specific + // + // +optional + // +kubebuilder:validation:MaxLength=128 + SessionName *string `json:"sessionName,omitempty"` + + // AbsoluteTimeout defines the absolute timeout of the persistent + // session. Once the AbsoluteTimeout duration has elapsed, the + // session becomes invalid. + // + // Support: Extended + // + // +optional + AbsoluteTimeout *Duration `json:"absoluteTimeout,omitempty"` + + // IdleTimeout defines the idle timeout of the persistent session. + // Once the session has been idle for more than the specified + // IdleTimeout duration, the session becomes invalid. + // + // Support: Extended + // + // +optional + IdleTimeout *Duration `json:"idleTimeout,omitempty"` + + // Type defines the type of session persistence such as through + // the use a header or cookie. Defaults to cookie based session + // persistence. + // + // Support: Core for "Cookie" type + // + // Support: Extended for "Header" type + // + // +optional + // +kubebuilder:default=Cookie + Type *SessionPersistenceType `json:"type,omitempty"` + + // CookieConfig provides configuration settings that are specific + // to cookie-based session persistence. + // + // Support: Core + // + // +optional + CookieConfig *CookieConfig `json:"cookieConfig,omitempty"` +} + +// +kubebuilder:validation:Enum=Cookie;Header +type SessionPersistenceType string + +const ( + // CookieBasedSessionPersistence specifies cookie-based session + // persistence. + // + // Support: Core + CookieBasedSessionPersistence SessionPersistenceType = "Cookie" + + // HeaderBasedSessionPersistence specifies header-based session + // persistence. + // + // Support: Extended + HeaderBasedSessionPersistence SessionPersistenceType = "Header" +) + +// CookieConfig defines the configuration for cookie-based session persistence. +type CookieConfig struct { + // LifetimeType specifies whether the cookie has a permanent or + // session-based lifetime. A permanent cookie persists until its + // specified expiry time, defined by the Expires or Max-Age cookie + // attributes, while a session cookie is deleted when the current + // session ends. + // + // When set to "Permanent", AbsoluteTimeout indicates the + // cookie's lifetime via the Expires or Max-Age cookie attributes + // and is required. + // + // When set to "Session", AbsoluteTimeout indicates the + // absolute lifetime of the cookie tracked by the gateway and + // is optional. + // + // Support: Core for "Session" type + // + // Support: Extended for "Permanent" type + // + // +optional + // +kubebuilder:default=Session + LifetimeType *CookieLifetimeType `json:"lifetimeType,omitempty"` +} + +// +kubebuilder:validation:Enum=Permanent;Session +type CookieLifetimeType string + +const ( + // SessionCookieLifetimeType specifies the type for a session + // cookie. + // + // Support: Core + SessionCookieLifetimeType CookieLifetimeType = "Session" + + // PermanentCookieLifetimeType specifies the type for a permanent + // cookie. + // + // Support: Extended + PermanentCookieLifetimeType CookieLifetimeType = "Permanent" +) diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/gateway-api/apis/v1/zz_generated.deepcopy.go index 8d047a284..1d919fa38 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1/zz_generated.deepcopy.go @@ -130,6 +130,327 @@ func (in *CommonRouteSpec) DeepCopy() *CommonRouteSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CookieConfig) DeepCopyInto(out *CookieConfig) { + *out = *in + if in.LifetimeType != nil { + in, out := &in.LifetimeType, &out.LifetimeType + *out = new(CookieLifetimeType) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CookieConfig. +func (in *CookieConfig) DeepCopy() *CookieConfig { + if in == nil { + return nil + } + out := new(CookieConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FrontendTLSValidation) DeepCopyInto(out *FrontendTLSValidation) { + *out = *in + if in.CACertificateRefs != nil { + in, out := &in.CACertificateRefs, &out.CACertificateRefs + *out = make([]ObjectReference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FrontendTLSValidation. +func (in *FrontendTLSValidation) DeepCopy() *FrontendTLSValidation { + if in == nil { + return nil + } + out := new(FrontendTLSValidation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GRPCBackendRef) DeepCopyInto(out *GRPCBackendRef) { + *out = *in + in.BackendRef.DeepCopyInto(&out.BackendRef) + if in.Filters != nil { + in, out := &in.Filters, &out.Filters + *out = make([]GRPCRouteFilter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCBackendRef. +func (in *GRPCBackendRef) DeepCopy() *GRPCBackendRef { + if in == nil { + return nil + } + out := new(GRPCBackendRef) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GRPCHeaderMatch) DeepCopyInto(out *GRPCHeaderMatch) { + *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(HeaderMatchType) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCHeaderMatch. +func (in *GRPCHeaderMatch) DeepCopy() *GRPCHeaderMatch { + if in == nil { + return nil + } + out := new(GRPCHeaderMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GRPCMethodMatch) DeepCopyInto(out *GRPCMethodMatch) { + *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(GRPCMethodMatchType) + **out = **in + } + if in.Service != nil { + in, out := &in.Service, &out.Service + *out = new(string) + **out = **in + } + if in.Method != nil { + in, out := &in.Method, &out.Method + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCMethodMatch. +func (in *GRPCMethodMatch) DeepCopy() *GRPCMethodMatch { + if in == nil { + return nil + } + out := new(GRPCMethodMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GRPCRoute) DeepCopyInto(out *GRPCRoute) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCRoute. +func (in *GRPCRoute) DeepCopy() *GRPCRoute { + if in == nil { + return nil + } + out := new(GRPCRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GRPCRoute) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GRPCRouteFilter) DeepCopyInto(out *GRPCRouteFilter) { + *out = *in + if in.RequestHeaderModifier != nil { + in, out := &in.RequestHeaderModifier, &out.RequestHeaderModifier + *out = new(HTTPHeaderFilter) + (*in).DeepCopyInto(*out) + } + if in.ResponseHeaderModifier != nil { + in, out := &in.ResponseHeaderModifier, &out.ResponseHeaderModifier + *out = new(HTTPHeaderFilter) + (*in).DeepCopyInto(*out) + } + if in.RequestMirror != nil { + in, out := &in.RequestMirror, &out.RequestMirror + *out = new(HTTPRequestMirrorFilter) + (*in).DeepCopyInto(*out) + } + if in.ExtensionRef != nil { + in, out := &in.ExtensionRef, &out.ExtensionRef + *out = new(LocalObjectReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCRouteFilter. +func (in *GRPCRouteFilter) DeepCopy() *GRPCRouteFilter { + if in == nil { + return nil + } + out := new(GRPCRouteFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GRPCRouteList) DeepCopyInto(out *GRPCRouteList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GRPCRoute, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCRouteList. +func (in *GRPCRouteList) DeepCopy() *GRPCRouteList { + if in == nil { + return nil + } + out := new(GRPCRouteList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GRPCRouteList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GRPCRouteMatch) DeepCopyInto(out *GRPCRouteMatch) { + *out = *in + if in.Method != nil { + in, out := &in.Method, &out.Method + *out = new(GRPCMethodMatch) + (*in).DeepCopyInto(*out) + } + if in.Headers != nil { + in, out := &in.Headers, &out.Headers + *out = make([]GRPCHeaderMatch, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCRouteMatch. +func (in *GRPCRouteMatch) DeepCopy() *GRPCRouteMatch { + if in == nil { + return nil + } + out := new(GRPCRouteMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GRPCRouteRule) DeepCopyInto(out *GRPCRouteRule) { + *out = *in + if in.Matches != nil { + in, out := &in.Matches, &out.Matches + *out = make([]GRPCRouteMatch, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Filters != nil { + in, out := &in.Filters, &out.Filters + *out = make([]GRPCRouteFilter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.BackendRefs != nil { + in, out := &in.BackendRefs, &out.BackendRefs + *out = make([]GRPCBackendRef, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SessionPersistence != nil { + in, out := &in.SessionPersistence, &out.SessionPersistence + *out = new(SessionPersistence) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCRouteRule. +func (in *GRPCRouteRule) DeepCopy() *GRPCRouteRule { + if in == nil { + return nil + } + out := new(GRPCRouteRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GRPCRouteSpec) DeepCopyInto(out *GRPCRouteSpec) { + *out = *in + in.CommonRouteSpec.DeepCopyInto(&out.CommonRouteSpec) + if in.Hostnames != nil { + in, out := &in.Hostnames, &out.Hostnames + *out = make([]Hostname, len(*in)) + copy(*out, *in) + } + if in.Rules != nil { + in, out := &in.Rules, &out.Rules + *out = make([]GRPCRouteRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCRouteSpec. +func (in *GRPCRouteSpec) DeepCopy() *GRPCRouteSpec { + if in == nil { + return nil + } + out := new(GRPCRouteSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GRPCRouteStatus) DeepCopyInto(out *GRPCRouteStatus) { + *out = *in + in.RouteStatus.DeepCopyInto(&out.RouteStatus) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCRouteStatus. +func (in *GRPCRouteStatus) DeepCopy() *GRPCRouteStatus { + if in == nil { + return nil + } + out := new(GRPCRouteStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Gateway) DeepCopyInto(out *Gateway) { *out = *in @@ -305,6 +626,11 @@ func (in *GatewayInfrastructure) DeepCopyInto(out *GatewayInfrastructure) { (*out)[key] = val } } + if in.ParametersRef != nil { + in, out := &in.ParametersRef, &out.ParametersRef + *out = new(LocalParametersReference) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayInfrastructure. @@ -454,6 +780,11 @@ func (in *GatewayTLSConfig) DeepCopyInto(out *GatewayTLSConfig) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.FrontendValidation != nil { + in, out := &in.FrontendValidation, &out.FrontendValidation + *out = new(FrontendTLSValidation) + (*in).DeepCopyInto(*out) + } if in.Options != nil { in, out := &in.Options, &out.Options *out = make(map[AnnotationKey]AnnotationValue, len(*in)) @@ -859,6 +1190,11 @@ func (in *HTTPRouteRule) DeepCopyInto(out *HTTPRouteRule) { *out = new(HTTPRouteTimeouts) (*in).DeepCopyInto(*out) } + if in.SessionPersistence != nil { + in, out := &in.SessionPersistence, &out.SessionPersistence + *out = new(SessionPersistence) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRouteRule. @@ -1039,6 +1375,41 @@ func (in *LocalObjectReference) DeepCopy() *LocalObjectReference { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalParametersReference) DeepCopyInto(out *LocalParametersReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalParametersReference. +func (in *LocalParametersReference) DeepCopy() *LocalParametersReference { + if in == nil { + return nil + } + out := new(LocalParametersReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ObjectReference) DeepCopyInto(out *ObjectReference) { + *out = *in + if in.Namespace != nil { + in, out := &in.Namespace, &out.Namespace + *out = new(Namespace) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectReference. +func (in *ObjectReference) DeepCopy() *ObjectReference { + if in == nil { + return nil + } + out := new(ObjectReference) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ParametersReference) DeepCopyInto(out *ParametersReference) { *out = *in @@ -1218,3 +1589,43 @@ func (in *SecretObjectReference) DeepCopy() *SecretObjectReference { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SessionPersistence) DeepCopyInto(out *SessionPersistence) { + *out = *in + if in.SessionName != nil { + in, out := &in.SessionName, &out.SessionName + *out = new(string) + **out = **in + } + if in.AbsoluteTimeout != nil { + in, out := &in.AbsoluteTimeout, &out.AbsoluteTimeout + *out = new(Duration) + **out = **in + } + if in.IdleTimeout != nil { + in, out := &in.IdleTimeout, &out.IdleTimeout + *out = new(Duration) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(SessionPersistenceType) + **out = **in + } + if in.CookieConfig != nil { + in, out := &in.CookieConfig, &out.CookieConfig + *out = new(CookieConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SessionPersistence. +func (in *SessionPersistence) DeepCopy() *SessionPersistence { + if in == nil { + return nil + } + out := new(SessionPersistence) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1/zz_generated.register.go b/vendor/sigs.k8s.io/gateway-api/apis/v1/zz_generated.register.go index f86709308..763dbcc12 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1/zz_generated.register.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1/zz_generated.register.go @@ -58,6 +58,8 @@ func init() { // Adds the list of known types to Scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, + &GRPCRoute{}, + &GRPCRouteList{}, &Gateway{}, &GatewayClass{}, &GatewayClassList{}, diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/backendlbpolicy_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/backendlbpolicy_types.go new file mode 100644 index 000000000..5063f0f4e --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/backendlbpolicy_types.go @@ -0,0 +1,74 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:resource:categories=gateway-api,shortName=blbpolicy +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` + +// BackendLBPolicy provides a way to define load balancing rules +// for a backend. +type BackendLBPolicy struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec defines the desired state of BackendLBPolicy. + Spec BackendLBPolicySpec `json:"spec"` + + // Status defines the current state of BackendLBPolicy. + Status PolicyStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true +// BackendLBPolicyList contains a list of BackendLBPolicies +type BackendLBPolicyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []BackendLBPolicy `json:"items"` +} + +// BackendLBPolicySpec defines the desired state of +// BackendLBPolicy. +// Note: there is no Override or Default policy configuration. +type BackendLBPolicySpec struct { + // TargetRef identifies an API object to apply policy to. + // Currently, Backends (i.e. Service, ServiceImport, or any + // implementation-specific backendRef) are the only valid API + // target references. + // +listType=map + // +listMapKey=group + // +listMapKey=kind + // +listMapKey=name + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=16 + TargetRefs []LocalPolicyTargetReference `json:"targetRefs"` + + // SessionPersistence defines and configures session persistence + // for the backend. + // + // Support: Extended + // + // +optional + SessionPersistence *SessionPersistence `json:"sessionPersistence"` +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/doc.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/doc.go index 68e165955..24ac87b9e 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/doc.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/doc.go @@ -17,6 +17,7 @@ limitations under the License. // Package v1alpha2 contains API Schema definitions for the // gateway.networking.k8s.io API group. // +// +k8s:openapi-gen=true // +kubebuilder:object:generate=true // +groupName=gateway.networking.k8s.io package v1alpha2 diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/gateway_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/gateway_types.go deleted file mode 100644 index bb187e8cb..000000000 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/gateway_types.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha2 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - v1 "sigs.k8s.io/gateway-api/apis/v1" -) - -// +genclient -// +kubebuilder:object:root=true -// +kubebuilder:resource:categories=gateway-api,shortName=gtw -// +kubebuilder:subresource:status -// +kubebuilder:skipversion -// +kubebuilder:deprecatedversion:warning="The v1alpha2 version of Gateway has been deprecated and will be removed in a future release of the API. Please upgrade to v1." -// +kubebuilder:printcolumn:name="Class",type=string,JSONPath=`.spec.gatewayClassName` -// +kubebuilder:printcolumn:name="Address",type=string,JSONPath=`.status.addresses[*].value` -// +kubebuilder:printcolumn:name="Programmed",type=string,JSONPath=`.status.conditions[?(@.type=="Programmed")].status` -// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` - -// Gateway represents an instance of a service-traffic handling infrastructure -// by binding Listeners to a set of IP addresses. -type Gateway v1.Gateway - -// +kubebuilder:object:root=true - -// GatewayList contains a list of Gateways. -type GatewayList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Gateway `json:"items"` -} - -// GatewaySpec defines the desired state of Gateway. -// -// Not all possible combinations of options specified in the Spec are -// valid. Some invalid configurations can be caught synchronously via a -// webhook, but there are many cases that will require asynchronous -// signaling via the GatewayStatus block. -// +k8s:deepcopy-gen=false -type GatewaySpec = v1.GatewaySpec - -// Listener embodies the concept of a logical endpoint where a Gateway accepts -// network connections. -// +k8s:deepcopy-gen=false -type Listener = v1.Listener - -// ProtocolType defines the application protocol accepted by a Listener. -// Implementations are not required to accept all the defined protocols. If an -// implementation does not support a specified protocol, it MUST set the -// "Accepted" condition to False for the affected Listener with a reason of -// "UnsupportedProtocol". -// -// Core ProtocolType values are listed in the table below. -// -// Implementations can define their own protocols if a core ProtocolType does not -// exist. Such definitions must use prefixed name, such as -// `mycompany.com/my-custom-protocol`. Un-prefixed names are reserved for core -// protocols. Any protocol defined by implementations will fall under -// implementation-specific conformance. -// -// Valid values include: -// -// * "HTTP" - Core support -// * "example.com/bar" - Implementation-specific support -// -// Invalid values include: -// -// * "example.com" - must include path if domain is used -// * "foo.example.com" - must include path if domain is used -// -// +kubebuilder:validation:MinLength=1 -// +kubebuilder:validation:MaxLength=255 -// +kubebuilder:validation:Pattern=`^[a-zA-Z0-9]([-a-zSA-Z0-9]*[a-zA-Z0-9])?$|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9]+$` -// +k8s:deepcopy-gen=false -type ProtocolType = v1.ProtocolType - -// GatewayTLSConfig describes a TLS configuration. -// +k8s:deepcopy-gen=false -type GatewayTLSConfig = v1.GatewayTLSConfig - -// TLSModeType type defines how a Gateway handles TLS sessions. -// -// Note that values may be added to this enum, implementations -// must ensure that unknown values will not cause a crash. -// -// Unknown values here must result in the implementation setting the -// Ready Condition for the Listener to `status: False`, with a -// Reason of `Invalid`. -// -// +kubebuilder:validation:Enum=Terminate;Passthrough -// +k8s:deepcopy-gen=false -type TLSModeType = v1.TLSModeType - -// AllowedRoutes defines which Routes may be attached to this Listener. -// +k8s:deepcopy-gen=false -type AllowedRoutes = v1.AllowedRoutes - -// FromNamespaces specifies namespace from which Routes may be attached to a -// Gateway. -// -// Note that values may be added to this enum, implementations -// must ensure that unknown values will not cause a crash. -// -// Unknown values here must result in the implementation setting the -// Ready Condition for the Listener to `status: False`, with a -// Reason of `Invalid`. -// -// +kubebuilder:validation:Enum=All;Selector;Same -// +k8s:deepcopy-gen=false -type FromNamespaces = v1.FromNamespaces - -// RouteNamespaces indicate which namespaces Routes should be selected from. -// +k8s:deepcopy-gen=false -type RouteNamespaces = v1.RouteNamespaces - -// RouteGroupKind indicates the group and kind of a Route resource. -// +k8s:deepcopy-gen=false -type RouteGroupKind = v1.RouteGroupKind - -// GatewayAddress describes an address that can be bound to a Gateway. -// +k8s:deepcopy-gen=false -type GatewayAddress = v1.GatewayAddress - -// GatewayStatus defines the observed state of Gateway. -// +k8s:deepcopy-gen=false -type GatewayStatus = v1.GatewayStatus - -// GatewayConditionType is a type of condition associated with a -// Gateway. This type should be used with the GatewayStatus.Conditions -// field. -// +k8s:deepcopy-gen=false -type GatewayConditionType = v1.GatewayConditionType - -// GatewayConditionReason defines the set of reasons that explain why a -// particular Gateway condition type has been raised. -// +k8s:deepcopy-gen=false -type GatewayConditionReason = v1.GatewayConditionReason - -// ListenerStatus is the status associated with a Listener. -// +k8s:deepcopy-gen=false -type ListenerStatus = v1.ListenerStatus - -// ListenerConditionType is a type of condition associated with the -// listener. This type should be used with the ListenerStatus.Conditions -// field. -// +k8s:deepcopy-gen=false -type ListenerConditionType = v1.ListenerConditionType - -// ListenerConditionReason defines the set of reasons that explain -// why a particular Listener condition type has been raised. -// +k8s:deepcopy-gen=false -type ListenerConditionReason = v1.ListenerConditionReason diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/gatewayclass_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/gatewayclass_types.go deleted file mode 100644 index df6ef4b9c..000000000 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/gatewayclass_types.go +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha2 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - v1 "sigs.k8s.io/gateway-api/apis/v1" -) - -// +genclient -// +genclient:nonNamespaced -// +kubebuilder:object:root=true -// +kubebuilder:resource:categories=gateway-api,scope=Cluster,shortName=gc -// +kubebuilder:subresource:status -// +kubebuilder:skipversion -// +kubebuilder:deprecatedversion:warning="The v1alpha2 version of GatewayClass has been deprecated and will be removed in a future release of the API. Please upgrade to v1." -// +kubebuilder:printcolumn:name="Controller",type=string,JSONPath=`.spec.controllerName` -// +kubebuilder:printcolumn:name="Accepted",type=string,JSONPath=`.status.conditions[?(@.type=="Accepted")].status` -// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` -// +kubebuilder:printcolumn:name="Description",type=string,JSONPath=`.spec.description`,priority=1 - -// GatewayClass describes a class of Gateways available to the user for creating -// Gateway resources. -// -// It is recommended that this resource be used as a template for Gateways. This -// means that a Gateway is based on the state of the GatewayClass at the time it -// was created and changes to the GatewayClass or associated parameters are not -// propagated down to existing Gateways. This recommendation is intended to -// limit the blast radius of changes to GatewayClass or associated parameters. -// If implementations choose to propagate GatewayClass changes to existing -// Gateways, that MUST be clearly documented by the implementation. -// -// Whenever one or more Gateways are using a GatewayClass, implementations SHOULD -// add the `gateway-exists-finalizer.gateway.networking.k8s.io` finalizer on the -// associated GatewayClass. This ensures that a GatewayClass associated with a -// Gateway is not deleted while in use. -// -// GatewayClass is a Cluster level resource. -type GatewayClass v1.GatewayClass - -// +kubebuilder:object:root=true - -// GatewayClassList contains a list of GatewayClass -type GatewayClassList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []GatewayClass `json:"items"` -} - -// GatewayClassSpec reflects the configuration of a class of Gateways. -// +k8s:deepcopy-gen=false -type GatewayClassSpec = v1.GatewayClassSpec - -// ParametersReference identifies an API object containing controller-specific -// configuration resource within the cluster. -// +k8s:deepcopy-gen=false -type ParametersReference = v1.ParametersReference - -// GatewayClassConditionType is the type for status conditions on -// Gateway resources. This type should be used with the -// GatewayClassStatus.Conditions field. -// +k8s:deepcopy-gen=false -type GatewayClassConditionType = v1.GatewayClassConditionType - -// GatewayClassConditionReason defines the set of reasons that explain why a -// particular GatewayClass condition type has been raised. -// +k8s:deepcopy-gen=false -type GatewayClassConditionReason = v1.GatewayClassConditionReason - -// GatewayClassStatus is the current status for the GatewayClass. -// +k8s:deepcopy-gen=false -type GatewayClassStatus = v1.GatewayClassStatus diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/grpcroute_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/grpcroute_types.go index c5ae6ea2e..0b0bb4e85 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/grpcroute_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/grpcroute_types.go @@ -24,597 +24,12 @@ import ( // +genclient // +kubebuilder:object:root=true -// +kubebuilder:resource:categories=gateway-api -// +kubebuilder:subresource:status -// +kubebuilder:storageversion -// +kubebuilder:printcolumn:name="Hostnames",type=string,JSONPath=`.spec.hostnames` -// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` - -// GRPCRoute provides a way to route gRPC requests. This includes the capability -// to match requests by hostname, gRPC service, gRPC method, or HTTP/2 header. -// Filters can be used to specify additional processing steps. Backends specify -// where matching requests will be routed. -// -// GRPCRoute falls under extended support within the Gateway API. Within the -// following specification, the word "MUST" indicates that an implementation -// supporting GRPCRoute must conform to the indicated requirement, but an -// implementation not supporting this route type need not follow the requirement -// unless explicitly indicated. -// -// Implementations supporting `GRPCRoute` with the `HTTPS` `ProtocolType` MUST -// accept HTTP/2 connections without an initial upgrade from HTTP/1.1, i.e. via -// ALPN. If the implementation does not support this, then it MUST set the -// "Accepted" condition to "False" for the affected listener with a reason of -// "UnsupportedProtocol". Implementations MAY also accept HTTP/2 connections -// with an upgrade from HTTP/1. -// -// Implementations supporting `GRPCRoute` with the `HTTP` `ProtocolType` MUST -// support HTTP/2 over cleartext TCP (h2c, -// https://www.rfc-editor.org/rfc/rfc7540#section-3.1) without an initial -// upgrade from HTTP/1.1, i.e. with prior knowledge -// (https://www.rfc-editor.org/rfc/rfc7540#section-3.4). If the implementation -// does not support this, then it MUST set the "Accepted" condition to "False" -// for the affected listener with a reason of "UnsupportedProtocol". -// Implementations MAY also accept HTTP/2 connections with an upgrade from -// HTTP/1, i.e. without prior knowledge. -type GRPCRoute struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Spec defines the desired state of GRPCRoute. - Spec GRPCRouteSpec `json:"spec,omitempty"` - - // Status defines the current state of GRPCRoute. - Status GRPCRouteStatus `json:"status,omitempty"` -} +// +kubebuilder:deprecatedversion:warning="The v1alpha2 version of GRPCRoute has been deprecated and will be removed in a future release of the API. Please upgrade to v1." +type GRPCRoute v1.GRPCRoute // +kubebuilder:object:root=true - -// GRPCRouteList contains a list of GRPCRoute. type GRPCRouteList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []GRPCRoute `json:"items"` } - -// GRPCRouteStatus defines the observed state of GRPCRoute. -type GRPCRouteStatus struct { - RouteStatus `json:",inline"` -} - -// GRPCRouteSpec defines the desired state of GRPCRoute -type GRPCRouteSpec struct { - CommonRouteSpec `json:",inline"` - - // Hostnames defines a set of hostnames to match against the GRPC - // Host header to select a GRPCRoute to process the request. This matches - // the RFC 1123 definition of a hostname with 2 notable exceptions: - // - // 1. IPs are not allowed. - // 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard - // label MUST appear by itself as the first label. - // - // If a hostname is specified by both the Listener and GRPCRoute, there - // MUST be at least one intersecting hostname for the GRPCRoute to be - // attached to the Listener. For example: - // - // * A Listener with `test.example.com` as the hostname matches GRPCRoutes - // that have either not specified any hostnames, or have specified at - // least one of `test.example.com` or `*.example.com`. - // * A Listener with `*.example.com` as the hostname matches GRPCRoutes - // that have either not specified any hostnames or have specified at least - // one hostname that matches the Listener hostname. For example, - // `test.example.com` and `*.example.com` would both match. On the other - // hand, `example.com` and `test.example.net` would not match. - // - // Hostnames that are prefixed with a wildcard label (`*.`) are interpreted - // as a suffix match. That means that a match for `*.example.com` would match - // both `test.example.com`, and `foo.test.example.com`, but not `example.com`. - // - // If both the Listener and GRPCRoute have specified hostnames, any - // GRPCRoute hostnames that do not match the Listener hostname MUST be - // ignored. For example, if a Listener specified `*.example.com`, and the - // GRPCRoute specified `test.example.com` and `test.example.net`, - // `test.example.net` MUST NOT be considered for a match. - // - // If both the Listener and GRPCRoute have specified hostnames, and none - // match with the criteria above, then the GRPCRoute MUST NOT be accepted by - // the implementation. The implementation MUST raise an 'Accepted' Condition - // with a status of `False` in the corresponding RouteParentStatus. - // - // If a Route (A) of type HTTPRoute or GRPCRoute is attached to a - // Listener and that listener already has another Route (B) of the other - // type attached and the intersection of the hostnames of A and B is - // non-empty, then the implementation MUST accept exactly one of these two - // routes, determined by the following criteria, in order: - // - // * The oldest Route based on creation timestamp. - // * The Route appearing first in alphabetical order by - // "{namespace}/{name}". - // - // The rejected Route MUST raise an 'Accepted' condition with a status of - // 'False' in the corresponding RouteParentStatus. - // - // Support: Core - // - // +optional - // +kubebuilder:validation:MaxItems=16 - Hostnames []Hostname `json:"hostnames,omitempty"` - - // Rules are a list of GRPC matchers, filters and actions. - // - // +optional - // +kubebuilder:validation:MaxItems=16 - Rules []GRPCRouteRule `json:"rules,omitempty"` -} - -// GRPCRouteRule defines the semantics for matching a gRPC request based on -// conditions (matches), processing it (filters), and forwarding the request to -// an API object (backendRefs). -type GRPCRouteRule struct { - // Matches define conditions used for matching the rule against incoming - // gRPC requests. Each match is independent, i.e. this rule will be matched - // if **any** one of the matches is satisfied. - // - // For example, take the following matches configuration: - // - // ``` - // matches: - // - method: - // service: foo.bar - // headers: - // values: - // version: 2 - // - method: - // service: foo.bar.v2 - // ``` - // - // For a request to match against this rule, it MUST satisfy - // EITHER of the two conditions: - // - // - service of foo.bar AND contains the header `version: 2` - // - service of foo.bar.v2 - // - // See the documentation for GRPCRouteMatch on how to specify multiple - // match conditions to be ANDed together. - // - // If no matches are specified, the implementation MUST match every gRPC request. - // - // Proxy or Load Balancer routing configuration generated from GRPCRoutes - // MUST prioritize rules based on the following criteria, continuing on - // ties. Merging MUST not be done between GRPCRoutes and HTTPRoutes. - // Precedence MUST be given to the rule with the largest number of: - // - // * Characters in a matching non-wildcard hostname. - // * Characters in a matching hostname. - // * Characters in a matching service. - // * Characters in a matching method. - // * Header matches. - // - // If ties still exist across multiple Routes, matching precedence MUST be - // determined in order of the following criteria, continuing on ties: - // - // * The oldest Route based on creation timestamp. - // * The Route appearing first in alphabetical order by - // "{namespace}/{name}". - // - // If ties still exist within the Route that has been given precedence, - // matching precedence MUST be granted to the first matching rule meeting - // the above criteria. - // - // +optional - // +kubebuilder:validation:MaxItems=8 - Matches []GRPCRouteMatch `json:"matches,omitempty"` - - // Filters define the filters that are applied to requests that match - // this rule. - // - // The effects of ordering of multiple behaviors are currently unspecified. - // This can change in the future based on feedback during the alpha stage. - // - // Conformance-levels at this level are defined based on the type of filter: - // - // - ALL core filters MUST be supported by all implementations that support - // GRPCRoute. - // - Implementers are encouraged to support extended filters. - // - Implementation-specific custom filters have no API guarantees across - // implementations. - // - // Specifying the same filter multiple times is not supported unless explicitly - // indicated in the filter. - // - // If an implementation can not support a combination of filters, it must clearly - // document that limitation. In cases where incompatible or unsupported - // filters are specified and cause the `Accepted` condition to be set to status - // `False`, implementations may use the `IncompatibleFilters` reason to specify - // this configuration error. - // - // Support: Core - // - // +optional - // +kubebuilder:validation:MaxItems=16 - // +kubebuilder:validation:XValidation:message="RequestHeaderModifier filter cannot be repeated",rule="self.filter(f, f.type == 'RequestHeaderModifier').size() <= 1" - // +kubebuilder:validation:XValidation:message="ResponseHeaderModifier filter cannot be repeated",rule="self.filter(f, f.type == 'ResponseHeaderModifier').size() <= 1" - Filters []GRPCRouteFilter `json:"filters,omitempty"` - - // BackendRefs defines the backend(s) where matching requests should be - // sent. - // - // Failure behavior here depends on how many BackendRefs are specified and - // how many are invalid. - // - // If *all* entries in BackendRefs are invalid, and there are also no filters - // specified in this route rule, *all* traffic which matches this rule MUST - // receive an `UNAVAILABLE` status. - // - // See the GRPCBackendRef definition for the rules about what makes a single - // GRPCBackendRef invalid. - // - // When a GRPCBackendRef is invalid, `UNAVAILABLE` statuses MUST be returned for - // requests that would have otherwise been routed to an invalid backend. If - // multiple backends are specified, and some are invalid, the proportion of - // requests that would otherwise have been routed to an invalid backend - // MUST receive an `UNAVAILABLE` status. - // - // For example, if two backends are specified with equal weights, and one is - // invalid, 50 percent of traffic MUST receive an `UNAVAILABLE` status. - // Implementations may choose how that 50 percent is determined. - // - // Support: Core for Kubernetes Service - // - // Support: Implementation-specific for any other resource - // - // Support for weight: Core - // - // +optional - // +kubebuilder:validation:MaxItems=16 - BackendRefs []GRPCBackendRef `json:"backendRefs,omitempty"` -} - -// GRPCRouteMatch defines the predicate used to match requests to a given -// action. Multiple match types are ANDed together, i.e. the match will -// evaluate to true only if all conditions are satisfied. -// -// For example, the match below will match a gRPC request only if its service -// is `foo` AND it contains the `version: v1` header: -// -// ``` -// matches: -// - method: -// type: Exact -// service: "foo" -// headers: -// - name: "version" -// value "v1" -// -// ``` -type GRPCRouteMatch struct { - // Method specifies a gRPC request service/method matcher. If this field is - // not specified, all services and methods will match. - // - // +optional - Method *GRPCMethodMatch `json:"method,omitempty"` - - // Headers specifies gRPC request header matchers. Multiple match values are - // ANDed together, meaning, a request MUST match all the specified headers - // to select the route. - // - // +listType=map - // +listMapKey=name - // +optional - // +kubebuilder:validation:MaxItems=16 - Headers []GRPCHeaderMatch `json:"headers,omitempty"` -} - -// GRPCMethodMatch describes how to select a gRPC route by matching the gRPC -// request service and/or method. -// -// At least one of Service and Method MUST be a non-empty string. -// -// +kubebuilder:validation:XValidation:message="One or both of 'service' or 'method' must be specified",rule="has(self.type) ? has(self.service) || has(self.method) : true" -// +kubebuilder:validation:XValidation:message="service must only contain valid characters (matching ^(?i)\\.?[a-z_][a-z_0-9]*(\\.[a-z_][a-z_0-9]*)*$)",rule="(!has(self.type) || self.type == 'Exact') && has(self.service) ? self.service.matches(r\"\"\"^(?i)\\.?[a-z_][a-z_0-9]*(\\.[a-z_][a-z_0-9]*)*$\"\"\"): true" -// +kubebuilder:validation:XValidation:message="method must only contain valid characters (matching ^[A-Za-z_][A-Za-z_0-9]*$)",rule="(!has(self.type) || self.type == 'Exact') && has(self.method) ? self.method.matches(r\"\"\"^[A-Za-z_][A-Za-z_0-9]*$\"\"\"): true" -type GRPCMethodMatch struct { - // Type specifies how to match against the service and/or method. - // Support: Core (Exact with service and method specified) - // - // Support: Implementation-specific (Exact with method specified but no service specified) - // - // Support: Implementation-specific (RegularExpression) - // - // +optional - // +kubebuilder:default=Exact - Type *GRPCMethodMatchType `json:"type,omitempty"` - - // Value of the service to match against. If left empty or omitted, will - // match any service. - // - // At least one of Service and Method MUST be a non-empty string. - // - // +optional - // +kubebuilder:validation:MaxLength=1024 - Service *string `json:"service,omitempty"` - - // Value of the method to match against. If left empty or omitted, will - // match all services. - // - // At least one of Service and Method MUST be a non-empty string. - // - // +optional - // +kubebuilder:validation:MaxLength=1024 - Method *string `json:"method,omitempty"` -} - -// MethodMatchType specifies the semantics of how gRPC methods and services are compared. -// Valid MethodMatchType values, along with their conformance levels, are: -// -// * "Exact" - Core -// * "RegularExpression" - Implementation Specific -// -// Exact methods MUST be syntactically valid: -// -// - Must not contain `/` character -// -// +kubebuilder:validation:Enum=Exact;RegularExpression -type GRPCMethodMatchType string - -const ( - // Matches the method or service exactly and with case sensitivity. - GRPCMethodMatchExact GRPCMethodMatchType = "Exact" - - // Matches if the method or service matches the given regular expression with - // case sensitivity. - // - // Since `"RegularExpression"` has implementation-specific conformance, - // implementations can support POSIX, PCRE, RE2 or any other regular expression - // dialect. - // Please read the implementation's documentation to determine the supported - // dialect. - GRPCMethodMatchRegularExpression GRPCMethodMatchType = "RegularExpression" -) - -// GRPCHeaderMatch describes how to select a gRPC route by matching gRPC request -// headers. -type GRPCHeaderMatch struct { - // Type specifies how to match against the value of the header. - // - // +optional - // +kubebuilder:default=Exact - Type *HeaderMatchType `json:"type,omitempty"` - - // Name is the name of the gRPC Header to be matched. - // - // If multiple entries specify equivalent header names, only the first - // entry with an equivalent name MUST be considered for a match. Subsequent - // entries with an equivalent header name MUST be ignored. Due to the - // case-insensitivity of header names, "foo" and "Foo" are considered - // equivalent. - Name GRPCHeaderName `json:"name"` - - // Value is the value of the gRPC Header to be matched. - // - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=4096 - Value string `json:"value"` -} - -// GRPCHeaderMatchType specifies the semantics of how GRPC header values should -// be compared. Valid GRPCHeaderMatchType values, along with their conformance -// levels, are: -// -// * "Exact" - Core -// * "RegularExpression" - Implementation Specific -// -// Note that new values may be added to this enum in future releases of the API, -// implementations MUST ensure that unknown values will not cause a crash. -// -// Unknown values here MUST result in the implementation setting the Accepted -// Condition for the Route to `status: False`, with a Reason of -// `UnsupportedValue`. -// -// +kubebuilder:validation:Enum=Exact;RegularExpression -type GRPCHeaderMatchType string - -// GRPCHeaderMatchType constants. -const ( - GRPCHeaderMatchExact GRPCHeaderMatchType = "Exact" - GRPCHeaderMatchRegularExpression GRPCHeaderMatchType = "RegularExpression" -) - -type GRPCHeaderName v1.HeaderName - -// GRPCRouteFilterType identifies a type of GRPCRoute filter. -type GRPCRouteFilterType string - -const ( - // GRPCRouteFilterRequestHeaderModifier can be used to add or remove a gRPC - // header from a gRPC request before it is sent to the upstream target. - // - // Support in GRPCRouteRule: Core - // - // Support in GRPCBackendRef: Extended - GRPCRouteFilterRequestHeaderModifier GRPCRouteFilterType = "RequestHeaderModifier" - - // GRPCRouteFilterRequestHeaderModifier can be used to add or remove a gRPC - // header from a gRPC response before it is sent to the client. - // - // Support in GRPCRouteRule: Core - // - // Support in GRPCBackendRef: Extended - GRPCRouteFilterResponseHeaderModifier GRPCRouteFilterType = "ResponseHeaderModifier" - - // GRPCRouteFilterRequestMirror can be used to mirror gRPC requests to a - // different backend. The responses from this backend MUST be ignored by - // the Gateway. - // - // Support in GRPCRouteRule: Extended - // - // Support in GRPCBackendRef: Extended - GRPCRouteFilterRequestMirror GRPCRouteFilterType = "RequestMirror" - - // GRPCRouteFilterExtensionRef should be used for configuring custom - // gRPC filters. - // - // Support in GRPCRouteRule: Implementation-specific - // - // Support in GRPCBackendRef: Implementation-specific - GRPCRouteFilterExtensionRef GRPCRouteFilterType = "ExtensionRef" -) - -// GRPCRouteFilter defines processing steps that must be completed during the -// request or response lifecycle. GRPCRouteFilters are meant as an extension -// point to express processing that may be done in Gateway implementations. Some -// examples include request or response modification, implementing -// authentication strategies, rate-limiting, and traffic shaping. API -// guarantee/conformance is defined based on the type of the filter. -// -// +kubebuilder:validation:XValidation:message="filter.requestHeaderModifier must be nil if the filter.type is not RequestHeaderModifier",rule="!(has(self.requestHeaderModifier) && self.type != 'RequestHeaderModifier')" -// +kubebuilder:validation:XValidation:message="filter.requestHeaderModifier must be specified for RequestHeaderModifier filter.type",rule="!(!has(self.requestHeaderModifier) && self.type == 'RequestHeaderModifier')" -// +kubebuilder:validation:XValidation:message="filter.responseHeaderModifier must be nil if the filter.type is not ResponseHeaderModifier",rule="!(has(self.responseHeaderModifier) && self.type != 'ResponseHeaderModifier')" -// +kubebuilder:validation:XValidation:message="filter.responseHeaderModifier must be specified for ResponseHeaderModifier filter.type",rule="!(!has(self.responseHeaderModifier) && self.type == 'ResponseHeaderModifier')" -// +kubebuilder:validation:XValidation:message="filter.requestMirror must be nil if the filter.type is not RequestMirror",rule="!(has(self.requestMirror) && self.type != 'RequestMirror')" -// +kubebuilder:validation:XValidation:message="filter.requestMirror must be specified for RequestMirror filter.type",rule="!(!has(self.requestMirror) && self.type == 'RequestMirror')" -// +kubebuilder:validation:XValidation:message="filter.extensionRef must be nil if the filter.type is not ExtensionRef",rule="!(has(self.extensionRef) && self.type != 'ExtensionRef')" -// +kubebuilder:validation:XValidation:message="filter.extensionRef must be specified for ExtensionRef filter.type",rule="!(!has(self.extensionRef) && self.type == 'ExtensionRef')" -type GRPCRouteFilter struct { - // Type identifies the type of filter to apply. As with other API fields, - // types are classified into three conformance levels: - // - // - Core: Filter types and their corresponding configuration defined by - // "Support: Core" in this package, e.g. "RequestHeaderModifier". All - // implementations supporting GRPCRoute MUST support core filters. - // - // - Extended: Filter types and their corresponding configuration defined by - // "Support: Extended" in this package, e.g. "RequestMirror". Implementers - // are encouraged to support extended filters. - // - // - Implementation-specific: Filters that are defined and supported by specific vendors. - // In the future, filters showing convergence in behavior across multiple - // implementations will be considered for inclusion in extended or core - // conformance levels. Filter-specific configuration for such filters - // is specified using the ExtensionRef field. `Type` MUST be set to - // "ExtensionRef" for custom filters. - // - // Implementers are encouraged to define custom implementation types to - // extend the core API with implementation-specific behavior. - // - // If a reference to a custom filter type cannot be resolved, the filter - // MUST NOT be skipped. Instead, requests that would have been processed by - // that filter MUST receive a HTTP error response. - // - // +unionDiscriminator - // +kubebuilder:validation:Enum=ResponseHeaderModifier;RequestHeaderModifier;RequestMirror;ExtensionRef - // - Type GRPCRouteFilterType `json:"type"` - - // RequestHeaderModifier defines a schema for a filter that modifies request - // headers. - // - // Support: Core - // - // +optional - RequestHeaderModifier *HTTPHeaderFilter `json:"requestHeaderModifier,omitempty"` - - // ResponseHeaderModifier defines a schema for a filter that modifies response - // headers. - // - // Support: Extended - // - // +optional - ResponseHeaderModifier *HTTPHeaderFilter `json:"responseHeaderModifier,omitempty"` - - // RequestMirror defines a schema for a filter that mirrors requests. - // Requests are sent to the specified destination, but responses from - // that destination are ignored. - // - // This filter can be used multiple times within the same rule. Note that - // not all implementations will be able to support mirroring to multiple - // backends. - // - // Support: Extended - // - // +optional - RequestMirror *HTTPRequestMirrorFilter `json:"requestMirror,omitempty"` - - // ExtensionRef is an optional, implementation-specific extension to the - // "filter" behavior. For example, resource "myroutefilter" in group - // "networking.example.net"). ExtensionRef MUST NOT be used for core and - // extended filters. - // - // Support: Implementation-specific - // - // This filter can be used multiple times within the same rule. - // +optional - ExtensionRef *LocalObjectReference `json:"extensionRef,omitempty"` -} - -// GRPCBackendRef defines how a GRPCRoute forwards a gRPC request. -// -// Note that when a namespace different than the local namespace is specified, a -// ReferenceGrant object is required in the referent namespace to allow that -// namespace's owner to accept the reference. See the ReferenceGrant -// documentation for details. -// -// -// -// When the BackendRef points to a Kubernetes Service, implementations SHOULD -// honor the appProtocol field if it is set for the target Service Port. -// -// Implementations supporting appProtocol SHOULD recognize the Kubernetes -// Standard Application Protocols defined in KEP-3726. -// -// If a Service appProtocol isn't specified, an implementation MAY infer the -// backend protocol through its own means. Implementations MAY infer the -// protocol from the Route type referring to the backend Service. -// -// If a Route is not able to send traffic to the backend using the specified -// protocol then the backend is considered invalid. Implementations MUST set the -// "ResolvedRefs" condition to "False" with the "UnsupportedProtocol" reason. -// -// -type GRPCBackendRef struct { - // BackendRef is a reference to a backend to forward matched requests to. - // - // A BackendRef can be invalid for the following reasons. In all cases, the - // implementation MUST ensure the `ResolvedRefs` Condition on the Route - // is set to `status: False`, with a Reason and Message that indicate - // what is the cause of the error. - // - // A BackendRef is invalid if: - // - // * It refers to an unknown or unsupported kind of resource. In this - // case, the Reason MUST be set to `InvalidKind` and Message of the - // Condition MUST explain which kind of resource is unknown or unsupported. - // - // * It refers to a resource that does not exist. In this case, the Reason MUST - // be set to `BackendNotFound` and the Message of the Condition MUST explain - // which resource does not exist. - // - // * It refers a resource in another namespace when the reference has not been - // explicitly allowed by a ReferenceGrant (or equivalent concept). In this - // case, the Reason MUST be set to `RefNotPermitted` and the Message of the - // Condition MUST explain which cross-namespace reference is not allowed. - // - // Support: Core for Kubernetes Service - // - // Support: Extended for Kubernetes ServiceImport - // - // Support: Implementation-specific for any other resource - // - // Support for weight: Core - // - // +optional - BackendRef `json:",inline"` - - // Filters defined at this level MUST be executed if and only if the - // request is being forwarded to the backend defined here. - // - // Support: Implementation-specific (For broader support of filters, use the - // Filters field in GRPCRouteRule.) - // - // +optional - // +kubebuilder:validation:MaxItems=16 - // +kubebuilder:validation:XValidation:message="RequestHeaderModifier filter cannot be repeated",rule="self.filter(f, f.type == 'RequestHeaderModifier').size() <= 1" - // +kubebuilder:validation:XValidation:message="ResponseHeaderModifier filter cannot be repeated",rule="self.filter(f, f.type == 'ResponseHeaderModifier').size() <= 1" - Filters []GRPCRouteFilter `json:"filters,omitempty"` -} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/httproute_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/httproute_types.go deleted file mode 100644 index caf5efac0..000000000 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/httproute_types.go +++ /dev/null @@ -1,243 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha2 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - v1 "sigs.k8s.io/gateway-api/apis/v1" -) - -// +genclient -// +kubebuilder:object:root=true -// +kubebuilder:resource:categories=gateway-api -// +kubebuilder:subresource:status -// +kubebuilder:skipversion -// +kubebuilder:deprecatedversion:warning="The v1alpha2 version of HTTPRoute has been deprecated and will be removed in a future release of the API. Please upgrade to v1." -// +kubebuilder:printcolumn:name="Hostnames",type=string,JSONPath=`.spec.hostnames` -// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` - -// HTTPRoute provides a way to route HTTP requests. This includes the capability -// to match requests by hostname, path, header, or query param. Filters can be -// used to specify additional processing steps. Backends specify where matching -// requests should be routed. -type HTTPRoute v1.HTTPRoute - -// +kubebuilder:object:root=true - -// HTTPRouteList contains a list of HTTPRoute. -type HTTPRouteList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []HTTPRoute `json:"items"` -} - -// HTTPRouteSpec defines the desired state of HTTPRoute -// +k8s:deepcopy-gen=false -type HTTPRouteSpec = v1.HTTPRouteSpec - -// HTTPRouteRule defines semantics for matching an HTTP request based on -// conditions (matches), processing it (filters), and forwarding the request to -// an API object (backendRefs). -// +k8s:deepcopy-gen=false -type HTTPRouteRule = v1.HTTPRouteRule - -// PathMatchType specifies the semantics of how HTTP paths should be compared. -// Valid PathMatchType values, along with their conformance level, are: -// -// * "Exact" - Core -// * "PathPrefix" - Core -// * "RegularExpression" - Implementation Specific -// -// PathPrefix and Exact paths must be syntactically valid: -// -// - Must begin with the `/` character -// - Must not contain consecutive `/` characters (e.g. `/foo///`, `//`). -// -// Note that values may be added to this enum, implementations -// must ensure that unknown values will not cause a crash. -// -// Unknown values here must result in the implementation setting the -// Accepted Condition for the Route to `status: False`, with a -// Reason of `UnsupportedValue`. -// -// +kubebuilder:validation:Enum=Exact;PathPrefix;RegularExpression -// +k8s:deepcopy-gen=false -type PathMatchType = v1.PathMatchType - -// HTTPPathMatch describes how to select a HTTP route by matching the HTTP request path. -// +k8s:deepcopy-gen=false -type HTTPPathMatch = v1.HTTPPathMatch - -// HeaderMatchType specifies the semantics of how HTTP header values should be -// compared. Valid HeaderMatchType values, along with their conformance levels, are: -// -// * "Exact" - Core -// * "RegularExpression" - Implementation Specific -// -// Note that values may be added to this enum, implementations -// must ensure that unknown values will not cause a crash. -// -// Unknown values here must result in the implementation setting the -// Accepted Condition for the Route to `status: False`, with a -// Reason of `UnsupportedValue`. -// -// +kubebuilder:validation:Enum=Exact;RegularExpression -// +k8s:deepcopy-gen=false -type HeaderMatchType = v1.HeaderMatchType - -// HTTPHeaderName is the name of an HTTP header. -// -// Valid values include: -// * "Authorization" -// * "Set-Cookie" -// -// Invalid values include: -// -// - ":method" - ":" is an invalid character. This means that HTTP/2 pseudo -// headers are not currently supported by this type. -// -// * "/invalid" - "/" is an invalid character -// +k8s:deepcopy-gen=false -type HTTPHeaderName = v1.HeaderName - -// HTTPHeaderMatch describes how to select a HTTP route by matching HTTP request -// headers. -// +k8s:deepcopy-gen=false -type HTTPHeaderMatch = v1.HTTPHeaderMatch - -// QueryParamMatchType specifies the semantics of how HTTP query parameter -// values should be compared. Valid QueryParamMatchType values, along with their -// conformance levels, are: -// -// * "Exact" - Core -// * "RegularExpression" - Implementation Specific -// -// Note that values may be added to this enum, implementations -// must ensure that unknown values will not cause a crash. -// -// Unknown values here must result in the implementation setting the -// Accepted Condition for the Route to `status: False`, with a -// Reason of `UnsupportedValue`. -// -// +kubebuilder:validation:Enum=Exact;RegularExpression -// +k8s:deepcopy-gen=false -type QueryParamMatchType = v1.QueryParamMatchType - -// HTTPQueryParamMatch describes how to select a HTTP route by matching HTTP -// query parameters. -// +k8s:deepcopy-gen=false -type HTTPQueryParamMatch = v1.HTTPQueryParamMatch - -// HTTPMethod describes how to select a HTTP route by matching the HTTP -// method as defined by -// [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-4) and -// [RFC 5789](https://datatracker.ietf.org/doc/html/rfc5789#section-2). -// The value is expected in upper case. -// -// Note that values may be added to this enum, implementations -// must ensure that unknown values will not cause a crash. -// -// Unknown values here must result in the implementation setting the -// Accepted Condition for the Route to `status: False`, with a -// Reason of `UnsupportedValue`. -// -// +kubebuilder:validation:Enum=GET;HEAD;POST;PUT;DELETE;CONNECT;OPTIONS;TRACE;PATCH -// +k8s:deepcopy-gen=false -type HTTPMethod = v1.HTTPMethod - -// HTTPRouteMatch defines the predicate used to match requests to a given -// action. Multiple match types are ANDed together, i.e. the match will -// evaluate to true only if all conditions are satisfied. -// -// For example, the match below will match a HTTP request only if its path -// starts with `/foo` AND it contains the `version: v1` header: -// -// ``` -// match: -// -// path: -// value: "/foo" -// headers: -// - name: "version" -// value "v1" -// -// ``` -// +k8s:deepcopy-gen=false -type HTTPRouteMatch = v1.HTTPRouteMatch - -// HTTPRouteFilter defines processing steps that must be completed during the -// request or response lifecycle. HTTPRouteFilters are meant as an extension -// point to express processing that may be done in Gateway implementations. Some -// examples include request or response modification, implementing -// authentication strategies, rate-limiting, and traffic shaping. API -// guarantee/conformance is defined based on the type of the filter. -// +k8s:deepcopy-gen=false -type HTTPRouteFilter = v1.HTTPRouteFilter - -// HTTPRouteFilterType identifies a type of HTTPRoute filter. -// +k8s:deepcopy-gen=false -type HTTPRouteFilterType = v1.HTTPRouteFilterType - -// HTTPRouteTimeouts defines timeouts that can be configured for an HTTPRoute. -// +k8s:deepcopy-gen=false -type HTTPRouteTimeouts = v1.HTTPRouteTimeouts - -// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230. -// +k8s:deepcopy-gen=false -type HTTPHeader = v1.HTTPHeader - -// HTTPHeaderFilter defines a filter that modifies the headers of an HTTP request -// or response. -// +k8s:deepcopy-gen=false -type HTTPHeaderFilter = v1.HTTPHeaderFilter - -// HTTPPathModifierType defines the type of path redirect or rewrite. -// +k8s:deepcopy-gen=false -type HTTPPathModifierType = v1.HTTPPathModifierType - -// HTTPPathModifier defines configuration for path modifiers. -// -// +k8s:deepcopy-gen=false -type HTTPPathModifier = v1.HTTPPathModifier - -// HTTPRequestRedirect defines a filter that redirects a request. This filter -// MUST NOT be used on the same Route rule as a HTTPURLRewrite filter. -// +k8s:deepcopy-gen=false -type HTTPRequestRedirectFilter = v1.HTTPRequestRedirectFilter - -// HTTPURLRewriteFilter defines a filter that modifies a request during -// forwarding. At most one of these filters may be used on a Route rule. This -// MUST NOT be used on the same Route rule as a HTTPRequestRedirect filter. -// -// Support: Extended -// -// -// +k8s:deepcopy-gen=false -type HTTPURLRewriteFilter = v1.HTTPURLRewriteFilter - -// HTTPRequestMirrorFilter defines configuration for the RequestMirror filter. -// +k8s:deepcopy-gen=false -type HTTPRequestMirrorFilter = v1.HTTPRequestMirrorFilter - -// HTTPBackendRef defines how a HTTPRoute should forward an HTTP request. -// +k8s:deepcopy-gen=false -type HTTPBackendRef = v1.HTTPBackendRef - -// HTTPRouteStatus defines the observed state of HTTPRoute. -// +k8s:deepcopy-gen=false -type HTTPRouteStatus = v1.HTTPRouteStatus diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/policy_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/policy_types.go index 092e743e6..bc2ef766a 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/policy_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/policy_types.go @@ -31,12 +31,29 @@ const ( PolicyLabelKey = "gateway.networking.k8s.io/policy" ) -// PolicyTargetReference identifies an API object to apply a direct or +// LocalPolicyTargetReference identifies an API object to apply a direct or // inherited policy to. This should be used as part of Policy resources // that can target Gateway API resources. For more information on how this // policy attachment model works, and a sample Policy resource, refer to // the policy attachment documentation for Gateway API. -type PolicyTargetReference struct { +type LocalPolicyTargetReference struct { + // Group is the group of the target resource. + Group Group `json:"group"` + + // Kind is kind of the target resource. + Kind Kind `json:"kind"` + + // Name is the name of the target resource. + Name ObjectName `json:"name"` +} + +// NamespacedPolicyTargetReference identifies an API object to apply a direct or +// inherited policy to, potentially in a different namespace. This should only +// be used as part of Policy resources that need to be able to target resources +// in different namespaces. For more information on how this policy attachment +// model works, and a sample Policy resource, refer to the policy attachment +// documentation for Gateway API. +type NamespacedPolicyTargetReference struct { // Group is the group of the target resource. Group Group `json:"group"` @@ -55,24 +72,25 @@ type PolicyTargetReference struct { Namespace *Namespace `json:"namespace,omitempty"` } -// PolicyTargetReferenceWithSectionName identifies an API object to apply a direct -// policy to. This should be used as part of Policy resources that can target -// single resources. For more information on how this policy attachment mode -// works, and a sample Policy resource, refer to the policy attachment documentation -// for Gateway API. +// LocalPolicyTargetReferenceWithSectionName identifies an API object to apply a +// direct policy to. This should be used as part of Policy resources that can +// target single resources. For more information on how this policy attachment +// mode works, and a sample Policy resource, refer to the policy attachment +// documentation for Gateway API. // // Note: This should only be used for direct policy attachment when references -// to SectionName are actually needed. In all other cases, PolicyTargetReference -// should be used. -type PolicyTargetReferenceWithSectionName struct { - PolicyTargetReference `json:",inline"` +// to SectionName are actually needed. In all other cases, +// LocalPolicyTargetReference should be used. +type LocalPolicyTargetReferenceWithSectionName struct { + LocalPolicyTargetReference `json:",inline"` // SectionName is the name of a section within the target resource. When // unspecified, this targetRef targets the entire resource. In the following // resources, SectionName is interpreted as the following: // - // * Gateway: Listener Name - // * Service: Port Name + // * Gateway: Listener name + // * HTTPRoute: HTTPRouteRule name + // * Service: Port name // // If a SectionName is specified, but does not exist on the targeted object, // the Policy must fail to attach, and the policy implementation should record diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/shared_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/shared_types.go index 4ff14aace..af04601e4 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/shared_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/shared_types.go @@ -253,11 +253,22 @@ type Namespace = v1.Namespace // SectionName is the name of a section in a Kubernetes resource. // +// In the following resources, SectionName is interpreted as the following: +// +// * Gateway: Listener name +// * HTTPRoute: HTTPRouteRule name +// * Service: Port name +// +// Section names can have a variety of forms, including RFC 1123 subdomains, +// RFC 1123 labels, or RFC 1035 labels. +// // This validation is based off of the corresponding Kubernetes validation: // https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L208 // // Valid values include: // +// * "example" +// * "foo-example" // * "example.com" // * "foo.example.com" // @@ -373,3 +384,8 @@ const ( // Support: Implementation-specific NamedAddressType AddressType = "NamedAddress" ) + +// SessionPersistence defines the desired state of +// SessionPersistence. +// +k8s:deepcopy-gen=false +type SessionPersistence = v1.SessionPersistence diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/zz_generated.deepcopy.go index c3486ee05..805d34c60 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/zz_generated.deepcopy.go @@ -27,7 +27,7 @@ import ( ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackendTLSPolicy) DeepCopyInto(out *BackendTLSPolicy) { +func (in *BackendLBPolicy) DeepCopyInto(out *BackendLBPolicy) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -35,18 +35,18 @@ func (in *BackendTLSPolicy) DeepCopyInto(out *BackendTLSPolicy) { in.Status.DeepCopyInto(&out.Status) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTLSPolicy. -func (in *BackendTLSPolicy) DeepCopy() *BackendTLSPolicy { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendLBPolicy. +func (in *BackendLBPolicy) DeepCopy() *BackendLBPolicy { if in == nil { return nil } - out := new(BackendTLSPolicy) + out := new(BackendLBPolicy) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BackendTLSPolicy) DeepCopyObject() runtime.Object { +func (in *BackendLBPolicy) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -54,56 +54,31 @@ func (in *BackendTLSPolicy) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackendTLSPolicyConfig) DeepCopyInto(out *BackendTLSPolicyConfig) { - *out = *in - if in.CACertRefs != nil { - in, out := &in.CACertRefs, &out.CACertRefs - *out = make([]v1.LocalObjectReference, len(*in)) - copy(*out, *in) - } - if in.WellKnownCACerts != nil { - in, out := &in.WellKnownCACerts, &out.WellKnownCACerts - *out = new(WellKnownCACertType) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTLSPolicyConfig. -func (in *BackendTLSPolicyConfig) DeepCopy() *BackendTLSPolicyConfig { - if in == nil { - return nil - } - out := new(BackendTLSPolicyConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackendTLSPolicyList) DeepCopyInto(out *BackendTLSPolicyList) { +func (in *BackendLBPolicyList) DeepCopyInto(out *BackendLBPolicyList) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]BackendTLSPolicy, len(*in)) + *out = make([]BackendLBPolicy, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTLSPolicyList. -func (in *BackendTLSPolicyList) DeepCopy() *BackendTLSPolicyList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendLBPolicyList. +func (in *BackendLBPolicyList) DeepCopy() *BackendLBPolicyList { if in == nil { return nil } - out := new(BackendTLSPolicyList) + out := new(BackendLBPolicyList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BackendTLSPolicyList) DeepCopyObject() runtime.Object { +func (in *BackendLBPolicyList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -111,91 +86,26 @@ func (in *BackendTLSPolicyList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackendTLSPolicySpec) DeepCopyInto(out *BackendTLSPolicySpec) { +func (in *BackendLBPolicySpec) DeepCopyInto(out *BackendLBPolicySpec) { *out = *in - in.TargetRef.DeepCopyInto(&out.TargetRef) - in.TLS.DeepCopyInto(&out.TLS) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTLSPolicySpec. -func (in *BackendTLSPolicySpec) DeepCopy() *BackendTLSPolicySpec { - if in == nil { - return nil - } - out := new(BackendTLSPolicySpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GRPCBackendRef) DeepCopyInto(out *GRPCBackendRef) { - *out = *in - in.BackendRef.DeepCopyInto(&out.BackendRef) - if in.Filters != nil { - in, out := &in.Filters, &out.Filters - *out = make([]GRPCRouteFilter, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCBackendRef. -func (in *GRPCBackendRef) DeepCopy() *GRPCBackendRef { - if in == nil { - return nil - } - out := new(GRPCBackendRef) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GRPCHeaderMatch) DeepCopyInto(out *GRPCHeaderMatch) { - *out = *in - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(v1.HeaderMatchType) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCHeaderMatch. -func (in *GRPCHeaderMatch) DeepCopy() *GRPCHeaderMatch { - if in == nil { - return nil - } - out := new(GRPCHeaderMatch) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GRPCMethodMatch) DeepCopyInto(out *GRPCMethodMatch) { - *out = *in - if in.Type != nil { - in, out := &in.Type, &out.Type - *out = new(GRPCMethodMatchType) - **out = **in - } - if in.Service != nil { - in, out := &in.Service, &out.Service - *out = new(string) - **out = **in + if in.TargetRefs != nil { + in, out := &in.TargetRefs, &out.TargetRefs + *out = make([]LocalPolicyTargetReference, len(*in)) + copy(*out, *in) } - if in.Method != nil { - in, out := &in.Method, &out.Method - *out = new(string) - **out = **in + if in.SessionPersistence != nil { + in, out := &in.SessionPersistence, &out.SessionPersistence + *out = new(v1.SessionPersistence) + (*in).DeepCopyInto(*out) } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCMethodMatch. -func (in *GRPCMethodMatch) DeepCopy() *GRPCMethodMatch { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendLBPolicySpec. +func (in *BackendLBPolicySpec) DeepCopy() *BackendLBPolicySpec { if in == nil { return nil } - out := new(GRPCMethodMatch) + out := new(BackendLBPolicySpec) in.DeepCopyInto(out) return out } @@ -227,41 +137,6 @@ func (in *GRPCRoute) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GRPCRouteFilter) DeepCopyInto(out *GRPCRouteFilter) { - *out = *in - if in.RequestHeaderModifier != nil { - in, out := &in.RequestHeaderModifier, &out.RequestHeaderModifier - *out = new(v1.HTTPHeaderFilter) - (*in).DeepCopyInto(*out) - } - if in.ResponseHeaderModifier != nil { - in, out := &in.ResponseHeaderModifier, &out.ResponseHeaderModifier - *out = new(v1.HTTPHeaderFilter) - (*in).DeepCopyInto(*out) - } - if in.RequestMirror != nil { - in, out := &in.RequestMirror, &out.RequestMirror - *out = new(v1.HTTPRequestMirrorFilter) - (*in).DeepCopyInto(*out) - } - if in.ExtensionRef != nil { - in, out := &in.ExtensionRef, &out.ExtensionRef - *out = new(v1.LocalObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCRouteFilter. -func (in *GRPCRouteFilter) DeepCopy() *GRPCRouteFilter { - if in == nil { - return nil - } - out := new(GRPCRouteFilter) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GRPCRouteList) DeepCopyInto(out *GRPCRouteList) { *out = *in @@ -295,289 +170,61 @@ func (in *GRPCRouteList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GRPCRouteMatch) DeepCopyInto(out *GRPCRouteMatch) { - *out = *in - if in.Method != nil { - in, out := &in.Method, &out.Method - *out = new(GRPCMethodMatch) - (*in).DeepCopyInto(*out) - } - if in.Headers != nil { - in, out := &in.Headers, &out.Headers - *out = make([]GRPCHeaderMatch, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCRouteMatch. -func (in *GRPCRouteMatch) DeepCopy() *GRPCRouteMatch { - if in == nil { - return nil - } - out := new(GRPCRouteMatch) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GRPCRouteRule) DeepCopyInto(out *GRPCRouteRule) { - *out = *in - if in.Matches != nil { - in, out := &in.Matches, &out.Matches - *out = make([]GRPCRouteMatch, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Filters != nil { - in, out := &in.Filters, &out.Filters - *out = make([]GRPCRouteFilter, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.BackendRefs != nil { - in, out := &in.BackendRefs, &out.BackendRefs - *out = make([]GRPCBackendRef, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCRouteRule. -func (in *GRPCRouteRule) DeepCopy() *GRPCRouteRule { - if in == nil { - return nil - } - out := new(GRPCRouteRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GRPCRouteSpec) DeepCopyInto(out *GRPCRouteSpec) { - *out = *in - in.CommonRouteSpec.DeepCopyInto(&out.CommonRouteSpec) - if in.Hostnames != nil { - in, out := &in.Hostnames, &out.Hostnames - *out = make([]v1.Hostname, len(*in)) - copy(*out, *in) - } - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]GRPCRouteRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCRouteSpec. -func (in *GRPCRouteSpec) DeepCopy() *GRPCRouteSpec { - if in == nil { - return nil - } - out := new(GRPCRouteSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GRPCRouteStatus) DeepCopyInto(out *GRPCRouteStatus) { +func (in *LocalPolicyTargetReference) DeepCopyInto(out *LocalPolicyTargetReference) { *out = *in - in.RouteStatus.DeepCopyInto(&out.RouteStatus) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCRouteStatus. -func (in *GRPCRouteStatus) DeepCopy() *GRPCRouteStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalPolicyTargetReference. +func (in *LocalPolicyTargetReference) DeepCopy() *LocalPolicyTargetReference { if in == nil { return nil } - out := new(GRPCRouteStatus) + out := new(LocalPolicyTargetReference) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Gateway) DeepCopyInto(out *Gateway) { +func (in *LocalPolicyTargetReferenceWithSectionName) DeepCopyInto(out *LocalPolicyTargetReferenceWithSectionName) { *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Gateway. -func (in *Gateway) DeepCopy() *Gateway { - if in == nil { - return nil - } - out := new(Gateway) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Gateway) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GatewayClass) DeepCopyInto(out *GatewayClass) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayClass. -func (in *GatewayClass) DeepCopy() *GatewayClass { - if in == nil { - return nil - } - out := new(GatewayClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GatewayClass) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GatewayClassList) DeepCopyInto(out *GatewayClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]GatewayClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayClassList. -func (in *GatewayClassList) DeepCopy() *GatewayClassList { - if in == nil { - return nil - } - out := new(GatewayClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GatewayClassList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GatewayList) DeepCopyInto(out *GatewayList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Gateway, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayList. -func (in *GatewayList) DeepCopy() *GatewayList { - if in == nil { - return nil - } - out := new(GatewayList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GatewayList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c + out.LocalPolicyTargetReference = in.LocalPolicyTargetReference + if in.SectionName != nil { + in, out := &in.SectionName, &out.SectionName + *out = new(v1.SectionName) + **out = **in } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HTTPRoute) DeepCopyInto(out *HTTPRoute) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRoute. -func (in *HTTPRoute) DeepCopy() *HTTPRoute { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalPolicyTargetReferenceWithSectionName. +func (in *LocalPolicyTargetReferenceWithSectionName) DeepCopy() *LocalPolicyTargetReferenceWithSectionName { if in == nil { return nil } - out := new(HTTPRoute) + out := new(LocalPolicyTargetReferenceWithSectionName) in.DeepCopyInto(out) return out } -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *HTTPRoute) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HTTPRouteList) DeepCopyInto(out *HTTPRouteList) { +func (in *NamespacedPolicyTargetReference) DeepCopyInto(out *NamespacedPolicyTargetReference) { *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]HTTPRoute, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + if in.Namespace != nil { + in, out := &in.Namespace, &out.Namespace + *out = new(v1.Namespace) + **out = **in } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRouteList. -func (in *HTTPRouteList) DeepCopy() *HTTPRouteList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedPolicyTargetReference. +func (in *NamespacedPolicyTargetReference) DeepCopy() *NamespacedPolicyTargetReference { if in == nil { return nil } - out := new(HTTPRouteList) + out := new(NamespacedPolicyTargetReference) in.DeepCopyInto(out) return out } -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *HTTPRouteList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PolicyAncestorStatus) DeepCopyInto(out *PolicyAncestorStatus) { *out = *in @@ -623,47 +270,6 @@ func (in *PolicyStatus) DeepCopy() *PolicyStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PolicyTargetReference) DeepCopyInto(out *PolicyTargetReference) { - *out = *in - if in.Namespace != nil { - in, out := &in.Namespace, &out.Namespace - *out = new(v1.Namespace) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyTargetReference. -func (in *PolicyTargetReference) DeepCopy() *PolicyTargetReference { - if in == nil { - return nil - } - out := new(PolicyTargetReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PolicyTargetReferenceWithSectionName) DeepCopyInto(out *PolicyTargetReferenceWithSectionName) { - *out = *in - in.PolicyTargetReference.DeepCopyInto(&out.PolicyTargetReference) - if in.SectionName != nil { - in, out := &in.SectionName, &out.SectionName - *out = new(v1.SectionName) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyTargetReferenceWithSectionName. -func (in *PolicyTargetReferenceWithSectionName) DeepCopy() *PolicyTargetReferenceWithSectionName { - if in == nil { - return nil - } - out := new(PolicyTargetReferenceWithSectionName) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ReferenceGrant) DeepCopyInto(out *ReferenceGrant) { *out = *in diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/zz_generated.register.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/zz_generated.register.go index 618308444..2fff9ce2c 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/zz_generated.register.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/zz_generated.register.go @@ -58,16 +58,10 @@ func init() { // Adds the list of known types to Scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, - &BackendTLSPolicy{}, - &BackendTLSPolicyList{}, + &BackendLBPolicy{}, + &BackendLBPolicyList{}, &GRPCRoute{}, &GRPCRouteList{}, - &Gateway{}, - &GatewayClass{}, - &GatewayClassList{}, - &GatewayList{}, - &HTTPRoute{}, - &HTTPRouteList{}, &ReferenceGrant{}, &ReferenceGrantList{}, &TCPRoute{}, diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/backendtlspolicy_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/backendtlspolicy_types.go similarity index 57% rename from vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/backendtlspolicy_types.go rename to vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/backendtlspolicy_types.go index ee8c2771b..3c20b4442 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha2/backendtlspolicy_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/backendtlspolicy_types.go @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/gateway-api/apis/v1beta1" + v1 "sigs.k8s.io/gateway-api/apis/v1" + "sigs.k8s.io/gateway-api/apis/v1alpha2" ) // +genclient @@ -42,11 +43,11 @@ type BackendTLSPolicy struct { Spec BackendTLSPolicySpec `json:"spec"` // Status defines the current state of BackendTLSPolicy. - Status PolicyStatus `json:"status,omitempty"` + Status v1alpha2.PolicyStatus `json:"status,omitempty"` } -// +kubebuilder:object:root=true // BackendTLSPolicyList contains a list of BackendTLSPolicies +// +kubebuilder:object:root=true type BackendTLSPolicyList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` @@ -57,7 +58,7 @@ type BackendTLSPolicyList struct { // // Support: Extended type BackendTLSPolicySpec struct { - // TargetRef identifies an API object to apply the policy to. + // TargetRefs identifies an API object to apply the policy to. // Only Services have Extended support. Implementations MAY support // additional objects, with Implementation Specific support. // Note that this config applies to the entire referenced resource @@ -68,29 +69,31 @@ type BackendTLSPolicySpec struct { // // Support: Implementation-specific for any other resource // - TargetRef PolicyTargetReferenceWithSectionName `json:"targetRef"` + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=16 + TargetRefs []v1alpha2.LocalPolicyTargetReferenceWithSectionName `json:"targetRefs"` - // TLS contains backend TLS policy configuration. - TLS BackendTLSPolicyConfig `json:"tls"` + // Validation contains backend TLS validation configuration. + Validation BackendTLSPolicyValidation `json:"validation"` } -// BackendTLSPolicyConfig contains backend TLS policy configuration. -// +kubebuilder:validation:XValidation:message="must not contain both CACertRefs and WellKnownCACerts",rule="!(has(self.caCertRefs) && size(self.caCertRefs) > 0 && has(self.wellKnownCACerts) && self.wellKnownCACerts != \"\")" -// +kubebuilder:validation:XValidation:message="must specify either CACertRefs or WellKnownCACerts",rule="(has(self.caCertRefs) && size(self.caCertRefs) > 0 || has(self.wellKnownCACerts) && self.wellKnownCACerts != \"\")" -type BackendTLSPolicyConfig struct { - // CACertRefs contains one or more references to Kubernetes objects that +// BackendTLSPolicyValidation contains backend TLS validation configuration. +// +kubebuilder:validation:XValidation:message="must not contain both CACertificateRefs and WellKnownCACertificates",rule="!(has(self.caCertificateRefs) && size(self.caCertificateRefs) > 0 && has(self.wellKnownCACertificates) && self.wellKnownCACertificates != \"\")" +// +kubebuilder:validation:XValidation:message="must specify either CACertificateRefs or WellKnownCACertificates",rule="(has(self.caCertificateRefs) && size(self.caCertificateRefs) > 0 || has(self.wellKnownCACertificates) && self.wellKnownCACertificates != \"\")" +type BackendTLSPolicyValidation struct { + // CACertificateRefs contains one or more references to Kubernetes objects that // contain a PEM-encoded TLS CA certificate bundle, which is used to // validate a TLS handshake between the Gateway and backend Pod. // - // If CACertRefs is empty or unspecified, then WellKnownCACerts must be - // specified. Only one of CACertRefs or WellKnownCACerts may be specified, - // not both. If CACertRefs is empty or unspecified, the configuration for - // WellKnownCACerts MUST be honored instead. + // If CACertificateRefs is empty or unspecified, then WellKnownCACertificates must be + // specified. Only one of CACertificateRefs or WellKnownCACertificates may be specified, + // not both. If CACertifcateRefs is empty or unspecified, the configuration for + // WellKnownCACertificates MUST be honored instead if supported by the implementation. // // References to a resource in a different namespace are invalid for the // moment, although we will revisit this in the future. // - // A single CACertRef to a Kubernetes ConfigMap kind has "Core" support. + // A single CACertificateRef to a Kubernetes ConfigMap kind has "Core" support. // Implementations MAY choose to support attaching multiple certificates to // a backend, but this behavior is implementation-specific. // @@ -102,19 +105,22 @@ type BackendTLSPolicyConfig struct { // // +kubebuilder:validation:MaxItems=8 // +optional - CACertRefs []v1beta1.LocalObjectReference `json:"caCertRefs,omitempty"` + CACertificateRefs []v1.LocalObjectReference `json:"caCertificateRefs,omitempty"` - // WellKnownCACerts specifies whether system CA certificates may be used in + // WellKnownCACertificates specifies whether system CA certificates may be used in // the TLS handshake between the gateway and backend pod. // - // If WellKnownCACerts is unspecified or empty (""), then CACertRefs must be - // specified with at least one entry for a valid configuration. Only one of - // CACertRefs or WellKnownCACerts may be specified, not both. + // If WellKnownCACertificates is unspecified or empty (""), then CACertificateRefs + // must be specified with at least one entry for a valid configuration. Only one of + // CACertificateRefs or WellKnownCACertificates may be specified, not both. If an + // implementation does not support the WellKnownCACertificates field or the value + // supplied is not supported, the Status Conditions on the Policy MUST be + // updated to include an Accepted: False Condition with Reason: Invalid. // - // Support: Core for "System" + // Support: Implementation-specific // // +optional - WellKnownCACerts *WellKnownCACertType `json:"wellKnownCACerts,omitempty"` + WellKnownCACertificates *WellKnownCACertificatesType `json:"wellKnownCACertificates,omitempty"` // Hostname is used for two purposes in the connection between Gateways and // backends: @@ -124,15 +130,15 @@ type BackendTLSPolicyConfig struct { // served by the matching backend. // // Support: Core - Hostname v1beta1.PreciseHostname `json:"hostname"` + Hostname v1.PreciseHostname `json:"hostname"` } -// WellKnownCACertType is the type of CA certificate that will be used when +// WellKnownCACertificatesType is the type of CA certificate that will be used when // the TLS.caCertRefs is unspecified. // +kubebuilder:validation:Enum=System -type WellKnownCACertType string +type WellKnownCACertificatesType string const ( - // Indicates that well known system CA certificates should be used. - WellKnownCACertSystem WellKnownCACertType = "System" + // WellKnownCACertificatesSystem indicates that well known system CA certificates should be used. + WellKnownCACertificatesSystem WellKnownCACertificatesType = "System" ) diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/doc.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/doc.go new file mode 100644 index 000000000..ceca92c69 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/doc.go @@ -0,0 +1,23 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1alpha3 contains API Schema definitions for the +// gateway.networking.k8s.io API group. +// +// +k8s:openapi-gen=true +// +kubebuilder:object:generate=true +// +groupName=gateway.networking.k8s.io +package v1alpha3 diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/zz_generated.deepcopy.go new file mode 100644 index 000000000..416f6bebe --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/zz_generated.deepcopy.go @@ -0,0 +1,134 @@ +//go:build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/gateway-api/apis/v1" + "sigs.k8s.io/gateway-api/apis/v1alpha2" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackendTLSPolicy) DeepCopyInto(out *BackendTLSPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTLSPolicy. +func (in *BackendTLSPolicy) DeepCopy() *BackendTLSPolicy { + if in == nil { + return nil + } + out := new(BackendTLSPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BackendTLSPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackendTLSPolicyList) DeepCopyInto(out *BackendTLSPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]BackendTLSPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTLSPolicyList. +func (in *BackendTLSPolicyList) DeepCopy() *BackendTLSPolicyList { + if in == nil { + return nil + } + out := new(BackendTLSPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BackendTLSPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackendTLSPolicySpec) DeepCopyInto(out *BackendTLSPolicySpec) { + *out = *in + if in.TargetRefs != nil { + in, out := &in.TargetRefs, &out.TargetRefs + *out = make([]v1alpha2.LocalPolicyTargetReferenceWithSectionName, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.Validation.DeepCopyInto(&out.Validation) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTLSPolicySpec. +func (in *BackendTLSPolicySpec) DeepCopy() *BackendTLSPolicySpec { + if in == nil { + return nil + } + out := new(BackendTLSPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackendTLSPolicyValidation) DeepCopyInto(out *BackendTLSPolicyValidation) { + *out = *in + if in.CACertificateRefs != nil { + in, out := &in.CACertificateRefs, &out.CACertificateRefs + *out = make([]v1.LocalObjectReference, len(*in)) + copy(*out, *in) + } + if in.WellKnownCACertificates != nil { + in, out := &in.WellKnownCACertificates, &out.WellKnownCACertificates + *out = new(WellKnownCACertificatesType) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTLSPolicyValidation. +func (in *BackendTLSPolicyValidation) DeepCopy() *BackendTLSPolicyValidation { + if in == nil { + return nil + } + out := new(BackendTLSPolicyValidation) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/zz_generated.register.go b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/zz_generated.register.go new file mode 100644 index 000000000..a7f649c7c --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1alpha3/zz_generated.register.go @@ -0,0 +1,67 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by register-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName specifies the group name used to register the objects. +const GroupName = "gateway.networking.k8s.io" + +// GroupVersion specifies the group and the version used to register the objects. +var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha3"} + +// SchemeGroupVersion is group version used to register these objects +// Deprecated: use GroupVersion instead. +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha3"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + // Depreciated: use Install instead + AddToScheme = localSchemeBuilder.AddToScheme + Install = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Adds the list of known types to Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &BackendTLSPolicy{}, + &BackendTLSPolicyList{}, + ) + // AddToGroupVersion allows the serialization of client types like ListOptions. + v1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/doc.go b/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/doc.go index 328100aee..c498bba79 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/doc.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/doc.go @@ -17,6 +17,7 @@ limitations under the License. // Package v1beta1 contains API Schema definitions for the // gateway.networking.k8s.io API group. // +// +k8s:openapi-gen=true // +kubebuilder:object:generate=true // +groupName=gateway.networking.k8s.io package v1beta1 diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/gateway_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/gateway_types.go index 817016669..2834915ca 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/gateway_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/gateway_types.go @@ -25,7 +25,6 @@ import ( // +genclient // +kubebuilder:object:root=true // +kubebuilder:resource:categories=gateway-api,shortName=gtw -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Class",type=string,JSONPath=`.spec.gatewayClassName` // +kubebuilder:printcolumn:name="Address",type=string,JSONPath=`.status.addresses[*].value` @@ -48,8 +47,8 @@ type GatewayList struct { // GatewaySpec defines the desired state of Gateway. // // Not all possible combinations of options specified in the Spec are -// valid. Some invalid configurations can be caught synchronously via a -// webhook, but there are many cases that will require asynchronous +// valid. Some invalid configurations can be caught synchronously via CRD +// validation, but there are many cases that will require asynchronous // signaling via the GatewayStatus block. // +k8s:deepcopy-gen=false type GatewaySpec = v1.GatewaySpec diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/gatewayclass_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/gatewayclass_types.go index f1b7ed8ae..0a704a781 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/gatewayclass_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/gatewayclass_types.go @@ -26,7 +26,6 @@ import ( // +genclient:nonNamespaced // +kubebuilder:object:root=true // +kubebuilder:resource:categories=gateway-api,scope=Cluster,shortName=gc -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Controller",type=string,JSONPath=`.spec.controllerName` // +kubebuilder:printcolumn:name="Accepted",type=string,JSONPath=`.status.conditions[?(@.type=="Accepted")].status` diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/httproute_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/httproute_types.go index 1d869e09b..25ab2560d 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/httproute_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/httproute_types.go @@ -25,7 +25,6 @@ import ( // +genclient // +kubebuilder:object:root=true // +kubebuilder:resource:categories=gateway-api -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Hostnames",type=string,JSONPath=`.spec.hostnames` // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` diff --git a/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/shared_types.go b/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/shared_types.go index 7b60f3dd7..2dfbb9264 100644 --- a/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/shared_types.go +++ b/vendor/sigs.k8s.io/gateway-api/apis/v1beta1/shared_types.go @@ -223,7 +223,7 @@ type Group = v1.Group type Kind = v1.Kind // ObjectName refers to the name of a Kubernetes object. -// Object names can have a variety of forms, including RFC1123 subdomains, +// Object names can have a variety of forms, including RFC 1123 subdomains, // RFC 1123 labels, or RFC 1035 labels. // // +kubebuilder:validation:MinLength=1 @@ -253,11 +253,22 @@ type Namespace = v1.Namespace // SectionName is the name of a section in a Kubernetes resource. // +// In the following resources, SectionName is interpreted as the following: +// +// * Gateway: Listener name +// * HTTPRoute: HTTPRouteRule name +// * Service: Port name +// +// Section names can have a variety of forms, including RFC 1123 subdomains, +// RFC 1123 labels, or RFC 1035 labels. +// // This validation is based off of the corresponding Kubernetes validation: // https://github.com/kubernetes/apimachinery/blob/02cfb53916346d085a6c6c7c66f882e3c6b0eca6/pkg/util/validation/validation.go#L208 // // Valid values include: // +// * "example" +// * "foo-example" // * "example.com" // * "foo.example.com" // diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/clientset.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/clientset.go index 743be8d8f..116d5cca8 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/clientset.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/clientset.go @@ -27,12 +27,14 @@ import ( flowcontrol "k8s.io/client-go/util/flowcontrol" gatewayv1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1" gatewayv1alpha2 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2" + gatewayv1alpha3 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3" gatewayv1beta1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1" ) type Interface interface { Discovery() discovery.DiscoveryInterface GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface + GatewayV1alpha3() gatewayv1alpha3.GatewayV1alpha3Interface GatewayV1beta1() gatewayv1beta1.GatewayV1beta1Interface GatewayV1() gatewayv1.GatewayV1Interface } @@ -41,6 +43,7 @@ type Interface interface { type Clientset struct { *discovery.DiscoveryClient gatewayV1alpha2 *gatewayv1alpha2.GatewayV1alpha2Client + gatewayV1alpha3 *gatewayv1alpha3.GatewayV1alpha3Client gatewayV1beta1 *gatewayv1beta1.GatewayV1beta1Client gatewayV1 *gatewayv1.GatewayV1Client } @@ -50,6 +53,11 @@ func (c *Clientset) GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface { return c.gatewayV1alpha2 } +// GatewayV1alpha3 retrieves the GatewayV1alpha3Client +func (c *Clientset) GatewayV1alpha3() gatewayv1alpha3.GatewayV1alpha3Interface { + return c.gatewayV1alpha3 +} + // GatewayV1beta1 retrieves the GatewayV1beta1Client func (c *Clientset) GatewayV1beta1() gatewayv1beta1.GatewayV1beta1Interface { return c.gatewayV1beta1 @@ -108,6 +116,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.gatewayV1alpha3, err = gatewayv1alpha3.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.gatewayV1beta1, err = gatewayv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -138,6 +150,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { func New(c rest.Interface) *Clientset { var cs Clientset cs.gatewayV1alpha2 = gatewayv1alpha2.New(c) + cs.gatewayV1alpha3 = gatewayv1alpha3.New(c) cs.gatewayV1beta1 = gatewayv1beta1.New(c) cs.gatewayV1 = gatewayv1.New(c) diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/fake/clientset_generated.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/fake/clientset_generated.go index a3045a710..c58837744 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -29,6 +29,8 @@ import ( fakegatewayv1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake" gatewayv1alpha2 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2" fakegatewayv1alpha2 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake" + gatewayv1alpha3 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3" + fakegatewayv1alpha3 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake" gatewayv1beta1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1" fakegatewayv1beta1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake" ) @@ -88,6 +90,11 @@ func (c *Clientset) GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface { return &fakegatewayv1alpha2.FakeGatewayV1alpha2{Fake: &c.Fake} } +// GatewayV1alpha3 retrieves the GatewayV1alpha3Client +func (c *Clientset) GatewayV1alpha3() gatewayv1alpha3.GatewayV1alpha3Interface { + return &fakegatewayv1alpha3.FakeGatewayV1alpha3{Fake: &c.Fake} +} + // GatewayV1beta1 retrieves the GatewayV1beta1Client func (c *Clientset) GatewayV1beta1() gatewayv1beta1.GatewayV1beta1Interface { return &fakegatewayv1beta1.FakeGatewayV1beta1{Fake: &c.Fake} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/fake/register.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/fake/register.go index e3296a9cb..502a6efc6 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/fake/register.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/fake/register.go @@ -26,6 +26,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" gatewayv1 "sigs.k8s.io/gateway-api/apis/v1" gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + gatewayv1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" ) @@ -34,6 +35,7 @@ var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ gatewayv1alpha2.AddToScheme, + gatewayv1alpha3.AddToScheme, gatewayv1beta1.AddToScheme, gatewayv1.AddToScheme, } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme/register.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme/register.go index 4d31a9ec7..c6eca7a83 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme/register.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme/register.go @@ -26,6 +26,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" gatewayv1 "sigs.k8s.io/gateway-api/apis/v1" gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + gatewayv1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" ) @@ -34,6 +35,7 @@ var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ gatewayv1alpha2.AddToScheme, + gatewayv1alpha3.AddToScheme, gatewayv1beta1.AddToScheme, gatewayv1.AddToScheme, } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/apis_client.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/apis_client.go index acc529114..99dfe9e00 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/apis_client.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/apis_client.go @@ -28,6 +28,7 @@ import ( type GatewayV1Interface interface { RESTClient() rest.Interface + GRPCRoutesGetter GatewaysGetter GatewayClassesGetter HTTPRoutesGetter @@ -38,6 +39,10 @@ type GatewayV1Client struct { restClient rest.Interface } +func (c *GatewayV1Client) GRPCRoutes(namespace string) GRPCRouteInterface { + return newGRPCRoutes(c, namespace) +} + func (c *GatewayV1Client) Gateways(namespace string) GatewayInterface { return newGateways(c, namespace) } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_apis_client.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_apis_client.go index 290fcce3e..1563d4cfd 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_apis_client.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_apis_client.go @@ -28,6 +28,10 @@ type FakeGatewayV1 struct { *testing.Fake } +func (c *FakeGatewayV1) GRPCRoutes(namespace string) v1.GRPCRouteInterface { + return &FakeGRPCRoutes{c, namespace} +} + func (c *FakeGatewayV1) Gateways(namespace string) v1.GatewayInterface { return &FakeGateways{c, namespace} } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gateway.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gateway.go index 5ab4e7e18..589461d4c 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gateway.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gateway.go @@ -20,12 +20,15 @@ package fake import ( "context" + json "encoding/json" + "fmt" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" ) @@ -139,3 +142,48 @@ func (c *FakeGateways) Patch(ctx context.Context, name string, pt types.PatchTyp } return obj.(*v1.Gateway), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied gateway. +func (c *FakeGateways) Apply(ctx context.Context, gateway *apisv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) { + if gateway == nil { + return nil, fmt.Errorf("gateway provided to Apply must not be nil") + } + data, err := json.Marshal(gateway) + if err != nil { + return nil, err + } + name := gateway.Name + if name == nil { + return nil, fmt.Errorf("gateway.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, *name, types.ApplyPatchType, data), &v1.Gateway{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Gateway), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeGateways) ApplyStatus(ctx context.Context, gateway *apisv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) { + if gateway == nil { + return nil, fmt.Errorf("gateway provided to Apply must not be nil") + } + data, err := json.Marshal(gateway) + if err != nil { + return nil, err + } + name := gateway.Name + if name == nil { + return nil, fmt.Errorf("gateway.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.Gateway{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Gateway), err +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gatewayclass.go index 0d85bf47a..69d777711 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gatewayclass.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gatewayclass.go @@ -20,12 +20,15 @@ package fake import ( "context" + json "encoding/json" + "fmt" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" ) @@ -130,3 +133,46 @@ func (c *FakeGatewayClasses) Patch(ctx context.Context, name string, pt types.Pa } return obj.(*v1.GatewayClass), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied gatewayClass. +func (c *FakeGatewayClasses) Apply(ctx context.Context, gatewayClass *apisv1.GatewayClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GatewayClass, err error) { + if gatewayClass == nil { + return nil, fmt.Errorf("gatewayClass provided to Apply must not be nil") + } + data, err := json.Marshal(gatewayClass) + if err != nil { + return nil, err + } + name := gatewayClass.Name + if name == nil { + return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gatewayclassesResource, *name, types.ApplyPatchType, data), &v1.GatewayClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1.GatewayClass), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeGatewayClasses) ApplyStatus(ctx context.Context, gatewayClass *apisv1.GatewayClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GatewayClass, err error) { + if gatewayClass == nil { + return nil, fmt.Errorf("gatewayClass provided to Apply must not be nil") + } + data, err := json.Marshal(gatewayClass) + if err != nil { + return nil, err + } + name := gatewayClass.Name + if name == nil { + return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gatewayclassesResource, *name, types.ApplyPatchType, data, "status"), &v1.GatewayClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1.GatewayClass), err +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_grpcroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_grpcroute.go new file mode 100644 index 000000000..9e6bf9f87 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_grpcroute.go @@ -0,0 +1,189 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// FakeGRPCRoutes implements GRPCRouteInterface +type FakeGRPCRoutes struct { + Fake *FakeGatewayV1 + ns string +} + +var grpcroutesResource = v1.SchemeGroupVersion.WithResource("grpcroutes") + +var grpcroutesKind = v1.SchemeGroupVersion.WithKind("GRPCRoute") + +// Get takes name of the gRPCRoute, and returns the corresponding gRPCRoute object, and an error if there is any. +func (c *FakeGRPCRoutes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GRPCRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(grpcroutesResource, c.ns, name), &v1.GRPCRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.GRPCRoute), err +} + +// List takes label and field selectors, and returns the list of GRPCRoutes that match those selectors. +func (c *FakeGRPCRoutes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GRPCRouteList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(grpcroutesResource, grpcroutesKind, c.ns, opts), &v1.GRPCRouteList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.GRPCRouteList{ListMeta: obj.(*v1.GRPCRouteList).ListMeta} + for _, item := range obj.(*v1.GRPCRouteList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested gRPCRoutes. +func (c *FakeGRPCRoutes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(grpcroutesResource, c.ns, opts)) + +} + +// Create takes the representation of a gRPCRoute and creates it. Returns the server's representation of the gRPCRoute, and an error, if there is any. +func (c *FakeGRPCRoutes) Create(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.CreateOptions) (result *v1.GRPCRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(grpcroutesResource, c.ns, gRPCRoute), &v1.GRPCRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.GRPCRoute), err +} + +// Update takes the representation of a gRPCRoute and updates it. Returns the server's representation of the gRPCRoute, and an error, if there is any. +func (c *FakeGRPCRoutes) Update(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.UpdateOptions) (result *v1.GRPCRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(grpcroutesResource, c.ns, gRPCRoute), &v1.GRPCRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.GRPCRoute), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeGRPCRoutes) UpdateStatus(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.UpdateOptions) (*v1.GRPCRoute, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(grpcroutesResource, "status", c.ns, gRPCRoute), &v1.GRPCRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.GRPCRoute), err +} + +// Delete takes name of the gRPCRoute and deletes it. Returns an error if one occurs. +func (c *FakeGRPCRoutes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(grpcroutesResource, c.ns, name, opts), &v1.GRPCRoute{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGRPCRoutes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewDeleteCollectionAction(grpcroutesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1.GRPCRouteList{}) + return err +} + +// Patch applies the patch and returns the patched gRPCRoute. +func (c *FakeGRPCRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GRPCRoute, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(grpcroutesResource, c.ns, name, pt, data, subresources...), &v1.GRPCRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.GRPCRoute), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied gRPCRoute. +func (c *FakeGRPCRoutes) Apply(ctx context.Context, gRPCRoute *apisv1.GRPCRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GRPCRoute, err error) { + if gRPCRoute == nil { + return nil, fmt.Errorf("gRPCRoute provided to Apply must not be nil") + } + data, err := json.Marshal(gRPCRoute) + if err != nil { + return nil, err + } + name := gRPCRoute.Name + if name == nil { + return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(grpcroutesResource, c.ns, *name, types.ApplyPatchType, data), &v1.GRPCRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.GRPCRoute), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeGRPCRoutes) ApplyStatus(ctx context.Context, gRPCRoute *apisv1.GRPCRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GRPCRoute, err error) { + if gRPCRoute == nil { + return nil, fmt.Errorf("gRPCRoute provided to Apply must not be nil") + } + data, err := json.Marshal(gRPCRoute) + if err != nil { + return nil, err + } + name := gRPCRoute.Name + if name == nil { + return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(grpcroutesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.GRPCRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.GRPCRoute), err +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httproute.go index 7bf864772..77c2f0d7e 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httproute.go @@ -20,12 +20,15 @@ package fake import ( "context" + json "encoding/json" + "fmt" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" ) @@ -139,3 +142,48 @@ func (c *FakeHTTPRoutes) Patch(ctx context.Context, name string, pt types.PatchT } return obj.(*v1.HTTPRoute), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied hTTPRoute. +func (c *FakeHTTPRoutes) Apply(ctx context.Context, hTTPRoute *apisv1.HTTPRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HTTPRoute, err error) { + if hTTPRoute == nil { + return nil, fmt.Errorf("hTTPRoute provided to Apply must not be nil") + } + data, err := json.Marshal(hTTPRoute) + if err != nil { + return nil, err + } + name := hTTPRoute.Name + if name == nil { + return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(httproutesResource, c.ns, *name, types.ApplyPatchType, data), &v1.HTTPRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.HTTPRoute), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeHTTPRoutes) ApplyStatus(ctx context.Context, hTTPRoute *apisv1.HTTPRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HTTPRoute, err error) { + if hTTPRoute == nil { + return nil, fmt.Errorf("hTTPRoute provided to Apply must not be nil") + } + data, err := json.Marshal(hTTPRoute) + if err != nil { + return nil, err + } + name := hTTPRoute.Name + if name == nil { + return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(httproutesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.HTTPRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.HTTPRoute), err +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gateway.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gateway.go index 37a78cfce..9ad264580 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gateway.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gateway.go @@ -20,12 +20,15 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) @@ -47,6 +50,8 @@ type GatewayInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.GatewayList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Gateway, err error) + Apply(ctx context.Context, gateway *apisv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) + ApplyStatus(ctx context.Context, gateway *apisv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) GatewayExpansion } @@ -193,3 +198,59 @@ func (c *gateways) Patch(ctx context.Context, name string, pt types.PatchType, d Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied gateway. +func (c *gateways) Apply(ctx context.Context, gateway *apisv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) { + if gateway == nil { + return nil, fmt.Errorf("gateway provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gateway) + if err != nil { + return nil, err + } + name := gateway.Name + if name == nil { + return nil, fmt.Errorf("gateway.Name must be provided to Apply") + } + result = &v1.Gateway{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("gateways"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *gateways) ApplyStatus(ctx context.Context, gateway *apisv1.GatewayApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Gateway, err error) { + if gateway == nil { + return nil, fmt.Errorf("gateway provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gateway) + if err != nil { + return nil, err + } + + name := gateway.Name + if name == nil { + return nil, fmt.Errorf("gateway.Name must be provided to Apply") + } + + result = &v1.Gateway{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("gateways"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gatewayclass.go index 929bd9d2d..817b92a7c 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gatewayclass.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/gatewayclass.go @@ -20,12 +20,15 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) @@ -47,6 +50,8 @@ type GatewayClassInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.GatewayClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GatewayClass, err error) + Apply(ctx context.Context, gatewayClass *apisv1.GatewayClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GatewayClass, err error) + ApplyStatus(ctx context.Context, gatewayClass *apisv1.GatewayClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GatewayClass, err error) GatewayClassExpansion } @@ -182,3 +187,57 @@ func (c *gatewayClasses) Patch(ctx context.Context, name string, pt types.PatchT Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied gatewayClass. +func (c *gatewayClasses) Apply(ctx context.Context, gatewayClass *apisv1.GatewayClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GatewayClass, err error) { + if gatewayClass == nil { + return nil, fmt.Errorf("gatewayClass provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gatewayClass) + if err != nil { + return nil, err + } + name := gatewayClass.Name + if name == nil { + return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") + } + result = &v1.GatewayClass{} + err = c.client.Patch(types.ApplyPatchType). + Resource("gatewayclasses"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *gatewayClasses) ApplyStatus(ctx context.Context, gatewayClass *apisv1.GatewayClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GatewayClass, err error) { + if gatewayClass == nil { + return nil, fmt.Errorf("gatewayClass provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gatewayClass) + if err != nil { + return nil, err + } + + name := gatewayClass.Name + if name == nil { + return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") + } + + result = &v1.GatewayClass{} + err = c.client.Patch(types.ApplyPatchType). + Resource("gatewayclasses"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/generated_expansion.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/generated_expansion.go index bf1da7c1a..69d7f1f91 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/generated_expansion.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/generated_expansion.go @@ -18,6 +18,8 @@ limitations under the License. package v1 +type GRPCRouteExpansion interface{} + type GatewayExpansion interface{} type GatewayClassExpansion interface{} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/grpcroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/grpcroute.go new file mode 100644 index 000000000..f8e1c2132 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/grpcroute.go @@ -0,0 +1,256 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + v1 "sigs.k8s.io/gateway-api/apis/v1" + scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" +) + +// GRPCRoutesGetter has a method to return a GRPCRouteInterface. +// A group's client should implement this interface. +type GRPCRoutesGetter interface { + GRPCRoutes(namespace string) GRPCRouteInterface +} + +// GRPCRouteInterface has methods to work with GRPCRoute resources. +type GRPCRouteInterface interface { + Create(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.CreateOptions) (*v1.GRPCRoute, error) + Update(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.UpdateOptions) (*v1.GRPCRoute, error) + UpdateStatus(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.UpdateOptions) (*v1.GRPCRoute, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GRPCRoute, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GRPCRouteList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GRPCRoute, err error) + Apply(ctx context.Context, gRPCRoute *apisv1.GRPCRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GRPCRoute, err error) + ApplyStatus(ctx context.Context, gRPCRoute *apisv1.GRPCRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GRPCRoute, err error) + GRPCRouteExpansion +} + +// gRPCRoutes implements GRPCRouteInterface +type gRPCRoutes struct { + client rest.Interface + ns string +} + +// newGRPCRoutes returns a GRPCRoutes +func newGRPCRoutes(c *GatewayV1Client, namespace string) *gRPCRoutes { + return &gRPCRoutes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the gRPCRoute, and returns the corresponding gRPCRoute object, and an error if there is any. +func (c *gRPCRoutes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GRPCRoute, err error) { + result = &v1.GRPCRoute{} + err = c.client.Get(). + Namespace(c.ns). + Resource("grpcroutes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GRPCRoutes that match those selectors. +func (c *gRPCRoutes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GRPCRouteList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.GRPCRouteList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("grpcroutes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested gRPCRoutes. +func (c *gRPCRoutes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("grpcroutes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a gRPCRoute and creates it. Returns the server's representation of the gRPCRoute, and an error, if there is any. +func (c *gRPCRoutes) Create(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.CreateOptions) (result *v1.GRPCRoute, err error) { + result = &v1.GRPCRoute{} + err = c.client.Post(). + Namespace(c.ns). + Resource("grpcroutes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gRPCRoute). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a gRPCRoute and updates it. Returns the server's representation of the gRPCRoute, and an error, if there is any. +func (c *gRPCRoutes) Update(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.UpdateOptions) (result *v1.GRPCRoute, err error) { + result = &v1.GRPCRoute{} + err = c.client.Put(). + Namespace(c.ns). + Resource("grpcroutes"). + Name(gRPCRoute.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gRPCRoute). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *gRPCRoutes) UpdateStatus(ctx context.Context, gRPCRoute *v1.GRPCRoute, opts metav1.UpdateOptions) (result *v1.GRPCRoute, err error) { + result = &v1.GRPCRoute{} + err = c.client.Put(). + Namespace(c.ns). + Resource("grpcroutes"). + Name(gRPCRoute.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(gRPCRoute). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the gRPCRoute and deletes it. Returns an error if one occurs. +func (c *gRPCRoutes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("grpcroutes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *gRPCRoutes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("grpcroutes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched gRPCRoute. +func (c *gRPCRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GRPCRoute, err error) { + result = &v1.GRPCRoute{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("grpcroutes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied gRPCRoute. +func (c *gRPCRoutes) Apply(ctx context.Context, gRPCRoute *apisv1.GRPCRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GRPCRoute, err error) { + if gRPCRoute == nil { + return nil, fmt.Errorf("gRPCRoute provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gRPCRoute) + if err != nil { + return nil, err + } + name := gRPCRoute.Name + if name == nil { + return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") + } + result = &v1.GRPCRoute{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("grpcroutes"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *gRPCRoutes) ApplyStatus(ctx context.Context, gRPCRoute *apisv1.GRPCRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.GRPCRoute, err error) { + if gRPCRoute == nil { + return nil, fmt.Errorf("gRPCRoute provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gRPCRoute) + if err != nil { + return nil, err + } + + name := gRPCRoute.Name + if name == nil { + return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") + } + + result = &v1.GRPCRoute{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("grpcroutes"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/httproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/httproute.go index 612593450..89cab587c 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/httproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/httproute.go @@ -20,12 +20,15 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) @@ -47,6 +50,8 @@ type HTTPRouteInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.HTTPRouteList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HTTPRoute, err error) + Apply(ctx context.Context, hTTPRoute *apisv1.HTTPRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HTTPRoute, err error) + ApplyStatus(ctx context.Context, hTTPRoute *apisv1.HTTPRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HTTPRoute, err error) HTTPRouteExpansion } @@ -193,3 +198,59 @@ func (c *hTTPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied hTTPRoute. +func (c *hTTPRoutes) Apply(ctx context.Context, hTTPRoute *apisv1.HTTPRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HTTPRoute, err error) { + if hTTPRoute == nil { + return nil, fmt.Errorf("hTTPRoute provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(hTTPRoute) + if err != nil { + return nil, err + } + name := hTTPRoute.Name + if name == nil { + return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") + } + result = &v1.HTTPRoute{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("httproutes"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *hTTPRoutes) ApplyStatus(ctx context.Context, hTTPRoute *apisv1.HTTPRouteApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HTTPRoute, err error) { + if hTTPRoute == nil { + return nil, fmt.Errorf("hTTPRoute provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(hTTPRoute) + if err != nil { + return nil, err + } + + name := hTTPRoute.Name + if name == nil { + return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") + } + + result = &v1.HTTPRoute{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("httproutes"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/apis_client.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/apis_client.go index 736b827cf..8431bb168 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/apis_client.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/apis_client.go @@ -28,11 +28,8 @@ import ( type GatewayV1alpha2Interface interface { RESTClient() rest.Interface - BackendTLSPoliciesGetter + BackendLBPoliciesGetter GRPCRoutesGetter - GatewaysGetter - GatewayClassesGetter - HTTPRoutesGetter ReferenceGrantsGetter TCPRoutesGetter TLSRoutesGetter @@ -44,26 +41,14 @@ type GatewayV1alpha2Client struct { restClient rest.Interface } -func (c *GatewayV1alpha2Client) BackendTLSPolicies(namespace string) BackendTLSPolicyInterface { - return newBackendTLSPolicies(c, namespace) +func (c *GatewayV1alpha2Client) BackendLBPolicies(namespace string) BackendLBPolicyInterface { + return newBackendLBPolicies(c, namespace) } func (c *GatewayV1alpha2Client) GRPCRoutes(namespace string) GRPCRouteInterface { return newGRPCRoutes(c, namespace) } -func (c *GatewayV1alpha2Client) Gateways(namespace string) GatewayInterface { - return newGateways(c, namespace) -} - -func (c *GatewayV1alpha2Client) GatewayClasses() GatewayClassInterface { - return newGatewayClasses(c) -} - -func (c *GatewayV1alpha2Client) HTTPRoutes(namespace string) HTTPRouteInterface { - return newHTTPRoutes(c, namespace) -} - func (c *GatewayV1alpha2Client) ReferenceGrants(namespace string) ReferenceGrantInterface { return newReferenceGrants(c, namespace) } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendlbpolicy.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendlbpolicy.go new file mode 100644 index 000000000..514cac1e2 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendlbpolicy.go @@ -0,0 +1,256 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" + v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" +) + +// BackendLBPoliciesGetter has a method to return a BackendLBPolicyInterface. +// A group's client should implement this interface. +type BackendLBPoliciesGetter interface { + BackendLBPolicies(namespace string) BackendLBPolicyInterface +} + +// BackendLBPolicyInterface has methods to work with BackendLBPolicy resources. +type BackendLBPolicyInterface interface { + Create(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.CreateOptions) (*v1alpha2.BackendLBPolicy, error) + Update(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendLBPolicy, error) + UpdateStatus(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendLBPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.BackendLBPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.BackendLBPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendLBPolicy, err error) + Apply(ctx context.Context, backendLBPolicy *apisv1alpha2.BackendLBPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendLBPolicy, err error) + ApplyStatus(ctx context.Context, backendLBPolicy *apisv1alpha2.BackendLBPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendLBPolicy, err error) + BackendLBPolicyExpansion +} + +// backendLBPolicies implements BackendLBPolicyInterface +type backendLBPolicies struct { + client rest.Interface + ns string +} + +// newBackendLBPolicies returns a BackendLBPolicies +func newBackendLBPolicies(c *GatewayV1alpha2Client, namespace string) *backendLBPolicies { + return &backendLBPolicies{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the backendLBPolicy, and returns the corresponding backendLBPolicy object, and an error if there is any. +func (c *backendLBPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.BackendLBPolicy, err error) { + result = &v1alpha2.BackendLBPolicy{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backendlbpolicies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of BackendLBPolicies that match those selectors. +func (c *backendLBPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.BackendLBPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha2.BackendLBPolicyList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backendlbpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested backendLBPolicies. +func (c *backendLBPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("backendlbpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a backendLBPolicy and creates it. Returns the server's representation of the backendLBPolicy, and an error, if there is any. +func (c *backendLBPolicies) Create(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.CreateOptions) (result *v1alpha2.BackendLBPolicy, err error) { + result = &v1alpha2.BackendLBPolicy{} + err = c.client.Post(). + Namespace(c.ns). + Resource("backendlbpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backendLBPolicy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a backendLBPolicy and updates it. Returns the server's representation of the backendLBPolicy, and an error, if there is any. +func (c *backendLBPolicies) Update(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendLBPolicy, err error) { + result = &v1alpha2.BackendLBPolicy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("backendlbpolicies"). + Name(backendLBPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backendLBPolicy). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *backendLBPolicies) UpdateStatus(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendLBPolicy, err error) { + result = &v1alpha2.BackendLBPolicy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("backendlbpolicies"). + Name(backendLBPolicy.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backendLBPolicy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the backendLBPolicy and deletes it. Returns an error if one occurs. +func (c *backendLBPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("backendlbpolicies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *backendLBPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("backendlbpolicies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched backendLBPolicy. +func (c *backendLBPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendLBPolicy, err error) { + result = &v1alpha2.BackendLBPolicy{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("backendlbpolicies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied backendLBPolicy. +func (c *backendLBPolicies) Apply(ctx context.Context, backendLBPolicy *apisv1alpha2.BackendLBPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendLBPolicy, err error) { + if backendLBPolicy == nil { + return nil, fmt.Errorf("backendLBPolicy provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(backendLBPolicy) + if err != nil { + return nil, err + } + name := backendLBPolicy.Name + if name == nil { + return nil, fmt.Errorf("backendLBPolicy.Name must be provided to Apply") + } + result = &v1alpha2.BackendLBPolicy{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("backendlbpolicies"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *backendLBPolicies) ApplyStatus(ctx context.Context, backendLBPolicy *apisv1alpha2.BackendLBPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendLBPolicy, err error) { + if backendLBPolicy == nil { + return nil, fmt.Errorf("backendLBPolicy provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(backendLBPolicy) + if err != nil { + return nil, err + } + + name := backendLBPolicy.Name + if name == nil { + return nil, fmt.Errorf("backendLBPolicy.Name must be provided to Apply") + } + + result = &v1alpha2.BackendLBPolicy{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("backendlbpolicies"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_apis_client.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_apis_client.go index 08b78999d..7ea0de647 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_apis_client.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_apis_client.go @@ -28,26 +28,14 @@ type FakeGatewayV1alpha2 struct { *testing.Fake } -func (c *FakeGatewayV1alpha2) BackendTLSPolicies(namespace string) v1alpha2.BackendTLSPolicyInterface { - return &FakeBackendTLSPolicies{c, namespace} +func (c *FakeGatewayV1alpha2) BackendLBPolicies(namespace string) v1alpha2.BackendLBPolicyInterface { + return &FakeBackendLBPolicies{c, namespace} } func (c *FakeGatewayV1alpha2) GRPCRoutes(namespace string) v1alpha2.GRPCRouteInterface { return &FakeGRPCRoutes{c, namespace} } -func (c *FakeGatewayV1alpha2) Gateways(namespace string) v1alpha2.GatewayInterface { - return &FakeGateways{c, namespace} -} - -func (c *FakeGatewayV1alpha2) GatewayClasses() v1alpha2.GatewayClassInterface { - return &FakeGatewayClasses{c} -} - -func (c *FakeGatewayV1alpha2) HTTPRoutes(namespace string) v1alpha2.HTTPRouteInterface { - return &FakeHTTPRoutes{c, namespace} -} - func (c *FakeGatewayV1alpha2) ReferenceGrants(namespace string) v1alpha2.ReferenceGrantInterface { return &FakeReferenceGrants{c, namespace} } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendlbpolicy.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendlbpolicy.go new file mode 100644 index 000000000..dab088600 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendlbpolicy.go @@ -0,0 +1,189 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" + v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +) + +// FakeBackendLBPolicies implements BackendLBPolicyInterface +type FakeBackendLBPolicies struct { + Fake *FakeGatewayV1alpha2 + ns string +} + +var backendlbpoliciesResource = v1alpha2.SchemeGroupVersion.WithResource("backendlbpolicies") + +var backendlbpoliciesKind = v1alpha2.SchemeGroupVersion.WithKind("BackendLBPolicy") + +// Get takes name of the backendLBPolicy, and returns the corresponding backendLBPolicy object, and an error if there is any. +func (c *FakeBackendLBPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.BackendLBPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(backendlbpoliciesResource, c.ns, name), &v1alpha2.BackendLBPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.BackendLBPolicy), err +} + +// List takes label and field selectors, and returns the list of BackendLBPolicies that match those selectors. +func (c *FakeBackendLBPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.BackendLBPolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(backendlbpoliciesResource, backendlbpoliciesKind, c.ns, opts), &v1alpha2.BackendLBPolicyList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha2.BackendLBPolicyList{ListMeta: obj.(*v1alpha2.BackendLBPolicyList).ListMeta} + for _, item := range obj.(*v1alpha2.BackendLBPolicyList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested backendLBPolicies. +func (c *FakeBackendLBPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(backendlbpoliciesResource, c.ns, opts)) + +} + +// Create takes the representation of a backendLBPolicy and creates it. Returns the server's representation of the backendLBPolicy, and an error, if there is any. +func (c *FakeBackendLBPolicies) Create(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.CreateOptions) (result *v1alpha2.BackendLBPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(backendlbpoliciesResource, c.ns, backendLBPolicy), &v1alpha2.BackendLBPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.BackendLBPolicy), err +} + +// Update takes the representation of a backendLBPolicy and updates it. Returns the server's representation of the backendLBPolicy, and an error, if there is any. +func (c *FakeBackendLBPolicies) Update(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendLBPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(backendlbpoliciesResource, c.ns, backendLBPolicy), &v1alpha2.BackendLBPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.BackendLBPolicy), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeBackendLBPolicies) UpdateStatus(ctx context.Context, backendLBPolicy *v1alpha2.BackendLBPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendLBPolicy, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(backendlbpoliciesResource, "status", c.ns, backendLBPolicy), &v1alpha2.BackendLBPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.BackendLBPolicy), err +} + +// Delete takes name of the backendLBPolicy and deletes it. Returns an error if one occurs. +func (c *FakeBackendLBPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(backendlbpoliciesResource, c.ns, name, opts), &v1alpha2.BackendLBPolicy{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBackendLBPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(backendlbpoliciesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha2.BackendLBPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched backendLBPolicy. +func (c *FakeBackendLBPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendLBPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(backendlbpoliciesResource, c.ns, name, pt, data, subresources...), &v1alpha2.BackendLBPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.BackendLBPolicy), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied backendLBPolicy. +func (c *FakeBackendLBPolicies) Apply(ctx context.Context, backendLBPolicy *apisv1alpha2.BackendLBPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendLBPolicy, err error) { + if backendLBPolicy == nil { + return nil, fmt.Errorf("backendLBPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(backendLBPolicy) + if err != nil { + return nil, err + } + name := backendLBPolicy.Name + if name == nil { + return nil, fmt.Errorf("backendLBPolicy.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(backendlbpoliciesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.BackendLBPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.BackendLBPolicy), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeBackendLBPolicies) ApplyStatus(ctx context.Context, backendLBPolicy *apisv1alpha2.BackendLBPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendLBPolicy, err error) { + if backendLBPolicy == nil { + return nil, fmt.Errorf("backendLBPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(backendLBPolicy) + if err != nil { + return nil, err + } + name := backendLBPolicy.Name + if name == nil { + return nil, fmt.Errorf("backendLBPolicy.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(backendlbpoliciesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha2.BackendLBPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.BackendLBPolicy), err +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_gateway.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_gateway.go deleted file mode 100644 index 2313be1bf..000000000 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_gateway.go +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" -) - -// FakeGateways implements GatewayInterface -type FakeGateways struct { - Fake *FakeGatewayV1alpha2 - ns string -} - -var gatewaysResource = v1alpha2.SchemeGroupVersion.WithResource("gateways") - -var gatewaysKind = v1alpha2.SchemeGroupVersion.WithKind("Gateway") - -// Get takes name of the gateway, and returns the corresponding gateway object, and an error if there is any. -func (c *FakeGateways) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.Gateway, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(gatewaysResource, c.ns, name), &v1alpha2.Gateway{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.Gateway), err -} - -// List takes label and field selectors, and returns the list of Gateways that match those selectors. -func (c *FakeGateways) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.GatewayList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(gatewaysResource, gatewaysKind, c.ns, opts), &v1alpha2.GatewayList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.GatewayList{ListMeta: obj.(*v1alpha2.GatewayList).ListMeta} - for _, item := range obj.(*v1alpha2.GatewayList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested gateways. -func (c *FakeGateways) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(gatewaysResource, c.ns, opts)) - -} - -// Create takes the representation of a gateway and creates it. Returns the server's representation of the gateway, and an error, if there is any. -func (c *FakeGateways) Create(ctx context.Context, gateway *v1alpha2.Gateway, opts v1.CreateOptions) (result *v1alpha2.Gateway, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(gatewaysResource, c.ns, gateway), &v1alpha2.Gateway{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.Gateway), err -} - -// Update takes the representation of a gateway and updates it. Returns the server's representation of the gateway, and an error, if there is any. -func (c *FakeGateways) Update(ctx context.Context, gateway *v1alpha2.Gateway, opts v1.UpdateOptions) (result *v1alpha2.Gateway, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(gatewaysResource, c.ns, gateway), &v1alpha2.Gateway{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.Gateway), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeGateways) UpdateStatus(ctx context.Context, gateway *v1alpha2.Gateway, opts v1.UpdateOptions) (*v1alpha2.Gateway, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(gatewaysResource, "status", c.ns, gateway), &v1alpha2.Gateway{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.Gateway), err -} - -// Delete takes name of the gateway and deletes it. Returns an error if one occurs. -func (c *FakeGateways) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(gatewaysResource, c.ns, name, opts), &v1alpha2.Gateway{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeGateways) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(gatewaysResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.GatewayList{}) - return err -} - -// Patch applies the patch and returns the patched gateway. -func (c *FakeGateways) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.Gateway, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, name, pt, data, subresources...), &v1alpha2.Gateway{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.Gateway), err -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_gatewayclass.go deleted file mode 100644 index 606fe6d78..000000000 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_gatewayclass.go +++ /dev/null @@ -1,132 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" -) - -// FakeGatewayClasses implements GatewayClassInterface -type FakeGatewayClasses struct { - Fake *FakeGatewayV1alpha2 -} - -var gatewayclassesResource = v1alpha2.SchemeGroupVersion.WithResource("gatewayclasses") - -var gatewayclassesKind = v1alpha2.SchemeGroupVersion.WithKind("GatewayClass") - -// Get takes name of the gatewayClass, and returns the corresponding gatewayClass object, and an error if there is any. -func (c *FakeGatewayClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.GatewayClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(gatewayclassesResource, name), &v1alpha2.GatewayClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.GatewayClass), err -} - -// List takes label and field selectors, and returns the list of GatewayClasses that match those selectors. -func (c *FakeGatewayClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.GatewayClassList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(gatewayclassesResource, gatewayclassesKind, opts), &v1alpha2.GatewayClassList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.GatewayClassList{ListMeta: obj.(*v1alpha2.GatewayClassList).ListMeta} - for _, item := range obj.(*v1alpha2.GatewayClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested gatewayClasses. -func (c *FakeGatewayClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(gatewayclassesResource, opts)) -} - -// Create takes the representation of a gatewayClass and creates it. Returns the server's representation of the gatewayClass, and an error, if there is any. -func (c *FakeGatewayClasses) Create(ctx context.Context, gatewayClass *v1alpha2.GatewayClass, opts v1.CreateOptions) (result *v1alpha2.GatewayClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(gatewayclassesResource, gatewayClass), &v1alpha2.GatewayClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.GatewayClass), err -} - -// Update takes the representation of a gatewayClass and updates it. Returns the server's representation of the gatewayClass, and an error, if there is any. -func (c *FakeGatewayClasses) Update(ctx context.Context, gatewayClass *v1alpha2.GatewayClass, opts v1.UpdateOptions) (result *v1alpha2.GatewayClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(gatewayclassesResource, gatewayClass), &v1alpha2.GatewayClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.GatewayClass), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeGatewayClasses) UpdateStatus(ctx context.Context, gatewayClass *v1alpha2.GatewayClass, opts v1.UpdateOptions) (*v1alpha2.GatewayClass, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(gatewayclassesResource, "status", gatewayClass), &v1alpha2.GatewayClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.GatewayClass), err -} - -// Delete takes name of the gatewayClass and deletes it. Returns an error if one occurs. -func (c *FakeGatewayClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(gatewayclassesResource, name, opts), &v1alpha2.GatewayClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeGatewayClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(gatewayclassesResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.GatewayClassList{}) - return err -} - -// Patch applies the patch and returns the patched gatewayClass. -func (c *FakeGatewayClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.GatewayClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(gatewayclassesResource, name, pt, data, subresources...), &v1alpha2.GatewayClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.GatewayClass), err -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_grpcroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_grpcroute.go index 631106727..3059cb994 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_grpcroute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_grpcroute.go @@ -20,12 +20,15 @@ package fake import ( "context" + json "encoding/json" + "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) @@ -139,3 +142,48 @@ func (c *FakeGRPCRoutes) Patch(ctx context.Context, name string, pt types.PatchT } return obj.(*v1alpha2.GRPCRoute), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied gRPCRoute. +func (c *FakeGRPCRoutes) Apply(ctx context.Context, gRPCRoute *apisv1alpha2.GRPCRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.GRPCRoute, err error) { + if gRPCRoute == nil { + return nil, fmt.Errorf("gRPCRoute provided to Apply must not be nil") + } + data, err := json.Marshal(gRPCRoute) + if err != nil { + return nil, err + } + name := gRPCRoute.Name + if name == nil { + return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(grpcroutesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.GRPCRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.GRPCRoute), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeGRPCRoutes) ApplyStatus(ctx context.Context, gRPCRoute *apisv1alpha2.GRPCRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.GRPCRoute, err error) { + if gRPCRoute == nil { + return nil, fmt.Errorf("gRPCRoute provided to Apply must not be nil") + } + data, err := json.Marshal(gRPCRoute) + if err != nil { + return nil, err + } + name := gRPCRoute.Name + if name == nil { + return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(grpcroutesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha2.GRPCRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.GRPCRoute), err +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_httproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_httproute.go deleted file mode 100644 index cf3bf1b4a..000000000 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_httproute.go +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" -) - -// FakeHTTPRoutes implements HTTPRouteInterface -type FakeHTTPRoutes struct { - Fake *FakeGatewayV1alpha2 - ns string -} - -var httproutesResource = v1alpha2.SchemeGroupVersion.WithResource("httproutes") - -var httproutesKind = v1alpha2.SchemeGroupVersion.WithKind("HTTPRoute") - -// Get takes name of the hTTPRoute, and returns the corresponding hTTPRoute object, and an error if there is any. -func (c *FakeHTTPRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.HTTPRoute, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(httproutesResource, c.ns, name), &v1alpha2.HTTPRoute{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.HTTPRoute), err -} - -// List takes label and field selectors, and returns the list of HTTPRoutes that match those selectors. -func (c *FakeHTTPRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.HTTPRouteList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(httproutesResource, httproutesKind, c.ns, opts), &v1alpha2.HTTPRouteList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.HTTPRouteList{ListMeta: obj.(*v1alpha2.HTTPRouteList).ListMeta} - for _, item := range obj.(*v1alpha2.HTTPRouteList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested hTTPRoutes. -func (c *FakeHTTPRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(httproutesResource, c.ns, opts)) - -} - -// Create takes the representation of a hTTPRoute and creates it. Returns the server's representation of the hTTPRoute, and an error, if there is any. -func (c *FakeHTTPRoutes) Create(ctx context.Context, hTTPRoute *v1alpha2.HTTPRoute, opts v1.CreateOptions) (result *v1alpha2.HTTPRoute, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(httproutesResource, c.ns, hTTPRoute), &v1alpha2.HTTPRoute{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.HTTPRoute), err -} - -// Update takes the representation of a hTTPRoute and updates it. Returns the server's representation of the hTTPRoute, and an error, if there is any. -func (c *FakeHTTPRoutes) Update(ctx context.Context, hTTPRoute *v1alpha2.HTTPRoute, opts v1.UpdateOptions) (result *v1alpha2.HTTPRoute, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(httproutesResource, c.ns, hTTPRoute), &v1alpha2.HTTPRoute{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.HTTPRoute), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeHTTPRoutes) UpdateStatus(ctx context.Context, hTTPRoute *v1alpha2.HTTPRoute, opts v1.UpdateOptions) (*v1alpha2.HTTPRoute, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(httproutesResource, "status", c.ns, hTTPRoute), &v1alpha2.HTTPRoute{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.HTTPRoute), err -} - -// Delete takes name of the hTTPRoute and deletes it. Returns an error if one occurs. -func (c *FakeHTTPRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(httproutesResource, c.ns, name, opts), &v1alpha2.HTTPRoute{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeHTTPRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(httproutesResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.HTTPRouteList{}) - return err -} - -// Patch applies the patch and returns the patched hTTPRoute. -func (c *FakeHTTPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.HTTPRoute, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(httproutesResource, c.ns, name, pt, data, subresources...), &v1alpha2.HTTPRoute{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha2.HTTPRoute), err -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_referencegrant.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_referencegrant.go index 1089d6e1c..50c90fa8a 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_referencegrant.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_referencegrant.go @@ -20,12 +20,15 @@ package fake import ( "context" + json "encoding/json" + "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) @@ -127,3 +130,25 @@ func (c *FakeReferenceGrants) Patch(ctx context.Context, name string, pt types.P } return obj.(*v1alpha2.ReferenceGrant), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied referenceGrant. +func (c *FakeReferenceGrants) Apply(ctx context.Context, referenceGrant *apisv1alpha2.ReferenceGrantApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ReferenceGrant, err error) { + if referenceGrant == nil { + return nil, fmt.Errorf("referenceGrant provided to Apply must not be nil") + } + data, err := json.Marshal(referenceGrant) + if err != nil { + return nil, err + } + name := referenceGrant.Name + if name == nil { + return nil, fmt.Errorf("referenceGrant.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(referencegrantsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.ReferenceGrant{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.ReferenceGrant), err +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tcproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tcproute.go index c6ecb3818..b93e76628 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tcproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tcproute.go @@ -20,12 +20,15 @@ package fake import ( "context" + json "encoding/json" + "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) @@ -139,3 +142,48 @@ func (c *FakeTCPRoutes) Patch(ctx context.Context, name string, pt types.PatchTy } return obj.(*v1alpha2.TCPRoute), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied tCPRoute. +func (c *FakeTCPRoutes) Apply(ctx context.Context, tCPRoute *apisv1alpha2.TCPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TCPRoute, err error) { + if tCPRoute == nil { + return nil, fmt.Errorf("tCPRoute provided to Apply must not be nil") + } + data, err := json.Marshal(tCPRoute) + if err != nil { + return nil, err + } + name := tCPRoute.Name + if name == nil { + return nil, fmt.Errorf("tCPRoute.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(tcproutesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.TCPRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.TCPRoute), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeTCPRoutes) ApplyStatus(ctx context.Context, tCPRoute *apisv1alpha2.TCPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TCPRoute, err error) { + if tCPRoute == nil { + return nil, fmt.Errorf("tCPRoute provided to Apply must not be nil") + } + data, err := json.Marshal(tCPRoute) + if err != nil { + return nil, err + } + name := tCPRoute.Name + if name == nil { + return nil, fmt.Errorf("tCPRoute.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(tcproutesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha2.TCPRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.TCPRoute), err +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tlsroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tlsroute.go index f9c0115d5..938387615 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tlsroute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tlsroute.go @@ -20,12 +20,15 @@ package fake import ( "context" + json "encoding/json" + "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) @@ -139,3 +142,48 @@ func (c *FakeTLSRoutes) Patch(ctx context.Context, name string, pt types.PatchTy } return obj.(*v1alpha2.TLSRoute), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied tLSRoute. +func (c *FakeTLSRoutes) Apply(ctx context.Context, tLSRoute *apisv1alpha2.TLSRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TLSRoute, err error) { + if tLSRoute == nil { + return nil, fmt.Errorf("tLSRoute provided to Apply must not be nil") + } + data, err := json.Marshal(tLSRoute) + if err != nil { + return nil, err + } + name := tLSRoute.Name + if name == nil { + return nil, fmt.Errorf("tLSRoute.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(tlsroutesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.TLSRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.TLSRoute), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeTLSRoutes) ApplyStatus(ctx context.Context, tLSRoute *apisv1alpha2.TLSRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TLSRoute, err error) { + if tLSRoute == nil { + return nil, fmt.Errorf("tLSRoute provided to Apply must not be nil") + } + data, err := json.Marshal(tLSRoute) + if err != nil { + return nil, err + } + name := tLSRoute.Name + if name == nil { + return nil, fmt.Errorf("tLSRoute.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(tlsroutesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha2.TLSRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.TLSRoute), err +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_udproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_udproute.go index 88a139e78..027f4a4c1 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_udproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_udproute.go @@ -20,12 +20,15 @@ package fake import ( "context" + json "encoding/json" + "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" ) @@ -139,3 +142,48 @@ func (c *FakeUDPRoutes) Patch(ctx context.Context, name string, pt types.PatchTy } return obj.(*v1alpha2.UDPRoute), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied uDPRoute. +func (c *FakeUDPRoutes) Apply(ctx context.Context, uDPRoute *apisv1alpha2.UDPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.UDPRoute, err error) { + if uDPRoute == nil { + return nil, fmt.Errorf("uDPRoute provided to Apply must not be nil") + } + data, err := json.Marshal(uDPRoute) + if err != nil { + return nil, err + } + name := uDPRoute.Name + if name == nil { + return nil, fmt.Errorf("uDPRoute.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(udproutesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.UDPRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.UDPRoute), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeUDPRoutes) ApplyStatus(ctx context.Context, uDPRoute *apisv1alpha2.UDPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.UDPRoute, err error) { + if uDPRoute == nil { + return nil, fmt.Errorf("uDPRoute provided to Apply must not be nil") + } + data, err := json.Marshal(uDPRoute) + if err != nil { + return nil, err + } + name := uDPRoute.Name + if name == nil { + return nil, fmt.Errorf("uDPRoute.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(udproutesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha2.UDPRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha2.UDPRoute), err +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/gateway.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/gateway.go deleted file mode 100644 index 0a594dc00..000000000 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/gateway.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "context" - "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" - scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" -) - -// GatewaysGetter has a method to return a GatewayInterface. -// A group's client should implement this interface. -type GatewaysGetter interface { - Gateways(namespace string) GatewayInterface -} - -// GatewayInterface has methods to work with Gateway resources. -type GatewayInterface interface { - Create(ctx context.Context, gateway *v1alpha2.Gateway, opts v1.CreateOptions) (*v1alpha2.Gateway, error) - Update(ctx context.Context, gateway *v1alpha2.Gateway, opts v1.UpdateOptions) (*v1alpha2.Gateway, error) - UpdateStatus(ctx context.Context, gateway *v1alpha2.Gateway, opts v1.UpdateOptions) (*v1alpha2.Gateway, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.Gateway, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.GatewayList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.Gateway, err error) - GatewayExpansion -} - -// gateways implements GatewayInterface -type gateways struct { - client rest.Interface - ns string -} - -// newGateways returns a Gateways -func newGateways(c *GatewayV1alpha2Client, namespace string) *gateways { - return &gateways{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the gateway, and returns the corresponding gateway object, and an error if there is any. -func (c *gateways) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.Gateway, err error) { - result = &v1alpha2.Gateway{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gateways"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Gateways that match those selectors. -func (c *gateways) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.GatewayList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.GatewayList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gateways"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested gateways. -func (c *gateways) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("gateways"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a gateway and creates it. Returns the server's representation of the gateway, and an error, if there is any. -func (c *gateways) Create(ctx context.Context, gateway *v1alpha2.Gateway, opts v1.CreateOptions) (result *v1alpha2.Gateway, err error) { - result = &v1alpha2.Gateway{} - err = c.client.Post(). - Namespace(c.ns). - Resource("gateways"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gateway). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a gateway and updates it. Returns the server's representation of the gateway, and an error, if there is any. -func (c *gateways) Update(ctx context.Context, gateway *v1alpha2.Gateway, opts v1.UpdateOptions) (result *v1alpha2.Gateway, err error) { - result = &v1alpha2.Gateway{} - err = c.client.Put(). - Namespace(c.ns). - Resource("gateways"). - Name(gateway.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gateway). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *gateways) UpdateStatus(ctx context.Context, gateway *v1alpha2.Gateway, opts v1.UpdateOptions) (result *v1alpha2.Gateway, err error) { - result = &v1alpha2.Gateway{} - err = c.client.Put(). - Namespace(c.ns). - Resource("gateways"). - Name(gateway.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gateway). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the gateway and deletes it. Returns an error if one occurs. -func (c *gateways) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("gateways"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *gateways) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("gateways"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched gateway. -func (c *gateways) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.Gateway, err error) { - result = &v1alpha2.Gateway{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("gateways"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/gatewayclass.go deleted file mode 100644 index 08d83b623..000000000 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/gatewayclass.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "context" - "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" - scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" -) - -// GatewayClassesGetter has a method to return a GatewayClassInterface. -// A group's client should implement this interface. -type GatewayClassesGetter interface { - GatewayClasses() GatewayClassInterface -} - -// GatewayClassInterface has methods to work with GatewayClass resources. -type GatewayClassInterface interface { - Create(ctx context.Context, gatewayClass *v1alpha2.GatewayClass, opts v1.CreateOptions) (*v1alpha2.GatewayClass, error) - Update(ctx context.Context, gatewayClass *v1alpha2.GatewayClass, opts v1.UpdateOptions) (*v1alpha2.GatewayClass, error) - UpdateStatus(ctx context.Context, gatewayClass *v1alpha2.GatewayClass, opts v1.UpdateOptions) (*v1alpha2.GatewayClass, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.GatewayClass, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.GatewayClassList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.GatewayClass, err error) - GatewayClassExpansion -} - -// gatewayClasses implements GatewayClassInterface -type gatewayClasses struct { - client rest.Interface -} - -// newGatewayClasses returns a GatewayClasses -func newGatewayClasses(c *GatewayV1alpha2Client) *gatewayClasses { - return &gatewayClasses{ - client: c.RESTClient(), - } -} - -// Get takes name of the gatewayClass, and returns the corresponding gatewayClass object, and an error if there is any. -func (c *gatewayClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.GatewayClass, err error) { - result = &v1alpha2.GatewayClass{} - err = c.client.Get(). - Resource("gatewayclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of GatewayClasses that match those selectors. -func (c *gatewayClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.GatewayClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.GatewayClassList{} - err = c.client.Get(). - Resource("gatewayclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested gatewayClasses. -func (c *gatewayClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("gatewayclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a gatewayClass and creates it. Returns the server's representation of the gatewayClass, and an error, if there is any. -func (c *gatewayClasses) Create(ctx context.Context, gatewayClass *v1alpha2.GatewayClass, opts v1.CreateOptions) (result *v1alpha2.GatewayClass, err error) { - result = &v1alpha2.GatewayClass{} - err = c.client.Post(). - Resource("gatewayclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gatewayClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a gatewayClass and updates it. Returns the server's representation of the gatewayClass, and an error, if there is any. -func (c *gatewayClasses) Update(ctx context.Context, gatewayClass *v1alpha2.GatewayClass, opts v1.UpdateOptions) (result *v1alpha2.GatewayClass, err error) { - result = &v1alpha2.GatewayClass{} - err = c.client.Put(). - Resource("gatewayclasses"). - Name(gatewayClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gatewayClass). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *gatewayClasses) UpdateStatus(ctx context.Context, gatewayClass *v1alpha2.GatewayClass, opts v1.UpdateOptions) (result *v1alpha2.GatewayClass, err error) { - result = &v1alpha2.GatewayClass{} - err = c.client.Put(). - Resource("gatewayclasses"). - Name(gatewayClass.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gatewayClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the gatewayClass and deletes it. Returns an error if one occurs. -func (c *gatewayClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("gatewayclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *gatewayClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("gatewayclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched gatewayClass. -func (c *gatewayClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.GatewayClass, err error) { - result = &v1alpha2.GatewayClass{} - err = c.client.Patch(pt). - Resource("gatewayclasses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/generated_expansion.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/generated_expansion.go index d8184bc9c..c0fe07b49 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/generated_expansion.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/generated_expansion.go @@ -18,16 +18,10 @@ limitations under the License. package v1alpha2 -type BackendTLSPolicyExpansion interface{} +type BackendLBPolicyExpansion interface{} type GRPCRouteExpansion interface{} -type GatewayExpansion interface{} - -type GatewayClassExpansion interface{} - -type HTTPRouteExpansion interface{} - type ReferenceGrantExpansion interface{} type TCPRouteExpansion interface{} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/grpcroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/grpcroute.go index 42861ba70..5e08af49d 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/grpcroute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/grpcroute.go @@ -20,12 +20,15 @@ package v1alpha2 import ( "context" + json "encoding/json" + "fmt" "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) @@ -47,6 +50,8 @@ type GRPCRouteInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.GRPCRouteList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.GRPCRoute, err error) + Apply(ctx context.Context, gRPCRoute *apisv1alpha2.GRPCRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.GRPCRoute, err error) + ApplyStatus(ctx context.Context, gRPCRoute *apisv1alpha2.GRPCRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.GRPCRoute, err error) GRPCRouteExpansion } @@ -193,3 +198,59 @@ func (c *gRPCRoutes) Patch(ctx context.Context, name string, pt types.PatchType, Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied gRPCRoute. +func (c *gRPCRoutes) Apply(ctx context.Context, gRPCRoute *apisv1alpha2.GRPCRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.GRPCRoute, err error) { + if gRPCRoute == nil { + return nil, fmt.Errorf("gRPCRoute provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gRPCRoute) + if err != nil { + return nil, err + } + name := gRPCRoute.Name + if name == nil { + return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") + } + result = &v1alpha2.GRPCRoute{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("grpcroutes"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *gRPCRoutes) ApplyStatus(ctx context.Context, gRPCRoute *apisv1alpha2.GRPCRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.GRPCRoute, err error) { + if gRPCRoute == nil { + return nil, fmt.Errorf("gRPCRoute provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gRPCRoute) + if err != nil { + return nil, err + } + + name := gRPCRoute.Name + if name == nil { + return nil, fmt.Errorf("gRPCRoute.Name must be provided to Apply") + } + + result = &v1alpha2.GRPCRoute{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("grpcroutes"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/httproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/httproute.go deleted file mode 100644 index 31b61312c..000000000 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/httproute.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "context" - "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" - scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" -) - -// HTTPRoutesGetter has a method to return a HTTPRouteInterface. -// A group's client should implement this interface. -type HTTPRoutesGetter interface { - HTTPRoutes(namespace string) HTTPRouteInterface -} - -// HTTPRouteInterface has methods to work with HTTPRoute resources. -type HTTPRouteInterface interface { - Create(ctx context.Context, hTTPRoute *v1alpha2.HTTPRoute, opts v1.CreateOptions) (*v1alpha2.HTTPRoute, error) - Update(ctx context.Context, hTTPRoute *v1alpha2.HTTPRoute, opts v1.UpdateOptions) (*v1alpha2.HTTPRoute, error) - UpdateStatus(ctx context.Context, hTTPRoute *v1alpha2.HTTPRoute, opts v1.UpdateOptions) (*v1alpha2.HTTPRoute, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.HTTPRoute, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.HTTPRouteList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.HTTPRoute, err error) - HTTPRouteExpansion -} - -// hTTPRoutes implements HTTPRouteInterface -type hTTPRoutes struct { - client rest.Interface - ns string -} - -// newHTTPRoutes returns a HTTPRoutes -func newHTTPRoutes(c *GatewayV1alpha2Client, namespace string) *hTTPRoutes { - return &hTTPRoutes{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the hTTPRoute, and returns the corresponding hTTPRoute object, and an error if there is any. -func (c *hTTPRoutes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.HTTPRoute, err error) { - result = &v1alpha2.HTTPRoute{} - err = c.client.Get(). - Namespace(c.ns). - Resource("httproutes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of HTTPRoutes that match those selectors. -func (c *hTTPRoutes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.HTTPRouteList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.HTTPRouteList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("httproutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested hTTPRoutes. -func (c *hTTPRoutes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("httproutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a hTTPRoute and creates it. Returns the server's representation of the hTTPRoute, and an error, if there is any. -func (c *hTTPRoutes) Create(ctx context.Context, hTTPRoute *v1alpha2.HTTPRoute, opts v1.CreateOptions) (result *v1alpha2.HTTPRoute, err error) { - result = &v1alpha2.HTTPRoute{} - err = c.client.Post(). - Namespace(c.ns). - Resource("httproutes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(hTTPRoute). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a hTTPRoute and updates it. Returns the server's representation of the hTTPRoute, and an error, if there is any. -func (c *hTTPRoutes) Update(ctx context.Context, hTTPRoute *v1alpha2.HTTPRoute, opts v1.UpdateOptions) (result *v1alpha2.HTTPRoute, err error) { - result = &v1alpha2.HTTPRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("httproutes"). - Name(hTTPRoute.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(hTTPRoute). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *hTTPRoutes) UpdateStatus(ctx context.Context, hTTPRoute *v1alpha2.HTTPRoute, opts v1.UpdateOptions) (result *v1alpha2.HTTPRoute, err error) { - result = &v1alpha2.HTTPRoute{} - err = c.client.Put(). - Namespace(c.ns). - Resource("httproutes"). - Name(hTTPRoute.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(hTTPRoute). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the hTTPRoute and deletes it. Returns an error if one occurs. -func (c *hTTPRoutes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("httproutes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *hTTPRoutes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("httproutes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched hTTPRoute. -func (c *hTTPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.HTTPRoute, err error) { - result = &v1alpha2.HTTPRoute{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("httproutes"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/referencegrant.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/referencegrant.go index 954fb6a24..ca799f71a 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/referencegrant.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/referencegrant.go @@ -20,12 +20,15 @@ package v1alpha2 import ( "context" + json "encoding/json" + "fmt" "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) @@ -46,6 +49,7 @@ type ReferenceGrantInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ReferenceGrantList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ReferenceGrant, err error) + Apply(ctx context.Context, referenceGrant *apisv1alpha2.ReferenceGrantApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ReferenceGrant, err error) ReferenceGrantExpansion } @@ -176,3 +180,29 @@ func (c *referenceGrants) Patch(ctx context.Context, name string, pt types.Patch Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied referenceGrant. +func (c *referenceGrants) Apply(ctx context.Context, referenceGrant *apisv1alpha2.ReferenceGrantApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ReferenceGrant, err error) { + if referenceGrant == nil { + return nil, fmt.Errorf("referenceGrant provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(referenceGrant) + if err != nil { + return nil, err + } + name := referenceGrant.Name + if name == nil { + return nil, fmt.Errorf("referenceGrant.Name must be provided to Apply") + } + result = &v1alpha2.ReferenceGrant{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("referencegrants"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tcproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tcproute.go index 74423654d..ffc6fa2ee 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tcproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tcproute.go @@ -20,12 +20,15 @@ package v1alpha2 import ( "context" + json "encoding/json" + "fmt" "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) @@ -47,6 +50,8 @@ type TCPRouteInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.TCPRouteList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.TCPRoute, err error) + Apply(ctx context.Context, tCPRoute *apisv1alpha2.TCPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TCPRoute, err error) + ApplyStatus(ctx context.Context, tCPRoute *apisv1alpha2.TCPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TCPRoute, err error) TCPRouteExpansion } @@ -193,3 +198,59 @@ func (c *tCPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied tCPRoute. +func (c *tCPRoutes) Apply(ctx context.Context, tCPRoute *apisv1alpha2.TCPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TCPRoute, err error) { + if tCPRoute == nil { + return nil, fmt.Errorf("tCPRoute provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(tCPRoute) + if err != nil { + return nil, err + } + name := tCPRoute.Name + if name == nil { + return nil, fmt.Errorf("tCPRoute.Name must be provided to Apply") + } + result = &v1alpha2.TCPRoute{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("tcproutes"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *tCPRoutes) ApplyStatus(ctx context.Context, tCPRoute *apisv1alpha2.TCPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TCPRoute, err error) { + if tCPRoute == nil { + return nil, fmt.Errorf("tCPRoute provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(tCPRoute) + if err != nil { + return nil, err + } + + name := tCPRoute.Name + if name == nil { + return nil, fmt.Errorf("tCPRoute.Name must be provided to Apply") + } + + result = &v1alpha2.TCPRoute{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("tcproutes"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tlsroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tlsroute.go index 8bf9c94da..23719242f 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tlsroute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/tlsroute.go @@ -20,12 +20,15 @@ package v1alpha2 import ( "context" + json "encoding/json" + "fmt" "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) @@ -47,6 +50,8 @@ type TLSRouteInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.TLSRouteList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.TLSRoute, err error) + Apply(ctx context.Context, tLSRoute *apisv1alpha2.TLSRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TLSRoute, err error) + ApplyStatus(ctx context.Context, tLSRoute *apisv1alpha2.TLSRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TLSRoute, err error) TLSRouteExpansion } @@ -193,3 +198,59 @@ func (c *tLSRoutes) Patch(ctx context.Context, name string, pt types.PatchType, Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied tLSRoute. +func (c *tLSRoutes) Apply(ctx context.Context, tLSRoute *apisv1alpha2.TLSRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TLSRoute, err error) { + if tLSRoute == nil { + return nil, fmt.Errorf("tLSRoute provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(tLSRoute) + if err != nil { + return nil, err + } + name := tLSRoute.Name + if name == nil { + return nil, fmt.Errorf("tLSRoute.Name must be provided to Apply") + } + result = &v1alpha2.TLSRoute{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("tlsroutes"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *tLSRoutes) ApplyStatus(ctx context.Context, tLSRoute *apisv1alpha2.TLSRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.TLSRoute, err error) { + if tLSRoute == nil { + return nil, fmt.Errorf("tLSRoute provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(tLSRoute) + if err != nil { + return nil, err + } + + name := tLSRoute.Name + if name == nil { + return nil, fmt.Errorf("tLSRoute.Name must be provided to Apply") + } + + result = &v1alpha2.TLSRoute{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("tlsroutes"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/udproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/udproute.go index 1c24be37d..3217a9004 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/udproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/udproute.go @@ -20,12 +20,15 @@ package v1alpha2 import ( "context" + json "encoding/json" + "fmt" "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) @@ -47,6 +50,8 @@ type UDPRouteInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.UDPRouteList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.UDPRoute, err error) + Apply(ctx context.Context, uDPRoute *apisv1alpha2.UDPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.UDPRoute, err error) + ApplyStatus(ctx context.Context, uDPRoute *apisv1alpha2.UDPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.UDPRoute, err error) UDPRouteExpansion } @@ -193,3 +198,59 @@ func (c *uDPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied uDPRoute. +func (c *uDPRoutes) Apply(ctx context.Context, uDPRoute *apisv1alpha2.UDPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.UDPRoute, err error) { + if uDPRoute == nil { + return nil, fmt.Errorf("uDPRoute provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(uDPRoute) + if err != nil { + return nil, err + } + name := uDPRoute.Name + if name == nil { + return nil, fmt.Errorf("uDPRoute.Name must be provided to Apply") + } + result = &v1alpha2.UDPRoute{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("udproutes"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *uDPRoutes) ApplyStatus(ctx context.Context, uDPRoute *apisv1alpha2.UDPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.UDPRoute, err error) { + if uDPRoute == nil { + return nil, fmt.Errorf("uDPRoute provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(uDPRoute) + if err != nil { + return nil, err + } + + name := uDPRoute.Name + if name == nil { + return nil, fmt.Errorf("uDPRoute.Name must be provided to Apply") + } + + result = &v1alpha2.UDPRoute{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("udproutes"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/apis_client.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/apis_client.go new file mode 100644 index 000000000..cdb327c3b --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/apis_client.go @@ -0,0 +1,107 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + "net/http" + + rest "k8s.io/client-go/rest" + v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" + "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" +) + +type GatewayV1alpha3Interface interface { + RESTClient() rest.Interface + BackendTLSPoliciesGetter +} + +// GatewayV1alpha3Client is used to interact with features provided by the gateway.networking.k8s.io group. +type GatewayV1alpha3Client struct { + restClient rest.Interface +} + +func (c *GatewayV1alpha3Client) BackendTLSPolicies(namespace string) BackendTLSPolicyInterface { + return newBackendTLSPolicies(c, namespace) +} + +// NewForConfig creates a new GatewayV1alpha3Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*GatewayV1alpha3Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new GatewayV1alpha3Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*GatewayV1alpha3Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &GatewayV1alpha3Client{client}, nil +} + +// NewForConfigOrDie creates a new GatewayV1alpha3Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *GatewayV1alpha3Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new GatewayV1alpha3Client for the given RESTClient. +func New(c rest.Interface) *GatewayV1alpha3Client { + return &GatewayV1alpha3Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha3.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *GatewayV1alpha3Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendtlspolicy.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/backendtlspolicy.go similarity index 61% rename from vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendtlspolicy.go rename to vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/backendtlspolicy.go index 73b666988..aecd62b6b 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendtlspolicy.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/backendtlspolicy.go @@ -16,17 +16,20 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" + json "encoding/json" + "fmt" "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + apisv1alpha3 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3" + v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) @@ -38,15 +41,17 @@ type BackendTLSPoliciesGetter interface { // BackendTLSPolicyInterface has methods to work with BackendTLSPolicy resources. type BackendTLSPolicyInterface interface { - Create(ctx context.Context, backendTLSPolicy *v1alpha2.BackendTLSPolicy, opts v1.CreateOptions) (*v1alpha2.BackendTLSPolicy, error) - Update(ctx context.Context, backendTLSPolicy *v1alpha2.BackendTLSPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendTLSPolicy, error) - UpdateStatus(ctx context.Context, backendTLSPolicy *v1alpha2.BackendTLSPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendTLSPolicy, error) + Create(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.CreateOptions) (*v1alpha3.BackendTLSPolicy, error) + Update(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.UpdateOptions) (*v1alpha3.BackendTLSPolicy, error) + UpdateStatus(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.UpdateOptions) (*v1alpha3.BackendTLSPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.BackendTLSPolicy, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.BackendTLSPolicyList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.BackendTLSPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.BackendTLSPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendTLSPolicy, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.BackendTLSPolicy, err error) + Apply(ctx context.Context, backendTLSPolicy *apisv1alpha3.BackendTLSPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.BackendTLSPolicy, err error) + ApplyStatus(ctx context.Context, backendTLSPolicy *apisv1alpha3.BackendTLSPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.BackendTLSPolicy, err error) BackendTLSPolicyExpansion } @@ -57,7 +62,7 @@ type backendTLSPolicies struct { } // newBackendTLSPolicies returns a BackendTLSPolicies -func newBackendTLSPolicies(c *GatewayV1alpha2Client, namespace string) *backendTLSPolicies { +func newBackendTLSPolicies(c *GatewayV1alpha3Client, namespace string) *backendTLSPolicies { return &backendTLSPolicies{ client: c.RESTClient(), ns: namespace, @@ -65,8 +70,8 @@ func newBackendTLSPolicies(c *GatewayV1alpha2Client, namespace string) *backendT } // Get takes name of the backendTLSPolicy, and returns the corresponding backendTLSPolicy object, and an error if there is any. -func (c *backendTLSPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.BackendTLSPolicy, err error) { - result = &v1alpha2.BackendTLSPolicy{} +func (c *backendTLSPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.BackendTLSPolicy, err error) { + result = &v1alpha3.BackendTLSPolicy{} err = c.client.Get(). Namespace(c.ns). Resource("backendtlspolicies"). @@ -78,12 +83,12 @@ func (c *backendTLSPolicies) Get(ctx context.Context, name string, options v1.Ge } // List takes label and field selectors, and returns the list of BackendTLSPolicies that match those selectors. -func (c *backendTLSPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.BackendTLSPolicyList, err error) { +func (c *backendTLSPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.BackendTLSPolicyList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha2.BackendTLSPolicyList{} + result = &v1alpha3.BackendTLSPolicyList{} err = c.client.Get(). Namespace(c.ns). Resource("backendtlspolicies"). @@ -110,8 +115,8 @@ func (c *backendTLSPolicies) Watch(ctx context.Context, opts v1.ListOptions) (wa } // Create takes the representation of a backendTLSPolicy and creates it. Returns the server's representation of the backendTLSPolicy, and an error, if there is any. -func (c *backendTLSPolicies) Create(ctx context.Context, backendTLSPolicy *v1alpha2.BackendTLSPolicy, opts v1.CreateOptions) (result *v1alpha2.BackendTLSPolicy, err error) { - result = &v1alpha2.BackendTLSPolicy{} +func (c *backendTLSPolicies) Create(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.CreateOptions) (result *v1alpha3.BackendTLSPolicy, err error) { + result = &v1alpha3.BackendTLSPolicy{} err = c.client.Post(). Namespace(c.ns). Resource("backendtlspolicies"). @@ -123,8 +128,8 @@ func (c *backendTLSPolicies) Create(ctx context.Context, backendTLSPolicy *v1alp } // Update takes the representation of a backendTLSPolicy and updates it. Returns the server's representation of the backendTLSPolicy, and an error, if there is any. -func (c *backendTLSPolicies) Update(ctx context.Context, backendTLSPolicy *v1alpha2.BackendTLSPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendTLSPolicy, err error) { - result = &v1alpha2.BackendTLSPolicy{} +func (c *backendTLSPolicies) Update(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.UpdateOptions) (result *v1alpha3.BackendTLSPolicy, err error) { + result = &v1alpha3.BackendTLSPolicy{} err = c.client.Put(). Namespace(c.ns). Resource("backendtlspolicies"). @@ -138,8 +143,8 @@ func (c *backendTLSPolicies) Update(ctx context.Context, backendTLSPolicy *v1alp // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *backendTLSPolicies) UpdateStatus(ctx context.Context, backendTLSPolicy *v1alpha2.BackendTLSPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendTLSPolicy, err error) { - result = &v1alpha2.BackendTLSPolicy{} +func (c *backendTLSPolicies) UpdateStatus(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.UpdateOptions) (result *v1alpha3.BackendTLSPolicy, err error) { + result = &v1alpha3.BackendTLSPolicy{} err = c.client.Put(). Namespace(c.ns). Resource("backendtlspolicies"). @@ -180,8 +185,8 @@ func (c *backendTLSPolicies) DeleteCollection(ctx context.Context, opts v1.Delet } // Patch applies the patch and returns the patched backendTLSPolicy. -func (c *backendTLSPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendTLSPolicy, err error) { - result = &v1alpha2.BackendTLSPolicy{} +func (c *backendTLSPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.BackendTLSPolicy, err error) { + result = &v1alpha3.BackendTLSPolicy{} err = c.client.Patch(pt). Namespace(c.ns). Resource("backendtlspolicies"). @@ -193,3 +198,59 @@ func (c *backendTLSPolicies) Patch(ctx context.Context, name string, pt types.Pa Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied backendTLSPolicy. +func (c *backendTLSPolicies) Apply(ctx context.Context, backendTLSPolicy *apisv1alpha3.BackendTLSPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.BackendTLSPolicy, err error) { + if backendTLSPolicy == nil { + return nil, fmt.Errorf("backendTLSPolicy provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(backendTLSPolicy) + if err != nil { + return nil, err + } + name := backendTLSPolicy.Name + if name == nil { + return nil, fmt.Errorf("backendTLSPolicy.Name must be provided to Apply") + } + result = &v1alpha3.BackendTLSPolicy{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("backendtlspolicies"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *backendTLSPolicies) ApplyStatus(ctx context.Context, backendTLSPolicy *apisv1alpha3.BackendTLSPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.BackendTLSPolicy, err error) { + if backendTLSPolicy == nil { + return nil, fmt.Errorf("backendTLSPolicy provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(backendTLSPolicy) + if err != nil { + return nil, err + } + + name := backendTLSPolicy.Name + if name == nil { + return nil, fmt.Errorf("backendTLSPolicy.Name must be provided to Apply") + } + + result = &v1alpha3.BackendTLSPolicy{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("backendtlspolicies"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/doc.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/doc.go new file mode 100644 index 000000000..fdb23fd37 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha3 diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/doc.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/doc.go similarity index 88% rename from vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/doc.go rename to vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/doc.go index 41721ca52..16f443990 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/doc.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/doc.go @@ -16,5 +16,5 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -// This package has the automatically generated clientset. -package versioned +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/fake_apis_client.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/fake_apis_client.go new file mode 100644 index 000000000..76f13e27e --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/fake_apis_client.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1alpha3 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3" +) + +type FakeGatewayV1alpha3 struct { + *testing.Fake +} + +func (c *FakeGatewayV1alpha3) BackendTLSPolicies(namespace string) v1alpha3.BackendTLSPolicyInterface { + return &FakeBackendTLSPolicies{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeGatewayV1alpha3) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendtlspolicy.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/fake_backendtlspolicy.go similarity index 54% rename from vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendtlspolicy.go rename to vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/fake_backendtlspolicy.go index ad40c9e74..65ec24e63 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendtlspolicy.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/fake_backendtlspolicy.go @@ -20,40 +20,43 @@ package fake import ( "context" + json "encoding/json" + "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + apisv1alpha3 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3" + v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" ) // FakeBackendTLSPolicies implements BackendTLSPolicyInterface type FakeBackendTLSPolicies struct { - Fake *FakeGatewayV1alpha2 + Fake *FakeGatewayV1alpha3 ns string } -var backendtlspoliciesResource = v1alpha2.SchemeGroupVersion.WithResource("backendtlspolicies") +var backendtlspoliciesResource = v1alpha3.SchemeGroupVersion.WithResource("backendtlspolicies") -var backendtlspoliciesKind = v1alpha2.SchemeGroupVersion.WithKind("BackendTLSPolicy") +var backendtlspoliciesKind = v1alpha3.SchemeGroupVersion.WithKind("BackendTLSPolicy") // Get takes name of the backendTLSPolicy, and returns the corresponding backendTLSPolicy object, and an error if there is any. -func (c *FakeBackendTLSPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.BackendTLSPolicy, err error) { +func (c *FakeBackendTLSPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.BackendTLSPolicy, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(backendtlspoliciesResource, c.ns, name), &v1alpha2.BackendTLSPolicy{}) + Invokes(testing.NewGetAction(backendtlspoliciesResource, c.ns, name), &v1alpha3.BackendTLSPolicy{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.BackendTLSPolicy), err + return obj.(*v1alpha3.BackendTLSPolicy), err } // List takes label and field selectors, and returns the list of BackendTLSPolicies that match those selectors. -func (c *FakeBackendTLSPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.BackendTLSPolicyList, err error) { +func (c *FakeBackendTLSPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.BackendTLSPolicyList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(backendtlspoliciesResource, backendtlspoliciesKind, c.ns, opts), &v1alpha2.BackendTLSPolicyList{}) + Invokes(testing.NewListAction(backendtlspoliciesResource, backendtlspoliciesKind, c.ns, opts), &v1alpha3.BackendTLSPolicyList{}) if obj == nil { return nil, err @@ -63,8 +66,8 @@ func (c *FakeBackendTLSPolicies) List(ctx context.Context, opts v1.ListOptions) if label == nil { label = labels.Everything() } - list := &v1alpha2.BackendTLSPolicyList{ListMeta: obj.(*v1alpha2.BackendTLSPolicyList).ListMeta} - for _, item := range obj.(*v1alpha2.BackendTLSPolicyList).Items { + list := &v1alpha3.BackendTLSPolicyList{ListMeta: obj.(*v1alpha3.BackendTLSPolicyList).ListMeta} + for _, item := range obj.(*v1alpha3.BackendTLSPolicyList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -80,43 +83,43 @@ func (c *FakeBackendTLSPolicies) Watch(ctx context.Context, opts v1.ListOptions) } // Create takes the representation of a backendTLSPolicy and creates it. Returns the server's representation of the backendTLSPolicy, and an error, if there is any. -func (c *FakeBackendTLSPolicies) Create(ctx context.Context, backendTLSPolicy *v1alpha2.BackendTLSPolicy, opts v1.CreateOptions) (result *v1alpha2.BackendTLSPolicy, err error) { +func (c *FakeBackendTLSPolicies) Create(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.CreateOptions) (result *v1alpha3.BackendTLSPolicy, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(backendtlspoliciesResource, c.ns, backendTLSPolicy), &v1alpha2.BackendTLSPolicy{}) + Invokes(testing.NewCreateAction(backendtlspoliciesResource, c.ns, backendTLSPolicy), &v1alpha3.BackendTLSPolicy{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.BackendTLSPolicy), err + return obj.(*v1alpha3.BackendTLSPolicy), err } // Update takes the representation of a backendTLSPolicy and updates it. Returns the server's representation of the backendTLSPolicy, and an error, if there is any. -func (c *FakeBackendTLSPolicies) Update(ctx context.Context, backendTLSPolicy *v1alpha2.BackendTLSPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendTLSPolicy, err error) { +func (c *FakeBackendTLSPolicies) Update(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.UpdateOptions) (result *v1alpha3.BackendTLSPolicy, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(backendtlspoliciesResource, c.ns, backendTLSPolicy), &v1alpha2.BackendTLSPolicy{}) + Invokes(testing.NewUpdateAction(backendtlspoliciesResource, c.ns, backendTLSPolicy), &v1alpha3.BackendTLSPolicy{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.BackendTLSPolicy), err + return obj.(*v1alpha3.BackendTLSPolicy), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeBackendTLSPolicies) UpdateStatus(ctx context.Context, backendTLSPolicy *v1alpha2.BackendTLSPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendTLSPolicy, error) { +func (c *FakeBackendTLSPolicies) UpdateStatus(ctx context.Context, backendTLSPolicy *v1alpha3.BackendTLSPolicy, opts v1.UpdateOptions) (*v1alpha3.BackendTLSPolicy, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(backendtlspoliciesResource, "status", c.ns, backendTLSPolicy), &v1alpha2.BackendTLSPolicy{}) + Invokes(testing.NewUpdateSubresourceAction(backendtlspoliciesResource, "status", c.ns, backendTLSPolicy), &v1alpha3.BackendTLSPolicy{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.BackendTLSPolicy), err + return obj.(*v1alpha3.BackendTLSPolicy), err } // Delete takes name of the backendTLSPolicy and deletes it. Returns an error if one occurs. func (c *FakeBackendTLSPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(backendtlspoliciesResource, c.ns, name, opts), &v1alpha2.BackendTLSPolicy{}) + Invokes(testing.NewDeleteActionWithOptions(backendtlspoliciesResource, c.ns, name, opts), &v1alpha3.BackendTLSPolicy{}) return err } @@ -125,17 +128,62 @@ func (c *FakeBackendTLSPolicies) Delete(ctx context.Context, name string, opts v func (c *FakeBackendTLSPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionAction(backendtlspoliciesResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha2.BackendTLSPolicyList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.BackendTLSPolicyList{}) return err } // Patch applies the patch and returns the patched backendTLSPolicy. -func (c *FakeBackendTLSPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendTLSPolicy, err error) { +func (c *FakeBackendTLSPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.BackendTLSPolicy, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(backendtlspoliciesResource, c.ns, name, pt, data, subresources...), &v1alpha2.BackendTLSPolicy{}) + Invokes(testing.NewPatchSubresourceAction(backendtlspoliciesResource, c.ns, name, pt, data, subresources...), &v1alpha3.BackendTLSPolicy{}) if obj == nil { return nil, err } - return obj.(*v1alpha2.BackendTLSPolicy), err + return obj.(*v1alpha3.BackendTLSPolicy), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied backendTLSPolicy. +func (c *FakeBackendTLSPolicies) Apply(ctx context.Context, backendTLSPolicy *apisv1alpha3.BackendTLSPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.BackendTLSPolicy, err error) { + if backendTLSPolicy == nil { + return nil, fmt.Errorf("backendTLSPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(backendTLSPolicy) + if err != nil { + return nil, err + } + name := backendTLSPolicy.Name + if name == nil { + return nil, fmt.Errorf("backendTLSPolicy.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(backendtlspoliciesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha3.BackendTLSPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha3.BackendTLSPolicy), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeBackendTLSPolicies) ApplyStatus(ctx context.Context, backendTLSPolicy *apisv1alpha3.BackendTLSPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.BackendTLSPolicy, err error) { + if backendTLSPolicy == nil { + return nil, fmt.Errorf("backendTLSPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(backendTLSPolicy) + if err != nil { + return nil, err + } + name := backendTLSPolicy.Name + if name == nil { + return nil, fmt.Errorf("backendTLSPolicy.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(backendtlspoliciesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha3.BackendTLSPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha3.BackendTLSPolicy), err } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/generated_expansion.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/generated_expansion.go new file mode 100644 index 000000000..68c5693b8 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha3 + +type BackendTLSPolicyExpansion interface{} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gateway.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gateway.go index 722587f68..e591318ce 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gateway.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gateway.go @@ -20,12 +20,15 @@ package fake import ( "context" + json "encoding/json" + "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" ) @@ -139,3 +142,48 @@ func (c *FakeGateways) Patch(ctx context.Context, name string, pt types.PatchTyp } return obj.(*v1beta1.Gateway), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied gateway. +func (c *FakeGateways) Apply(ctx context.Context, gateway *apisv1beta1.GatewayApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Gateway, err error) { + if gateway == nil { + return nil, fmt.Errorf("gateway provided to Apply must not be nil") + } + data, err := json.Marshal(gateway) + if err != nil { + return nil, err + } + name := gateway.Name + if name == nil { + return nil, fmt.Errorf("gateway.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Gateway{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Gateway), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeGateways) ApplyStatus(ctx context.Context, gateway *apisv1beta1.GatewayApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Gateway, err error) { + if gateway == nil { + return nil, fmt.Errorf("gateway provided to Apply must not be nil") + } + data, err := json.Marshal(gateway) + if err != nil { + return nil, err + } + name := gateway.Name + if name == nil { + return nil, fmt.Errorf("gateway.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.Gateway{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Gateway), err +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gatewayclass.go index 7215742cb..4eb6d6a41 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gatewayclass.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gatewayclass.go @@ -20,12 +20,15 @@ package fake import ( "context" + json "encoding/json" + "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" ) @@ -130,3 +133,46 @@ func (c *FakeGatewayClasses) Patch(ctx context.Context, name string, pt types.Pa } return obj.(*v1beta1.GatewayClass), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied gatewayClass. +func (c *FakeGatewayClasses) Apply(ctx context.Context, gatewayClass *apisv1beta1.GatewayClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.GatewayClass, err error) { + if gatewayClass == nil { + return nil, fmt.Errorf("gatewayClass provided to Apply must not be nil") + } + data, err := json.Marshal(gatewayClass) + if err != nil { + return nil, err + } + name := gatewayClass.Name + if name == nil { + return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gatewayclassesResource, *name, types.ApplyPatchType, data), &v1beta1.GatewayClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.GatewayClass), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeGatewayClasses) ApplyStatus(ctx context.Context, gatewayClass *apisv1beta1.GatewayClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.GatewayClass, err error) { + if gatewayClass == nil { + return nil, fmt.Errorf("gatewayClass provided to Apply must not be nil") + } + data, err := json.Marshal(gatewayClass) + if err != nil { + return nil, err + } + name := gatewayClass.Name + if name == nil { + return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(gatewayclassesResource, *name, types.ApplyPatchType, data, "status"), &v1beta1.GatewayClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.GatewayClass), err +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_httproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_httproute.go index 93f4edf36..cae13dec8 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_httproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_httproute.go @@ -20,12 +20,15 @@ package fake import ( "context" + json "encoding/json" + "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" ) @@ -139,3 +142,48 @@ func (c *FakeHTTPRoutes) Patch(ctx context.Context, name string, pt types.PatchT } return obj.(*v1beta1.HTTPRoute), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied hTTPRoute. +func (c *FakeHTTPRoutes) Apply(ctx context.Context, hTTPRoute *apisv1beta1.HTTPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.HTTPRoute, err error) { + if hTTPRoute == nil { + return nil, fmt.Errorf("hTTPRoute provided to Apply must not be nil") + } + data, err := json.Marshal(hTTPRoute) + if err != nil { + return nil, err + } + name := hTTPRoute.Name + if name == nil { + return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(httproutesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.HTTPRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.HTTPRoute), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeHTTPRoutes) ApplyStatus(ctx context.Context, hTTPRoute *apisv1beta1.HTTPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.HTTPRoute, err error) { + if hTTPRoute == nil { + return nil, fmt.Errorf("hTTPRoute provided to Apply must not be nil") + } + data, err := json.Marshal(hTTPRoute) + if err != nil { + return nil, err + } + name := hTTPRoute.Name + if name == nil { + return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(httproutesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.HTTPRoute{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.HTTPRoute), err +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_referencegrant.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_referencegrant.go index c103c1c10..d6e31e827 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_referencegrant.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_referencegrant.go @@ -20,12 +20,15 @@ package fake import ( "context" + json "encoding/json" + "fmt" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" + apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" ) @@ -127,3 +130,25 @@ func (c *FakeReferenceGrants) Patch(ctx context.Context, name string, pt types.P } return obj.(*v1beta1.ReferenceGrant), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied referenceGrant. +func (c *FakeReferenceGrants) Apply(ctx context.Context, referenceGrant *apisv1beta1.ReferenceGrantApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReferenceGrant, err error) { + if referenceGrant == nil { + return nil, fmt.Errorf("referenceGrant provided to Apply must not be nil") + } + data, err := json.Marshal(referenceGrant) + if err != nil { + return nil, err + } + name := referenceGrant.Name + if name == nil { + return nil, fmt.Errorf("referenceGrant.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(referencegrantsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.ReferenceGrant{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ReferenceGrant), err +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gateway.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gateway.go index a9dc05263..ad54bccd5 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gateway.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gateway.go @@ -20,12 +20,15 @@ package v1beta1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) @@ -47,6 +50,8 @@ type GatewayInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1beta1.GatewayList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Gateway, err error) + Apply(ctx context.Context, gateway *apisv1beta1.GatewayApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Gateway, err error) + ApplyStatus(ctx context.Context, gateway *apisv1beta1.GatewayApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Gateway, err error) GatewayExpansion } @@ -193,3 +198,59 @@ func (c *gateways) Patch(ctx context.Context, name string, pt types.PatchType, d Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied gateway. +func (c *gateways) Apply(ctx context.Context, gateway *apisv1beta1.GatewayApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Gateway, err error) { + if gateway == nil { + return nil, fmt.Errorf("gateway provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gateway) + if err != nil { + return nil, err + } + name := gateway.Name + if name == nil { + return nil, fmt.Errorf("gateway.Name must be provided to Apply") + } + result = &v1beta1.Gateway{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("gateways"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *gateways) ApplyStatus(ctx context.Context, gateway *apisv1beta1.GatewayApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Gateway, err error) { + if gateway == nil { + return nil, fmt.Errorf("gateway provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gateway) + if err != nil { + return nil, err + } + + name := gateway.Name + if name == nil { + return nil, fmt.Errorf("gateway.Name must be provided to Apply") + } + + result = &v1beta1.Gateway{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("gateways"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gatewayclass.go index c47559463..45bd5fcad 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gatewayclass.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/gatewayclass.go @@ -20,12 +20,15 @@ package v1beta1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) @@ -47,6 +50,8 @@ type GatewayClassInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1beta1.GatewayClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.GatewayClass, err error) + Apply(ctx context.Context, gatewayClass *apisv1beta1.GatewayClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.GatewayClass, err error) + ApplyStatus(ctx context.Context, gatewayClass *apisv1beta1.GatewayClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.GatewayClass, err error) GatewayClassExpansion } @@ -182,3 +187,57 @@ func (c *gatewayClasses) Patch(ctx context.Context, name string, pt types.PatchT Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied gatewayClass. +func (c *gatewayClasses) Apply(ctx context.Context, gatewayClass *apisv1beta1.GatewayClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.GatewayClass, err error) { + if gatewayClass == nil { + return nil, fmt.Errorf("gatewayClass provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gatewayClass) + if err != nil { + return nil, err + } + name := gatewayClass.Name + if name == nil { + return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") + } + result = &v1beta1.GatewayClass{} + err = c.client.Patch(types.ApplyPatchType). + Resource("gatewayclasses"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *gatewayClasses) ApplyStatus(ctx context.Context, gatewayClass *apisv1beta1.GatewayClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.GatewayClass, err error) { + if gatewayClass == nil { + return nil, fmt.Errorf("gatewayClass provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(gatewayClass) + if err != nil { + return nil, err + } + + name := gatewayClass.Name + if name == nil { + return nil, fmt.Errorf("gatewayClass.Name must be provided to Apply") + } + + result = &v1beta1.GatewayClass{} + err = c.client.Patch(types.ApplyPatchType). + Resource("gatewayclasses"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/httproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/httproute.go index 219ae7c97..a85262dca 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/httproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/httproute.go @@ -20,12 +20,15 @@ package v1beta1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) @@ -47,6 +50,8 @@ type HTTPRouteInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1beta1.HTTPRouteList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.HTTPRoute, err error) + Apply(ctx context.Context, hTTPRoute *apisv1beta1.HTTPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.HTTPRoute, err error) + ApplyStatus(ctx context.Context, hTTPRoute *apisv1beta1.HTTPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.HTTPRoute, err error) HTTPRouteExpansion } @@ -193,3 +198,59 @@ func (c *hTTPRoutes) Patch(ctx context.Context, name string, pt types.PatchType, Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied hTTPRoute. +func (c *hTTPRoutes) Apply(ctx context.Context, hTTPRoute *apisv1beta1.HTTPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.HTTPRoute, err error) { + if hTTPRoute == nil { + return nil, fmt.Errorf("hTTPRoute provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(hTTPRoute) + if err != nil { + return nil, err + } + name := hTTPRoute.Name + if name == nil { + return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") + } + result = &v1beta1.HTTPRoute{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("httproutes"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *hTTPRoutes) ApplyStatus(ctx context.Context, hTTPRoute *apisv1beta1.HTTPRouteApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.HTTPRoute, err error) { + if hTTPRoute == nil { + return nil, fmt.Errorf("hTTPRoute provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(hTTPRoute) + if err != nil { + return nil, err + } + + name := hTTPRoute.Name + if name == nil { + return nil, fmt.Errorf("hTTPRoute.Name must be provided to Apply") + } + + result = &v1beta1.HTTPRoute{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("httproutes"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/referencegrant.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/referencegrant.go index 63b29e90f..575bbd4c0 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/referencegrant.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/referencegrant.go @@ -20,12 +20,15 @@ package v1beta1 import ( "context" + json "encoding/json" + "fmt" "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" + apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) @@ -46,6 +49,7 @@ type ReferenceGrantInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ReferenceGrantList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ReferenceGrant, err error) + Apply(ctx context.Context, referenceGrant *apisv1beta1.ReferenceGrantApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReferenceGrant, err error) ReferenceGrantExpansion } @@ -176,3 +180,29 @@ func (c *referenceGrants) Patch(ctx context.Context, name string, pt types.Patch Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied referenceGrant. +func (c *referenceGrants) Apply(ctx context.Context, referenceGrant *apisv1beta1.ReferenceGrantApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReferenceGrant, err error) { + if referenceGrant == nil { + return nil, fmt.Errorf("referenceGrant provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(referenceGrant) + if err != nil { + return nil, err + } + name := referenceGrant.Name + if name == nil { + return nil, fmt.Errorf("referenceGrant.Name must be provided to Apply") + } + result = &v1beta1.ReferenceGrant{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("referencegrants"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/interface.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/interface.go index 05de6bbe3..ec6d9155d 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/interface.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/interface.go @@ -21,6 +21,7 @@ package apis import ( v1 "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1" v1alpha2 "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2" + v1alpha3 "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha3" v1beta1 "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1beta1" internalinterfaces "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/internalinterfaces" ) @@ -29,6 +30,8 @@ import ( type Interface interface { // V1alpha2 provides access to shared informers for resources in V1alpha2. V1alpha2() v1alpha2.Interface + // V1alpha3 provides access to shared informers for resources in V1alpha3. + V1alpha3() v1alpha3.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface // V1 provides access to shared informers for resources in V1. @@ -51,6 +54,11 @@ func (g *group) V1alpha2() v1alpha2.Interface { return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) } +// V1alpha3 returns a new v1alpha3.Interface. +func (g *group) V1alpha3() v1alpha3.Interface { + return v1alpha3.New(g.factory, g.namespace, g.tweakListOptions) +} + // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/httproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1/grpcroute.go similarity index 60% rename from vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/httproute.go rename to vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1/grpcroute.go index c18c7f874..f27004eb7 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/httproute.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1/grpcroute.go @@ -16,75 +16,75 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1 import ( "context" time "time" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + apisv1 "sigs.k8s.io/gateway-api/apis/v1" versioned "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned" internalinterfaces "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/internalinterfaces" - v1alpha2 "sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2" + v1 "sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1" ) -// HTTPRouteInformer provides access to a shared informer and lister for -// HTTPRoutes. -type HTTPRouteInformer interface { +// GRPCRouteInformer provides access to a shared informer and lister for +// GRPCRoutes. +type GRPCRouteInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.HTTPRouteLister + Lister() v1.GRPCRouteLister } -type hTTPRouteInformer struct { +type gRPCRouteInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } -// NewHTTPRouteInformer constructs a new informer for HTTPRoute type. +// NewGRPCRouteInformer constructs a new informer for GRPCRoute 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 NewHTTPRouteInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredHTTPRouteInformer(client, namespace, resyncPeriod, indexers, nil) +func NewGRPCRouteInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredGRPCRouteInformer(client, namespace, resyncPeriod, indexers, nil) } -// NewFilteredHTTPRouteInformer constructs a new informer for HTTPRoute type. +// NewFilteredGRPCRouteInformer constructs a new informer for GRPCRoute 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 NewFilteredHTTPRouteInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredGRPCRouteInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.GatewayV1alpha2().HTTPRoutes(namespace).List(context.TODO(), options) + return client.GatewayV1().GRPCRoutes(namespace).List(context.TODO(), options) }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.GatewayV1alpha2().HTTPRoutes(namespace).Watch(context.TODO(), options) + return client.GatewayV1().GRPCRoutes(namespace).Watch(context.TODO(), options) }, }, - &apisv1alpha2.HTTPRoute{}, + &apisv1.GRPCRoute{}, resyncPeriod, indexers, ) } -func (f *hTTPRouteInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredHTTPRouteInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *gRPCRouteInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredGRPCRouteInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *hTTPRouteInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisv1alpha2.HTTPRoute{}, f.defaultInformer) +func (f *gRPCRouteInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apisv1.GRPCRoute{}, f.defaultInformer) } -func (f *hTTPRouteInformer) Lister() v1alpha2.HTTPRouteLister { - return v1alpha2.NewHTTPRouteLister(f.Informer().GetIndexer()) +func (f *gRPCRouteInformer) Lister() v1.GRPCRouteLister { + return v1.NewGRPCRouteLister(f.Informer().GetIndexer()) } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1/interface.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1/interface.go index 74c823c19..18666f971 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1/interface.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1/interface.go @@ -24,6 +24,8 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // GRPCRoutes returns a GRPCRouteInformer. + GRPCRoutes() GRPCRouteInformer // Gateways returns a GatewayInformer. Gateways() GatewayInformer // GatewayClasses returns a GatewayClassInformer. @@ -43,6 +45,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// GRPCRoutes returns a GRPCRouteInformer. +func (v *version) GRPCRoutes() GRPCRouteInformer { + return &gRPCRouteInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + // Gateways returns a GatewayInformer. func (v *version) Gateways() GatewayInformer { return &gatewayInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/gateway.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/backendlbpolicy.go similarity index 56% rename from vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/gateway.go rename to vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/backendlbpolicy.go index b955bb3c3..e5cdbe7cb 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/gateway.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/backendlbpolicy.go @@ -32,59 +32,59 @@ import ( v1alpha2 "sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2" ) -// GatewayInformer provides access to a shared informer and lister for -// Gateways. -type GatewayInformer interface { +// BackendLBPolicyInformer provides access to a shared informer and lister for +// BackendLBPolicies. +type BackendLBPolicyInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.GatewayLister + Lister() v1alpha2.BackendLBPolicyLister } -type gatewayInformer struct { +type backendLBPolicyInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } -// NewGatewayInformer constructs a new informer for Gateway type. +// NewBackendLBPolicyInformer constructs a new informer for BackendLBPolicy 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 NewGatewayInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredGatewayInformer(client, namespace, resyncPeriod, indexers, nil) +func NewBackendLBPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBackendLBPolicyInformer(client, namespace, resyncPeriod, indexers, nil) } -// NewFilteredGatewayInformer constructs a new informer for Gateway type. +// NewFilteredBackendLBPolicyInformer constructs a new informer for BackendLBPolicy 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 NewFilteredGatewayInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredBackendLBPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.GatewayV1alpha2().Gateways(namespace).List(context.TODO(), options) + return client.GatewayV1alpha2().BackendLBPolicies(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.GatewayV1alpha2().Gateways(namespace).Watch(context.TODO(), options) + return client.GatewayV1alpha2().BackendLBPolicies(namespace).Watch(context.TODO(), options) }, }, - &apisv1alpha2.Gateway{}, + &apisv1alpha2.BackendLBPolicy{}, resyncPeriod, indexers, ) } -func (f *gatewayInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredGatewayInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *backendLBPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBackendLBPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *gatewayInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisv1alpha2.Gateway{}, f.defaultInformer) +func (f *backendLBPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apisv1alpha2.BackendLBPolicy{}, f.defaultInformer) } -func (f *gatewayInformer) Lister() v1alpha2.GatewayLister { - return v1alpha2.NewGatewayLister(f.Informer().GetIndexer()) +func (f *backendLBPolicyInformer) Lister() v1alpha2.BackendLBPolicyLister { + return v1alpha2.NewBackendLBPolicyLister(f.Informer().GetIndexer()) } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/gatewayclass.go deleted file mode 100644 index 5dd0933ca..000000000 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/gatewayclass.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "context" - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" - apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" - versioned "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned" - internalinterfaces "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/internalinterfaces" - v1alpha2 "sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2" -) - -// GatewayClassInformer provides access to a shared informer and lister for -// GatewayClasses. -type GatewayClassInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha2.GatewayClassLister -} - -type gatewayClassInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewGatewayClassInformer constructs a new informer for GatewayClass 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 NewGatewayClassInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredGatewayClassInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredGatewayClassInformer constructs a new informer for GatewayClass 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 NewFilteredGatewayClassInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GatewayV1alpha2().GatewayClasses().List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GatewayV1alpha2().GatewayClasses().Watch(context.TODO(), options) - }, - }, - &apisv1alpha2.GatewayClass{}, - resyncPeriod, - indexers, - ) -} - -func (f *gatewayClassInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredGatewayClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *gatewayClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisv1alpha2.GatewayClass{}, f.defaultInformer) -} - -func (f *gatewayClassInformer) Lister() v1alpha2.GatewayClassLister { - return v1alpha2.NewGatewayClassLister(f.Informer().GetIndexer()) -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/interface.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/interface.go index 92c95f65f..8f21c3d8e 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/interface.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/interface.go @@ -24,16 +24,10 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { - // BackendTLSPolicies returns a BackendTLSPolicyInformer. - BackendTLSPolicies() BackendTLSPolicyInformer + // BackendLBPolicies returns a BackendLBPolicyInformer. + BackendLBPolicies() BackendLBPolicyInformer // GRPCRoutes returns a GRPCRouteInformer. GRPCRoutes() GRPCRouteInformer - // Gateways returns a GatewayInformer. - Gateways() GatewayInformer - // GatewayClasses returns a GatewayClassInformer. - GatewayClasses() GatewayClassInformer - // HTTPRoutes returns a HTTPRouteInformer. - HTTPRoutes() HTTPRouteInformer // ReferenceGrants returns a ReferenceGrantInformer. ReferenceGrants() ReferenceGrantInformer // TCPRoutes returns a TCPRouteInformer. @@ -55,9 +49,9 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// BackendTLSPolicies returns a BackendTLSPolicyInformer. -func (v *version) BackendTLSPolicies() BackendTLSPolicyInformer { - return &backendTLSPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +// BackendLBPolicies returns a BackendLBPolicyInformer. +func (v *version) BackendLBPolicies() BackendLBPolicyInformer { + return &backendLBPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // GRPCRoutes returns a GRPCRouteInformer. @@ -65,21 +59,6 @@ func (v *version) GRPCRoutes() GRPCRouteInformer { return &gRPCRouteInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Gateways returns a GatewayInformer. -func (v *version) Gateways() GatewayInformer { - return &gatewayInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - -// GatewayClasses returns a GatewayClassInformer. -func (v *version) GatewayClasses() GatewayClassInformer { - return &gatewayClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// HTTPRoutes returns a HTTPRouteInformer. -func (v *version) HTTPRoutes() HTTPRouteInformer { - return &hTTPRouteInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // ReferenceGrants returns a ReferenceGrantInformer. func (v *version) ReferenceGrants() ReferenceGrantInformer { return &referenceGrantInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/backendtlspolicy.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha3/backendtlspolicy.go similarity index 85% rename from vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/backendtlspolicy.go rename to vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha3/backendtlspolicy.go index 2e1ac1aa7..927db8da4 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha2/backendtlspolicy.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha3/backendtlspolicy.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" @@ -26,17 +26,17 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + apisv1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" versioned "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned" internalinterfaces "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/internalinterfaces" - v1alpha2 "sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2" + v1alpha3 "sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha3" ) // BackendTLSPolicyInformer provides access to a shared informer and lister for // BackendTLSPolicies. type BackendTLSPolicyInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.BackendTLSPolicyLister + Lister() v1alpha3.BackendTLSPolicyLister } type backendTLSPolicyInformer struct { @@ -62,16 +62,16 @@ func NewFilteredBackendTLSPolicyInformer(client versioned.Interface, namespace s if tweakListOptions != nil { tweakListOptions(&options) } - return client.GatewayV1alpha2().BackendTLSPolicies(namespace).List(context.TODO(), options) + return client.GatewayV1alpha3().BackendTLSPolicies(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.GatewayV1alpha2().BackendTLSPolicies(namespace).Watch(context.TODO(), options) + return client.GatewayV1alpha3().BackendTLSPolicies(namespace).Watch(context.TODO(), options) }, }, - &apisv1alpha2.BackendTLSPolicy{}, + &apisv1alpha3.BackendTLSPolicy{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *backendTLSPolicyInformer) defaultInformer(client versioned.Interface, r } func (f *backendTLSPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisv1alpha2.BackendTLSPolicy{}, f.defaultInformer) + return f.factory.InformerFor(&apisv1alpha3.BackendTLSPolicy{}, f.defaultInformer) } -func (f *backendTLSPolicyInformer) Lister() v1alpha2.BackendTLSPolicyLister { - return v1alpha2.NewBackendTLSPolicyLister(f.Informer().GetIndexer()) +func (f *backendTLSPolicyInformer) Lister() v1alpha3.BackendTLSPolicyLister { + return v1alpha3.NewBackendTLSPolicyLister(f.Informer().GetIndexer()) } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha3/interface.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha3/interface.go new file mode 100644 index 000000000..468614d4f --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1alpha3/interface.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + internalinterfaces "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // BackendTLSPolicies returns a BackendTLSPolicyInformer. + BackendTLSPolicies() BackendTLSPolicyInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// BackendTLSPolicies returns a BackendTLSPolicyInformer. +func (v *version) BackendTLSPolicies() BackendTLSPolicyInformer { + return &backendTLSPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/factory.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/factory.go index f4479aa10..e7f08e89f 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/factory.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/factory.go @@ -42,6 +42,7 @@ type sharedInformerFactory struct { lock sync.Mutex defaultResync time.Duration customResync map[reflect.Type]time.Duration + transform cache.TransformFunc informers map[reflect.Type]cache.SharedIndexInformer // startedInformers is used for tracking which informers have been started. @@ -80,6 +81,14 @@ func WithNamespace(namespace string) SharedInformerOption { } } +// WithTransform sets a transform on all informers. +func WithTransform(transform cache.TransformFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.transform = transform + return factory + } +} + // NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync) @@ -184,6 +193,7 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal } informer = newFunc(f.client, resyncPeriod) + informer.SetTransform(f.transform) f.informers[informerType] = informer return informer diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/generic.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/generic.go index 20f69bf8f..283d2475b 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/generic.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/generic.go @@ -25,6 +25,7 @@ import ( cache "k8s.io/client-go/tools/cache" v1 "sigs.k8s.io/gateway-api/apis/v1" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" ) @@ -55,6 +56,8 @@ func (f *genericInformer) Lister() cache.GenericLister { func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { // Group=gateway.networking.k8s.io, Version=v1 + case v1.SchemeGroupVersion.WithResource("grpcroutes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1().GRPCRoutes().Informer()}, nil case v1.SchemeGroupVersion.WithResource("gateways"): return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1().Gateways().Informer()}, nil case v1.SchemeGroupVersion.WithResource("gatewayclasses"): @@ -63,16 +66,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1().HTTPRoutes().Informer()}, nil // Group=gateway.networking.k8s.io, Version=v1alpha2 - case v1alpha2.SchemeGroupVersion.WithResource("backendtlspolicies"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().BackendTLSPolicies().Informer()}, nil + case v1alpha2.SchemeGroupVersion.WithResource("backendlbpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().BackendLBPolicies().Informer()}, nil case v1alpha2.SchemeGroupVersion.WithResource("grpcroutes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().GRPCRoutes().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("gateways"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().Gateways().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("gatewayclasses"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().GatewayClasses().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("httproutes"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().HTTPRoutes().Informer()}, nil case v1alpha2.SchemeGroupVersion.WithResource("referencegrants"): return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().ReferenceGrants().Informer()}, nil case v1alpha2.SchemeGroupVersion.WithResource("tcproutes"): @@ -82,6 +79,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case v1alpha2.SchemeGroupVersion.WithResource("udproutes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().UDPRoutes().Informer()}, nil + // Group=gateway.networking.k8s.io, Version=v1alpha3 + case v1alpha3.SchemeGroupVersion.WithResource("backendtlspolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha3().BackendTLSPolicies().Informer()}, nil + // Group=gateway.networking.k8s.io, Version=v1beta1 case v1beta1.SchemeGroupVersion.WithResource("gateways"): return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1beta1().Gateways().Informer()}, nil diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/expansion_generated.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/expansion_generated.go index 910136e21..4324e2551 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/expansion_generated.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/expansion_generated.go @@ -18,6 +18,14 @@ limitations under the License. package v1 +// GRPCRouteListerExpansion allows custom methods to be added to +// GRPCRouteLister. +type GRPCRouteListerExpansion interface{} + +// GRPCRouteNamespaceListerExpansion allows custom methods to be added to +// GRPCRouteNamespaceLister. +type GRPCRouteNamespaceListerExpansion interface{} + // GatewayListerExpansion allows custom methods to be added to // GatewayLister. type GatewayListerExpansion interface{} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/grpcroute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/grpcroute.go new file mode 100644 index 000000000..5859b59a1 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1/grpcroute.go @@ -0,0 +1,99 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// GRPCRouteLister helps list GRPCRoutes. +// All objects returned here must be treated as read-only. +type GRPCRouteLister interface { + // List lists all GRPCRoutes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GRPCRoute, err error) + // GRPCRoutes returns an object that can list and get GRPCRoutes. + GRPCRoutes(namespace string) GRPCRouteNamespaceLister + GRPCRouteListerExpansion +} + +// gRPCRouteLister implements the GRPCRouteLister interface. +type gRPCRouteLister struct { + indexer cache.Indexer +} + +// NewGRPCRouteLister returns a new GRPCRouteLister. +func NewGRPCRouteLister(indexer cache.Indexer) GRPCRouteLister { + return &gRPCRouteLister{indexer: indexer} +} + +// List lists all GRPCRoutes in the indexer. +func (s *gRPCRouteLister) List(selector labels.Selector) (ret []*v1.GRPCRoute, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GRPCRoute)) + }) + return ret, err +} + +// GRPCRoutes returns an object that can list and get GRPCRoutes. +func (s *gRPCRouteLister) GRPCRoutes(namespace string) GRPCRouteNamespaceLister { + return gRPCRouteNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// GRPCRouteNamespaceLister helps list and get GRPCRoutes. +// All objects returned here must be treated as read-only. +type GRPCRouteNamespaceLister interface { + // List lists all GRPCRoutes in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.GRPCRoute, err error) + // Get retrieves the GRPCRoute from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.GRPCRoute, error) + GRPCRouteNamespaceListerExpansion +} + +// gRPCRouteNamespaceLister implements the GRPCRouteNamespaceLister +// interface. +type gRPCRouteNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all GRPCRoutes in the indexer for a given namespace. +func (s gRPCRouteNamespaceLister) List(selector labels.Selector) (ret []*v1.GRPCRoute, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.GRPCRoute)) + }) + return ret, err +} + +// Get retrieves the GRPCRoute from the indexer for a given namespace and name. +func (s gRPCRouteNamespaceLister) Get(name string) (*v1.GRPCRoute, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("grpcroute"), name) + } + return obj.(*v1.GRPCRoute), nil +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/backendlbpolicy.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/backendlbpolicy.go new file mode 100644 index 000000000..1b01f4ec3 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/backendlbpolicy.go @@ -0,0 +1,99 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +) + +// BackendLBPolicyLister helps list BackendLBPolicies. +// All objects returned here must be treated as read-only. +type BackendLBPolicyLister interface { + // List lists all BackendLBPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha2.BackendLBPolicy, err error) + // BackendLBPolicies returns an object that can list and get BackendLBPolicies. + BackendLBPolicies(namespace string) BackendLBPolicyNamespaceLister + BackendLBPolicyListerExpansion +} + +// backendLBPolicyLister implements the BackendLBPolicyLister interface. +type backendLBPolicyLister struct { + indexer cache.Indexer +} + +// NewBackendLBPolicyLister returns a new BackendLBPolicyLister. +func NewBackendLBPolicyLister(indexer cache.Indexer) BackendLBPolicyLister { + return &backendLBPolicyLister{indexer: indexer} +} + +// List lists all BackendLBPolicies in the indexer. +func (s *backendLBPolicyLister) List(selector labels.Selector) (ret []*v1alpha2.BackendLBPolicy, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha2.BackendLBPolicy)) + }) + return ret, err +} + +// BackendLBPolicies returns an object that can list and get BackendLBPolicies. +func (s *backendLBPolicyLister) BackendLBPolicies(namespace string) BackendLBPolicyNamespaceLister { + return backendLBPolicyNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// BackendLBPolicyNamespaceLister helps list and get BackendLBPolicies. +// All objects returned here must be treated as read-only. +type BackendLBPolicyNamespaceLister interface { + // List lists all BackendLBPolicies in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha2.BackendLBPolicy, err error) + // Get retrieves the BackendLBPolicy from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha2.BackendLBPolicy, error) + BackendLBPolicyNamespaceListerExpansion +} + +// backendLBPolicyNamespaceLister implements the BackendLBPolicyNamespaceLister +// interface. +type backendLBPolicyNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all BackendLBPolicies in the indexer for a given namespace. +func (s backendLBPolicyNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.BackendLBPolicy, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha2.BackendLBPolicy)) + }) + return ret, err +} + +// Get retrieves the BackendLBPolicy from the indexer for a given namespace and name. +func (s backendLBPolicyNamespaceLister) Get(name string) (*v1alpha2.BackendLBPolicy, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha2.Resource("backendlbpolicy"), name) + } + return obj.(*v1alpha2.BackendLBPolicy), nil +} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/expansion_generated.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/expansion_generated.go index b2d81f338..d311d4915 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/expansion_generated.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/expansion_generated.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha2 -// BackendTLSPolicyListerExpansion allows custom methods to be added to -// BackendTLSPolicyLister. -type BackendTLSPolicyListerExpansion interface{} +// BackendLBPolicyListerExpansion allows custom methods to be added to +// BackendLBPolicyLister. +type BackendLBPolicyListerExpansion interface{} -// BackendTLSPolicyNamespaceListerExpansion allows custom methods to be added to -// BackendTLSPolicyNamespaceLister. -type BackendTLSPolicyNamespaceListerExpansion interface{} +// BackendLBPolicyNamespaceListerExpansion allows custom methods to be added to +// BackendLBPolicyNamespaceLister. +type BackendLBPolicyNamespaceListerExpansion interface{} // GRPCRouteListerExpansion allows custom methods to be added to // GRPCRouteLister. @@ -34,26 +34,6 @@ type GRPCRouteListerExpansion interface{} // GRPCRouteNamespaceLister. type GRPCRouteNamespaceListerExpansion interface{} -// GatewayListerExpansion allows custom methods to be added to -// GatewayLister. -type GatewayListerExpansion interface{} - -// GatewayNamespaceListerExpansion allows custom methods to be added to -// GatewayNamespaceLister. -type GatewayNamespaceListerExpansion interface{} - -// GatewayClassListerExpansion allows custom methods to be added to -// GatewayClassLister. -type GatewayClassListerExpansion interface{} - -// HTTPRouteListerExpansion allows custom methods to be added to -// HTTPRouteLister. -type HTTPRouteListerExpansion interface{} - -// HTTPRouteNamespaceListerExpansion allows custom methods to be added to -// HTTPRouteNamespaceLister. -type HTTPRouteNamespaceListerExpansion interface{} - // ReferenceGrantListerExpansion allows custom methods to be added to // ReferenceGrantLister. type ReferenceGrantListerExpansion interface{} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/gateway.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/gateway.go deleted file mode 100644 index 7c0d392b8..000000000 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/gateway.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" -) - -// GatewayLister helps list Gateways. -// All objects returned here must be treated as read-only. -type GatewayLister interface { - // List lists all Gateways in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.Gateway, err error) - // Gateways returns an object that can list and get Gateways. - Gateways(namespace string) GatewayNamespaceLister - GatewayListerExpansion -} - -// gatewayLister implements the GatewayLister interface. -type gatewayLister struct { - indexer cache.Indexer -} - -// NewGatewayLister returns a new GatewayLister. -func NewGatewayLister(indexer cache.Indexer) GatewayLister { - return &gatewayLister{indexer: indexer} -} - -// List lists all Gateways in the indexer. -func (s *gatewayLister) List(selector labels.Selector) (ret []*v1alpha2.Gateway, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.Gateway)) - }) - return ret, err -} - -// Gateways returns an object that can list and get Gateways. -func (s *gatewayLister) Gateways(namespace string) GatewayNamespaceLister { - return gatewayNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// GatewayNamespaceLister helps list and get Gateways. -// All objects returned here must be treated as read-only. -type GatewayNamespaceLister interface { - // List lists all Gateways in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.Gateway, err error) - // Get retrieves the Gateway from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.Gateway, error) - GatewayNamespaceListerExpansion -} - -// gatewayNamespaceLister implements the GatewayNamespaceLister -// interface. -type gatewayNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Gateways in the indexer for a given namespace. -func (s gatewayNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.Gateway, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.Gateway)) - }) - return ret, err -} - -// Get retrieves the Gateway from the indexer for a given namespace and name. -func (s gatewayNamespaceLister) Get(name string) (*v1alpha2.Gateway, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("gateway"), name) - } - return obj.(*v1alpha2.Gateway), nil -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/gatewayclass.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/gatewayclass.go deleted file mode 100644 index cbb655dc4..000000000 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/gatewayclass.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" -) - -// GatewayClassLister helps list GatewayClasses. -// All objects returned here must be treated as read-only. -type GatewayClassLister interface { - // List lists all GatewayClasses in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.GatewayClass, err error) - // Get retrieves the GatewayClass from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.GatewayClass, error) - GatewayClassListerExpansion -} - -// gatewayClassLister implements the GatewayClassLister interface. -type gatewayClassLister struct { - indexer cache.Indexer -} - -// NewGatewayClassLister returns a new GatewayClassLister. -func NewGatewayClassLister(indexer cache.Indexer) GatewayClassLister { - return &gatewayClassLister{indexer: indexer} -} - -// List lists all GatewayClasses in the indexer. -func (s *gatewayClassLister) List(selector labels.Selector) (ret []*v1alpha2.GatewayClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.GatewayClass)) - }) - return ret, err -} - -// Get retrieves the GatewayClass from the index for a given name. -func (s *gatewayClassLister) Get(name string) (*v1alpha2.GatewayClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("gatewayclass"), name) - } - return obj.(*v1alpha2.GatewayClass), nil -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/httproute.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/httproute.go deleted file mode 100644 index eea392d5d..000000000 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/httproute.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" -) - -// HTTPRouteLister helps list HTTPRoutes. -// All objects returned here must be treated as read-only. -type HTTPRouteLister interface { - // List lists all HTTPRoutes in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.HTTPRoute, err error) - // HTTPRoutes returns an object that can list and get HTTPRoutes. - HTTPRoutes(namespace string) HTTPRouteNamespaceLister - HTTPRouteListerExpansion -} - -// hTTPRouteLister implements the HTTPRouteLister interface. -type hTTPRouteLister struct { - indexer cache.Indexer -} - -// NewHTTPRouteLister returns a new HTTPRouteLister. -func NewHTTPRouteLister(indexer cache.Indexer) HTTPRouteLister { - return &hTTPRouteLister{indexer: indexer} -} - -// List lists all HTTPRoutes in the indexer. -func (s *hTTPRouteLister) List(selector labels.Selector) (ret []*v1alpha2.HTTPRoute, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.HTTPRoute)) - }) - return ret, err -} - -// HTTPRoutes returns an object that can list and get HTTPRoutes. -func (s *hTTPRouteLister) HTTPRoutes(namespace string) HTTPRouteNamespaceLister { - return hTTPRouteNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// HTTPRouteNamespaceLister helps list and get HTTPRoutes. -// All objects returned here must be treated as read-only. -type HTTPRouteNamespaceLister interface { - // List lists all HTTPRoutes in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.HTTPRoute, err error) - // Get retrieves the HTTPRoute from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.HTTPRoute, error) - HTTPRouteNamespaceListerExpansion -} - -// hTTPRouteNamespaceLister implements the HTTPRouteNamespaceLister -// interface. -type hTTPRouteNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all HTTPRoutes in the indexer for a given namespace. -func (s hTTPRouteNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.HTTPRoute, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.HTTPRoute)) - }) - return ret, err -} - -// Get retrieves the HTTPRoute from the indexer for a given namespace and name. -func (s hTTPRouteNamespaceLister) Get(name string) (*v1alpha2.HTTPRoute, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("httproute"), name) - } - return obj.(*v1alpha2.HTTPRoute), nil -} diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/backendtlspolicy.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha3/backendtlspolicy.go similarity index 84% rename from vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/backendtlspolicy.go rename to vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha3/backendtlspolicy.go index f5927ef19..56ea81737 100644 --- a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2/backendtlspolicy.go +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha3/backendtlspolicy.go @@ -16,13 +16,13 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" ) // BackendTLSPolicyLister helps list BackendTLSPolicies. @@ -30,7 +30,7 @@ import ( type BackendTLSPolicyLister interface { // List lists all BackendTLSPolicies in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.BackendTLSPolicy, err error) + List(selector labels.Selector) (ret []*v1alpha3.BackendTLSPolicy, err error) // BackendTLSPolicies returns an object that can list and get BackendTLSPolicies. BackendTLSPolicies(namespace string) BackendTLSPolicyNamespaceLister BackendTLSPolicyListerExpansion @@ -47,9 +47,9 @@ func NewBackendTLSPolicyLister(indexer cache.Indexer) BackendTLSPolicyLister { } // List lists all BackendTLSPolicies in the indexer. -func (s *backendTLSPolicyLister) List(selector labels.Selector) (ret []*v1alpha2.BackendTLSPolicy, err error) { +func (s *backendTLSPolicyLister) List(selector labels.Selector) (ret []*v1alpha3.BackendTLSPolicy, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.BackendTLSPolicy)) + ret = append(ret, m.(*v1alpha3.BackendTLSPolicy)) }) return ret, err } @@ -64,10 +64,10 @@ func (s *backendTLSPolicyLister) BackendTLSPolicies(namespace string) BackendTLS type BackendTLSPolicyNamespaceLister interface { // List lists all BackendTLSPolicies in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.BackendTLSPolicy, err error) + List(selector labels.Selector) (ret []*v1alpha3.BackendTLSPolicy, err error) // Get retrieves the BackendTLSPolicy from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.BackendTLSPolicy, error) + Get(name string) (*v1alpha3.BackendTLSPolicy, error) BackendTLSPolicyNamespaceListerExpansion } @@ -79,21 +79,21 @@ type backendTLSPolicyNamespaceLister struct { } // List lists all BackendTLSPolicies in the indexer for a given namespace. -func (s backendTLSPolicyNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.BackendTLSPolicy, err error) { +func (s backendTLSPolicyNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.BackendTLSPolicy, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.BackendTLSPolicy)) + ret = append(ret, m.(*v1alpha3.BackendTLSPolicy)) }) return ret, err } // Get retrieves the BackendTLSPolicy from the indexer for a given namespace and name. -func (s backendTLSPolicyNamespaceLister) Get(name string) (*v1alpha2.BackendTLSPolicy, error) { +func (s backendTLSPolicyNamespaceLister) Get(name string) (*v1alpha3.BackendTLSPolicy, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("backendtlspolicy"), name) + return nil, errors.NewNotFound(v1alpha3.Resource("backendtlspolicy"), name) } - return obj.(*v1alpha2.BackendTLSPolicy), nil + return obj.(*v1alpha3.BackendTLSPolicy), nil } diff --git a/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha3/expansion_generated.go b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha3/expansion_generated.go new file mode 100644 index 000000000..5cba22fc9 --- /dev/null +++ b/vendor/sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha3/expansion_generated.go @@ -0,0 +1,27 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha3 + +// BackendTLSPolicyListerExpansion allows custom methods to be added to +// BackendTLSPolicyLister. +type BackendTLSPolicyListerExpansion interface{} + +// BackendTLSPolicyNamespaceListerExpansion allows custom methods to be added to +// BackendTLSPolicyNamespaceLister. +type BackendTLSPolicyNamespaceListerExpansion interface{}