From bb7ae6b542902bf86d4393379a59870a80036824 Mon Sep 17 00:00:00 2001 From: Rob Cernich Date: Thu, 15 Jul 2021 08:27:49 -0600 Subject: [PATCH] MAISTRA-2513 more federation API refinements (#21) * MAISTRA-2513 more federation API refinements Signed-off-by: rcernich * update generated code Signed-off-by: rcernich --- Makefile | 12 +- .../externalversions/core/v1/interface.go | 21 - client/informers/externalversions/factory.go | 6 + .../externalversions/federation/interface.go | 44 ++ .../v1/exportedserviceset.go} | 42 +- .../v1/importedserviceset.go} | 42 +- .../federation/v1/interface.go | 57 ++ .../v1/servicemeshpeer.go} | 42 +- client/informers/externalversions/generic.go | 15 +- client/listers/core/v1/expansion_generated.go | 24 - client/listers/core/v1/meshfederation.go | 97 --- client/listers/core/v1/serviceexports.go | 97 --- client/listers/core/v1/serviceimports.go | 97 --- .../federation/v1/expansion_generated.go | 41 ++ .../federation/v1/exportedserviceset.go | 97 +++ .../federation/v1/importedserviceset.go | 97 +++ .../listers/federation/v1/servicemeshpeer.go | 97 +++ client/versioned/clientset.go | 14 + client/versioned/fake/clientset_generated.go | 7 + client/versioned/fake/register.go | 2 + client/versioned/scheme/register.go | 2 + client/versioned/typed/core/v1/core_client.go | 15 - .../typed/core/v1/fake/fake_core_client.go | 12 - .../typed/core/v1/fake/fake_meshfederation.go | 140 ---- .../typed/core/v1/fake/fake_serviceexports.go | 140 ---- .../typed/core/v1/fake/fake_serviceimports.go | 140 ---- .../typed/core/v1/generated_expansion.go | 6 - .../versioned/typed/core/v1/meshfederation.go | 193 ------ .../versioned/typed/core/v1/serviceexports.go | 193 ------ .../versioned/typed/core/v1/serviceimports.go | 193 ------ client/versioned/typed/federation/v1/doc.go | 18 + .../typed/federation/v1/exportedserviceset.go | 193 ++++++ .../versioned/typed/federation/v1/fake/doc.go | 18 + .../v1/fake/fake_exportedserviceset.go | 140 ++++ .../v1/fake/fake_federation_client.go | 46 ++ .../v1/fake/fake_importedserviceset.go | 140 ++++ .../v1/fake/fake_servicemeshpeer.go | 140 ++++ .../typed/federation/v1/federation_client.go | 97 +++ .../federation/v1/generated_expansion.go | 23 + .../typed/federation/v1/importedserviceset.go | 193 ++++++ .../typed/federation/v1/servicemeshpeer.go | 193 ++++++ client/xnsinformer/core/v1/interface.go | 21 - client/xnsinformer/factory.go | 6 + client/xnsinformer/federation/interface.go | 45 ++ .../v1/exportedserviceset.go} | 42 +- .../v1/importedserviceset.go} | 42 +- client/xnsinformer/federation/v1/interface.go | 58 ++ .../v1/servicemeshpeer.go} | 42 +- client/xnsinformer/generic.go | 15 +- core/v1/groupversion_info.go | 3 - core/v1/zz_generated.deepcopy.go | 622 ----------------- docs/crd/CRDS.adoc | 16 +- ...tion.maistra.io_ExportedServiceSet_v1.adoc | 69 ++ ...erviceSet_ImportedServiceLocality_v1.adoc} | 8 +- ...ion.maistra.io_ImportedServiceSet_v1.adoc} | 45 +- ...er_ServiceMeshPeerDiscoveryStatus_v1.adoc} | 28 +- ...eMeshPeer_ServiceMeshPeerGateways_v1.adoc} | 8 +- ...iceMeshPeer_ServiceMeshPeerRemote_v1.adoc} | 8 +- ...eMeshPeer_ServiceMeshPeerSecurity_v1.adoc} | 8 +- ...ration.maistra.io_ServiceMeshPeer_v1.adoc} | 48 +- docs/crd/maistra.io_ServiceExports_v1.adoc | 60 -- federation/v1/doc.go | 16 + .../v1/exportedserviceset_types.go | 33 +- federation/v1/groupversion_info.go | 49 ++ .../v1/import_export_mapping.go | 37 +- .../v1/importedserviceset_types.go | 39 +- .../v1/servicemeshpeer_types.go | 101 +-- federation/v1/zz_generated.deepcopy.go | 645 ++++++++++++++++++ ...ation.maistra.io_exportedservicesets.yaml} | 73 +- ...ation.maistra.io_importedservicesets.yaml} | 66 +- ...deration.maistra.io_servicemeshpeers.yaml} | 92 +-- security/v1/trustbundle.pb.go | 73 +- 72 files changed, 3028 insertions(+), 2576 deletions(-) create mode 100644 client/informers/externalversions/federation/interface.go rename client/informers/externalversions/{core/v1/serviceexports.go => federation/v1/exportedserviceset.go} (51%) rename client/informers/externalversions/{core/v1/serviceimports.go => federation/v1/importedserviceset.go} (51%) create mode 100644 client/informers/externalversions/federation/v1/interface.go rename client/informers/externalversions/{core/v1/meshfederation.go => federation/v1/servicemeshpeer.go} (52%) delete mode 100644 client/listers/core/v1/meshfederation.go delete mode 100644 client/listers/core/v1/serviceexports.go delete mode 100644 client/listers/core/v1/serviceimports.go create mode 100644 client/listers/federation/v1/expansion_generated.go create mode 100644 client/listers/federation/v1/exportedserviceset.go create mode 100644 client/listers/federation/v1/importedserviceset.go create mode 100644 client/listers/federation/v1/servicemeshpeer.go delete mode 100644 client/versioned/typed/core/v1/fake/fake_meshfederation.go delete mode 100644 client/versioned/typed/core/v1/fake/fake_serviceexports.go delete mode 100644 client/versioned/typed/core/v1/fake/fake_serviceimports.go delete mode 100644 client/versioned/typed/core/v1/meshfederation.go delete mode 100644 client/versioned/typed/core/v1/serviceexports.go delete mode 100644 client/versioned/typed/core/v1/serviceimports.go create mode 100644 client/versioned/typed/federation/v1/doc.go create mode 100644 client/versioned/typed/federation/v1/exportedserviceset.go create mode 100644 client/versioned/typed/federation/v1/fake/doc.go create mode 100644 client/versioned/typed/federation/v1/fake/fake_exportedserviceset.go create mode 100644 client/versioned/typed/federation/v1/fake/fake_federation_client.go create mode 100644 client/versioned/typed/federation/v1/fake/fake_importedserviceset.go create mode 100644 client/versioned/typed/federation/v1/fake/fake_servicemeshpeer.go create mode 100644 client/versioned/typed/federation/v1/federation_client.go create mode 100644 client/versioned/typed/federation/v1/generated_expansion.go create mode 100644 client/versioned/typed/federation/v1/importedserviceset.go create mode 100644 client/versioned/typed/federation/v1/servicemeshpeer.go create mode 100644 client/xnsinformer/federation/interface.go rename client/xnsinformer/{core/v1/serviceimports.go => federation/v1/exportedserviceset.go} (53%) rename client/xnsinformer/{core/v1/meshfederation.go => federation/v1/importedserviceset.go} (53%) create mode 100644 client/xnsinformer/federation/v1/interface.go rename client/xnsinformer/{core/v1/serviceexports.go => federation/v1/servicemeshpeer.go} (54%) create mode 100644 docs/crd/federation.maistra.io_ExportedServiceSet_v1.adoc rename docs/crd/{maistra.io_ServiceImports_ServiceImportLocality_v1.adoc => federation.maistra.io_ImportedServiceSet_ImportedServiceLocality_v1.adoc} (65%) rename docs/crd/{maistra.io_ServiceImports_v1.adoc => federation.maistra.io_ImportedServiceSet_v1.adoc} (51%) rename docs/crd/{maistra.io_MeshFederation_FederationDiscoveryStatus_v1.adoc => federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerDiscoveryStatus_v1.adoc} (77%) rename docs/crd/{maistra.io_MeshFederation_MeshFederationGateways_v1.adoc => federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerGateways_v1.adoc} (64%) rename docs/crd/{maistra.io_MeshFederation_MeshFederationRemote_v1.adoc => federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerRemote_v1.adoc} (75%) rename docs/crd/{maistra.io_MeshFederation_MeshFederationSecurity_v1.adoc => federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerSecurity_v1.adoc} (79%) rename docs/crd/{maistra.io_MeshFederation_v1.adoc => federation.maistra.io_ServiceMeshPeer_v1.adoc} (50%) delete mode 100644 docs/crd/maistra.io_ServiceExports_v1.adoc create mode 100644 federation/v1/doc.go rename core/v1/serviceexports_types.go => federation/v1/exportedserviceset_types.go (66%) create mode 100644 federation/v1/groupversion_info.go rename {core => federation}/v1/import_export_mapping.go (62%) rename core/v1/serviceimports_types.go => federation/v1/importedserviceset_types.go (73%) rename core/v1/meshfederation_types.go => federation/v1/servicemeshpeer_types.go (67%) create mode 100644 federation/v1/zz_generated.deepcopy.go rename manifests/{maistra.io_serviceexports.yaml => federation.maistra.io_exportedservicesets.yaml} (67%) rename manifests/{maistra.io_serviceimports.yaml => federation.maistra.io_importedservicesets.yaml} (57%) rename manifests/{maistra.io_meshfederations.yaml => federation.maistra.io_servicemeshpeers.yaml} (76%) diff --git a/Makefile b/Makefile index d2f97fbc..24ccffc0 100644 --- a/Makefile +++ b/Makefile @@ -12,16 +12,17 @@ space := $(empty) $(empty) kube_api_packages = $(subst $(space),$(empty), \ $(kube_base_output_package)/core/v1, \ $(kube_base_output_package)/core/v1alpha1, \ - $(kube_base_output_package)/core/v2 \ + $(kube_base_output_package)/core/v2, \ + $(kube_base_output_package)/federation/v1 \ ) kube_base_output_package = maistra.io/api kube_clientset_package = $(kube_base_output_package)/client kube_listers_package = $(kube_base_output_package)/client/listers kube_informers_package = $(kube_base_output_package)/client/informers xns_informers_package = $(kube_base_output_package)/client/xnsinformer -path_apis = "./core/..." +path_apis = "./core/...;./federation/..." header_file = "header.go.txt" -plural_exceptions = ServiceExports:ServiceExports,ServiceImports:ServiceImports +plural_exceptions = ExportedServices:ExportedServices,ImportedServices:ImportedServices # protobuf out_path = /tmp @@ -64,7 +65,7 @@ generate-crd: generate-docs: rm -rf $(docs_path) - $(DOC_GEN) paths=maistra.io/api/core/... output:dir=$(docs_path) doc:format=adoc,depth=2 + $(DOC_GEN) paths="maistra.io/api/core/...;maistra.io/api/federation/..." output:dir=$(docs_path) doc:format=adoc,depth=2 generate-copy: $(CONTROLLER_GEN) object:headerFile=$(header_file) paths=$(path_apis) @@ -100,6 +101,7 @@ generate-conversion: clean: rm -rf client manifests find core -name zz_generated.deepcopy.go -delete -o -name conversion_generated.go -delete + find federation -name zz_generated.deepcopy.go -delete -o -name conversion_generated.go -delete all: gen gen: generate-copy generate-client generate-crd generate-conversion generate-proto generate-docs @@ -112,4 +114,4 @@ check-clean-repo: @if [[ -n $$(git status --porcelain) ]]; then echo -e "ERROR: Some files need to be updated, run 'make gen' and include any changed files in your PR. Output:\n"; git status; git diff; exit 1; fi test: - go test -race $(path_apis) + go test -race ./core/... ./federation/... diff --git a/client/informers/externalversions/core/v1/interface.go b/client/informers/externalversions/core/v1/interface.go index 6a30493f..bd0fd137 100644 --- a/client/informers/externalversions/core/v1/interface.go +++ b/client/informers/externalversions/core/v1/interface.go @@ -22,12 +22,6 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { - // MeshFederations returns a MeshFederationInformer. - MeshFederations() MeshFederationInformer - // ServiceExports returns a ServiceExportsInformer. - ServiceExports() ServiceExportsInformer - // ServiceImports returns a ServiceImportsInformer. - ServiceImports() ServiceImportsInformer // ServiceMeshControlPlanes returns a ServiceMeshControlPlaneInformer. ServiceMeshControlPlanes() ServiceMeshControlPlaneInformer // ServiceMeshExtensions returns a ServiceMeshExtensionInformer. @@ -49,21 +43,6 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// MeshFederations returns a MeshFederationInformer. -func (v *version) MeshFederations() MeshFederationInformer { - return &meshFederationInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - -// ServiceExports returns a ServiceExportsInformer. -func (v *version) ServiceExports() ServiceExportsInformer { - return &serviceExportsInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - -// ServiceImports returns a ServiceImportsInformer. -func (v *version) ServiceImports() ServiceImportsInformer { - return &serviceImportsInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // ServiceMeshControlPlanes returns a ServiceMeshControlPlaneInformer. func (v *version) ServiceMeshControlPlanes() ServiceMeshControlPlaneInformer { return &serviceMeshControlPlaneInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/client/informers/externalversions/factory.go b/client/informers/externalversions/factory.go index f82c7180..9350c355 100644 --- a/client/informers/externalversions/factory.go +++ b/client/informers/externalversions/factory.go @@ -26,6 +26,7 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" core "maistra.io/api/client/informers/externalversions/core" + federation "maistra.io/api/client/informers/externalversions/federation" internalinterfaces "maistra.io/api/client/informers/externalversions/internalinterfaces" versioned "maistra.io/api/client/versioned" ) @@ -171,8 +172,13 @@ type SharedInformerFactory interface { WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool Core() core.Interface + Federation() federation.Interface } func (f *sharedInformerFactory) Core() core.Interface { return core.New(f, f.namespace, f.tweakListOptions) } + +func (f *sharedInformerFactory) Federation() federation.Interface { + return federation.New(f, f.namespace, f.tweakListOptions) +} diff --git a/client/informers/externalversions/federation/interface.go b/client/informers/externalversions/federation/interface.go new file mode 100644 index 00000000..12efb7bc --- /dev/null +++ b/client/informers/externalversions/federation/interface.go @@ -0,0 +1,44 @@ +// Copyright Red Hat, Inc. +// +// 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 federation + +import ( + v1 "maistra.io/api/client/informers/externalversions/federation/v1" + internalinterfaces "maistra.io/api/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface +} + +type group 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 &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/client/informers/externalversions/core/v1/serviceexports.go b/client/informers/externalversions/federation/v1/exportedserviceset.go similarity index 51% rename from client/informers/externalversions/core/v1/serviceexports.go rename to client/informers/externalversions/federation/v1/exportedserviceset.go index 8a3cc8c7..97fb3b42 100644 --- a/client/informers/externalversions/core/v1/serviceexports.go +++ b/client/informers/externalversions/federation/v1/exportedserviceset.go @@ -25,64 +25,64 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" internalinterfaces "maistra.io/api/client/informers/externalversions/internalinterfaces" - v1 "maistra.io/api/client/listers/core/v1" + v1 "maistra.io/api/client/listers/federation/v1" versioned "maistra.io/api/client/versioned" - corev1 "maistra.io/api/core/v1" + federationv1 "maistra.io/api/federation/v1" ) -// ServiceExportsInformer provides access to a shared informer and lister for -// ServiceExports. -type ServiceExportsInformer interface { +// ExportedServiceSetInformer provides access to a shared informer and lister for +// ExportedServiceSets. +type ExportedServiceSetInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.ServiceExportsLister + Lister() v1.ExportedServiceSetLister } -type serviceExportsInformer struct { +type exportedServiceSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } -// NewServiceExportsInformer constructs a new informer for ServiceExports type. +// NewExportedServiceSetInformer constructs a new informer for ExportedServiceSet 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 NewServiceExportsInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredServiceExportsInformer(client, namespace, resyncPeriod, indexers, nil) +func NewExportedServiceSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExportedServiceSetInformer(client, namespace, resyncPeriod, indexers, nil) } -// NewFilteredServiceExportsInformer constructs a new informer for ServiceExports type. +// NewFilteredExportedServiceSetInformer constructs a new informer for ExportedServiceSet 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 NewFilteredServiceExportsInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredExportedServiceSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ServiceExports(namespace).List(context.TODO(), options) + return client.FederationV1().ExportedServiceSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ServiceExports(namespace).Watch(context.TODO(), options) + return client.FederationV1().ExportedServiceSets(namespace).Watch(context.TODO(), options) }, }, - &corev1.ServiceExports{}, + &federationv1.ExportedServiceSet{}, resyncPeriod, indexers, ) } -func (f *serviceExportsInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredServiceExportsInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *exportedServiceSetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExportedServiceSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *serviceExportsInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&corev1.ServiceExports{}, f.defaultInformer) +func (f *exportedServiceSetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&federationv1.ExportedServiceSet{}, f.defaultInformer) } -func (f *serviceExportsInformer) Lister() v1.ServiceExportsLister { - return v1.NewServiceExportsLister(f.Informer().GetIndexer()) +func (f *exportedServiceSetInformer) Lister() v1.ExportedServiceSetLister { + return v1.NewExportedServiceSetLister(f.Informer().GetIndexer()) } diff --git a/client/informers/externalversions/core/v1/serviceimports.go b/client/informers/externalversions/federation/v1/importedserviceset.go similarity index 51% rename from client/informers/externalversions/core/v1/serviceimports.go rename to client/informers/externalversions/federation/v1/importedserviceset.go index 0adbeb25..62bd57d1 100644 --- a/client/informers/externalversions/core/v1/serviceimports.go +++ b/client/informers/externalversions/federation/v1/importedserviceset.go @@ -25,64 +25,64 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" internalinterfaces "maistra.io/api/client/informers/externalversions/internalinterfaces" - v1 "maistra.io/api/client/listers/core/v1" + v1 "maistra.io/api/client/listers/federation/v1" versioned "maistra.io/api/client/versioned" - corev1 "maistra.io/api/core/v1" + federationv1 "maistra.io/api/federation/v1" ) -// ServiceImportsInformer provides access to a shared informer and lister for -// ServiceImports. -type ServiceImportsInformer interface { +// ImportedServiceSetInformer provides access to a shared informer and lister for +// ImportedServiceSets. +type ImportedServiceSetInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.ServiceImportsLister + Lister() v1.ImportedServiceSetLister } -type serviceImportsInformer struct { +type importedServiceSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } -// NewServiceImportsInformer constructs a new informer for ServiceImports type. +// NewImportedServiceSetInformer constructs a new informer for ImportedServiceSet 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 NewServiceImportsInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredServiceImportsInformer(client, namespace, resyncPeriod, indexers, nil) +func NewImportedServiceSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredImportedServiceSetInformer(client, namespace, resyncPeriod, indexers, nil) } -// NewFilteredServiceImportsInformer constructs a new informer for ServiceImports type. +// NewFilteredImportedServiceSetInformer constructs a new informer for ImportedServiceSet 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 NewFilteredServiceImportsInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredImportedServiceSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ServiceImports(namespace).List(context.TODO(), options) + return client.FederationV1().ImportedServiceSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ServiceImports(namespace).Watch(context.TODO(), options) + return client.FederationV1().ImportedServiceSets(namespace).Watch(context.TODO(), options) }, }, - &corev1.ServiceImports{}, + &federationv1.ImportedServiceSet{}, resyncPeriod, indexers, ) } -func (f *serviceImportsInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredServiceImportsInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *importedServiceSetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredImportedServiceSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *serviceImportsInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&corev1.ServiceImports{}, f.defaultInformer) +func (f *importedServiceSetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&federationv1.ImportedServiceSet{}, f.defaultInformer) } -func (f *serviceImportsInformer) Lister() v1.ServiceImportsLister { - return v1.NewServiceImportsLister(f.Informer().GetIndexer()) +func (f *importedServiceSetInformer) Lister() v1.ImportedServiceSetLister { + return v1.NewImportedServiceSetLister(f.Informer().GetIndexer()) } diff --git a/client/informers/externalversions/federation/v1/interface.go b/client/informers/externalversions/federation/v1/interface.go new file mode 100644 index 00000000..2a085c90 --- /dev/null +++ b/client/informers/externalversions/federation/v1/interface.go @@ -0,0 +1,57 @@ +// Copyright Red Hat, Inc. +// +// 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 v1 + +import ( + internalinterfaces "maistra.io/api/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // ExportedServiceSets returns a ExportedServiceSetInformer. + ExportedServiceSets() ExportedServiceSetInformer + // ImportedServiceSets returns a ImportedServiceSetInformer. + ImportedServiceSets() ImportedServiceSetInformer + // ServiceMeshPeers returns a ServiceMeshPeerInformer. + ServiceMeshPeers() ServiceMeshPeerInformer +} + +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} +} + +// ExportedServiceSets returns a ExportedServiceSetInformer. +func (v *version) ExportedServiceSets() ExportedServiceSetInformer { + return &exportedServiceSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// ImportedServiceSets returns a ImportedServiceSetInformer. +func (v *version) ImportedServiceSets() ImportedServiceSetInformer { + return &importedServiceSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// ServiceMeshPeers returns a ServiceMeshPeerInformer. +func (v *version) ServiceMeshPeers() ServiceMeshPeerInformer { + return &serviceMeshPeerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/client/informers/externalversions/core/v1/meshfederation.go b/client/informers/externalversions/federation/v1/servicemeshpeer.go similarity index 52% rename from client/informers/externalversions/core/v1/meshfederation.go rename to client/informers/externalversions/federation/v1/servicemeshpeer.go index 660d789e..164c32df 100644 --- a/client/informers/externalversions/core/v1/meshfederation.go +++ b/client/informers/externalversions/federation/v1/servicemeshpeer.go @@ -25,64 +25,64 @@ import ( watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" internalinterfaces "maistra.io/api/client/informers/externalversions/internalinterfaces" - v1 "maistra.io/api/client/listers/core/v1" + v1 "maistra.io/api/client/listers/federation/v1" versioned "maistra.io/api/client/versioned" - corev1 "maistra.io/api/core/v1" + federationv1 "maistra.io/api/federation/v1" ) -// MeshFederationInformer provides access to a shared informer and lister for -// MeshFederations. -type MeshFederationInformer interface { +// ServiceMeshPeerInformer provides access to a shared informer and lister for +// ServiceMeshPeers. +type ServiceMeshPeerInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.MeshFederationLister + Lister() v1.ServiceMeshPeerLister } -type meshFederationInformer struct { +type serviceMeshPeerInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } -// NewMeshFederationInformer constructs a new informer for MeshFederation type. +// NewServiceMeshPeerInformer constructs a new informer for ServiceMeshPeer 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 NewMeshFederationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredMeshFederationInformer(client, namespace, resyncPeriod, indexers, nil) +func NewServiceMeshPeerInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceMeshPeerInformer(client, namespace, resyncPeriod, indexers, nil) } -// NewFilteredMeshFederationInformer constructs a new informer for MeshFederation type. +// NewFilteredServiceMeshPeerInformer constructs a new informer for ServiceMeshPeer 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 NewFilteredMeshFederationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredServiceMeshPeerInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().MeshFederations(namespace).List(context.TODO(), options) + return client.FederationV1().ServiceMeshPeers(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().MeshFederations(namespace).Watch(context.TODO(), options) + return client.FederationV1().ServiceMeshPeers(namespace).Watch(context.TODO(), options) }, }, - &corev1.MeshFederation{}, + &federationv1.ServiceMeshPeer{}, resyncPeriod, indexers, ) } -func (f *meshFederationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredMeshFederationInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *serviceMeshPeerInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceMeshPeerInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *meshFederationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&corev1.MeshFederation{}, f.defaultInformer) +func (f *serviceMeshPeerInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&federationv1.ServiceMeshPeer{}, f.defaultInformer) } -func (f *meshFederationInformer) Lister() v1.MeshFederationLister { - return v1.NewMeshFederationLister(f.Informer().GetIndexer()) +func (f *serviceMeshPeerInformer) Lister() v1.ServiceMeshPeerLister { + return v1.NewServiceMeshPeerLister(f.Informer().GetIndexer()) } diff --git a/client/informers/externalversions/generic.go b/client/informers/externalversions/generic.go index 42a51acf..4ec4ac5c 100644 --- a/client/informers/externalversions/generic.go +++ b/client/informers/externalversions/generic.go @@ -24,6 +24,7 @@ import ( v1 "maistra.io/api/core/v1" v1alpha1 "maistra.io/api/core/v1alpha1" v2 "maistra.io/api/core/v2" + federationv1 "maistra.io/api/federation/v1" ) // GenericInformer is type of SharedIndexInformer which will locate and delegate to other @@ -53,12 +54,6 @@ func (f *genericInformer) Lister() cache.GenericLister { func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { // Group=core, Version=v1 - case v1.SchemeGroupVersion.WithResource("meshfederations"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().MeshFederations().Informer()}, nil - case v1.SchemeGroupVersion.WithResource("serviceexports"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ServiceExports().Informer()}, nil - case v1.SchemeGroupVersion.WithResource("serviceimports"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ServiceImports().Informer()}, nil case v1.SchemeGroupVersion.WithResource("servicemeshcontrolplanes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ServiceMeshControlPlanes().Informer()}, nil case v1.SchemeGroupVersion.WithResource("servicemeshextensions"): @@ -76,6 +71,14 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case v2.SchemeGroupVersion.WithResource("servicemeshcontrolplanes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V2().ServiceMeshControlPlanes().Informer()}, nil + // Group=federation.maistra.io, Version=v1 + case federationv1.SchemeGroupVersion.WithResource("exportedservicesets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Federation().V1().ExportedServiceSets().Informer()}, nil + case federationv1.SchemeGroupVersion.WithResource("importedservicesets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Federation().V1().ImportedServiceSets().Informer()}, nil + case federationv1.SchemeGroupVersion.WithResource("servicemeshpeers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Federation().V1().ServiceMeshPeers().Informer()}, nil + } return nil, fmt.Errorf("no informer found for %v", resource) diff --git a/client/listers/core/v1/expansion_generated.go b/client/listers/core/v1/expansion_generated.go index 41f0bd95..c8f10de4 100644 --- a/client/listers/core/v1/expansion_generated.go +++ b/client/listers/core/v1/expansion_generated.go @@ -16,30 +16,6 @@ package v1 -// MeshFederationListerExpansion allows custom methods to be added to -// MeshFederationLister. -type MeshFederationListerExpansion interface{} - -// MeshFederationNamespaceListerExpansion allows custom methods to be added to -// MeshFederationNamespaceLister. -type MeshFederationNamespaceListerExpansion interface{} - -// ServiceExportsListerExpansion allows custom methods to be added to -// ServiceExportsLister. -type ServiceExportsListerExpansion interface{} - -// ServiceExportsNamespaceListerExpansion allows custom methods to be added to -// ServiceExportsNamespaceLister. -type ServiceExportsNamespaceListerExpansion interface{} - -// ServiceImportsListerExpansion allows custom methods to be added to -// ServiceImportsLister. -type ServiceImportsListerExpansion interface{} - -// ServiceImportsNamespaceListerExpansion allows custom methods to be added to -// ServiceImportsNamespaceLister. -type ServiceImportsNamespaceListerExpansion interface{} - // ServiceMeshControlPlaneListerExpansion allows custom methods to be added to // ServiceMeshControlPlaneLister. type ServiceMeshControlPlaneListerExpansion interface{} diff --git a/client/listers/core/v1/meshfederation.go b/client/listers/core/v1/meshfederation.go deleted file mode 100644 index 8b150ee7..00000000 --- a/client/listers/core/v1/meshfederation.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright Red Hat, Inc. -// -// 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 "maistra.io/api/core/v1" -) - -// MeshFederationLister helps list MeshFederations. -// All objects returned here must be treated as read-only. -type MeshFederationLister interface { - // List lists all MeshFederations in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.MeshFederation, err error) - // MeshFederations returns an object that can list and get MeshFederations. - MeshFederations(namespace string) MeshFederationNamespaceLister - MeshFederationListerExpansion -} - -// meshFederationLister implements the MeshFederationLister interface. -type meshFederationLister struct { - indexer cache.Indexer -} - -// NewMeshFederationLister returns a new MeshFederationLister. -func NewMeshFederationLister(indexer cache.Indexer) MeshFederationLister { - return &meshFederationLister{indexer: indexer} -} - -// List lists all MeshFederations in the indexer. -func (s *meshFederationLister) List(selector labels.Selector) (ret []*v1.MeshFederation, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.MeshFederation)) - }) - return ret, err -} - -// MeshFederations returns an object that can list and get MeshFederations. -func (s *meshFederationLister) MeshFederations(namespace string) MeshFederationNamespaceLister { - return meshFederationNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// MeshFederationNamespaceLister helps list and get MeshFederations. -// All objects returned here must be treated as read-only. -type MeshFederationNamespaceLister interface { - // List lists all MeshFederations in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.MeshFederation, err error) - // Get retrieves the MeshFederation from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.MeshFederation, error) - MeshFederationNamespaceListerExpansion -} - -// meshFederationNamespaceLister implements the MeshFederationNamespaceLister -// interface. -type meshFederationNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all MeshFederations in the indexer for a given namespace. -func (s meshFederationNamespaceLister) List(selector labels.Selector) (ret []*v1.MeshFederation, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.MeshFederation)) - }) - return ret, err -} - -// Get retrieves the MeshFederation from the indexer for a given namespace and name. -func (s meshFederationNamespaceLister) Get(name string) (*v1.MeshFederation, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("meshfederation"), name) - } - return obj.(*v1.MeshFederation), nil -} diff --git a/client/listers/core/v1/serviceexports.go b/client/listers/core/v1/serviceexports.go deleted file mode 100644 index b1c9ee15..00000000 --- a/client/listers/core/v1/serviceexports.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright Red Hat, Inc. -// -// 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 "maistra.io/api/core/v1" -) - -// ServiceExportsLister helps list ServiceExports. -// All objects returned here must be treated as read-only. -type ServiceExportsLister interface { - // List lists all ServiceExports in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.ServiceExports, err error) - // ServiceExports returns an object that can list and get ServiceExports. - ServiceExports(namespace string) ServiceExportsNamespaceLister - ServiceExportsListerExpansion -} - -// serviceExportsLister implements the ServiceExportsLister interface. -type serviceExportsLister struct { - indexer cache.Indexer -} - -// NewServiceExportsLister returns a new ServiceExportsLister. -func NewServiceExportsLister(indexer cache.Indexer) ServiceExportsLister { - return &serviceExportsLister{indexer: indexer} -} - -// List lists all ServiceExports in the indexer. -func (s *serviceExportsLister) List(selector labels.Selector) (ret []*v1.ServiceExports, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ServiceExports)) - }) - return ret, err -} - -// ServiceExports returns an object that can list and get ServiceExports. -func (s *serviceExportsLister) ServiceExports(namespace string) ServiceExportsNamespaceLister { - return serviceExportsNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// ServiceExportsNamespaceLister helps list and get ServiceExports. -// All objects returned here must be treated as read-only. -type ServiceExportsNamespaceLister interface { - // List lists all ServiceExports in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.ServiceExports, err error) - // Get retrieves the ServiceExports from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.ServiceExports, error) - ServiceExportsNamespaceListerExpansion -} - -// serviceExportsNamespaceLister implements the ServiceExportsNamespaceLister -// interface. -type serviceExportsNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ServiceExports in the indexer for a given namespace. -func (s serviceExportsNamespaceLister) List(selector labels.Selector) (ret []*v1.ServiceExports, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ServiceExports)) - }) - return ret, err -} - -// Get retrieves the ServiceExports from the indexer for a given namespace and name. -func (s serviceExportsNamespaceLister) Get(name string) (*v1.ServiceExports, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("serviceexports"), name) - } - return obj.(*v1.ServiceExports), nil -} diff --git a/client/listers/core/v1/serviceimports.go b/client/listers/core/v1/serviceimports.go deleted file mode 100644 index 7c65f864..00000000 --- a/client/listers/core/v1/serviceimports.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright Red Hat, Inc. -// -// 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 "maistra.io/api/core/v1" -) - -// ServiceImportsLister helps list ServiceImports. -// All objects returned here must be treated as read-only. -type ServiceImportsLister interface { - // List lists all ServiceImports in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.ServiceImports, err error) - // ServiceImports returns an object that can list and get ServiceImports. - ServiceImports(namespace string) ServiceImportsNamespaceLister - ServiceImportsListerExpansion -} - -// serviceImportsLister implements the ServiceImportsLister interface. -type serviceImportsLister struct { - indexer cache.Indexer -} - -// NewServiceImportsLister returns a new ServiceImportsLister. -func NewServiceImportsLister(indexer cache.Indexer) ServiceImportsLister { - return &serviceImportsLister{indexer: indexer} -} - -// List lists all ServiceImports in the indexer. -func (s *serviceImportsLister) List(selector labels.Selector) (ret []*v1.ServiceImports, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ServiceImports)) - }) - return ret, err -} - -// ServiceImports returns an object that can list and get ServiceImports. -func (s *serviceImportsLister) ServiceImports(namespace string) ServiceImportsNamespaceLister { - return serviceImportsNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// ServiceImportsNamespaceLister helps list and get ServiceImports. -// All objects returned here must be treated as read-only. -type ServiceImportsNamespaceLister interface { - // List lists all ServiceImports in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.ServiceImports, err error) - // Get retrieves the ServiceImports from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.ServiceImports, error) - ServiceImportsNamespaceListerExpansion -} - -// serviceImportsNamespaceLister implements the ServiceImportsNamespaceLister -// interface. -type serviceImportsNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ServiceImports in the indexer for a given namespace. -func (s serviceImportsNamespaceLister) List(selector labels.Selector) (ret []*v1.ServiceImports, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ServiceImports)) - }) - return ret, err -} - -// Get retrieves the ServiceImports from the indexer for a given namespace and name. -func (s serviceImportsNamespaceLister) Get(name string) (*v1.ServiceImports, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("serviceimports"), name) - } - return obj.(*v1.ServiceImports), nil -} diff --git a/client/listers/federation/v1/expansion_generated.go b/client/listers/federation/v1/expansion_generated.go new file mode 100644 index 00000000..67d6acf2 --- /dev/null +++ b/client/listers/federation/v1/expansion_generated.go @@ -0,0 +1,41 @@ +// Copyright Red Hat, Inc. +// +// 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 + +// ExportedServiceSetListerExpansion allows custom methods to be added to +// ExportedServiceSetLister. +type ExportedServiceSetListerExpansion interface{} + +// ExportedServiceSetNamespaceListerExpansion allows custom methods to be added to +// ExportedServiceSetNamespaceLister. +type ExportedServiceSetNamespaceListerExpansion interface{} + +// ImportedServiceSetListerExpansion allows custom methods to be added to +// ImportedServiceSetLister. +type ImportedServiceSetListerExpansion interface{} + +// ImportedServiceSetNamespaceListerExpansion allows custom methods to be added to +// ImportedServiceSetNamespaceLister. +type ImportedServiceSetNamespaceListerExpansion interface{} + +// ServiceMeshPeerListerExpansion allows custom methods to be added to +// ServiceMeshPeerLister. +type ServiceMeshPeerListerExpansion interface{} + +// ServiceMeshPeerNamespaceListerExpansion allows custom methods to be added to +// ServiceMeshPeerNamespaceLister. +type ServiceMeshPeerNamespaceListerExpansion interface{} diff --git a/client/listers/federation/v1/exportedserviceset.go b/client/listers/federation/v1/exportedserviceset.go new file mode 100644 index 00000000..71c4571d --- /dev/null +++ b/client/listers/federation/v1/exportedserviceset.go @@ -0,0 +1,97 @@ +// Copyright Red Hat, Inc. +// +// 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 "maistra.io/api/federation/v1" +) + +// ExportedServiceSetLister helps list ExportedServiceSets. +// All objects returned here must be treated as read-only. +type ExportedServiceSetLister interface { + // List lists all ExportedServiceSets in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExportedServiceSet, err error) + // ExportedServiceSets returns an object that can list and get ExportedServiceSets. + ExportedServiceSets(namespace string) ExportedServiceSetNamespaceLister + ExportedServiceSetListerExpansion +} + +// exportedServiceSetLister implements the ExportedServiceSetLister interface. +type exportedServiceSetLister struct { + indexer cache.Indexer +} + +// NewExportedServiceSetLister returns a new ExportedServiceSetLister. +func NewExportedServiceSetLister(indexer cache.Indexer) ExportedServiceSetLister { + return &exportedServiceSetLister{indexer: indexer} +} + +// List lists all ExportedServiceSets in the indexer. +func (s *exportedServiceSetLister) List(selector labels.Selector) (ret []*v1.ExportedServiceSet, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExportedServiceSet)) + }) + return ret, err +} + +// ExportedServiceSets returns an object that can list and get ExportedServiceSets. +func (s *exportedServiceSetLister) ExportedServiceSets(namespace string) ExportedServiceSetNamespaceLister { + return exportedServiceSetNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ExportedServiceSetNamespaceLister helps list and get ExportedServiceSets. +// All objects returned here must be treated as read-only. +type ExportedServiceSetNamespaceLister interface { + // List lists all ExportedServiceSets in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ExportedServiceSet, err error) + // Get retrieves the ExportedServiceSet from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ExportedServiceSet, error) + ExportedServiceSetNamespaceListerExpansion +} + +// exportedServiceSetNamespaceLister implements the ExportedServiceSetNamespaceLister +// interface. +type exportedServiceSetNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ExportedServiceSets in the indexer for a given namespace. +func (s exportedServiceSetNamespaceLister) List(selector labels.Selector) (ret []*v1.ExportedServiceSet, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ExportedServiceSet)) + }) + return ret, err +} + +// Get retrieves the ExportedServiceSet from the indexer for a given namespace and name. +func (s exportedServiceSetNamespaceLister) Get(name string) (*v1.ExportedServiceSet, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("exportedserviceset"), name) + } + return obj.(*v1.ExportedServiceSet), nil +} diff --git a/client/listers/federation/v1/importedserviceset.go b/client/listers/federation/v1/importedserviceset.go new file mode 100644 index 00000000..09878373 --- /dev/null +++ b/client/listers/federation/v1/importedserviceset.go @@ -0,0 +1,97 @@ +// Copyright Red Hat, Inc. +// +// 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 "maistra.io/api/federation/v1" +) + +// ImportedServiceSetLister helps list ImportedServiceSets. +// All objects returned here must be treated as read-only. +type ImportedServiceSetLister interface { + // List lists all ImportedServiceSets in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ImportedServiceSet, err error) + // ImportedServiceSets returns an object that can list and get ImportedServiceSets. + ImportedServiceSets(namespace string) ImportedServiceSetNamespaceLister + ImportedServiceSetListerExpansion +} + +// importedServiceSetLister implements the ImportedServiceSetLister interface. +type importedServiceSetLister struct { + indexer cache.Indexer +} + +// NewImportedServiceSetLister returns a new ImportedServiceSetLister. +func NewImportedServiceSetLister(indexer cache.Indexer) ImportedServiceSetLister { + return &importedServiceSetLister{indexer: indexer} +} + +// List lists all ImportedServiceSets in the indexer. +func (s *importedServiceSetLister) List(selector labels.Selector) (ret []*v1.ImportedServiceSet, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ImportedServiceSet)) + }) + return ret, err +} + +// ImportedServiceSets returns an object that can list and get ImportedServiceSets. +func (s *importedServiceSetLister) ImportedServiceSets(namespace string) ImportedServiceSetNamespaceLister { + return importedServiceSetNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ImportedServiceSetNamespaceLister helps list and get ImportedServiceSets. +// All objects returned here must be treated as read-only. +type ImportedServiceSetNamespaceLister interface { + // List lists all ImportedServiceSets in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ImportedServiceSet, err error) + // Get retrieves the ImportedServiceSet from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ImportedServiceSet, error) + ImportedServiceSetNamespaceListerExpansion +} + +// importedServiceSetNamespaceLister implements the ImportedServiceSetNamespaceLister +// interface. +type importedServiceSetNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ImportedServiceSets in the indexer for a given namespace. +func (s importedServiceSetNamespaceLister) List(selector labels.Selector) (ret []*v1.ImportedServiceSet, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ImportedServiceSet)) + }) + return ret, err +} + +// Get retrieves the ImportedServiceSet from the indexer for a given namespace and name. +func (s importedServiceSetNamespaceLister) Get(name string) (*v1.ImportedServiceSet, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("importedserviceset"), name) + } + return obj.(*v1.ImportedServiceSet), nil +} diff --git a/client/listers/federation/v1/servicemeshpeer.go b/client/listers/federation/v1/servicemeshpeer.go new file mode 100644 index 00000000..61f4d502 --- /dev/null +++ b/client/listers/federation/v1/servicemeshpeer.go @@ -0,0 +1,97 @@ +// Copyright Red Hat, Inc. +// +// 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 "maistra.io/api/federation/v1" +) + +// ServiceMeshPeerLister helps list ServiceMeshPeers. +// All objects returned here must be treated as read-only. +type ServiceMeshPeerLister interface { + // List lists all ServiceMeshPeers in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceMeshPeer, err error) + // ServiceMeshPeers returns an object that can list and get ServiceMeshPeers. + ServiceMeshPeers(namespace string) ServiceMeshPeerNamespaceLister + ServiceMeshPeerListerExpansion +} + +// serviceMeshPeerLister implements the ServiceMeshPeerLister interface. +type serviceMeshPeerLister struct { + indexer cache.Indexer +} + +// NewServiceMeshPeerLister returns a new ServiceMeshPeerLister. +func NewServiceMeshPeerLister(indexer cache.Indexer) ServiceMeshPeerLister { + return &serviceMeshPeerLister{indexer: indexer} +} + +// List lists all ServiceMeshPeers in the indexer. +func (s *serviceMeshPeerLister) List(selector labels.Selector) (ret []*v1.ServiceMeshPeer, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceMeshPeer)) + }) + return ret, err +} + +// ServiceMeshPeers returns an object that can list and get ServiceMeshPeers. +func (s *serviceMeshPeerLister) ServiceMeshPeers(namespace string) ServiceMeshPeerNamespaceLister { + return serviceMeshPeerNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ServiceMeshPeerNamespaceLister helps list and get ServiceMeshPeers. +// All objects returned here must be treated as read-only. +type ServiceMeshPeerNamespaceLister interface { + // List lists all ServiceMeshPeers in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ServiceMeshPeer, err error) + // Get retrieves the ServiceMeshPeer from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ServiceMeshPeer, error) + ServiceMeshPeerNamespaceListerExpansion +} + +// serviceMeshPeerNamespaceLister implements the ServiceMeshPeerNamespaceLister +// interface. +type serviceMeshPeerNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ServiceMeshPeers in the indexer for a given namespace. +func (s serviceMeshPeerNamespaceLister) List(selector labels.Selector) (ret []*v1.ServiceMeshPeer, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceMeshPeer)) + }) + return ret, err +} + +// Get retrieves the ServiceMeshPeer from the indexer for a given namespace and name. +func (s serviceMeshPeerNamespaceLister) Get(name string) (*v1.ServiceMeshPeer, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicemeshpeer"), name) + } + return obj.(*v1.ServiceMeshPeer), nil +} diff --git a/client/versioned/clientset.go b/client/versioned/clientset.go index 696fe5c9..d5cfdaa2 100644 --- a/client/versioned/clientset.go +++ b/client/versioned/clientset.go @@ -25,6 +25,7 @@ import ( corev1 "maistra.io/api/client/versioned/typed/core/v1" corev1alpha1 "maistra.io/api/client/versioned/typed/core/v1alpha1" corev2 "maistra.io/api/client/versioned/typed/core/v2" + federationv1 "maistra.io/api/client/versioned/typed/federation/v1" ) type Interface interface { @@ -32,6 +33,7 @@ type Interface interface { CoreV1() corev1.CoreV1Interface CoreV1alpha1() corev1alpha1.CoreV1alpha1Interface CoreV2() corev2.CoreV2Interface + FederationV1() federationv1.FederationV1Interface } // Clientset contains the clients for groups. Each group has exactly one @@ -41,6 +43,7 @@ type Clientset struct { coreV1 *corev1.CoreV1Client coreV1alpha1 *corev1alpha1.CoreV1alpha1Client coreV2 *corev2.CoreV2Client + federationV1 *federationv1.FederationV1Client } // CoreV1 retrieves the CoreV1Client @@ -58,6 +61,11 @@ func (c *Clientset) CoreV2() corev2.CoreV2Interface { return c.coreV2 } +// FederationV1 retrieves the FederationV1Client +func (c *Clientset) FederationV1() federationv1.FederationV1Interface { + return c.federationV1 +} + // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterface { if c == nil { @@ -91,6 +99,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { if err != nil { return nil, err } + cs.federationV1, err = federationv1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) if err != nil { @@ -106,6 +118,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { cs.coreV1 = corev1.NewForConfigOrDie(c) cs.coreV1alpha1 = corev1alpha1.NewForConfigOrDie(c) cs.coreV2 = corev2.NewForConfigOrDie(c) + cs.federationV1 = federationv1.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -117,6 +130,7 @@ func New(c rest.Interface) *Clientset { cs.coreV1 = corev1.New(c) cs.coreV1alpha1 = corev1alpha1.New(c) cs.coreV2 = corev2.New(c) + cs.federationV1 = federationv1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/client/versioned/fake/clientset_generated.go b/client/versioned/fake/clientset_generated.go index 7a9ed0e3..68eeee4d 100644 --- a/client/versioned/fake/clientset_generated.go +++ b/client/versioned/fake/clientset_generated.go @@ -29,6 +29,8 @@ import ( fakecorev1alpha1 "maistra.io/api/client/versioned/typed/core/v1alpha1/fake" corev2 "maistra.io/api/client/versioned/typed/core/v2" fakecorev2 "maistra.io/api/client/versioned/typed/core/v2/fake" + federationv1 "maistra.io/api/client/versioned/typed/federation/v1" + fakefederationv1 "maistra.io/api/client/versioned/typed/federation/v1/fake" ) // NewSimpleClientset returns a clientset that will respond with the provided objects. @@ -92,3 +94,8 @@ func (c *Clientset) CoreV1alpha1() corev1alpha1.CoreV1alpha1Interface { func (c *Clientset) CoreV2() corev2.CoreV2Interface { return &fakecorev2.FakeCoreV2{Fake: &c.Fake} } + +// FederationV1 retrieves the FederationV1Client +func (c *Clientset) FederationV1() federationv1.FederationV1Interface { + return &fakefederationv1.FakeFederationV1{Fake: &c.Fake} +} diff --git a/client/versioned/fake/register.go b/client/versioned/fake/register.go index 39d77e5a..19d1191f 100644 --- a/client/versioned/fake/register.go +++ b/client/versioned/fake/register.go @@ -25,6 +25,7 @@ import ( corev1 "maistra.io/api/core/v1" corev1alpha1 "maistra.io/api/core/v1alpha1" corev2 "maistra.io/api/core/v2" + federationv1 "maistra.io/api/federation/v1" ) var scheme = runtime.NewScheme() @@ -34,6 +35,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ corev1.AddToScheme, corev1alpha1.AddToScheme, corev2.AddToScheme, + federationv1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/client/versioned/scheme/register.go b/client/versioned/scheme/register.go index ca06f089..11708c52 100644 --- a/client/versioned/scheme/register.go +++ b/client/versioned/scheme/register.go @@ -25,6 +25,7 @@ import ( corev1 "maistra.io/api/core/v1" corev1alpha1 "maistra.io/api/core/v1alpha1" corev2 "maistra.io/api/core/v2" + federationv1 "maistra.io/api/federation/v1" ) var Scheme = runtime.NewScheme() @@ -34,6 +35,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ corev1.AddToScheme, corev1alpha1.AddToScheme, corev2.AddToScheme, + federationv1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/client/versioned/typed/core/v1/core_client.go b/client/versioned/typed/core/v1/core_client.go index 283d9467..add7128e 100644 --- a/client/versioned/typed/core/v1/core_client.go +++ b/client/versioned/typed/core/v1/core_client.go @@ -24,9 +24,6 @@ import ( type CoreV1Interface interface { RESTClient() rest.Interface - MeshFederationsGetter - ServiceExportsGetter - ServiceImportsGetter ServiceMeshControlPlanesGetter ServiceMeshExtensionsGetter ServiceMeshMembersGetter @@ -38,18 +35,6 @@ type CoreV1Client struct { restClient rest.Interface } -func (c *CoreV1Client) MeshFederations(namespace string) MeshFederationInterface { - return newMeshFederations(c, namespace) -} - -func (c *CoreV1Client) ServiceExports(namespace string) ServiceExportsInterface { - return newServiceExports(c, namespace) -} - -func (c *CoreV1Client) ServiceImports(namespace string) ServiceImportsInterface { - return newServiceImports(c, namespace) -} - func (c *CoreV1Client) ServiceMeshControlPlanes(namespace string) ServiceMeshControlPlaneInterface { return newServiceMeshControlPlanes(c, namespace) } diff --git a/client/versioned/typed/core/v1/fake/fake_core_client.go b/client/versioned/typed/core/v1/fake/fake_core_client.go index 997868c1..56b0cea2 100644 --- a/client/versioned/typed/core/v1/fake/fake_core_client.go +++ b/client/versioned/typed/core/v1/fake/fake_core_client.go @@ -26,18 +26,6 @@ type FakeCoreV1 struct { *testing.Fake } -func (c *FakeCoreV1) MeshFederations(namespace string) v1.MeshFederationInterface { - return &FakeMeshFederations{c, namespace} -} - -func (c *FakeCoreV1) ServiceExports(namespace string) v1.ServiceExportsInterface { - return &FakeServiceExports{c, namespace} -} - -func (c *FakeCoreV1) ServiceImports(namespace string) v1.ServiceImportsInterface { - return &FakeServiceImports{c, namespace} -} - func (c *FakeCoreV1) ServiceMeshControlPlanes(namespace string) v1.ServiceMeshControlPlaneInterface { return &FakeServiceMeshControlPlanes{c, namespace} } diff --git a/client/versioned/typed/core/v1/fake/fake_meshfederation.go b/client/versioned/typed/core/v1/fake/fake_meshfederation.go deleted file mode 100644 index 1218da83..00000000 --- a/client/versioned/typed/core/v1/fake/fake_meshfederation.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright Red Hat, Inc. -// -// 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" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - corev1 "maistra.io/api/core/v1" -) - -// FakeMeshFederations implements MeshFederationInterface -type FakeMeshFederations struct { - Fake *FakeCoreV1 - ns string -} - -var meshfederationsResource = schema.GroupVersionResource{Group: "maistra.io", Version: "v1", Resource: "meshfederations"} - -var meshfederationsKind = schema.GroupVersionKind{Group: "maistra.io", Version: "v1", Kind: "MeshFederation"} - -// Get takes name of the meshFederation, and returns the corresponding meshFederation object, and an error if there is any. -func (c *FakeMeshFederations) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.MeshFederation, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(meshfederationsResource, c.ns, name), &corev1.MeshFederation{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.MeshFederation), err -} - -// List takes label and field selectors, and returns the list of MeshFederations that match those selectors. -func (c *FakeMeshFederations) List(ctx context.Context, opts v1.ListOptions) (result *corev1.MeshFederationList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(meshfederationsResource, meshfederationsKind, c.ns, opts), &corev1.MeshFederationList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &corev1.MeshFederationList{ListMeta: obj.(*corev1.MeshFederationList).ListMeta} - for _, item := range obj.(*corev1.MeshFederationList).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 meshFederations. -func (c *FakeMeshFederations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(meshfederationsResource, c.ns, opts)) - -} - -// Create takes the representation of a meshFederation and creates it. Returns the server's representation of the meshFederation, and an error, if there is any. -func (c *FakeMeshFederations) Create(ctx context.Context, meshFederation *corev1.MeshFederation, opts v1.CreateOptions) (result *corev1.MeshFederation, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(meshfederationsResource, c.ns, meshFederation), &corev1.MeshFederation{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.MeshFederation), err -} - -// Update takes the representation of a meshFederation and updates it. Returns the server's representation of the meshFederation, and an error, if there is any. -func (c *FakeMeshFederations) Update(ctx context.Context, meshFederation *corev1.MeshFederation, opts v1.UpdateOptions) (result *corev1.MeshFederation, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(meshfederationsResource, c.ns, meshFederation), &corev1.MeshFederation{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.MeshFederation), 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 *FakeMeshFederations) UpdateStatus(ctx context.Context, meshFederation *corev1.MeshFederation, opts v1.UpdateOptions) (*corev1.MeshFederation, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(meshfederationsResource, "status", c.ns, meshFederation), &corev1.MeshFederation{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.MeshFederation), err -} - -// Delete takes name of the meshFederation and deletes it. Returns an error if one occurs. -func (c *FakeMeshFederations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(meshfederationsResource, c.ns, name), &corev1.MeshFederation{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeMeshFederations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(meshfederationsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &corev1.MeshFederationList{}) - return err -} - -// Patch applies the patch and returns the patched meshFederation. -func (c *FakeMeshFederations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.MeshFederation, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(meshfederationsResource, c.ns, name, pt, data, subresources...), &corev1.MeshFederation{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.MeshFederation), err -} diff --git a/client/versioned/typed/core/v1/fake/fake_serviceexports.go b/client/versioned/typed/core/v1/fake/fake_serviceexports.go deleted file mode 100644 index f9667dfc..00000000 --- a/client/versioned/typed/core/v1/fake/fake_serviceexports.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright Red Hat, Inc. -// -// 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" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - corev1 "maistra.io/api/core/v1" -) - -// FakeServiceExports implements ServiceExportsInterface -type FakeServiceExports struct { - Fake *FakeCoreV1 - ns string -} - -var serviceexportsResource = schema.GroupVersionResource{Group: "maistra.io", Version: "v1", Resource: "serviceexports"} - -var serviceexportsKind = schema.GroupVersionKind{Group: "maistra.io", Version: "v1", Kind: "ServiceExports"} - -// Get takes name of the serviceExports, and returns the corresponding serviceExports object, and an error if there is any. -func (c *FakeServiceExports) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.ServiceExports, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(serviceexportsResource, c.ns, name), &corev1.ServiceExports{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.ServiceExports), err -} - -// List takes label and field selectors, and returns the list of ServiceExports that match those selectors. -func (c *FakeServiceExports) List(ctx context.Context, opts v1.ListOptions) (result *corev1.ServiceExportsList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(serviceexportsResource, serviceexportsKind, c.ns, opts), &corev1.ServiceExportsList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &corev1.ServiceExportsList{ListMeta: obj.(*corev1.ServiceExportsList).ListMeta} - for _, item := range obj.(*corev1.ServiceExportsList).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 serviceExports. -func (c *FakeServiceExports) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(serviceexportsResource, c.ns, opts)) - -} - -// Create takes the representation of a serviceExports and creates it. Returns the server's representation of the serviceExports, and an error, if there is any. -func (c *FakeServiceExports) Create(ctx context.Context, serviceExports *corev1.ServiceExports, opts v1.CreateOptions) (result *corev1.ServiceExports, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(serviceexportsResource, c.ns, serviceExports), &corev1.ServiceExports{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.ServiceExports), err -} - -// Update takes the representation of a serviceExports and updates it. Returns the server's representation of the serviceExports, and an error, if there is any. -func (c *FakeServiceExports) Update(ctx context.Context, serviceExports *corev1.ServiceExports, opts v1.UpdateOptions) (result *corev1.ServiceExports, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(serviceexportsResource, c.ns, serviceExports), &corev1.ServiceExports{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.ServiceExports), 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 *FakeServiceExports) UpdateStatus(ctx context.Context, serviceExports *corev1.ServiceExports, opts v1.UpdateOptions) (*corev1.ServiceExports, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(serviceexportsResource, "status", c.ns, serviceExports), &corev1.ServiceExports{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.ServiceExports), err -} - -// Delete takes name of the serviceExports and deletes it. Returns an error if one occurs. -func (c *FakeServiceExports) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(serviceexportsResource, c.ns, name), &corev1.ServiceExports{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeServiceExports) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(serviceexportsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &corev1.ServiceExportsList{}) - return err -} - -// Patch applies the patch and returns the patched serviceExports. -func (c *FakeServiceExports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.ServiceExports, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(serviceexportsResource, c.ns, name, pt, data, subresources...), &corev1.ServiceExports{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.ServiceExports), err -} diff --git a/client/versioned/typed/core/v1/fake/fake_serviceimports.go b/client/versioned/typed/core/v1/fake/fake_serviceimports.go deleted file mode 100644 index 12bd08db..00000000 --- a/client/versioned/typed/core/v1/fake/fake_serviceimports.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright Red Hat, Inc. -// -// 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" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - corev1 "maistra.io/api/core/v1" -) - -// FakeServiceImports implements ServiceImportsInterface -type FakeServiceImports struct { - Fake *FakeCoreV1 - ns string -} - -var serviceimportsResource = schema.GroupVersionResource{Group: "maistra.io", Version: "v1", Resource: "serviceimports"} - -var serviceimportsKind = schema.GroupVersionKind{Group: "maistra.io", Version: "v1", Kind: "ServiceImports"} - -// Get takes name of the serviceImports, and returns the corresponding serviceImports object, and an error if there is any. -func (c *FakeServiceImports) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.ServiceImports, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(serviceimportsResource, c.ns, name), &corev1.ServiceImports{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.ServiceImports), err -} - -// List takes label and field selectors, and returns the list of ServiceImports that match those selectors. -func (c *FakeServiceImports) List(ctx context.Context, opts v1.ListOptions) (result *corev1.ServiceImportsList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(serviceimportsResource, serviceimportsKind, c.ns, opts), &corev1.ServiceImportsList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &corev1.ServiceImportsList{ListMeta: obj.(*corev1.ServiceImportsList).ListMeta} - for _, item := range obj.(*corev1.ServiceImportsList).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 serviceImports. -func (c *FakeServiceImports) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(serviceimportsResource, c.ns, opts)) - -} - -// Create takes the representation of a serviceImports and creates it. Returns the server's representation of the serviceImports, and an error, if there is any. -func (c *FakeServiceImports) Create(ctx context.Context, serviceImports *corev1.ServiceImports, opts v1.CreateOptions) (result *corev1.ServiceImports, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(serviceimportsResource, c.ns, serviceImports), &corev1.ServiceImports{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.ServiceImports), err -} - -// Update takes the representation of a serviceImports and updates it. Returns the server's representation of the serviceImports, and an error, if there is any. -func (c *FakeServiceImports) Update(ctx context.Context, serviceImports *corev1.ServiceImports, opts v1.UpdateOptions) (result *corev1.ServiceImports, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(serviceimportsResource, c.ns, serviceImports), &corev1.ServiceImports{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.ServiceImports), 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 *FakeServiceImports) UpdateStatus(ctx context.Context, serviceImports *corev1.ServiceImports, opts v1.UpdateOptions) (*corev1.ServiceImports, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(serviceimportsResource, "status", c.ns, serviceImports), &corev1.ServiceImports{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.ServiceImports), err -} - -// Delete takes name of the serviceImports and deletes it. Returns an error if one occurs. -func (c *FakeServiceImports) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(serviceimportsResource, c.ns, name), &corev1.ServiceImports{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeServiceImports) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(serviceimportsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &corev1.ServiceImportsList{}) - return err -} - -// Patch applies the patch and returns the patched serviceImports. -func (c *FakeServiceImports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.ServiceImports, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(serviceimportsResource, c.ns, name, pt, data, subresources...), &corev1.ServiceImports{}) - - if obj == nil { - return nil, err - } - return obj.(*corev1.ServiceImports), err -} diff --git a/client/versioned/typed/core/v1/generated_expansion.go b/client/versioned/typed/core/v1/generated_expansion.go index a81d1221..83886a80 100644 --- a/client/versioned/typed/core/v1/generated_expansion.go +++ b/client/versioned/typed/core/v1/generated_expansion.go @@ -16,12 +16,6 @@ package v1 -type MeshFederationExpansion interface{} - -type ServiceExportsExpansion interface{} - -type ServiceImportsExpansion interface{} - type ServiceMeshControlPlaneExpansion interface{} type ServiceMeshExtensionExpansion interface{} diff --git a/client/versioned/typed/core/v1/meshfederation.go b/client/versioned/typed/core/v1/meshfederation.go deleted file mode 100644 index 35af34ad..00000000 --- a/client/versioned/typed/core/v1/meshfederation.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright Red Hat, Inc. -// -// 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" - "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" - scheme "maistra.io/api/client/versioned/scheme" - v1 "maistra.io/api/core/v1" -) - -// MeshFederationsGetter has a method to return a MeshFederationInterface. -// A group's client should implement this interface. -type MeshFederationsGetter interface { - MeshFederations(namespace string) MeshFederationInterface -} - -// MeshFederationInterface has methods to work with MeshFederation resources. -type MeshFederationInterface interface { - Create(ctx context.Context, meshFederation *v1.MeshFederation, opts metav1.CreateOptions) (*v1.MeshFederation, error) - Update(ctx context.Context, meshFederation *v1.MeshFederation, opts metav1.UpdateOptions) (*v1.MeshFederation, error) - UpdateStatus(ctx context.Context, meshFederation *v1.MeshFederation, opts metav1.UpdateOptions) (*v1.MeshFederation, 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.MeshFederation, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.MeshFederationList, 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.MeshFederation, err error) - MeshFederationExpansion -} - -// meshFederations implements MeshFederationInterface -type meshFederations struct { - client rest.Interface - ns string -} - -// newMeshFederations returns a MeshFederations -func newMeshFederations(c *CoreV1Client, namespace string) *meshFederations { - return &meshFederations{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the meshFederation, and returns the corresponding meshFederation object, and an error if there is any. -func (c *meshFederations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MeshFederation, err error) { - result = &v1.MeshFederation{} - err = c.client.Get(). - Namespace(c.ns). - Resource("meshfederations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of MeshFederations that match those selectors. -func (c *meshFederations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MeshFederationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.MeshFederationList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("meshfederations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested meshFederations. -func (c *meshFederations) 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("meshfederations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a meshFederation and creates it. Returns the server's representation of the meshFederation, and an error, if there is any. -func (c *meshFederations) Create(ctx context.Context, meshFederation *v1.MeshFederation, opts metav1.CreateOptions) (result *v1.MeshFederation, err error) { - result = &v1.MeshFederation{} - err = c.client.Post(). - Namespace(c.ns). - Resource("meshfederations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(meshFederation). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a meshFederation and updates it. Returns the server's representation of the meshFederation, and an error, if there is any. -func (c *meshFederations) Update(ctx context.Context, meshFederation *v1.MeshFederation, opts metav1.UpdateOptions) (result *v1.MeshFederation, err error) { - result = &v1.MeshFederation{} - err = c.client.Put(). - Namespace(c.ns). - Resource("meshfederations"). - Name(meshFederation.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(meshFederation). - 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 *meshFederations) UpdateStatus(ctx context.Context, meshFederation *v1.MeshFederation, opts metav1.UpdateOptions) (result *v1.MeshFederation, err error) { - result = &v1.MeshFederation{} - err = c.client.Put(). - Namespace(c.ns). - Resource("meshfederations"). - Name(meshFederation.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(meshFederation). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the meshFederation and deletes it. Returns an error if one occurs. -func (c *meshFederations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("meshfederations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *meshFederations) 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("meshfederations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched meshFederation. -func (c *meshFederations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MeshFederation, err error) { - result = &v1.MeshFederation{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("meshfederations"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client/versioned/typed/core/v1/serviceexports.go b/client/versioned/typed/core/v1/serviceexports.go deleted file mode 100644 index fbea966a..00000000 --- a/client/versioned/typed/core/v1/serviceexports.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright Red Hat, Inc. -// -// 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" - "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" - scheme "maistra.io/api/client/versioned/scheme" - v1 "maistra.io/api/core/v1" -) - -// ServiceExportsGetter has a method to return a ServiceExportsInterface. -// A group's client should implement this interface. -type ServiceExportsGetter interface { - ServiceExports(namespace string) ServiceExportsInterface -} - -// ServiceExportsInterface has methods to work with ServiceExports resources. -type ServiceExportsInterface interface { - Create(ctx context.Context, serviceExports *v1.ServiceExports, opts metav1.CreateOptions) (*v1.ServiceExports, error) - Update(ctx context.Context, serviceExports *v1.ServiceExports, opts metav1.UpdateOptions) (*v1.ServiceExports, error) - UpdateStatus(ctx context.Context, serviceExports *v1.ServiceExports, opts metav1.UpdateOptions) (*v1.ServiceExports, 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.ServiceExports, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceExportsList, 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.ServiceExports, err error) - ServiceExportsExpansion -} - -// serviceExports implements ServiceExportsInterface -type serviceExports struct { - client rest.Interface - ns string -} - -// newServiceExports returns a ServiceExports -func newServiceExports(c *CoreV1Client, namespace string) *serviceExports { - return &serviceExports{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the serviceExports, and returns the corresponding serviceExports object, and an error if there is any. -func (c *serviceExports) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceExports, err error) { - result = &v1.ServiceExports{} - err = c.client.Get(). - Namespace(c.ns). - Resource("serviceexports"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ServiceExports that match those selectors. -func (c *serviceExports) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceExportsList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ServiceExportsList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("serviceexports"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested serviceExports. -func (c *serviceExports) 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("serviceexports"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a serviceExports and creates it. Returns the server's representation of the serviceExports, and an error, if there is any. -func (c *serviceExports) Create(ctx context.Context, serviceExports *v1.ServiceExports, opts metav1.CreateOptions) (result *v1.ServiceExports, err error) { - result = &v1.ServiceExports{} - err = c.client.Post(). - Namespace(c.ns). - Resource("serviceexports"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceExports). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a serviceExports and updates it. Returns the server's representation of the serviceExports, and an error, if there is any. -func (c *serviceExports) Update(ctx context.Context, serviceExports *v1.ServiceExports, opts metav1.UpdateOptions) (result *v1.ServiceExports, err error) { - result = &v1.ServiceExports{} - err = c.client.Put(). - Namespace(c.ns). - Resource("serviceexports"). - Name(serviceExports.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceExports). - 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 *serviceExports) UpdateStatus(ctx context.Context, serviceExports *v1.ServiceExports, opts metav1.UpdateOptions) (result *v1.ServiceExports, err error) { - result = &v1.ServiceExports{} - err = c.client.Put(). - Namespace(c.ns). - Resource("serviceexports"). - Name(serviceExports.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceExports). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the serviceExports and deletes it. Returns an error if one occurs. -func (c *serviceExports) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("serviceexports"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *serviceExports) 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("serviceexports"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched serviceExports. -func (c *serviceExports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceExports, err error) { - result = &v1.ServiceExports{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("serviceexports"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client/versioned/typed/core/v1/serviceimports.go b/client/versioned/typed/core/v1/serviceimports.go deleted file mode 100644 index 397fff54..00000000 --- a/client/versioned/typed/core/v1/serviceimports.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright Red Hat, Inc. -// -// 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" - "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" - scheme "maistra.io/api/client/versioned/scheme" - v1 "maistra.io/api/core/v1" -) - -// ServiceImportsGetter has a method to return a ServiceImportsInterface. -// A group's client should implement this interface. -type ServiceImportsGetter interface { - ServiceImports(namespace string) ServiceImportsInterface -} - -// ServiceImportsInterface has methods to work with ServiceImports resources. -type ServiceImportsInterface interface { - Create(ctx context.Context, serviceImports *v1.ServiceImports, opts metav1.CreateOptions) (*v1.ServiceImports, error) - Update(ctx context.Context, serviceImports *v1.ServiceImports, opts metav1.UpdateOptions) (*v1.ServiceImports, error) - UpdateStatus(ctx context.Context, serviceImports *v1.ServiceImports, opts metav1.UpdateOptions) (*v1.ServiceImports, 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.ServiceImports, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceImportsList, 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.ServiceImports, err error) - ServiceImportsExpansion -} - -// serviceImports implements ServiceImportsInterface -type serviceImports struct { - client rest.Interface - ns string -} - -// newServiceImports returns a ServiceImports -func newServiceImports(c *CoreV1Client, namespace string) *serviceImports { - return &serviceImports{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the serviceImports, and returns the corresponding serviceImports object, and an error if there is any. -func (c *serviceImports) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceImports, err error) { - result = &v1.ServiceImports{} - err = c.client.Get(). - Namespace(c.ns). - Resource("serviceimports"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ServiceImports that match those selectors. -func (c *serviceImports) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceImportsList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ServiceImportsList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("serviceimports"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested serviceImports. -func (c *serviceImports) 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("serviceimports"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a serviceImports and creates it. Returns the server's representation of the serviceImports, and an error, if there is any. -func (c *serviceImports) Create(ctx context.Context, serviceImports *v1.ServiceImports, opts metav1.CreateOptions) (result *v1.ServiceImports, err error) { - result = &v1.ServiceImports{} - err = c.client.Post(). - Namespace(c.ns). - Resource("serviceimports"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceImports). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a serviceImports and updates it. Returns the server's representation of the serviceImports, and an error, if there is any. -func (c *serviceImports) Update(ctx context.Context, serviceImports *v1.ServiceImports, opts metav1.UpdateOptions) (result *v1.ServiceImports, err error) { - result = &v1.ServiceImports{} - err = c.client.Put(). - Namespace(c.ns). - Resource("serviceimports"). - Name(serviceImports.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceImports). - 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 *serviceImports) UpdateStatus(ctx context.Context, serviceImports *v1.ServiceImports, opts metav1.UpdateOptions) (result *v1.ServiceImports, err error) { - result = &v1.ServiceImports{} - err = c.client.Put(). - Namespace(c.ns). - Resource("serviceimports"). - Name(serviceImports.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceImports). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the serviceImports and deletes it. Returns an error if one occurs. -func (c *serviceImports) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("serviceimports"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *serviceImports) 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("serviceimports"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched serviceImports. -func (c *serviceImports) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceImports, err error) { - result = &v1.ServiceImports{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("serviceimports"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client/versioned/typed/federation/v1/doc.go b/client/versioned/typed/federation/v1/doc.go new file mode 100644 index 00000000..4f64357b --- /dev/null +++ b/client/versioned/typed/federation/v1/doc.go @@ -0,0 +1,18 @@ +// Copyright Red Hat, Inc. +// +// 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 v1 diff --git a/client/versioned/typed/federation/v1/exportedserviceset.go b/client/versioned/typed/federation/v1/exportedserviceset.go new file mode 100644 index 00000000..1cfe4352 --- /dev/null +++ b/client/versioned/typed/federation/v1/exportedserviceset.go @@ -0,0 +1,193 @@ +// Copyright Red Hat, Inc. +// +// 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" + "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" + scheme "maistra.io/api/client/versioned/scheme" + v1 "maistra.io/api/federation/v1" +) + +// ExportedServiceSetsGetter has a method to return a ExportedServiceSetInterface. +// A group's client should implement this interface. +type ExportedServiceSetsGetter interface { + ExportedServiceSets(namespace string) ExportedServiceSetInterface +} + +// ExportedServiceSetInterface has methods to work with ExportedServiceSet resources. +type ExportedServiceSetInterface interface { + Create(ctx context.Context, exportedServiceSet *v1.ExportedServiceSet, opts metav1.CreateOptions) (*v1.ExportedServiceSet, error) + Update(ctx context.Context, exportedServiceSet *v1.ExportedServiceSet, opts metav1.UpdateOptions) (*v1.ExportedServiceSet, error) + UpdateStatus(ctx context.Context, exportedServiceSet *v1.ExportedServiceSet, opts metav1.UpdateOptions) (*v1.ExportedServiceSet, 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.ExportedServiceSet, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExportedServiceSetList, 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.ExportedServiceSet, err error) + ExportedServiceSetExpansion +} + +// exportedServiceSets implements ExportedServiceSetInterface +type exportedServiceSets struct { + client rest.Interface + ns string +} + +// newExportedServiceSets returns a ExportedServiceSets +func newExportedServiceSets(c *FederationV1Client, namespace string) *exportedServiceSets { + return &exportedServiceSets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the exportedServiceSet, and returns the corresponding exportedServiceSet object, and an error if there is any. +func (c *exportedServiceSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ExportedServiceSet, err error) { + result = &v1.ExportedServiceSet{} + err = c.client.Get(). + Namespace(c.ns). + Resource("exportedservicesets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ExportedServiceSets that match those selectors. +func (c *exportedServiceSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExportedServiceSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ExportedServiceSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("exportedservicesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested exportedServiceSets. +func (c *exportedServiceSets) 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("exportedservicesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a exportedServiceSet and creates it. Returns the server's representation of the exportedServiceSet, and an error, if there is any. +func (c *exportedServiceSets) Create(ctx context.Context, exportedServiceSet *v1.ExportedServiceSet, opts metav1.CreateOptions) (result *v1.ExportedServiceSet, err error) { + result = &v1.ExportedServiceSet{} + err = c.client.Post(). + Namespace(c.ns). + Resource("exportedservicesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(exportedServiceSet). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a exportedServiceSet and updates it. Returns the server's representation of the exportedServiceSet, and an error, if there is any. +func (c *exportedServiceSets) Update(ctx context.Context, exportedServiceSet *v1.ExportedServiceSet, opts metav1.UpdateOptions) (result *v1.ExportedServiceSet, err error) { + result = &v1.ExportedServiceSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("exportedservicesets"). + Name(exportedServiceSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(exportedServiceSet). + 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 *exportedServiceSets) UpdateStatus(ctx context.Context, exportedServiceSet *v1.ExportedServiceSet, opts metav1.UpdateOptions) (result *v1.ExportedServiceSet, err error) { + result = &v1.ExportedServiceSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("exportedservicesets"). + Name(exportedServiceSet.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(exportedServiceSet). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the exportedServiceSet and deletes it. Returns an error if one occurs. +func (c *exportedServiceSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("exportedservicesets"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *exportedServiceSets) 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("exportedservicesets"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched exportedServiceSet. +func (c *exportedServiceSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ExportedServiceSet, err error) { + result = &v1.ExportedServiceSet{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("exportedservicesets"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/client/versioned/typed/federation/v1/fake/doc.go b/client/versioned/typed/federation/v1/fake/doc.go new file mode 100644 index 00000000..52886aa7 --- /dev/null +++ b/client/versioned/typed/federation/v1/fake/doc.go @@ -0,0 +1,18 @@ +// Copyright Red Hat, Inc. +// +// 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 has the automatically generated clients. +package fake diff --git a/client/versioned/typed/federation/v1/fake/fake_exportedserviceset.go b/client/versioned/typed/federation/v1/fake/fake_exportedserviceset.go new file mode 100644 index 00000000..88d530bb --- /dev/null +++ b/client/versioned/typed/federation/v1/fake/fake_exportedserviceset.go @@ -0,0 +1,140 @@ +// Copyright Red Hat, Inc. +// +// 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" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + federationv1 "maistra.io/api/federation/v1" +) + +// FakeExportedServiceSets implements ExportedServiceSetInterface +type FakeExportedServiceSets struct { + Fake *FakeFederationV1 + ns string +} + +var exportedservicesetsResource = schema.GroupVersionResource{Group: "federation.maistra.io", Version: "v1", Resource: "exportedservicesets"} + +var exportedservicesetsKind = schema.GroupVersionKind{Group: "federation.maistra.io", Version: "v1", Kind: "ExportedServiceSet"} + +// Get takes name of the exportedServiceSet, and returns the corresponding exportedServiceSet object, and an error if there is any. +func (c *FakeExportedServiceSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *federationv1.ExportedServiceSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(exportedservicesetsResource, c.ns, name), &federationv1.ExportedServiceSet{}) + + if obj == nil { + return nil, err + } + return obj.(*federationv1.ExportedServiceSet), err +} + +// List takes label and field selectors, and returns the list of ExportedServiceSets that match those selectors. +func (c *FakeExportedServiceSets) List(ctx context.Context, opts v1.ListOptions) (result *federationv1.ExportedServiceSetList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(exportedservicesetsResource, exportedservicesetsKind, c.ns, opts), &federationv1.ExportedServiceSetList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &federationv1.ExportedServiceSetList{ListMeta: obj.(*federationv1.ExportedServiceSetList).ListMeta} + for _, item := range obj.(*federationv1.ExportedServiceSetList).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 exportedServiceSets. +func (c *FakeExportedServiceSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(exportedservicesetsResource, c.ns, opts)) + +} + +// Create takes the representation of a exportedServiceSet and creates it. Returns the server's representation of the exportedServiceSet, and an error, if there is any. +func (c *FakeExportedServiceSets) Create(ctx context.Context, exportedServiceSet *federationv1.ExportedServiceSet, opts v1.CreateOptions) (result *federationv1.ExportedServiceSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(exportedservicesetsResource, c.ns, exportedServiceSet), &federationv1.ExportedServiceSet{}) + + if obj == nil { + return nil, err + } + return obj.(*federationv1.ExportedServiceSet), err +} + +// Update takes the representation of a exportedServiceSet and updates it. Returns the server's representation of the exportedServiceSet, and an error, if there is any. +func (c *FakeExportedServiceSets) Update(ctx context.Context, exportedServiceSet *federationv1.ExportedServiceSet, opts v1.UpdateOptions) (result *federationv1.ExportedServiceSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(exportedservicesetsResource, c.ns, exportedServiceSet), &federationv1.ExportedServiceSet{}) + + if obj == nil { + return nil, err + } + return obj.(*federationv1.ExportedServiceSet), 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 *FakeExportedServiceSets) UpdateStatus(ctx context.Context, exportedServiceSet *federationv1.ExportedServiceSet, opts v1.UpdateOptions) (*federationv1.ExportedServiceSet, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(exportedservicesetsResource, "status", c.ns, exportedServiceSet), &federationv1.ExportedServiceSet{}) + + if obj == nil { + return nil, err + } + return obj.(*federationv1.ExportedServiceSet), err +} + +// Delete takes name of the exportedServiceSet and deletes it. Returns an error if one occurs. +func (c *FakeExportedServiceSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(exportedservicesetsResource, c.ns, name), &federationv1.ExportedServiceSet{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeExportedServiceSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(exportedservicesetsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &federationv1.ExportedServiceSetList{}) + return err +} + +// Patch applies the patch and returns the patched exportedServiceSet. +func (c *FakeExportedServiceSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *federationv1.ExportedServiceSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(exportedservicesetsResource, c.ns, name, pt, data, subresources...), &federationv1.ExportedServiceSet{}) + + if obj == nil { + return nil, err + } + return obj.(*federationv1.ExportedServiceSet), err +} diff --git a/client/versioned/typed/federation/v1/fake/fake_federation_client.go b/client/versioned/typed/federation/v1/fake/fake_federation_client.go new file mode 100644 index 00000000..a7401b4c --- /dev/null +++ b/client/versioned/typed/federation/v1/fake/fake_federation_client.go @@ -0,0 +1,46 @@ +// Copyright Red Hat, Inc. +// +// 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" + v1 "maistra.io/api/client/versioned/typed/federation/v1" +) + +type FakeFederationV1 struct { + *testing.Fake +} + +func (c *FakeFederationV1) ExportedServiceSets(namespace string) v1.ExportedServiceSetInterface { + return &FakeExportedServiceSets{c, namespace} +} + +func (c *FakeFederationV1) ImportedServiceSets(namespace string) v1.ImportedServiceSetInterface { + return &FakeImportedServiceSets{c, namespace} +} + +func (c *FakeFederationV1) ServiceMeshPeers(namespace string) v1.ServiceMeshPeerInterface { + return &FakeServiceMeshPeers{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeFederationV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/client/versioned/typed/federation/v1/fake/fake_importedserviceset.go b/client/versioned/typed/federation/v1/fake/fake_importedserviceset.go new file mode 100644 index 00000000..73937b4c --- /dev/null +++ b/client/versioned/typed/federation/v1/fake/fake_importedserviceset.go @@ -0,0 +1,140 @@ +// Copyright Red Hat, Inc. +// +// 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" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + federationv1 "maistra.io/api/federation/v1" +) + +// FakeImportedServiceSets implements ImportedServiceSetInterface +type FakeImportedServiceSets struct { + Fake *FakeFederationV1 + ns string +} + +var importedservicesetsResource = schema.GroupVersionResource{Group: "federation.maistra.io", Version: "v1", Resource: "importedservicesets"} + +var importedservicesetsKind = schema.GroupVersionKind{Group: "federation.maistra.io", Version: "v1", Kind: "ImportedServiceSet"} + +// Get takes name of the importedServiceSet, and returns the corresponding importedServiceSet object, and an error if there is any. +func (c *FakeImportedServiceSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *federationv1.ImportedServiceSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(importedservicesetsResource, c.ns, name), &federationv1.ImportedServiceSet{}) + + if obj == nil { + return nil, err + } + return obj.(*federationv1.ImportedServiceSet), err +} + +// List takes label and field selectors, and returns the list of ImportedServiceSets that match those selectors. +func (c *FakeImportedServiceSets) List(ctx context.Context, opts v1.ListOptions) (result *federationv1.ImportedServiceSetList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(importedservicesetsResource, importedservicesetsKind, c.ns, opts), &federationv1.ImportedServiceSetList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &federationv1.ImportedServiceSetList{ListMeta: obj.(*federationv1.ImportedServiceSetList).ListMeta} + for _, item := range obj.(*federationv1.ImportedServiceSetList).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 importedServiceSets. +func (c *FakeImportedServiceSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(importedservicesetsResource, c.ns, opts)) + +} + +// Create takes the representation of a importedServiceSet and creates it. Returns the server's representation of the importedServiceSet, and an error, if there is any. +func (c *FakeImportedServiceSets) Create(ctx context.Context, importedServiceSet *federationv1.ImportedServiceSet, opts v1.CreateOptions) (result *federationv1.ImportedServiceSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(importedservicesetsResource, c.ns, importedServiceSet), &federationv1.ImportedServiceSet{}) + + if obj == nil { + return nil, err + } + return obj.(*federationv1.ImportedServiceSet), err +} + +// Update takes the representation of a importedServiceSet and updates it. Returns the server's representation of the importedServiceSet, and an error, if there is any. +func (c *FakeImportedServiceSets) Update(ctx context.Context, importedServiceSet *federationv1.ImportedServiceSet, opts v1.UpdateOptions) (result *federationv1.ImportedServiceSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(importedservicesetsResource, c.ns, importedServiceSet), &federationv1.ImportedServiceSet{}) + + if obj == nil { + return nil, err + } + return obj.(*federationv1.ImportedServiceSet), 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 *FakeImportedServiceSets) UpdateStatus(ctx context.Context, importedServiceSet *federationv1.ImportedServiceSet, opts v1.UpdateOptions) (*federationv1.ImportedServiceSet, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(importedservicesetsResource, "status", c.ns, importedServiceSet), &federationv1.ImportedServiceSet{}) + + if obj == nil { + return nil, err + } + return obj.(*federationv1.ImportedServiceSet), err +} + +// Delete takes name of the importedServiceSet and deletes it. Returns an error if one occurs. +func (c *FakeImportedServiceSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(importedservicesetsResource, c.ns, name), &federationv1.ImportedServiceSet{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeImportedServiceSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(importedservicesetsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &federationv1.ImportedServiceSetList{}) + return err +} + +// Patch applies the patch and returns the patched importedServiceSet. +func (c *FakeImportedServiceSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *federationv1.ImportedServiceSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(importedservicesetsResource, c.ns, name, pt, data, subresources...), &federationv1.ImportedServiceSet{}) + + if obj == nil { + return nil, err + } + return obj.(*federationv1.ImportedServiceSet), err +} diff --git a/client/versioned/typed/federation/v1/fake/fake_servicemeshpeer.go b/client/versioned/typed/federation/v1/fake/fake_servicemeshpeer.go new file mode 100644 index 00000000..992244b6 --- /dev/null +++ b/client/versioned/typed/federation/v1/fake/fake_servicemeshpeer.go @@ -0,0 +1,140 @@ +// Copyright Red Hat, Inc. +// +// 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" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + federationv1 "maistra.io/api/federation/v1" +) + +// FakeServiceMeshPeers implements ServiceMeshPeerInterface +type FakeServiceMeshPeers struct { + Fake *FakeFederationV1 + ns string +} + +var servicemeshpeersResource = schema.GroupVersionResource{Group: "federation.maistra.io", Version: "v1", Resource: "servicemeshpeers"} + +var servicemeshpeersKind = schema.GroupVersionKind{Group: "federation.maistra.io", Version: "v1", Kind: "ServiceMeshPeer"} + +// Get takes name of the serviceMeshPeer, and returns the corresponding serviceMeshPeer object, and an error if there is any. +func (c *FakeServiceMeshPeers) Get(ctx context.Context, name string, options v1.GetOptions) (result *federationv1.ServiceMeshPeer, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(servicemeshpeersResource, c.ns, name), &federationv1.ServiceMeshPeer{}) + + if obj == nil { + return nil, err + } + return obj.(*federationv1.ServiceMeshPeer), err +} + +// List takes label and field selectors, and returns the list of ServiceMeshPeers that match those selectors. +func (c *FakeServiceMeshPeers) List(ctx context.Context, opts v1.ListOptions) (result *federationv1.ServiceMeshPeerList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(servicemeshpeersResource, servicemeshpeersKind, c.ns, opts), &federationv1.ServiceMeshPeerList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &federationv1.ServiceMeshPeerList{ListMeta: obj.(*federationv1.ServiceMeshPeerList).ListMeta} + for _, item := range obj.(*federationv1.ServiceMeshPeerList).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 serviceMeshPeers. +func (c *FakeServiceMeshPeers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(servicemeshpeersResource, c.ns, opts)) + +} + +// Create takes the representation of a serviceMeshPeer and creates it. Returns the server's representation of the serviceMeshPeer, and an error, if there is any. +func (c *FakeServiceMeshPeers) Create(ctx context.Context, serviceMeshPeer *federationv1.ServiceMeshPeer, opts v1.CreateOptions) (result *federationv1.ServiceMeshPeer, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(servicemeshpeersResource, c.ns, serviceMeshPeer), &federationv1.ServiceMeshPeer{}) + + if obj == nil { + return nil, err + } + return obj.(*federationv1.ServiceMeshPeer), err +} + +// Update takes the representation of a serviceMeshPeer and updates it. Returns the server's representation of the serviceMeshPeer, and an error, if there is any. +func (c *FakeServiceMeshPeers) Update(ctx context.Context, serviceMeshPeer *federationv1.ServiceMeshPeer, opts v1.UpdateOptions) (result *federationv1.ServiceMeshPeer, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(servicemeshpeersResource, c.ns, serviceMeshPeer), &federationv1.ServiceMeshPeer{}) + + if obj == nil { + return nil, err + } + return obj.(*federationv1.ServiceMeshPeer), 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 *FakeServiceMeshPeers) UpdateStatus(ctx context.Context, serviceMeshPeer *federationv1.ServiceMeshPeer, opts v1.UpdateOptions) (*federationv1.ServiceMeshPeer, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(servicemeshpeersResource, "status", c.ns, serviceMeshPeer), &federationv1.ServiceMeshPeer{}) + + if obj == nil { + return nil, err + } + return obj.(*federationv1.ServiceMeshPeer), err +} + +// Delete takes name of the serviceMeshPeer and deletes it. Returns an error if one occurs. +func (c *FakeServiceMeshPeers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(servicemeshpeersResource, c.ns, name), &federationv1.ServiceMeshPeer{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceMeshPeers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(servicemeshpeersResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &federationv1.ServiceMeshPeerList{}) + return err +} + +// Patch applies the patch and returns the patched serviceMeshPeer. +func (c *FakeServiceMeshPeers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *federationv1.ServiceMeshPeer, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(servicemeshpeersResource, c.ns, name, pt, data, subresources...), &federationv1.ServiceMeshPeer{}) + + if obj == nil { + return nil, err + } + return obj.(*federationv1.ServiceMeshPeer), err +} diff --git a/client/versioned/typed/federation/v1/federation_client.go b/client/versioned/typed/federation/v1/federation_client.go new file mode 100644 index 00000000..2db52285 --- /dev/null +++ b/client/versioned/typed/federation/v1/federation_client.go @@ -0,0 +1,97 @@ +// Copyright Red Hat, Inc. +// +// 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 ( + rest "k8s.io/client-go/rest" + "maistra.io/api/client/versioned/scheme" + v1 "maistra.io/api/federation/v1" +) + +type FederationV1Interface interface { + RESTClient() rest.Interface + ExportedServiceSetsGetter + ImportedServiceSetsGetter + ServiceMeshPeersGetter +} + +// FederationV1Client is used to interact with features provided by the federation.maistra.io group. +type FederationV1Client struct { + restClient rest.Interface +} + +func (c *FederationV1Client) ExportedServiceSets(namespace string) ExportedServiceSetInterface { + return newExportedServiceSets(c, namespace) +} + +func (c *FederationV1Client) ImportedServiceSets(namespace string) ImportedServiceSetInterface { + return newImportedServiceSets(c, namespace) +} + +func (c *FederationV1Client) ServiceMeshPeers(namespace string) ServiceMeshPeerInterface { + return newServiceMeshPeers(c, namespace) +} + +// NewForConfig creates a new FederationV1Client for the given config. +func NewForConfig(c *rest.Config) (*FederationV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &FederationV1Client{client}, nil +} + +// NewForConfigOrDie creates a new FederationV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *FederationV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new FederationV1Client for the given RESTClient. +func New(c rest.Interface) *FederationV1Client { + return &FederationV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.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 *FederationV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/client/versioned/typed/federation/v1/generated_expansion.go b/client/versioned/typed/federation/v1/generated_expansion.go new file mode 100644 index 00000000..1536004a --- /dev/null +++ b/client/versioned/typed/federation/v1/generated_expansion.go @@ -0,0 +1,23 @@ +// Copyright Red Hat, Inc. +// +// 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 + +type ExportedServiceSetExpansion interface{} + +type ImportedServiceSetExpansion interface{} + +type ServiceMeshPeerExpansion interface{} diff --git a/client/versioned/typed/federation/v1/importedserviceset.go b/client/versioned/typed/federation/v1/importedserviceset.go new file mode 100644 index 00000000..81150afa --- /dev/null +++ b/client/versioned/typed/federation/v1/importedserviceset.go @@ -0,0 +1,193 @@ +// Copyright Red Hat, Inc. +// +// 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" + "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" + scheme "maistra.io/api/client/versioned/scheme" + v1 "maistra.io/api/federation/v1" +) + +// ImportedServiceSetsGetter has a method to return a ImportedServiceSetInterface. +// A group's client should implement this interface. +type ImportedServiceSetsGetter interface { + ImportedServiceSets(namespace string) ImportedServiceSetInterface +} + +// ImportedServiceSetInterface has methods to work with ImportedServiceSet resources. +type ImportedServiceSetInterface interface { + Create(ctx context.Context, importedServiceSet *v1.ImportedServiceSet, opts metav1.CreateOptions) (*v1.ImportedServiceSet, error) + Update(ctx context.Context, importedServiceSet *v1.ImportedServiceSet, opts metav1.UpdateOptions) (*v1.ImportedServiceSet, error) + UpdateStatus(ctx context.Context, importedServiceSet *v1.ImportedServiceSet, opts metav1.UpdateOptions) (*v1.ImportedServiceSet, 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.ImportedServiceSet, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ImportedServiceSetList, 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.ImportedServiceSet, err error) + ImportedServiceSetExpansion +} + +// importedServiceSets implements ImportedServiceSetInterface +type importedServiceSets struct { + client rest.Interface + ns string +} + +// newImportedServiceSets returns a ImportedServiceSets +func newImportedServiceSets(c *FederationV1Client, namespace string) *importedServiceSets { + return &importedServiceSets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the importedServiceSet, and returns the corresponding importedServiceSet object, and an error if there is any. +func (c *importedServiceSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ImportedServiceSet, err error) { + result = &v1.ImportedServiceSet{} + err = c.client.Get(). + Namespace(c.ns). + Resource("importedservicesets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ImportedServiceSets that match those selectors. +func (c *importedServiceSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ImportedServiceSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ImportedServiceSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("importedservicesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested importedServiceSets. +func (c *importedServiceSets) 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("importedservicesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a importedServiceSet and creates it. Returns the server's representation of the importedServiceSet, and an error, if there is any. +func (c *importedServiceSets) Create(ctx context.Context, importedServiceSet *v1.ImportedServiceSet, opts metav1.CreateOptions) (result *v1.ImportedServiceSet, err error) { + result = &v1.ImportedServiceSet{} + err = c.client.Post(). + Namespace(c.ns). + Resource("importedservicesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(importedServiceSet). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a importedServiceSet and updates it. Returns the server's representation of the importedServiceSet, and an error, if there is any. +func (c *importedServiceSets) Update(ctx context.Context, importedServiceSet *v1.ImportedServiceSet, opts metav1.UpdateOptions) (result *v1.ImportedServiceSet, err error) { + result = &v1.ImportedServiceSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("importedservicesets"). + Name(importedServiceSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(importedServiceSet). + 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 *importedServiceSets) UpdateStatus(ctx context.Context, importedServiceSet *v1.ImportedServiceSet, opts metav1.UpdateOptions) (result *v1.ImportedServiceSet, err error) { + result = &v1.ImportedServiceSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("importedservicesets"). + Name(importedServiceSet.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(importedServiceSet). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the importedServiceSet and deletes it. Returns an error if one occurs. +func (c *importedServiceSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("importedservicesets"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *importedServiceSets) 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("importedservicesets"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched importedServiceSet. +func (c *importedServiceSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ImportedServiceSet, err error) { + result = &v1.ImportedServiceSet{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("importedservicesets"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/client/versioned/typed/federation/v1/servicemeshpeer.go b/client/versioned/typed/federation/v1/servicemeshpeer.go new file mode 100644 index 00000000..2c017765 --- /dev/null +++ b/client/versioned/typed/federation/v1/servicemeshpeer.go @@ -0,0 +1,193 @@ +// Copyright Red Hat, Inc. +// +// 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" + "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" + scheme "maistra.io/api/client/versioned/scheme" + v1 "maistra.io/api/federation/v1" +) + +// ServiceMeshPeersGetter has a method to return a ServiceMeshPeerInterface. +// A group's client should implement this interface. +type ServiceMeshPeersGetter interface { + ServiceMeshPeers(namespace string) ServiceMeshPeerInterface +} + +// ServiceMeshPeerInterface has methods to work with ServiceMeshPeer resources. +type ServiceMeshPeerInterface interface { + Create(ctx context.Context, serviceMeshPeer *v1.ServiceMeshPeer, opts metav1.CreateOptions) (*v1.ServiceMeshPeer, error) + Update(ctx context.Context, serviceMeshPeer *v1.ServiceMeshPeer, opts metav1.UpdateOptions) (*v1.ServiceMeshPeer, error) + UpdateStatus(ctx context.Context, serviceMeshPeer *v1.ServiceMeshPeer, opts metav1.UpdateOptions) (*v1.ServiceMeshPeer, 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.ServiceMeshPeer, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceMeshPeerList, 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.ServiceMeshPeer, err error) + ServiceMeshPeerExpansion +} + +// serviceMeshPeers implements ServiceMeshPeerInterface +type serviceMeshPeers struct { + client rest.Interface + ns string +} + +// newServiceMeshPeers returns a ServiceMeshPeers +func newServiceMeshPeers(c *FederationV1Client, namespace string) *serviceMeshPeers { + return &serviceMeshPeers{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the serviceMeshPeer, and returns the corresponding serviceMeshPeer object, and an error if there is any. +func (c *serviceMeshPeers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceMeshPeer, err error) { + result = &v1.ServiceMeshPeer{} + err = c.client.Get(). + Namespace(c.ns). + Resource("servicemeshpeers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceMeshPeers that match those selectors. +func (c *serviceMeshPeers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceMeshPeerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceMeshPeerList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("servicemeshpeers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceMeshPeers. +func (c *serviceMeshPeers) 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("servicemeshpeers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceMeshPeer and creates it. Returns the server's representation of the serviceMeshPeer, and an error, if there is any. +func (c *serviceMeshPeers) Create(ctx context.Context, serviceMeshPeer *v1.ServiceMeshPeer, opts metav1.CreateOptions) (result *v1.ServiceMeshPeer, err error) { + result = &v1.ServiceMeshPeer{} + err = c.client.Post(). + Namespace(c.ns). + Resource("servicemeshpeers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceMeshPeer). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceMeshPeer and updates it. Returns the server's representation of the serviceMeshPeer, and an error, if there is any. +func (c *serviceMeshPeers) Update(ctx context.Context, serviceMeshPeer *v1.ServiceMeshPeer, opts metav1.UpdateOptions) (result *v1.ServiceMeshPeer, err error) { + result = &v1.ServiceMeshPeer{} + err = c.client.Put(). + Namespace(c.ns). + Resource("servicemeshpeers"). + Name(serviceMeshPeer.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceMeshPeer). + 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 *serviceMeshPeers) UpdateStatus(ctx context.Context, serviceMeshPeer *v1.ServiceMeshPeer, opts metav1.UpdateOptions) (result *v1.ServiceMeshPeer, err error) { + result = &v1.ServiceMeshPeer{} + err = c.client.Put(). + Namespace(c.ns). + Resource("servicemeshpeers"). + Name(serviceMeshPeer.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceMeshPeer). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceMeshPeer and deletes it. Returns an error if one occurs. +func (c *serviceMeshPeers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("servicemeshpeers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceMeshPeers) 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("servicemeshpeers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceMeshPeer. +func (c *serviceMeshPeers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceMeshPeer, err error) { + result = &v1.ServiceMeshPeer{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("servicemeshpeers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/client/xnsinformer/core/v1/interface.go b/client/xnsinformer/core/v1/interface.go index 46f3c143..b04f0b54 100644 --- a/client/xnsinformer/core/v1/interface.go +++ b/client/xnsinformer/core/v1/interface.go @@ -23,12 +23,6 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { - // MeshFederations returns a MeshFederationInformer. - MeshFederations() MeshFederationInformer - // ServiceExports returns a ServiceExportsInformer. - ServiceExports() ServiceExportsInformer - // ServiceImports returns a ServiceImportsInformer. - ServiceImports() ServiceImportsInformer // ServiceMeshControlPlanes returns a ServiceMeshControlPlaneInformer. ServiceMeshControlPlanes() ServiceMeshControlPlaneInformer // ServiceMeshExtensions returns a ServiceMeshExtensionInformer. @@ -50,21 +44,6 @@ func New(f internalinterfaces.SharedInformerFactory, namespaces informers.Namesp return &version{factory: f, namespaces: namespaces, tweakListOptions: tweakListOptions} } -// MeshFederations returns a MeshFederationInformer. -func (v *version) MeshFederations() MeshFederationInformer { - return &meshFederationInformer{factory: v.factory, namespaces: v.namespaces, tweakListOptions: v.tweakListOptions} -} - -// ServiceExports returns a ServiceExportsInformer. -func (v *version) ServiceExports() ServiceExportsInformer { - return &serviceExportsInformer{factory: v.factory, namespaces: v.namespaces, tweakListOptions: v.tweakListOptions} -} - -// ServiceImports returns a ServiceImportsInformer. -func (v *version) ServiceImports() ServiceImportsInformer { - return &serviceImportsInformer{factory: v.factory, namespaces: v.namespaces, tweakListOptions: v.tweakListOptions} -} - // ServiceMeshControlPlanes returns a ServiceMeshControlPlaneInformer. func (v *version) ServiceMeshControlPlanes() ServiceMeshControlPlaneInformer { return &serviceMeshControlPlaneInformer{factory: v.factory, namespaces: v.namespaces, tweakListOptions: v.tweakListOptions} diff --git a/client/xnsinformer/factory.go b/client/xnsinformer/factory.go index 7b7ff02c..04640d2b 100644 --- a/client/xnsinformer/factory.go +++ b/client/xnsinformer/factory.go @@ -28,6 +28,7 @@ import ( cache "k8s.io/client-go/tools/cache" versioned "maistra.io/api/client/versioned" core "maistra.io/api/client/xnsinformer/core" + federation "maistra.io/api/client/xnsinformer/federation" internalinterfaces "maistra.io/api/client/xnsinformer/internalinterfaces" ) @@ -173,8 +174,13 @@ type SharedInformerFactory interface { WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool Core() core.Interface + Federation() federation.Interface } func (f *sharedInformerFactory) Core() core.Interface { return core.New(f, f.namespaces, f.tweakListOptions) } + +func (f *sharedInformerFactory) Federation() federation.Interface { + return federation.New(f, f.namespaces, f.tweakListOptions) +} diff --git a/client/xnsinformer/federation/interface.go b/client/xnsinformer/federation/interface.go new file mode 100644 index 00000000..3e09b623 --- /dev/null +++ b/client/xnsinformer/federation/interface.go @@ -0,0 +1,45 @@ +// Copyright Red Hat, Inc. +// +// 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 xns-informer-gen. DO NOT EDIT. + +package federation + +import ( + informers "github.com/maistra/xns-informer/pkg/informers" + v1 "maistra.io/api/client/xnsinformer/federation/v1" + internalinterfaces "maistra.io/api/client/xnsinformer/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespaces informers.NamespaceSet + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespaces informers.NamespaceSet, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespaces: namespaces, tweakListOptions: tweakListOptions} +} + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespaces, g.tweakListOptions) +} diff --git a/client/xnsinformer/core/v1/serviceimports.go b/client/xnsinformer/federation/v1/exportedserviceset.go similarity index 53% rename from client/xnsinformer/core/v1/serviceimports.go rename to client/xnsinformer/federation/v1/exportedserviceset.go index fb9bb1ad..95ce43d0 100644 --- a/client/xnsinformer/core/v1/serviceimports.go +++ b/client/xnsinformer/federation/v1/exportedserviceset.go @@ -25,36 +25,36 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - v1 "maistra.io/api/client/listers/core/v1" + v1 "maistra.io/api/client/listers/federation/v1" versioned "maistra.io/api/client/versioned" internalinterfaces "maistra.io/api/client/xnsinformer/internalinterfaces" - corev1 "maistra.io/api/core/v1" + federationv1 "maistra.io/api/federation/v1" ) -// ServiceImportsInformer provides access to a shared informer and lister for -// ServiceImports. -type ServiceImportsInformer interface { +// ExportedServiceSetInformer provides access to a shared informer and lister for +// ExportedServiceSets. +type ExportedServiceSetInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.ServiceImportsLister + Lister() v1.ExportedServiceSetLister } -type serviceImportsInformer struct { +type exportedServiceSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespaces informers.NamespaceSet } -// NewServiceImportsInformer constructs a new informer for ServiceImports type. +// NewExportedServiceSetInformer constructs a new informer for ExportedServiceSet 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 NewServiceImportsInformer(client versioned.Interface, namespaces informers.NamespaceSet, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredServiceImportsInformer(client, namespaces, resyncPeriod, indexers, nil) +func NewExportedServiceSetInformer(client versioned.Interface, namespaces informers.NamespaceSet, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredExportedServiceSetInformer(client, namespaces, resyncPeriod, indexers, nil) } -// NewFilteredServiceImportsInformer constructs a new informer for ServiceImports type. +// NewFilteredExportedServiceSetInformer constructs a new informer for ExportedServiceSet 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 NewFilteredServiceImportsInformer(client versioned.Interface, namespaces informers.NamespaceSet, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredExportedServiceSetInformer(client versioned.Interface, namespaces informers.NamespaceSet, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { newInformer := func(namespace string) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ @@ -62,16 +62,16 @@ func NewFilteredServiceImportsInformer(client versioned.Interface, namespaces in if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ServiceImports(namespace).List(context.TODO(), options) + return client.FederationV1().ExportedServiceSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ServiceImports(namespace).Watch(context.TODO(), options) + return client.FederationV1().ExportedServiceSets(namespace).Watch(context.TODO(), options) }, }, - &corev1.ServiceImports{}, + &federationv1.ExportedServiceSet{}, resyncPeriod, indexers, ) @@ -80,14 +80,14 @@ func NewFilteredServiceImportsInformer(client versioned.Interface, namespaces in return informers.NewMultiNamespaceInformer(namespaces, resyncPeriod, newInformer) } -func (f *serviceImportsInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredServiceImportsInformer(client, f.namespaces, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *exportedServiceSetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredExportedServiceSetInformer(client, f.namespaces, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *serviceImportsInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&corev1.ServiceImports{}, f.defaultInformer) +func (f *exportedServiceSetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&federationv1.ExportedServiceSet{}, f.defaultInformer) } -func (f *serviceImportsInformer) Lister() v1.ServiceImportsLister { - return v1.NewServiceImportsLister(f.Informer().GetIndexer()) +func (f *exportedServiceSetInformer) Lister() v1.ExportedServiceSetLister { + return v1.NewExportedServiceSetLister(f.Informer().GetIndexer()) } diff --git a/client/xnsinformer/core/v1/meshfederation.go b/client/xnsinformer/federation/v1/importedserviceset.go similarity index 53% rename from client/xnsinformer/core/v1/meshfederation.go rename to client/xnsinformer/federation/v1/importedserviceset.go index dd4554f5..d0d777d1 100644 --- a/client/xnsinformer/core/v1/meshfederation.go +++ b/client/xnsinformer/federation/v1/importedserviceset.go @@ -25,36 +25,36 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - v1 "maistra.io/api/client/listers/core/v1" + v1 "maistra.io/api/client/listers/federation/v1" versioned "maistra.io/api/client/versioned" internalinterfaces "maistra.io/api/client/xnsinformer/internalinterfaces" - corev1 "maistra.io/api/core/v1" + federationv1 "maistra.io/api/federation/v1" ) -// MeshFederationInformer provides access to a shared informer and lister for -// MeshFederations. -type MeshFederationInformer interface { +// ImportedServiceSetInformer provides access to a shared informer and lister for +// ImportedServiceSets. +type ImportedServiceSetInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.MeshFederationLister + Lister() v1.ImportedServiceSetLister } -type meshFederationInformer struct { +type importedServiceSetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespaces informers.NamespaceSet } -// NewMeshFederationInformer constructs a new informer for MeshFederation type. +// NewImportedServiceSetInformer constructs a new informer for ImportedServiceSet 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 NewMeshFederationInformer(client versioned.Interface, namespaces informers.NamespaceSet, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredMeshFederationInformer(client, namespaces, resyncPeriod, indexers, nil) +func NewImportedServiceSetInformer(client versioned.Interface, namespaces informers.NamespaceSet, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredImportedServiceSetInformer(client, namespaces, resyncPeriod, indexers, nil) } -// NewFilteredMeshFederationInformer constructs a new informer for MeshFederation type. +// NewFilteredImportedServiceSetInformer constructs a new informer for ImportedServiceSet 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 NewFilteredMeshFederationInformer(client versioned.Interface, namespaces informers.NamespaceSet, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredImportedServiceSetInformer(client versioned.Interface, namespaces informers.NamespaceSet, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { newInformer := func(namespace string) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ @@ -62,16 +62,16 @@ func NewFilteredMeshFederationInformer(client versioned.Interface, namespaces in if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().MeshFederations(namespace).List(context.TODO(), options) + return client.FederationV1().ImportedServiceSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().MeshFederations(namespace).Watch(context.TODO(), options) + return client.FederationV1().ImportedServiceSets(namespace).Watch(context.TODO(), options) }, }, - &corev1.MeshFederation{}, + &federationv1.ImportedServiceSet{}, resyncPeriod, indexers, ) @@ -80,14 +80,14 @@ func NewFilteredMeshFederationInformer(client versioned.Interface, namespaces in return informers.NewMultiNamespaceInformer(namespaces, resyncPeriod, newInformer) } -func (f *meshFederationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredMeshFederationInformer(client, f.namespaces, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *importedServiceSetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredImportedServiceSetInformer(client, f.namespaces, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *meshFederationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&corev1.MeshFederation{}, f.defaultInformer) +func (f *importedServiceSetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&federationv1.ImportedServiceSet{}, f.defaultInformer) } -func (f *meshFederationInformer) Lister() v1.MeshFederationLister { - return v1.NewMeshFederationLister(f.Informer().GetIndexer()) +func (f *importedServiceSetInformer) Lister() v1.ImportedServiceSetLister { + return v1.NewImportedServiceSetLister(f.Informer().GetIndexer()) } diff --git a/client/xnsinformer/federation/v1/interface.go b/client/xnsinformer/federation/v1/interface.go new file mode 100644 index 00000000..d73f2135 --- /dev/null +++ b/client/xnsinformer/federation/v1/interface.go @@ -0,0 +1,58 @@ +// Copyright Red Hat, Inc. +// +// 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 xns-informer-gen. DO NOT EDIT. + +package v1 + +import ( + informers "github.com/maistra/xns-informer/pkg/informers" + internalinterfaces "maistra.io/api/client/xnsinformer/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // ExportedServiceSets returns a ExportedServiceSetInformer. + ExportedServiceSets() ExportedServiceSetInformer + // ImportedServiceSets returns a ImportedServiceSetInformer. + ImportedServiceSets() ImportedServiceSetInformer + // ServiceMeshPeers returns a ServiceMeshPeerInformer. + ServiceMeshPeers() ServiceMeshPeerInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespaces informers.NamespaceSet + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespaces informers.NamespaceSet, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespaces: namespaces, tweakListOptions: tweakListOptions} +} + +// ExportedServiceSets returns a ExportedServiceSetInformer. +func (v *version) ExportedServiceSets() ExportedServiceSetInformer { + return &exportedServiceSetInformer{factory: v.factory, namespaces: v.namespaces, tweakListOptions: v.tweakListOptions} +} + +// ImportedServiceSets returns a ImportedServiceSetInformer. +func (v *version) ImportedServiceSets() ImportedServiceSetInformer { + return &importedServiceSetInformer{factory: v.factory, namespaces: v.namespaces, tweakListOptions: v.tweakListOptions} +} + +// ServiceMeshPeers returns a ServiceMeshPeerInformer. +func (v *version) ServiceMeshPeers() ServiceMeshPeerInformer { + return &serviceMeshPeerInformer{factory: v.factory, namespaces: v.namespaces, tweakListOptions: v.tweakListOptions} +} diff --git a/client/xnsinformer/core/v1/serviceexports.go b/client/xnsinformer/federation/v1/servicemeshpeer.go similarity index 54% rename from client/xnsinformer/core/v1/serviceexports.go rename to client/xnsinformer/federation/v1/servicemeshpeer.go index 06bd62f7..06c1e68d 100644 --- a/client/xnsinformer/core/v1/serviceexports.go +++ b/client/xnsinformer/federation/v1/servicemeshpeer.go @@ -25,36 +25,36 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - v1 "maistra.io/api/client/listers/core/v1" + v1 "maistra.io/api/client/listers/federation/v1" versioned "maistra.io/api/client/versioned" internalinterfaces "maistra.io/api/client/xnsinformer/internalinterfaces" - corev1 "maistra.io/api/core/v1" + federationv1 "maistra.io/api/federation/v1" ) -// ServiceExportsInformer provides access to a shared informer and lister for -// ServiceExports. -type ServiceExportsInformer interface { +// ServiceMeshPeerInformer provides access to a shared informer and lister for +// ServiceMeshPeers. +type ServiceMeshPeerInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.ServiceExportsLister + Lister() v1.ServiceMeshPeerLister } -type serviceExportsInformer struct { +type serviceMeshPeerInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespaces informers.NamespaceSet } -// NewServiceExportsInformer constructs a new informer for ServiceExports type. +// NewServiceMeshPeerInformer constructs a new informer for ServiceMeshPeer 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 NewServiceExportsInformer(client versioned.Interface, namespaces informers.NamespaceSet, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredServiceExportsInformer(client, namespaces, resyncPeriod, indexers, nil) +func NewServiceMeshPeerInformer(client versioned.Interface, namespaces informers.NamespaceSet, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceMeshPeerInformer(client, namespaces, resyncPeriod, indexers, nil) } -// NewFilteredServiceExportsInformer constructs a new informer for ServiceExports type. +// NewFilteredServiceMeshPeerInformer constructs a new informer for ServiceMeshPeer 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 NewFilteredServiceExportsInformer(client versioned.Interface, namespaces informers.NamespaceSet, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredServiceMeshPeerInformer(client versioned.Interface, namespaces informers.NamespaceSet, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { newInformer := func(namespace string) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ @@ -62,16 +62,16 @@ func NewFilteredServiceExportsInformer(client versioned.Interface, namespaces in if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ServiceExports(namespace).List(context.TODO(), options) + return client.FederationV1().ServiceMeshPeers(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ServiceExports(namespace).Watch(context.TODO(), options) + return client.FederationV1().ServiceMeshPeers(namespace).Watch(context.TODO(), options) }, }, - &corev1.ServiceExports{}, + &federationv1.ServiceMeshPeer{}, resyncPeriod, indexers, ) @@ -80,14 +80,14 @@ func NewFilteredServiceExportsInformer(client versioned.Interface, namespaces in return informers.NewMultiNamespaceInformer(namespaces, resyncPeriod, newInformer) } -func (f *serviceExportsInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredServiceExportsInformer(client, f.namespaces, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *serviceMeshPeerInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceMeshPeerInformer(client, f.namespaces, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *serviceExportsInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&corev1.ServiceExports{}, f.defaultInformer) +func (f *serviceMeshPeerInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&federationv1.ServiceMeshPeer{}, f.defaultInformer) } -func (f *serviceExportsInformer) Lister() v1.ServiceExportsLister { - return v1.NewServiceExportsLister(f.Informer().GetIndexer()) +func (f *serviceMeshPeerInformer) Lister() v1.ServiceMeshPeerLister { + return v1.NewServiceMeshPeerLister(f.Informer().GetIndexer()) } diff --git a/client/xnsinformer/generic.go b/client/xnsinformer/generic.go index 8aa59494..e109dd72 100644 --- a/client/xnsinformer/generic.go +++ b/client/xnsinformer/generic.go @@ -24,6 +24,7 @@ import ( v1 "maistra.io/api/core/v1" v1alpha1 "maistra.io/api/core/v1alpha1" v2 "maistra.io/api/core/v2" + federationv1 "maistra.io/api/federation/v1" ) // GenericInformer is type of SharedIndexInformer which will locate and delegate to other @@ -53,12 +54,6 @@ func (f *genericInformer) Lister() cache.GenericLister { func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { // Group=core, Version=v1 - case v1.SchemeGroupVersion.WithResource("meshfederations"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().MeshFederations().Informer()}, nil - case v1.SchemeGroupVersion.WithResource("serviceexports"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ServiceExports().Informer()}, nil - case v1.SchemeGroupVersion.WithResource("serviceimports"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ServiceImports().Informer()}, nil case v1.SchemeGroupVersion.WithResource("servicemeshcontrolplanes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ServiceMeshControlPlanes().Informer()}, nil case v1.SchemeGroupVersion.WithResource("servicemeshextensions"): @@ -76,6 +71,14 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case v2.SchemeGroupVersion.WithResource("servicemeshcontrolplanes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V2().ServiceMeshControlPlanes().Informer()}, nil + // Group=federation.maistra.io, Version=v1 + case federationv1.SchemeGroupVersion.WithResource("exportedservicesets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Federation().V1().ExportedServiceSets().Informer()}, nil + case federationv1.SchemeGroupVersion.WithResource("importedservicesets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Federation().V1().ImportedServiceSets().Informer()}, nil + case federationv1.SchemeGroupVersion.WithResource("servicemeshpeers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Federation().V1().ServiceMeshPeers().Informer()}, nil + } return nil, fmt.Errorf("no informer found for %v", resource) diff --git a/core/v1/groupversion_info.go b/core/v1/groupversion_info.go index b6bfa1e5..d6d1015b 100644 --- a/core/v1/groupversion_info.go +++ b/core/v1/groupversion_info.go @@ -46,8 +46,5 @@ func init() { &ServiceMeshControlPlane{}, &ServiceMeshControlPlaneList{}, &ServiceMeshMember{}, &ServiceMeshMemberList{}, &ServiceMeshMemberRoll{}, &ServiceMeshMemberRollList{}, - &MeshFederation{}, &MeshFederationList{}, - &ServiceExports{}, &ServiceExportsList{}, - &ServiceImports{}, &ServiceImportsList{}, ) } diff --git a/core/v1/zz_generated.deepcopy.go b/core/v1/zz_generated.deepcopy.go index 44ef4742..ee93f13b 100644 --- a/core/v1/zz_generated.deepcopy.go +++ b/core/v1/zz_generated.deepcopy.go @@ -150,102 +150,6 @@ func (in *DeploymentStatus) DeepCopy() *DeploymentStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DiscoveryConnectionStatus) DeepCopyInto(out *DiscoveryConnectionStatus) { - *out = *in - in.LastConnected.DeepCopyInto(&out.LastConnected) - in.LastEvent.DeepCopyInto(&out.LastEvent) - in.LastFullSync.DeepCopyInto(&out.LastFullSync) - in.LastDisconnect.DeepCopyInto(&out.LastDisconnect) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoveryConnectionStatus. -func (in *DiscoveryConnectionStatus) DeepCopy() *DiscoveryConnectionStatus { - if in == nil { - return nil - } - out := new(DiscoveryConnectionStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DiscoveryRemoteStatus) DeepCopyInto(out *DiscoveryRemoteStatus) { - *out = *in - in.DiscoveryConnectionStatus.DeepCopyInto(&out.DiscoveryConnectionStatus) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoveryRemoteStatus. -func (in *DiscoveryRemoteStatus) DeepCopy() *DiscoveryRemoteStatus { - if in == nil { - return nil - } - out := new(DiscoveryRemoteStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DiscoveryWatchStatus) DeepCopyInto(out *DiscoveryWatchStatus) { - *out = *in - in.DiscoveryConnectionStatus.DeepCopyInto(&out.DiscoveryConnectionStatus) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoveryWatchStatus. -func (in *DiscoveryWatchStatus) DeepCopy() *DiscoveryWatchStatus { - if in == nil { - return nil - } - out := new(DiscoveryWatchStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FederationDiscoveryStatus) DeepCopyInto(out *FederationDiscoveryStatus) { - *out = *in - if in.Active != nil { - in, out := &in.Active, &out.Active - *out = make([]FederationPodDiscoveryStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Inactive != nil { - in, out := &in.Inactive, &out.Inactive - *out = make([]FederationPodDiscoveryStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederationDiscoveryStatus. -func (in *FederationDiscoveryStatus) DeepCopy() *FederationDiscoveryStatus { - if in == nil { - return nil - } - out := new(FederationDiscoveryStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FederationPodDiscoveryStatus) DeepCopyInto(out *FederationPodDiscoveryStatus) { - *out = *in - in.MeshDiscoveryStatus.DeepCopyInto(&out.MeshDiscoveryStatus) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FederationPodDiscoveryStatus. -func (in *FederationPodDiscoveryStatus) DeepCopy() *FederationPodDiscoveryStatus { - if in == nil { - return nil - } - out := new(FederationPodDiscoveryStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmValues. func (in *HelmValues) DeepCopy() *HelmValues { if in == nil { @@ -256,496 +160,6 @@ func (in *HelmValues) DeepCopy() *HelmValues { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MeshDiscoveryStatus) DeepCopyInto(out *MeshDiscoveryStatus) { - *out = *in - if in.Remotes != nil { - in, out := &in.Remotes, &out.Remotes - *out = make([]DiscoveryRemoteStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.Watch.DeepCopyInto(&out.Watch) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshDiscoveryStatus. -func (in *MeshDiscoveryStatus) DeepCopy() *MeshDiscoveryStatus { - if in == nil { - return nil - } - out := new(MeshDiscoveryStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MeshFederation) DeepCopyInto(out *MeshFederation) { - *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 MeshFederation. -func (in *MeshFederation) DeepCopy() *MeshFederation { - if in == nil { - return nil - } - out := new(MeshFederation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MeshFederation) 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 *MeshFederationGateways) DeepCopyInto(out *MeshFederationGateways) { - *out = *in - out.Ingress = in.Ingress - out.Egress = in.Egress -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshFederationGateways. -func (in *MeshFederationGateways) DeepCopy() *MeshFederationGateways { - if in == nil { - return nil - } - out := new(MeshFederationGateways) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MeshFederationList) DeepCopyInto(out *MeshFederationList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MeshFederation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshFederationList. -func (in *MeshFederationList) DeepCopy() *MeshFederationList { - if in == nil { - return nil - } - out := new(MeshFederationList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MeshFederationList) 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 *MeshFederationRemote) DeepCopyInto(out *MeshFederationRemote) { - *out = *in - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshFederationRemote. -func (in *MeshFederationRemote) DeepCopy() *MeshFederationRemote { - if in == nil { - return nil - } - out := new(MeshFederationRemote) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MeshFederationSecurity) DeepCopyInto(out *MeshFederationSecurity) { - *out = *in - in.CertificateChain.DeepCopyInto(&out.CertificateChain) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshFederationSecurity. -func (in *MeshFederationSecurity) DeepCopy() *MeshFederationSecurity { - if in == nil { - return nil - } - out := new(MeshFederationSecurity) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MeshFederationSpec) DeepCopyInto(out *MeshFederationSpec) { - *out = *in - in.Remote.DeepCopyInto(&out.Remote) - out.Gateways = in.Gateways - in.Security.DeepCopyInto(&out.Security) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshFederationSpec. -func (in *MeshFederationSpec) DeepCopy() *MeshFederationSpec { - if in == nil { - return nil - } - out := new(MeshFederationSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MeshFederationStatus) DeepCopyInto(out *MeshFederationStatus) { - *out = *in - in.DiscoveryStatus.DeepCopyInto(&out.DiscoveryStatus) - if in.Exports != nil { - in, out := &in.Exports, &out.Exports - *out = make([]MeshServiceMapping, len(*in)) - copy(*out, *in) - } - if in.Imports != nil { - in, out := &in.Imports, &out.Imports - *out = make([]MeshServiceMapping, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshFederationStatus. -func (in *MeshFederationStatus) DeepCopy() *MeshFederationStatus { - if in == nil { - return nil - } - out := new(MeshFederationStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MeshServiceMapping) DeepCopyInto(out *MeshServiceMapping) { - *out = *in - out.LocalService = in.LocalService -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshServiceMapping. -func (in *MeshServiceMapping) DeepCopy() *MeshServiceMapping { - if in == nil { - return nil - } - out := new(MeshServiceMapping) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceExportRule) DeepCopyInto(out *ServiceExportRule) { - *out = *in - if in.LabelSelector != nil { - in, out := &in.LabelSelector, &out.LabelSelector - *out = new(ServiceImportExportLabelelector) - (*in).DeepCopyInto(*out) - } - if in.NameSelector != nil { - in, out := &in.NameSelector, &out.NameSelector - *out = new(ServiceNameMapping) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceExportRule. -func (in *ServiceExportRule) DeepCopy() *ServiceExportRule { - if in == nil { - return nil - } - out := new(ServiceExportRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceExportStatus) DeepCopyInto(out *ServiceExportStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceExportStatus. -func (in *ServiceExportStatus) DeepCopy() *ServiceExportStatus { - if in == nil { - return nil - } - out := new(ServiceExportStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceExports) DeepCopyInto(out *ServiceExports) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceExports. -func (in *ServiceExports) DeepCopy() *ServiceExports { - if in == nil { - return nil - } - out := new(ServiceExports) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ServiceExports) 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 *ServiceExportsList) DeepCopyInto(out *ServiceExportsList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ServiceExports, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceExportsList. -func (in *ServiceExportsList) DeepCopy() *ServiceExportsList { - if in == nil { - return nil - } - out := new(ServiceExportsList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ServiceExportsList) 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 *ServiceExportsSpec) DeepCopyInto(out *ServiceExportsSpec) { - *out = *in - if in.Exports != nil { - in, out := &in.Exports, &out.Exports - *out = make([]ServiceExportRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceExportsSpec. -func (in *ServiceExportsSpec) DeepCopy() *ServiceExportsSpec { - if in == nil { - return nil - } - out := new(ServiceExportsSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceImportExportLabelelector) DeepCopyInto(out *ServiceImportExportLabelelector) { - *out = *in - in.Selector.DeepCopyInto(&out.Selector) - if in.Aliases != nil { - in, out := &in.Aliases, &out.Aliases - *out = make([]ServiceNameMapping, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceImportExportLabelelector. -func (in *ServiceImportExportLabelelector) DeepCopy() *ServiceImportExportLabelelector { - if in == nil { - return nil - } - out := new(ServiceImportExportLabelelector) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceImportLocality) DeepCopyInto(out *ServiceImportLocality) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceImportLocality. -func (in *ServiceImportLocality) DeepCopy() *ServiceImportLocality { - if in == nil { - return nil - } - out := new(ServiceImportLocality) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceImportRule) DeepCopyInto(out *ServiceImportRule) { - *out = *in - if in.NameSelector != nil { - in, out := &in.NameSelector, &out.NameSelector - *out = new(ServiceNameMapping) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceImportRule. -func (in *ServiceImportRule) DeepCopy() *ServiceImportRule { - if in == nil { - return nil - } - out := new(ServiceImportRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceImports) DeepCopyInto(out *ServiceImports) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceImports. -func (in *ServiceImports) DeepCopy() *ServiceImports { - if in == nil { - return nil - } - out := new(ServiceImports) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ServiceImports) 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 *ServiceImportsList) DeepCopyInto(out *ServiceImportsList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ServiceImports, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceImportsList. -func (in *ServiceImportsList) DeepCopy() *ServiceImportsList { - if in == nil { - return nil - } - out := new(ServiceImportsList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ServiceImportsList) 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 *ServiceImportsSpec) DeepCopyInto(out *ServiceImportsSpec) { - *out = *in - if in.Locality != nil { - in, out := &in.Locality, &out.Locality - *out = new(ServiceImportLocality) - **out = **in - } - if in.Imports != nil { - in, out := &in.Imports, &out.Imports - *out = make([]ServiceImportRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceImportsSpec. -func (in *ServiceImportsSpec) DeepCopy() *ServiceImportsSpec { - if in == nil { - return nil - } - out := new(ServiceImportsSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceImportsStatus) DeepCopyInto(out *ServiceImportsStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceImportsStatus. -func (in *ServiceImportsStatus) DeepCopy() *ServiceImportsStatus { - if in == nil { - return nil - } - out := new(ServiceImportsStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceKey) DeepCopyInto(out *ServiceKey) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceKey. -func (in *ServiceKey) DeepCopy() *ServiceKey { - if in == nil { - return nil - } - out := new(ServiceKey) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ServiceMeshControlPlane) DeepCopyInto(out *ServiceMeshControlPlane) { *out = *in @@ -1214,42 +628,6 @@ func (in *ServiceMeshMemberStatusSummary) DeepCopy() *ServiceMeshMemberStatusSum return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceName) DeepCopyInto(out *ServiceName) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceName. -func (in *ServiceName) DeepCopy() *ServiceName { - if in == nil { - return nil - } - out := new(ServiceName) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceNameMapping) DeepCopyInto(out *ServiceNameMapping) { - *out = *in - out.Name = in.Name - if in.Alias != nil { - in, out := &in.Alias, &out.Alias - *out = new(ServiceName) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceNameMapping. -func (in *ServiceNameMapping) DeepCopy() *ServiceNameMapping { - if in == nil { - return nil - } - out := new(ServiceNameMapping) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StatusBase) DeepCopyInto(out *StatusBase) { *out = *in diff --git a/docs/crd/CRDS.adoc b/docs/crd/CRDS.adoc index 6a300491..93a44e6f 100644 --- a/docs/crd/CRDS.adoc +++ b/docs/crd/CRDS.adoc @@ -10,12 +10,6 @@ link:maistra.io_ServiceMeshControlPlane_v2.adoc[ServiceMeshControlPlane]:: Servi === v1 -link:maistra.io_MeshFederation_v1.adoc[MeshFederation]:: MeshFederation is the Schema for joining two meshes together. The resource name will be used to identify the 'cluster' to which imported services belong. - -link:maistra.io_ServiceExports_v1.adoc[ServiceExports]:: ServiceExport is the Schema for configuring exported services. The name of the ServiceExports resource must match the name of a MeshFederation resource defining the remote mesh to which the services will be exported. - -link:maistra.io_ServiceImports_v1.adoc[ServiceImports]:: ServiceImports is the Schema for configuring imported services. The name of the ServiceImports resource must match the name of a MeshFederation resource defining the remote mesh from which the services will be imported. - link:maistra.io_ServiceMeshControlPlane_v1.adoc[ServiceMeshControlPlane]:: ServiceMeshControlPlane represents a deployment of the service mesh control plane. The control plane components are deployed in the namespace in which the ServiceMeshControlPlane resides. The configuration options for the components that comprise the control plane are specified in this object. link:maistra.io_ServiceMeshExtension_v1.adoc[ServiceMeshExtension]:: ServiceMeshExtension is the Schema for the servicemeshextensions API @@ -30,3 +24,13 @@ link:maistra.io_ServiceMeshMemberRoll_v1.adoc[ServiceMeshMemberRoll]:: The Servi link:maistra.io_ServiceMeshExtension_v1alpha1.adoc[ServiceMeshExtension]:: ServiceMeshExtension is the Schema for the servicemeshextensions API +== federation.maistra.io + +=== v1 + +link:federation.maistra.io_ExportedServiceSet_v1.adoc[ExportedServiceSet]:: ExportedServiceSet is the Schema for configuring exported services. The name of the ExportedServiceSet resource must match the name of a ServiceMeshPeer resource defining the remote mesh to which the services will be exported. + +link:federation.maistra.io_ImportedServiceSet_v1.adoc[ImportedServiceSet]:: ImportedServiceSet is the Schema for configuring imported services. The name of the ImportedServiceSet resource must match the name of a ServiceMeshPeer resource defining the remote mesh from which the services will be imported. + +link:federation.maistra.io_ServiceMeshPeer_v1.adoc[ServiceMeshPeer]:: ServiceMeshPeer is the Schema for joining two meshes together. The resource name will be used to identify the 'cluster' to which imported services belong. + diff --git a/docs/crd/federation.maistra.io_ExportedServiceSet_v1.adoc b/docs/crd/federation.maistra.io_ExportedServiceSet_v1.adoc new file mode 100644 index 00000000..9962ce16 --- /dev/null +++ b/docs/crd/federation.maistra.io_ExportedServiceSet_v1.adoc @@ -0,0 +1,69 @@ + + += ExportedServiceSet - federation.maistra.io/v1 + +:toc: right + +maistra.io/api/federation/v1 + +ExportedServiceSet is the Schema for configuring exported services. The name of the ExportedServiceSet resource must match the name of a ServiceMeshPeer resource defining the remote mesh to which the services will be exported. + +.Table ExportedServiceSet Fields +|=== +| Name | Description | Type + +| apiVersion +| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources +| string + +| kind +| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds +| string + +| metadata +| +| <> + +| spec +| Spec defines rules for matching services to be exported. +| <> + +| status +| +| <> + +|=== + + +[#ExportedServiceSetSpec] +== ExportedServiceSetSpec + +maistra.io/api/federation/v1 + +.Table ExportedServiceSetSpec Fields +|=== +| Name | Description | Type + +| exportRules +| ExportRules are the rules that determine which services are exported from the mesh. The list is processed in order and the first spec in the list that applies to a service is the one that will be applied. This allows more specific selectors to be placed before more general selectors. +| []ExportedServiceRule + +|=== + + +[#ExportedServiceSetStatus] +== ExportedServiceSetStatus + +maistra.io/api/federation/v1 + +.Table ExportedServiceSetStatus Fields +|=== +| Name | Description | Type + +| exportedServices +| Exports provides details about the services exported by this mesh. +| []PeerServiceMapping + +|=== + + diff --git a/docs/crd/maistra.io_ServiceImports_ServiceImportLocality_v1.adoc b/docs/crd/federation.maistra.io_ImportedServiceSet_ImportedServiceLocality_v1.adoc similarity index 65% rename from docs/crd/maistra.io_ServiceImports_ServiceImportLocality_v1.adoc rename to docs/crd/federation.maistra.io_ImportedServiceSet_ImportedServiceLocality_v1.adoc index 8bb9009b..4d9227e6 100644 --- a/docs/crd/maistra.io_ServiceImports_ServiceImportLocality_v1.adoc +++ b/docs/crd/federation.maistra.io_ImportedServiceSet_ImportedServiceLocality_v1.adoc @@ -1,14 +1,14 @@ -= ServiceImportLocality += ImportedServiceLocality :toc: right -Used by link:maistra.io_ServiceImports_v1.adoc[ServiceImports(maistra.io/v1)] +Used by link:federation.maistra.io_ImportedServiceSet_v1.adoc[ImportedServiceSet(federation.maistra.io/v1)] -maistra.io/api/core/v1 +maistra.io/api/federation/v1 -.Table ServiceImportLocality Fields +.Table ImportedServiceLocality Fields |=== | Name | Description | Type diff --git a/docs/crd/maistra.io_ServiceImports_v1.adoc b/docs/crd/federation.maistra.io_ImportedServiceSet_v1.adoc similarity index 51% rename from docs/crd/maistra.io_ServiceImports_v1.adoc rename to docs/crd/federation.maistra.io_ImportedServiceSet_v1.adoc index 754df97d..8ee4dcfd 100644 --- a/docs/crd/maistra.io_ServiceImports_v1.adoc +++ b/docs/crd/federation.maistra.io_ImportedServiceSet_v1.adoc @@ -1,14 +1,14 @@ -= ServiceImports - maistra.io/v1 += ImportedServiceSet - federation.maistra.io/v1 :toc: right -maistra.io/api/core/v1 +maistra.io/api/federation/v1 -ServiceImports is the Schema for configuring imported services. The name of the ServiceImports resource must match the name of a MeshFederation resource defining the remote mesh from which the services will be imported. +ImportedServiceSet is the Schema for configuring imported services. The name of the ImportedServiceSet resource must match the name of a ServiceMeshPeer resource defining the remote mesh from which the services will be imported. -.Table ServiceImports Fields +.Table ImportedServiceSet Fields |=== | Name | Description | Type @@ -26,21 +26,21 @@ ServiceImports is the Schema for configuring imported services. The name of the | spec | Spec defines rules for matching services to be imported. -| <> +| <> | status | -| <> +| <> |=== -[#ServiceImportsSpec] -== ServiceImportsSpec +[#ImportedServiceSetSpec] +== ImportedServiceSetSpec -maistra.io/api/core/v1 +maistra.io/api/federation/v1 -.Table ServiceImportsSpec Fields +.Table ImportedServiceSetSpec Fields |=== | Name | Description | Type @@ -48,21 +48,30 @@ maistra.io/api/core/v1 | DomainSuffix specifies the domain suffix to be applies to imported services. If no domain suffix is specified, imported services will be named as follows: ..svc.-imports.local If a domain suffix is specified, imported services will be named as follows: .. | string -| imports -| Imports are the rules that determine which services are imported to the mesh. The list is processed in order and the first spec in the list that applies to a service is the one that will be applied. This allows more specific selectors to be placed before more general selectors. -| []ServiceImportRule +| importRules +| ImportRules are the rules that determine which services are imported to the mesh. The list is processed in order and the first spec in the list that applies to a service is the one that will be applied. This allows more specific selectors to be placed before more general selectors. +| []ImportedServiceRule | locality | Locality within which imported services should be associated. -| link:maistra.io_ServiceImports_ServiceImportLocality_v1.adoc[ServiceImportLocality] +| link:federation.maistra.io_ImportedServiceSet_ImportedServiceLocality_v1.adoc[ImportedServiceLocality] |=== -[#ServiceImportsStatus] -== ServiceImportsStatus +[#ImportedServiceSetStatus] +== ImportedServiceSetStatus -maistra.io/api/core/v1 +maistra.io/api/federation/v1 + +.Table ImportedServiceSetStatus Fields +|=== +| Name | Description | Type + +| importedServices +| Imports provides details about the services imported by this mesh. +| []PeerServiceMapping + +|=== -Type: object diff --git a/docs/crd/maistra.io_MeshFederation_FederationDiscoveryStatus_v1.adoc b/docs/crd/federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerDiscoveryStatus_v1.adoc similarity index 77% rename from docs/crd/maistra.io_MeshFederation_FederationDiscoveryStatus_v1.adoc rename to docs/crd/federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerDiscoveryStatus_v1.adoc index 1d0d5450..5e4ae588 100644 --- a/docs/crd/maistra.io_MeshFederation_FederationDiscoveryStatus_v1.adoc +++ b/docs/crd/federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerDiscoveryStatus_v1.adoc @@ -1,38 +1,38 @@ -= FederationDiscoveryStatus += ServiceMeshPeerDiscoveryStatus :toc: right -Used by link:maistra.io_MeshFederation_v1.adoc[MeshFederation(maistra.io/v1)] +Used by link:federation.maistra.io_ServiceMeshPeer_v1.adoc[ServiceMeshPeer(federation.maistra.io/v1)] -maistra.io/api/core/v1 +maistra.io/api/federation/v1 -FederationDiscoveryStatus provides details about the discovery status of each pilot/istiod instance in the mesh. This is separated into lists of active and inactive pods. Active pods will all have their watch.connected value set to true. +ServiceMeshPeerDiscoveryStatus provides details about the discovery status of each pilot/istiod instance in the mesh. This is separated into lists of active and inactive pods. Active pods will all have their watch.connected value set to true. -.Table FederationDiscoveryStatus Fields +.Table ServiceMeshPeerDiscoveryStatus Fields |=== | Name | Description | Type | active | Active represents the pilot/istiod pods actively watching the other mesh for discovery. -| []<> +| []<> | inactive | Inactive represents the pilot/istiod pods not actively watching the other mesh for discovery. -| []<> +| []<> |=== -[#FederationPodDiscoveryStatus] -== FederationPodDiscoveryStatus +[#PodPeerDiscoveryStatus] +== PodPeerDiscoveryStatus -maistra.io/api/core/v1 +maistra.io/api/federation/v1 -FederationPodDiscoveryStatus provides discovery details related to a specific pilot/istiod pod. +PodPeerDiscoveryStatus provides discovery details related to a specific pilot/istiod pod. -.Table FederationPodDiscoveryStatus Fields +.Table PodPeerDiscoveryStatus Fields |=== | Name | Description | Type @@ -54,7 +54,7 @@ FederationPodDiscoveryStatus provides discovery details related to a specific pi [#DiscoveryRemoteStatus] == DiscoveryRemoteStatus -maistra.io/api/core/v1 +maistra.io/api/federation/v1 DiscoveryRemoteStatus represents details related to an inbound connection from a remote mesh. @@ -96,7 +96,7 @@ DiscoveryRemoteStatus represents details related to an inbound connection from a [#DiscoveryWatchStatus] == DiscoveryWatchStatus -maistra.io/api/core/v1 +maistra.io/api/federation/v1 DiscoveryWatchStatus represents details related to the outbound connection to the remote mesh. diff --git a/docs/crd/maistra.io_MeshFederation_MeshFederationGateways_v1.adoc b/docs/crd/federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerGateways_v1.adoc similarity index 64% rename from docs/crd/maistra.io_MeshFederation_MeshFederationGateways_v1.adoc rename to docs/crd/federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerGateways_v1.adoc index d6aae33c..3b20633b 100644 --- a/docs/crd/maistra.io_MeshFederation_MeshFederationGateways_v1.adoc +++ b/docs/crd/federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerGateways_v1.adoc @@ -1,14 +1,14 @@ -= MeshFederationGateways += ServiceMeshPeerGateways :toc: right -Used by link:maistra.io_MeshFederation_v1.adoc[MeshFederation(maistra.io/v1)] +Used by link:federation.maistra.io_ServiceMeshPeer_v1.adoc[ServiceMeshPeer(federation.maistra.io/v1)] -maistra.io/api/core/v1 +maistra.io/api/federation/v1 -.Table MeshFederationGateways Fields +.Table ServiceMeshPeerGateways Fields |=== | Name | Description | Type diff --git a/docs/crd/maistra.io_MeshFederation_MeshFederationRemote_v1.adoc b/docs/crd/federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerRemote_v1.adoc similarity index 75% rename from docs/crd/maistra.io_MeshFederation_MeshFederationRemote_v1.adoc rename to docs/crd/federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerRemote_v1.adoc index f5e5cbd8..37096cd9 100644 --- a/docs/crd/maistra.io_MeshFederation_MeshFederationRemote_v1.adoc +++ b/docs/crd/federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerRemote_v1.adoc @@ -1,14 +1,14 @@ -= MeshFederationRemote += ServiceMeshPeerRemote :toc: right -Used by link:maistra.io_MeshFederation_v1.adoc[MeshFederation(maistra.io/v1)] +Used by link:federation.maistra.io_ServiceMeshPeer_v1.adoc[ServiceMeshPeer(federation.maistra.io/v1)] -maistra.io/api/core/v1 +maistra.io/api/federation/v1 -.Table MeshFederationRemote Fields +.Table ServiceMeshPeerRemote Fields |=== | Name | Description | Type diff --git a/docs/crd/maistra.io_MeshFederation_MeshFederationSecurity_v1.adoc b/docs/crd/federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerSecurity_v1.adoc similarity index 79% rename from docs/crd/maistra.io_MeshFederation_MeshFederationSecurity_v1.adoc rename to docs/crd/federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerSecurity_v1.adoc index 8212c303..5b5df0fe 100644 --- a/docs/crd/maistra.io_MeshFederation_MeshFederationSecurity_v1.adoc +++ b/docs/crd/federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerSecurity_v1.adoc @@ -1,14 +1,14 @@ -= MeshFederationSecurity += ServiceMeshPeerSecurity :toc: right -Used by link:maistra.io_MeshFederation_v1.adoc[MeshFederation(maistra.io/v1)] +Used by link:federation.maistra.io_ServiceMeshPeer_v1.adoc[ServiceMeshPeer(federation.maistra.io/v1)] -maistra.io/api/core/v1 +maistra.io/api/federation/v1 -.Table MeshFederationSecurity Fields +.Table ServiceMeshPeerSecurity Fields |=== | Name | Description | Type diff --git a/docs/crd/maistra.io_MeshFederation_v1.adoc b/docs/crd/federation.maistra.io_ServiceMeshPeer_v1.adoc similarity index 50% rename from docs/crd/maistra.io_MeshFederation_v1.adoc rename to docs/crd/federation.maistra.io_ServiceMeshPeer_v1.adoc index 283ee3db..687b7b9c 100644 --- a/docs/crd/maistra.io_MeshFederation_v1.adoc +++ b/docs/crd/federation.maistra.io_ServiceMeshPeer_v1.adoc @@ -1,14 +1,14 @@ -= MeshFederation - maistra.io/v1 += ServiceMeshPeer - federation.maistra.io/v1 :toc: right -maistra.io/api/core/v1 +maistra.io/api/federation/v1 -MeshFederation is the Schema for joining two meshes together. The resource name will be used to identify the 'cluster' to which imported services belong. +ServiceMeshPeer is the Schema for joining two meshes together. The resource name will be used to identify the 'cluster' to which imported services belong. -.Table MeshFederation Fields +.Table ServiceMeshPeer Fields |=== | Name | Description | Type @@ -26,63 +26,55 @@ MeshFederation is the Schema for joining two meshes together. The resource name | spec | -| <> +| <> | status | -| <> +| <> |=== -[#MeshFederationSpec] -== MeshFederationSpec +[#ServiceMeshPeerSpec] +== ServiceMeshPeerSpec -maistra.io/api/core/v1 +maistra.io/api/federation/v1 -MeshFederationSpec configures details required to support federation with another service mesh. +ServiceMeshPeerSpec configures details required to support federation with another service mesh. -.Table MeshFederationSpec Fields +.Table ServiceMeshPeerSpec Fields |=== | Name | Description | Type | gateways | Gateways configures the gateways used to facilitate ingress and egress with the other mesh. -| link:maistra.io_MeshFederation_MeshFederationGateways_v1.adoc[MeshFederationGateways] +| link:federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerGateways_v1.adoc[ServiceMeshPeerGateways] | remote | Remote configures details related to the remote mesh with which this mesh is federating. -| link:maistra.io_MeshFederation_MeshFederationRemote_v1.adoc[MeshFederationRemote] +| link:federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerRemote_v1.adoc[ServiceMeshPeerRemote] | security | Security configures details for securing communication with the other mesh. -| link:maistra.io_MeshFederation_MeshFederationSecurity_v1.adoc[MeshFederationSecurity] +| link:federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerSecurity_v1.adoc[ServiceMeshPeerSecurity] |=== -[#MeshFederationStatus] -== MeshFederationStatus +[#ServiceMeshPeerStatus] +== ServiceMeshPeerStatus -maistra.io/api/core/v1 +maistra.io/api/federation/v1 -MeshFederationStatus provides information related to the other mesh. +ServiceMeshPeerStatus provides information related to the other mesh. -.Table MeshFederationStatus Fields +.Table ServiceMeshPeerStatus Fields |=== | Name | Description | Type | discoveryStatus | DiscoveryStatus represents the discovery status of each pilot/istiod pod in the mesh. -| link:maistra.io_MeshFederation_FederationDiscoveryStatus_v1.adoc[FederationDiscoveryStatus] - -| exports -| Exports provides details about the services exported by this mesh. -| []MeshServiceMapping - -| imports -| Imports provides details about the services imported by this mesh. -| []MeshServiceMapping +| link:federation.maistra.io_ServiceMeshPeer_ServiceMeshPeerDiscoveryStatus_v1.adoc[ServiceMeshPeerDiscoveryStatus] |=== diff --git a/docs/crd/maistra.io_ServiceExports_v1.adoc b/docs/crd/maistra.io_ServiceExports_v1.adoc deleted file mode 100644 index df2a06a8..00000000 --- a/docs/crd/maistra.io_ServiceExports_v1.adoc +++ /dev/null @@ -1,60 +0,0 @@ - - -= ServiceExports - maistra.io/v1 - -:toc: right - -maistra.io/api/core/v1 - -ServiceExport is the Schema for configuring exported services. The name of the ServiceExports resource must match the name of a MeshFederation resource defining the remote mesh to which the services will be exported. - -.Table ServiceExports Fields -|=== -| Name | Description | Type - -| apiVersion -| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources -| string - -| kind -| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds -| string - -| metadata -| -| <> - -| spec -| Spec defines rules for matching services to be exported. -| <> - -| status -| -| <> - -|=== - - -[#ServiceExportsSpec] -== ServiceExportsSpec - -maistra.io/api/core/v1 - -.Table ServiceExportsSpec Fields -|=== -| Name | Description | Type - -| exports -| Exports are the rules that determine which services are exported from the mesh. The list is processed in order and the first spec in the list that applies to a service is the one that will be applied. This allows more specific selectors to be placed before more general selectors. -| []ServiceExportRule - -|=== - - -[#ServiceExportStatus] -== ServiceExportStatus - -maistra.io/api/core/v1 - -Type: object - diff --git a/federation/v1/doc.go b/federation/v1/doc.go new file mode 100644 index 00000000..a61fe851 --- /dev/null +++ b/federation/v1/doc.go @@ -0,0 +1,16 @@ +// Copyright Red Hat, Inc. +// +// 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. + +// +groupName=federation.maistra.io +package v1 diff --git a/core/v1/serviceexports_types.go b/federation/v1/exportedserviceset_types.go similarity index 66% rename from core/v1/serviceexports_types.go rename to federation/v1/exportedserviceset_types.go index f404a710..66dc0463 100644 --- a/core/v1/serviceexports_types.go +++ b/federation/v1/exportedserviceset_types.go @@ -23,37 +23,37 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// ServiceExport is the Schema for configuring exported services. The name of -// the ServiceExports resource must match the name of a MeshFederation resource +// ExportedServiceSet is the Schema for configuring exported services. The name of +// the ExportedServiceSet resource must match the name of a ServiceMeshPeer resource // defining the remote mesh to which the services will be exported. -type ServiceExports struct { +type ExportedServiceSet struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Spec defines rules for matching services to be exported. - Spec ServiceExportsSpec `json:"spec,omitempty"` - Status ServiceExportStatus `json:"status,omitempty"` + Spec ExportedServiceSetSpec `json:"spec,omitempty"` + Status ExportedServiceSetStatus `json:"status,omitempty"` } // +kubebuilder:object:root=true // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// ServiceExportList contains a list of ServiceExport -type ServiceExportsList struct { +// ExportedServiceSetList contains a list of ExportedServiceSet +type ExportedServiceSetList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []ServiceExports `json:"items"` + Items []ExportedServiceSet `json:"items"` } -type ServiceExportsSpec struct { - // Exports are the rules that determine which services are exported from the +type ExportedServiceSetSpec struct { + // ExportRules are the rules that determine which services are exported from the // mesh. The list is processed in order and the first spec in the list that // applies to a service is the one that will be applied. This allows more // specific selectors to be placed before more general selectors. - Exports []ServiceExportRule `json:"exports,omitempty"` + ExportRules []ExportedServiceRule `json:"exportRules,omitempty"` } -type ServiceExportRule struct { +type ExportedServiceRule struct { // Type of rule. One of Name or Label. // +required Type ServiceImportExportSelectorType `json:"type"` @@ -67,5 +67,12 @@ type ServiceExportRule struct { NameSelector *ServiceNameMapping `json:"nameSelector,omitempty"` } -type ServiceExportStatus struct { +type ExportedServiceSetStatus struct { + // Exports provides details about the services exported by this mesh. + // +required + // +listType=map + // +listMapKey=exportedName + // +patchMergeKey=exportedName + // +patchStrategy=merge,retainKeys + ExportedServices []PeerServiceMapping `json:"exportedServices"` } diff --git a/federation/v1/groupversion_info.go b/federation/v1/groupversion_info.go new file mode 100644 index 00000000..c9c80013 --- /dev/null +++ b/federation/v1/groupversion_info.go @@ -0,0 +1,49 @@ +/* +Copyright Red Hat, Inc. + +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 contains API Schema definitions for the maistra.io v1 API group +//+kubebuilder:object:generate=true +//+groupName=maistra.io +package v1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // SchemeGroupVersion is group version used to register these objects + SchemeGroupVersion = schema.GroupVersion{Group: "federation.maistra.io", Version: "v1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +func init() { + SchemeBuilder.Register( + &ServiceMeshPeer{}, &ServiceMeshPeerList{}, + &ExportedServiceSet{}, &ExportedServiceSetList{}, + &ImportedServiceSet{}, &ImportedServiceSetList{}, + ) +} diff --git a/core/v1/import_export_mapping.go b/federation/v1/import_export_mapping.go similarity index 62% rename from core/v1/import_export_mapping.go rename to federation/v1/import_export_mapping.go index c6e8d1ef..a00d68e2 100644 --- a/core/v1/import_export_mapping.go +++ b/federation/v1/import_export_mapping.go @@ -23,8 +23,8 @@ import ( type ServiceImportExportSelectorType string const ( - LabelSelectorType ServiceImportExportSelectorType = "Label" - NameSelectorType ServiceImportExportSelectorType = "Name" + LabelSelectorType ServiceImportExportSelectorType = "LabelSelector" + NameSelectorType ServiceImportExportSelectorType = "NameSelector" ) type ServiceName struct { @@ -44,8 +44,8 @@ func (s ServiceName) String() string { const MatchAny = "*" type ServiceNameMapping struct { - Name ServiceName `json:"name,omitempty"` - Alias *ServiceName `json:"alias,omitempty"` + ServiceName `json:",inline"` + Alias *ServiceName `json:"alias,omitempty"` } type ServiceImportExportLabelelector struct { @@ -72,4 +72,33 @@ type ServiceImportExportLabelelector struct { Aliases []ServiceNameMapping `json:"aliases,omitempty"` } +// ServiceKey provides all the details about a Service +type ServiceKey struct { + // Name represents the simple name of the service, e.g. the metadata.name + // field of a kubernetes Service. + // +required + Name string `json:"name"` + // Namespace represents the namespace within which the service resides. + // +required + Namespace string `json:"namespace"` + // Hostname represents fully qualified domain name (FQDN) used to access + // the service. + // +required + Hostname string `json:"hostname"` +} +// PeerServiceMapping represents the name mapping between an exported service +// and its local counterpart. +type PeerServiceMapping struct { + // LocalService represents the service in the local (i.e. this) mesh. For an + // exporting mesh, this would be the service being exported. For an + // importing mesh, this would be the imported service. + // +required + LocalService ServiceKey `json:"localService"` + // ExportedName represents the fully qualified domain name (FQDN) of an + // exported service. For an exporting mesh, this is the name that is + // exported to the remote mesh. For an importing mesh, this would be the + // name of the service exported by the remote mesh. + // +required + ExportedName string `json:"exportedName"` +} diff --git a/core/v1/serviceimports_types.go b/federation/v1/importedserviceset_types.go similarity index 73% rename from core/v1/serviceimports_types.go rename to federation/v1/importedserviceset_types.go index a23abb9d..2f43b11d 100644 --- a/core/v1/serviceimports_types.go +++ b/federation/v1/importedserviceset_types.go @@ -23,29 +23,29 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// ServiceImports is the Schema for configuring imported services. The name of -// the ServiceImports resource must match the name of a MeshFederation resource +// ImportedServiceSet is the Schema for configuring imported services. The name of +// the ImportedServiceSet resource must match the name of a ServiceMeshPeer resource // defining the remote mesh from which the services will be imported. -type ServiceImports struct { +type ImportedServiceSet struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Spec defines rules for matching services to be imported. - Spec ServiceImportsSpec `json:"spec,omitempty"` - Status ServiceImportsStatus `json:"status,omitempty"` + Spec ImportedServiceSetSpec `json:"spec,omitempty"` + Status ImportedServiceSetStatus `json:"status,omitempty"` } // +kubebuilder:object:root=true // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// ServiceImportsList contains a list of ServiceImport -type ServiceImportsList struct { +// ImportedServiceSetList contains a list of ImportedService +type ImportedServiceSetList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []ServiceImports `json:"items"` + Items []ImportedServiceSet `json:"items"` } -type ServiceImportsSpec struct { +type ImportedServiceSetSpec struct { // DomainSuffix specifies the domain suffix to be applies to imported // services. If no domain suffix is specified, imported services will be // named as follows: @@ -56,17 +56,17 @@ type ServiceImportsSpec struct { // +optional DomainSuffix string `json:"domainSuffix,omitempty"` // Locality within which imported services should be associated. - Locality *ServiceImportLocality `json:"locality,omitempty"` - // Imports are the rules that determine which services are imported to the + Locality *ImportedServiceLocality `json:"locality,omitempty"` + // ImportRules are the rules that determine which services are imported to the // mesh. The list is processed in order and the first spec in the list that // applies to a service is the one that will be applied. This allows more // specific selectors to be placed before more general selectors. - Imports []ServiceImportRule `json:"imports,omitempty"` + ImportRules []ImportedServiceRule `json:"importRules,omitempty"` } -type ServiceImportRule struct { +type ImportedServiceRule struct { // DomainSuffix applies the specified suffix to services imported by this - // rule. The behavior is identical to that of ServiceImportsSpec.DomainSuffix. + // rule. The behavior is identical to that of ImportedServiceSetSpec.DomainSuffix. // +optional DomainSuffix string `json:"domainSuffix,omitempty"` // ImportAsLocal imports the service as a local service in the mesh. For @@ -86,7 +86,7 @@ type ServiceImportRule struct { NameSelector *ServiceNameMapping `json:"nameSelector,omitempty"` } -type ServiceImportLocality struct { +type ImportedServiceLocality struct { // Region within which imported services are located. Region string `json:"region,omitempty"` // Zone within which imported services are located. If Zone is specified, @@ -97,5 +97,12 @@ type ServiceImportLocality struct { Subzone string `json:"subzone,omitempty"` } -type ServiceImportsStatus struct { +type ImportedServiceSetStatus struct { + // Imports provides details about the services imported by this mesh. + // +required + // +listType=map + // +listMapKey=exportedName + // +patchMergeKey=exportedName + // +patchStrategy=merge,retainKeys + ImportedServices []PeerServiceMapping `json:"importedServices"` } diff --git a/core/v1/meshfederation_types.go b/federation/v1/servicemeshpeer_types.go similarity index 67% rename from core/v1/meshfederation_types.go rename to federation/v1/servicemeshpeer_types.go index 0794e29f..4bd4b43b 100644 --- a/core/v1/meshfederation_types.go +++ b/federation/v1/servicemeshpeer_types.go @@ -25,28 +25,28 @@ import ( // +kubebuilder:resource:categories=maistra-io // +groupName=maistra.io -// MeshFederation is the Schema for joining two meshes together. The resource +// ServiceMeshPeer is the Schema for joining two meshes together. The resource // name will be used to identify the 'cluster' to which imported services // belong. -type MeshFederation struct { +type ServiceMeshPeer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec MeshFederationSpec `json:"spec,omitempty"` - Status MeshFederationStatus `json:"status,omitempty"` + Spec ServiceMeshPeerSpec `json:"spec,omitempty"` + Status ServiceMeshPeerStatus `json:"status,omitempty"` } // +kubebuilder:object:root=true // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// MeshFederationList contains a list of MeshFederation -type MeshFederationList struct { +// ServiceMeshPeerList contains a list of ServiceMeshPeer +type ServiceMeshPeerList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []MeshFederation `json:"items"` + Items []ServiceMeshPeer `json:"items"` } -type MeshFederationSecurity struct { +type ServiceMeshPeerSecurity struct { // ClientID of the remote mesh. This is used to authenticate incoming // requrests from the remote mesh's discovery client. // +required @@ -78,7 +78,7 @@ type MeshFederationSecurity struct { AllowDirectOutbound bool `json:"-"` } -type MeshFederationGateways struct { +type ServiceMeshPeerGateways struct { // Gateway through which inbound federated service traffic will travel. // +optional Ingress corev1.LocalObjectReference `json:"ingress,omitempty"` @@ -88,24 +88,24 @@ type MeshFederationGateways struct { Egress corev1.LocalObjectReference `json:"egress,omitempty"` } -// MeshFederationSpec configures details required to support federation with +// ServiceMeshPeerSpec configures details required to support federation with // another service mesh. -type MeshFederationSpec struct { +type ServiceMeshPeerSpec struct { // Remote configures details related to the remote mesh with which this mesh // is federating. // +required - Remote MeshFederationRemote `json:"remote,omitempty"` + Remote ServiceMeshPeerRemote `json:"remote,omitempty"` // Gateways configures the gateways used to facilitate ingress and egress // with the other mesh. - Gateways MeshFederationGateways `json:"gateways,omitempty"` + Gateways ServiceMeshPeerGateways `json:"gateways,omitempty"` // Security configures details for securing communication with the other // mesh. - Security MeshFederationSecurity `json:"security,omitempty"` + Security ServiceMeshPeerSecurity `json:"security,omitempty"` } -type MeshFederationRemote struct { +type ServiceMeshPeerRemote struct { // Addresses are the addresses to which discovery and service requests // should be sent (i.e. the addresses of ingress gateways on the remote // mesh). These may be specified as resolveable DNS names or IP addresses. @@ -118,33 +118,19 @@ type MeshFederationRemote struct { ServicePort int32 `json:"servicePort,omitempty"` } -// MeshFederationStatus provides information related to the other mesh. -type MeshFederationStatus struct { +// ServiceMeshPeerStatus provides information related to the other mesh. +type ServiceMeshPeerStatus struct { // DiscoveryStatus represents the discovery status of each pilot/istiod pod // in the mesh. // +optional - DiscoveryStatus FederationDiscoveryStatus `json:"discoveryStatus,omitempty"` - // Exports provides details about the services exported by this mesh. - // +required - // +listType=map - // +listMapKey=exportedName - // +patchMergeKey=exportedName - // +patchStrategy=merge,retainKeys - Exports []MeshServiceMapping `json:"exports"` - // Imports provides details about the services imported by this mesh. - // +required - // +listType=map - // +listMapKey=exportedName - // +patchMergeKey=exportedName - // +patchStrategy=merge,retainKeys - Imports []MeshServiceMapping `json:"imports"` + DiscoveryStatus ServiceMeshPeerDiscoveryStatus `json:"discoveryStatus,omitempty"` } -// FederationDiscoveryStatus provides details about the discovery status of each +// ServiceMeshPeerDiscoveryStatus provides details about the discovery status of each // pilot/istiod instance in the mesh. This is separated into lists of active // and inactive pods. Active pods will all have their watch.connected value set // to true. -type FederationDiscoveryStatus struct { +type ServiceMeshPeerDiscoveryStatus struct { // Active represents the pilot/istiod pods actively watching the other mesh // for discovery. // +optional @@ -153,7 +139,7 @@ type FederationDiscoveryStatus struct { // +listMapKey=pod // +patchMergeKey=pod // +patchStrategy=merge,retainKeys - Active []FederationPodDiscoveryStatus `json:"active,omitempty"` + Active []PodPeerDiscoveryStatus `json:"active,omitempty"` // Inactive represents the pilot/istiod pods not actively watching the other // mesh for discovery. // +optional @@ -162,55 +148,24 @@ type FederationDiscoveryStatus struct { // +listMapKey=pod // +patchMergeKey=pod // +patchStrategy=merge,retainKeys - Inactive []FederationPodDiscoveryStatus `json:"inactive,omitempty"` + Inactive []PodPeerDiscoveryStatus `json:"inactive,omitempty"` } -// FederationPodDiscoveryStatus provides discovery details related to a specific +// PodPeerDiscoveryStatus provides discovery details related to a specific // pilot/istiod pod. -type FederationPodDiscoveryStatus struct { - // Discovery provides details about the connection to the remote mesh. +type PodPeerDiscoveryStatus struct { + // PeerDiscoveryStatus provides details about the connection to the remote mesh. // +required - MeshDiscoveryStatus `json:",inline"` + PeerDiscoveryStatus `json:",inline"` // Pod is the pod name to which these details apply. This maps to a // a pilot/istiod pod. // +required Pod string `json:"pod"` } -// ServiceKey provides all the details about a Service -type ServiceKey struct { - // Name represents the simple name of the service, e.g. the metadata.name - // field of a kubernetes Service. - // +required - Name string `json:"name"` - // Namespace represents the namespace within which the service resides. - // +required - Namespace string `json:"namespace"` - // Hostname represents fully qualified domain name (FQDN) used to access - // the service. - // +required - Hostname string `json:"hostname"` -} - -// MeshServiceMapping represents the name mapping between an exported service -// and its local counterpart. -type MeshServiceMapping struct { - // LocalService represents the service in the local (i.e. this) mesh. For an - // exporting mesh, this would be the service being exported. For an - // importing mesh, this would be the imported service. - // +required - LocalService ServiceKey `json:"localService"` - // ExportedName represents the fully qualified domain name (FQDN) of an - // exported service. For an exporting mesh, this is the name that is - // exported to the remote mesh. For an importing mesh, this would be the - // name of the service exported by the remote mesh. - // +required - ExportedName string `json:"exportedName"` -} - -// MeshDiscoveryStatus represents the status of the discovery connection between +// PeerDiscoveryStatus represents the status of the discovery connection between // meshes. -type MeshDiscoveryStatus struct { +type PeerDiscoveryStatus struct { // Remotes represents details related to the inbound connections from remote // meshes. // +optional diff --git a/federation/v1/zz_generated.deepcopy.go b/federation/v1/zz_generated.deepcopy.go new file mode 100644 index 00000000..5e6a20b2 --- /dev/null +++ b/federation/v1/zz_generated.deepcopy.go @@ -0,0 +1,645 @@ +// +build !ignore_autogenerated + +// Copyright Red Hat, Inc. +// +// 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 v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DiscoveryConnectionStatus) DeepCopyInto(out *DiscoveryConnectionStatus) { + *out = *in + in.LastConnected.DeepCopyInto(&out.LastConnected) + in.LastEvent.DeepCopyInto(&out.LastEvent) + in.LastFullSync.DeepCopyInto(&out.LastFullSync) + in.LastDisconnect.DeepCopyInto(&out.LastDisconnect) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoveryConnectionStatus. +func (in *DiscoveryConnectionStatus) DeepCopy() *DiscoveryConnectionStatus { + if in == nil { + return nil + } + out := new(DiscoveryConnectionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DiscoveryRemoteStatus) DeepCopyInto(out *DiscoveryRemoteStatus) { + *out = *in + in.DiscoveryConnectionStatus.DeepCopyInto(&out.DiscoveryConnectionStatus) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoveryRemoteStatus. +func (in *DiscoveryRemoteStatus) DeepCopy() *DiscoveryRemoteStatus { + if in == nil { + return nil + } + out := new(DiscoveryRemoteStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DiscoveryWatchStatus) DeepCopyInto(out *DiscoveryWatchStatus) { + *out = *in + in.DiscoveryConnectionStatus.DeepCopyInto(&out.DiscoveryConnectionStatus) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoveryWatchStatus. +func (in *DiscoveryWatchStatus) DeepCopy() *DiscoveryWatchStatus { + if in == nil { + return nil + } + out := new(DiscoveryWatchStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExportedServiceRule) DeepCopyInto(out *ExportedServiceRule) { + *out = *in + if in.LabelSelector != nil { + in, out := &in.LabelSelector, &out.LabelSelector + *out = new(ServiceImportExportLabelelector) + (*in).DeepCopyInto(*out) + } + if in.NameSelector != nil { + in, out := &in.NameSelector, &out.NameSelector + *out = new(ServiceNameMapping) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExportedServiceRule. +func (in *ExportedServiceRule) DeepCopy() *ExportedServiceRule { + if in == nil { + return nil + } + out := new(ExportedServiceRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExportedServiceSet) DeepCopyInto(out *ExportedServiceSet) { + *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 ExportedServiceSet. +func (in *ExportedServiceSet) DeepCopy() *ExportedServiceSet { + if in == nil { + return nil + } + out := new(ExportedServiceSet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExportedServiceSet) 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 *ExportedServiceSetList) DeepCopyInto(out *ExportedServiceSetList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ExportedServiceSet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExportedServiceSetList. +func (in *ExportedServiceSetList) DeepCopy() *ExportedServiceSetList { + if in == nil { + return nil + } + out := new(ExportedServiceSetList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ExportedServiceSetList) 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 *ExportedServiceSetSpec) DeepCopyInto(out *ExportedServiceSetSpec) { + *out = *in + if in.ExportRules != nil { + in, out := &in.ExportRules, &out.ExportRules + *out = make([]ExportedServiceRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExportedServiceSetSpec. +func (in *ExportedServiceSetSpec) DeepCopy() *ExportedServiceSetSpec { + if in == nil { + return nil + } + out := new(ExportedServiceSetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExportedServiceSetStatus) DeepCopyInto(out *ExportedServiceSetStatus) { + *out = *in + if in.ExportedServices != nil { + in, out := &in.ExportedServices, &out.ExportedServices + *out = make([]PeerServiceMapping, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExportedServiceSetStatus. +func (in *ExportedServiceSetStatus) DeepCopy() *ExportedServiceSetStatus { + if in == nil { + return nil + } + out := new(ExportedServiceSetStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImportedServiceLocality) DeepCopyInto(out *ImportedServiceLocality) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImportedServiceLocality. +func (in *ImportedServiceLocality) DeepCopy() *ImportedServiceLocality { + if in == nil { + return nil + } + out := new(ImportedServiceLocality) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImportedServiceRule) DeepCopyInto(out *ImportedServiceRule) { + *out = *in + if in.NameSelector != nil { + in, out := &in.NameSelector, &out.NameSelector + *out = new(ServiceNameMapping) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImportedServiceRule. +func (in *ImportedServiceRule) DeepCopy() *ImportedServiceRule { + if in == nil { + return nil + } + out := new(ImportedServiceRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImportedServiceSet) DeepCopyInto(out *ImportedServiceSet) { + *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 ImportedServiceSet. +func (in *ImportedServiceSet) DeepCopy() *ImportedServiceSet { + if in == nil { + return nil + } + out := new(ImportedServiceSet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ImportedServiceSet) 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 *ImportedServiceSetList) DeepCopyInto(out *ImportedServiceSetList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ImportedServiceSet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImportedServiceSetList. +func (in *ImportedServiceSetList) DeepCopy() *ImportedServiceSetList { + if in == nil { + return nil + } + out := new(ImportedServiceSetList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ImportedServiceSetList) 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 *ImportedServiceSetSpec) DeepCopyInto(out *ImportedServiceSetSpec) { + *out = *in + if in.Locality != nil { + in, out := &in.Locality, &out.Locality + *out = new(ImportedServiceLocality) + **out = **in + } + if in.ImportRules != nil { + in, out := &in.ImportRules, &out.ImportRules + *out = make([]ImportedServiceRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImportedServiceSetSpec. +func (in *ImportedServiceSetSpec) DeepCopy() *ImportedServiceSetSpec { + if in == nil { + return nil + } + out := new(ImportedServiceSetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImportedServiceSetStatus) DeepCopyInto(out *ImportedServiceSetStatus) { + *out = *in + if in.ImportedServices != nil { + in, out := &in.ImportedServices, &out.ImportedServices + *out = make([]PeerServiceMapping, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImportedServiceSetStatus. +func (in *ImportedServiceSetStatus) DeepCopy() *ImportedServiceSetStatus { + if in == nil { + return nil + } + out := new(ImportedServiceSetStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PeerDiscoveryStatus) DeepCopyInto(out *PeerDiscoveryStatus) { + *out = *in + if in.Remotes != nil { + in, out := &in.Remotes, &out.Remotes + *out = make([]DiscoveryRemoteStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.Watch.DeepCopyInto(&out.Watch) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerDiscoveryStatus. +func (in *PeerDiscoveryStatus) DeepCopy() *PeerDiscoveryStatus { + if in == nil { + return nil + } + out := new(PeerDiscoveryStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PeerServiceMapping) DeepCopyInto(out *PeerServiceMapping) { + *out = *in + out.LocalService = in.LocalService +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerServiceMapping. +func (in *PeerServiceMapping) DeepCopy() *PeerServiceMapping { + if in == nil { + return nil + } + out := new(PeerServiceMapping) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodPeerDiscoveryStatus) DeepCopyInto(out *PodPeerDiscoveryStatus) { + *out = *in + in.PeerDiscoveryStatus.DeepCopyInto(&out.PeerDiscoveryStatus) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodPeerDiscoveryStatus. +func (in *PodPeerDiscoveryStatus) DeepCopy() *PodPeerDiscoveryStatus { + if in == nil { + return nil + } + out := new(PodPeerDiscoveryStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceImportExportLabelelector) DeepCopyInto(out *ServiceImportExportLabelelector) { + *out = *in + in.Selector.DeepCopyInto(&out.Selector) + if in.Aliases != nil { + in, out := &in.Aliases, &out.Aliases + *out = make([]ServiceNameMapping, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceImportExportLabelelector. +func (in *ServiceImportExportLabelelector) DeepCopy() *ServiceImportExportLabelelector { + if in == nil { + return nil + } + out := new(ServiceImportExportLabelelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceKey) DeepCopyInto(out *ServiceKey) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceKey. +func (in *ServiceKey) DeepCopy() *ServiceKey { + if in == nil { + return nil + } + out := new(ServiceKey) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceMeshPeer) DeepCopyInto(out *ServiceMeshPeer) { + *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 ServiceMeshPeer. +func (in *ServiceMeshPeer) DeepCopy() *ServiceMeshPeer { + if in == nil { + return nil + } + out := new(ServiceMeshPeer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceMeshPeer) 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 *ServiceMeshPeerDiscoveryStatus) DeepCopyInto(out *ServiceMeshPeerDiscoveryStatus) { + *out = *in + if in.Active != nil { + in, out := &in.Active, &out.Active + *out = make([]PodPeerDiscoveryStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Inactive != nil { + in, out := &in.Inactive, &out.Inactive + *out = make([]PodPeerDiscoveryStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshPeerDiscoveryStatus. +func (in *ServiceMeshPeerDiscoveryStatus) DeepCopy() *ServiceMeshPeerDiscoveryStatus { + if in == nil { + return nil + } + out := new(ServiceMeshPeerDiscoveryStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceMeshPeerGateways) DeepCopyInto(out *ServiceMeshPeerGateways) { + *out = *in + out.Ingress = in.Ingress + out.Egress = in.Egress +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshPeerGateways. +func (in *ServiceMeshPeerGateways) DeepCopy() *ServiceMeshPeerGateways { + if in == nil { + return nil + } + out := new(ServiceMeshPeerGateways) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceMeshPeerList) DeepCopyInto(out *ServiceMeshPeerList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceMeshPeer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshPeerList. +func (in *ServiceMeshPeerList) DeepCopy() *ServiceMeshPeerList { + if in == nil { + return nil + } + out := new(ServiceMeshPeerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceMeshPeerList) 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 *ServiceMeshPeerRemote) DeepCopyInto(out *ServiceMeshPeerRemote) { + *out = *in + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshPeerRemote. +func (in *ServiceMeshPeerRemote) DeepCopy() *ServiceMeshPeerRemote { + if in == nil { + return nil + } + out := new(ServiceMeshPeerRemote) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceMeshPeerSecurity) DeepCopyInto(out *ServiceMeshPeerSecurity) { + *out = *in + in.CertificateChain.DeepCopyInto(&out.CertificateChain) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshPeerSecurity. +func (in *ServiceMeshPeerSecurity) DeepCopy() *ServiceMeshPeerSecurity { + if in == nil { + return nil + } + out := new(ServiceMeshPeerSecurity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceMeshPeerSpec) DeepCopyInto(out *ServiceMeshPeerSpec) { + *out = *in + in.Remote.DeepCopyInto(&out.Remote) + out.Gateways = in.Gateways + in.Security.DeepCopyInto(&out.Security) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshPeerSpec. +func (in *ServiceMeshPeerSpec) DeepCopy() *ServiceMeshPeerSpec { + if in == nil { + return nil + } + out := new(ServiceMeshPeerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceMeshPeerStatus) DeepCopyInto(out *ServiceMeshPeerStatus) { + *out = *in + in.DiscoveryStatus.DeepCopyInto(&out.DiscoveryStatus) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMeshPeerStatus. +func (in *ServiceMeshPeerStatus) DeepCopy() *ServiceMeshPeerStatus { + if in == nil { + return nil + } + out := new(ServiceMeshPeerStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceName) DeepCopyInto(out *ServiceName) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceName. +func (in *ServiceName) DeepCopy() *ServiceName { + if in == nil { + return nil + } + out := new(ServiceName) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceNameMapping) DeepCopyInto(out *ServiceNameMapping) { + *out = *in + out.ServiceName = in.ServiceName + if in.Alias != nil { + in, out := &in.Alias, &out.Alias + *out = new(ServiceName) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceNameMapping. +func (in *ServiceNameMapping) DeepCopy() *ServiceNameMapping { + if in == nil { + return nil + } + out := new(ServiceNameMapping) + in.DeepCopyInto(out) + return out +} diff --git a/manifests/maistra.io_serviceexports.yaml b/manifests/federation.maistra.io_exportedservicesets.yaml similarity index 67% rename from manifests/maistra.io_serviceexports.yaml rename to manifests/federation.maistra.io_exportedservicesets.yaml index 6829446a..6ff179e6 100644 --- a/manifests/maistra.io_serviceexports.yaml +++ b/manifests/federation.maistra.io_exportedservicesets.yaml @@ -1,25 +1,26 @@ +--- apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.4.1 creationTimestamp: null - name: serviceexports.maistra.io + name: exportedservicesets.federation.maistra.io spec: - group: maistra.io + group: federation.maistra.io names: - kind: ServiceExports - listKind: ServiceExportsList - plural: serviceexports - singular: serviceexports + kind: ExportedServiceSet + listKind: ExportedServiceSetList + plural: exportedservicesets + singular: exportedserviceset preserveUnknownFields: false scope: Namespaced subresources: status: {} validation: openAPIV3Schema: - description: ServiceExport is the Schema for configuring exported services. The name of the ServiceExports resource must match the name of a MeshFederation resource defining the remote mesh to which the services will be exported. + description: ExportedServiceSet is the Schema for configuring exported services. The name of the ExportedServiceSet resource must match the name of a ServiceMeshPeer resource defining the remote mesh to which the services will be exported. properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' @@ -32,8 +33,8 @@ spec: spec: description: Spec defines rules for matching services to be exported. properties: - exports: - description: Exports are the rules that determine which services are exported from the mesh. The list is processed in order and the first spec in the list that applies to a service is the one that will be applied. This allows more specific selectors to be placed before more general selectors. + exportRules: + description: ExportRules are the rules that determine which services are exported from the mesh. The list is processed in order and the first spec in the list that applies to a service is the one that will be applied. This allows more specific selectors to be placed before more general selectors. items: properties: labelSelector: @@ -51,12 +52,9 @@ spec: type: string type: object name: - properties: - name: - type: string - namespace: - type: string - type: object + type: string + namespace: + type: string type: object type: array namespace: @@ -104,12 +102,9 @@ spec: type: string type: object name: - properties: - name: - type: string - namespace: - type: string - type: object + type: string + namespace: + type: string type: object type: description: Type of rule. One of Name or Label. @@ -120,6 +115,42 @@ spec: type: array type: object status: + properties: + exportedServices: + description: Exports provides details about the services exported by this mesh. + items: + description: PeerServiceMapping represents the name mapping between an exported service and its local counterpart. + properties: + exportedName: + description: ExportedName represents the fully qualified domain name (FQDN) of an exported service. For an exporting mesh, this is the name that is exported to the remote mesh. For an importing mesh, this would be the name of the service exported by the remote mesh. + type: string + localService: + description: LocalService represents the service in the local (i.e. this) mesh. For an exporting mesh, this would be the service being exported. For an importing mesh, this would be the imported service. + properties: + hostname: + description: Hostname represents fully qualified domain name (FQDN) used to access the service. + type: string + name: + description: Name represents the simple name of the service, e.g. the metadata.name field of a kubernetes Service. + type: string + namespace: + description: Namespace represents the namespace within which the service resides. + type: string + required: + - hostname + - name + - namespace + type: object + required: + - exportedName + - localService + type: object + type: array + x-kubernetes-list-map-keys: + - exportedName + x-kubernetes-list-type: map + required: + - exportedServices type: object type: object version: v1 diff --git a/manifests/maistra.io_serviceimports.yaml b/manifests/federation.maistra.io_importedservicesets.yaml similarity index 57% rename from manifests/maistra.io_serviceimports.yaml rename to manifests/federation.maistra.io_importedservicesets.yaml index 95486c56..76d65c24 100644 --- a/manifests/maistra.io_serviceimports.yaml +++ b/manifests/federation.maistra.io_importedservicesets.yaml @@ -1,25 +1,26 @@ +--- apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.4.1 creationTimestamp: null - name: serviceimports.maistra.io + name: importedservicesets.federation.maistra.io spec: - group: maistra.io + group: federation.maistra.io names: - kind: ServiceImports - listKind: ServiceImportsList - plural: serviceimports - singular: serviceimports + kind: ImportedServiceSet + listKind: ImportedServiceSetList + plural: importedservicesets + singular: importedserviceset preserveUnknownFields: false scope: Namespaced subresources: status: {} validation: openAPIV3Schema: - description: ServiceImports is the Schema for configuring imported services. The name of the ServiceImports resource must match the name of a MeshFederation resource defining the remote mesh from which the services will be imported. + description: ImportedServiceSet is the Schema for configuring imported services. The name of the ImportedServiceSet resource must match the name of a ServiceMeshPeer resource defining the remote mesh from which the services will be imported. properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' @@ -35,12 +36,12 @@ spec: domainSuffix: description: 'DomainSuffix specifies the domain suffix to be applies to imported services. If no domain suffix is specified, imported services will be named as follows: ..svc.-imports.local If a domain suffix is specified, imported services will be named as follows: ..' type: string - imports: - description: Imports are the rules that determine which services are imported to the mesh. The list is processed in order and the first spec in the list that applies to a service is the one that will be applied. This allows more specific selectors to be placed before more general selectors. + importRules: + description: ImportRules are the rules that determine which services are imported to the mesh. The list is processed in order and the first spec in the list that applies to a service is the one that will be applied. This allows more specific selectors to be placed before more general selectors. items: properties: domainSuffix: - description: DomainSuffix applies the specified suffix to services imported by this rule. The behavior is identical to that of ServiceImportsSpec.DomainSuffix. + description: DomainSuffix applies the specified suffix to services imported by this rule. The behavior is identical to that of ImportedServiceSetSpec.DomainSuffix. type: string importAsLocal: description: ImportAsLocal imports the service as a local service in the mesh. For example, if an exported service, foo/bar is imported as some-ns/service, the service will be imported as service.some-ns.svc.cluster.local in the some-ns namespace. If a service of this name already exists in the mesh, the imported service's endpoints will be aggregated with any other workloads associated with the service. This setting overrides DomainSuffix. @@ -56,12 +57,9 @@ spec: type: string type: object name: - properties: - name: - type: string - namespace: - type: string - type: object + type: string + namespace: + type: string type: object type: description: Type of rule. Only Name type is supported. @@ -85,6 +83,42 @@ spec: type: object type: object status: + properties: + importedServices: + description: Imports provides details about the services imported by this mesh. + items: + description: PeerServiceMapping represents the name mapping between an exported service and its local counterpart. + properties: + exportedName: + description: ExportedName represents the fully qualified domain name (FQDN) of an exported service. For an exporting mesh, this is the name that is exported to the remote mesh. For an importing mesh, this would be the name of the service exported by the remote mesh. + type: string + localService: + description: LocalService represents the service in the local (i.e. this) mesh. For an exporting mesh, this would be the service being exported. For an importing mesh, this would be the imported service. + properties: + hostname: + description: Hostname represents fully qualified domain name (FQDN) used to access the service. + type: string + name: + description: Name represents the simple name of the service, e.g. the metadata.name field of a kubernetes Service. + type: string + namespace: + description: Namespace represents the namespace within which the service resides. + type: string + required: + - hostname + - name + - namespace + type: object + required: + - exportedName + - localService + type: object + type: array + x-kubernetes-list-map-keys: + - exportedName + x-kubernetes-list-type: map + required: + - importedServices type: object type: object version: v1 diff --git a/manifests/maistra.io_meshfederations.yaml b/manifests/federation.maistra.io_servicemeshpeers.yaml similarity index 76% rename from manifests/maistra.io_meshfederations.yaml rename to manifests/federation.maistra.io_servicemeshpeers.yaml index d40b1745..d0d5cdc7 100644 --- a/manifests/maistra.io_meshfederations.yaml +++ b/manifests/federation.maistra.io_servicemeshpeers.yaml @@ -1,27 +1,28 @@ +--- apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.4.1 creationTimestamp: null - name: meshfederations.maistra.io + name: servicemeshpeers.federation.maistra.io spec: - group: maistra.io + group: federation.maistra.io names: categories: - maistra-io - kind: MeshFederation - listKind: MeshFederationList - plural: meshfederations - singular: meshfederation + kind: ServiceMeshPeer + listKind: ServiceMeshPeerList + plural: servicemeshpeers + singular: servicemeshpeer preserveUnknownFields: false scope: Namespaced subresources: status: {} validation: openAPIV3Schema: - description: MeshFederation is the Schema for joining two meshes together. The resource name will be used to identify the 'cluster' to which imported services belong. + description: ServiceMeshPeer is the Schema for joining two meshes together. The resource name will be used to identify the 'cluster' to which imported services belong. properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' @@ -32,7 +33,7 @@ spec: metadata: type: object spec: - description: MeshFederationSpec configures details required to support federation with another service mesh. + description: ServiceMeshPeerSpec configures details required to support federation with another service mesh. properties: gateways: description: Gateways configures the gateways used to facilitate ingress and egress with the other mesh. @@ -97,7 +98,7 @@ spec: type: object type: object status: - description: MeshFederationStatus provides information related to the other mesh. + description: ServiceMeshPeerStatus provides information related to the other mesh. properties: discoveryStatus: description: DiscoveryStatus represents the discovery status of each pilot/istiod pod in the mesh. @@ -105,7 +106,7 @@ spec: active: description: Active represents the pilot/istiod pods actively watching the other mesh for discovery. items: - description: FederationPodDiscoveryStatus provides discovery details related to a specific pilot/istiod pod. + description: PodPeerDiscoveryStatus provides discovery details related to a specific pilot/istiod pod. properties: pod: description: Pod is the pod name to which these details apply. This maps to a a pilot/istiod pod. @@ -187,7 +188,7 @@ spec: inactive: description: Inactive represents the pilot/istiod pods not actively watching the other mesh for discovery. items: - description: FederationPodDiscoveryStatus provides discovery details related to a specific pilot/istiod pod. + description: PodPeerDiscoveryStatus provides discovery details related to a specific pilot/istiod pod. properties: pod: description: Pod is the pod name to which these details apply. This maps to a a pilot/istiod pod. @@ -267,75 +268,6 @@ spec: - pod x-kubernetes-list-type: map type: object - exports: - description: Exports provides details about the services exported by this mesh. - items: - description: MeshServiceMapping represents the name mapping between an exported service and its local counterpart. - properties: - exportedName: - description: ExportedName represents the fully qualified domain name (FQDN) of an exported service. For an exporting mesh, this is the name that is exported to the remote mesh. For an importing mesh, this would be the name of the service exported by the remote mesh. - type: string - localService: - description: LocalService represents the service in the local (i.e. this) mesh. For an exporting mesh, this would be the service being exported. For an importing mesh, this would be the imported service. - properties: - hostname: - description: Hostname represents fully qualified domain name (FQDN) used to access the service. - type: string - name: - description: Name represents the simple name of the service, e.g. the metadata.name field of a kubernetes Service. - type: string - namespace: - description: Namespace represents the namespace within which the service resides. - type: string - required: - - hostname - - name - - namespace - type: object - required: - - exportedName - - localService - type: object - type: array - x-kubernetes-list-map-keys: - - exportedName - x-kubernetes-list-type: map - imports: - description: Imports provides details about the services imported by this mesh. - items: - description: MeshServiceMapping represents the name mapping between an exported service and its local counterpart. - properties: - exportedName: - description: ExportedName represents the fully qualified domain name (FQDN) of an exported service. For an exporting mesh, this is the name that is exported to the remote mesh. For an importing mesh, this would be the name of the service exported by the remote mesh. - type: string - localService: - description: LocalService represents the service in the local (i.e. this) mesh. For an exporting mesh, this would be the service being exported. For an importing mesh, this would be the imported service. - properties: - hostname: - description: Hostname represents fully qualified domain name (FQDN) used to access the service. - type: string - name: - description: Name represents the simple name of the service, e.g. the metadata.name field of a kubernetes Service. - type: string - namespace: - description: Namespace represents the namespace within which the service resides. - type: string - required: - - hostname - - name - - namespace - type: object - required: - - exportedName - - localService - type: object - type: array - x-kubernetes-list-map-keys: - - exportedName - x-kubernetes-list-type: map - required: - - exports - - imports type: object type: object version: v1 diff --git a/security/v1/trustbundle.pb.go b/security/v1/trustbundle.pb.go index 548d3d50..bf7e2740 100644 --- a/security/v1/trustbundle.pb.go +++ b/security/v1/trustbundle.pb.go @@ -551,10 +551,7 @@ func (m *TrustBundle) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTrustbundle - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTrustbundle } if (iNdEx + skippy) > l { @@ -605,10 +602,7 @@ func (m *TrustBundleRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTrustbundle - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTrustbundle } if (iNdEx + skippy) > l { @@ -693,10 +687,7 @@ func (m *TrustBundleResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTrustbundle - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTrustbundle } if (iNdEx + skippy) > l { @@ -715,6 +706,7 @@ func (m *TrustBundleResponse) Unmarshal(dAtA []byte) error { func skipTrustbundle(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -746,10 +738,8 @@ func skipTrustbundle(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -770,55 +760,30 @@ func skipTrustbundle(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthTrustbundle } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthTrustbundle - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTrustbundle - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipTrustbundle(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthTrustbundle - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTrustbundle + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthTrustbundle + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthTrustbundle = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTrustbundle = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthTrustbundle = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTrustbundle = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTrustbundle = fmt.Errorf("proto: unexpected end of group") )