From 6da2e11683b55c26b012138a3f6e524c765e366a Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Sat, 16 Mar 2019 14:10:09 +0200 Subject: [PATCH] Add AppMesh CRDs and Kubernetes client --- hack/update-codegen.sh | 3 +- pkg/apis/appmesh/register.go | 5 + pkg/apis/appmesh/v1alpha1/doc.go | 5 + pkg/apis/appmesh/v1alpha1/register.go | 40 + pkg/apis/appmesh/v1alpha1/types.go | 289 +++++++ .../appmesh/v1alpha1/zz_generated.deepcopy.go | 756 ++++++++++++++++++ pkg/client/clientset/versioned/clientset.go | 22 + .../versioned/fake/clientset_generated.go | 12 + .../clientset/versioned/fake/register.go | 2 + .../clientset/versioned/scheme/register.go | 2 + .../typed/appmesh/v1alpha1/appmesh_client.go | 100 +++ .../versioned/typed/appmesh/v1alpha1/doc.go | 20 + .../typed/appmesh/v1alpha1/fake/doc.go | 20 + .../v1alpha1/fake/fake_appmesh_client.go | 48 ++ .../typed/appmesh/v1alpha1/fake/fake_mesh.go | 140 ++++ .../appmesh/v1alpha1/fake/fake_virtualnode.go | 140 ++++ .../v1alpha1/fake/fake_virtualservice.go | 140 ++++ .../appmesh/v1alpha1/generated_expansion.go | 25 + .../versioned/typed/appmesh/v1alpha1/mesh.go | 174 ++++ .../typed/appmesh/v1alpha1/virtualnode.go | 174 ++++ .../typed/appmesh/v1alpha1/virtualservice.go | 174 ++++ .../externalversions/appmesh/interface.go | 46 ++ .../appmesh/v1alpha1/interface.go | 59 ++ .../externalversions/appmesh/v1alpha1/mesh.go | 89 +++ .../appmesh/v1alpha1/virtualnode.go | 89 +++ .../appmesh/v1alpha1/virtualservice.go | 89 +++ .../informers/externalversions/factory.go | 6 + .../informers/externalversions/generic.go | 11 +- .../appmesh/v1alpha1/expansion_generated.go | 43 + pkg/client/listers/appmesh/v1alpha1/mesh.go | 94 +++ .../listers/appmesh/v1alpha1/virtualnode.go | 94 +++ .../appmesh/v1alpha1/virtualservice.go | 94 +++ 32 files changed, 3002 insertions(+), 3 deletions(-) create mode 100644 pkg/apis/appmesh/register.go create mode 100644 pkg/apis/appmesh/v1alpha1/doc.go create mode 100644 pkg/apis/appmesh/v1alpha1/register.go create mode 100644 pkg/apis/appmesh/v1alpha1/types.go create mode 100644 pkg/apis/appmesh/v1alpha1/zz_generated.deepcopy.go create mode 100644 pkg/client/clientset/versioned/typed/appmesh/v1alpha1/appmesh_client.go create mode 100644 pkg/client/clientset/versioned/typed/appmesh/v1alpha1/doc.go create mode 100644 pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/doc.go create mode 100644 pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_appmesh_client.go create mode 100644 pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_mesh.go create mode 100644 pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_virtualnode.go create mode 100644 pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_virtualservice.go create mode 100644 pkg/client/clientset/versioned/typed/appmesh/v1alpha1/generated_expansion.go create mode 100644 pkg/client/clientset/versioned/typed/appmesh/v1alpha1/mesh.go create mode 100644 pkg/client/clientset/versioned/typed/appmesh/v1alpha1/virtualnode.go create mode 100644 pkg/client/clientset/versioned/typed/appmesh/v1alpha1/virtualservice.go create mode 100644 pkg/client/informers/externalversions/appmesh/interface.go create mode 100644 pkg/client/informers/externalversions/appmesh/v1alpha1/interface.go create mode 100644 pkg/client/informers/externalversions/appmesh/v1alpha1/mesh.go create mode 100644 pkg/client/informers/externalversions/appmesh/v1alpha1/virtualnode.go create mode 100644 pkg/client/informers/externalversions/appmesh/v1alpha1/virtualservice.go create mode 100644 pkg/client/listers/appmesh/v1alpha1/expansion_generated.go create mode 100644 pkg/client/listers/appmesh/v1alpha1/mesh.go create mode 100644 pkg/client/listers/appmesh/v1alpha1/virtualnode.go create mode 100644 pkg/client/listers/appmesh/v1alpha1/virtualservice.go diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index d05b702d..97b4ead8 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -23,6 +23,5 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-ge ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \ github.com/stefanprodan/flagger/pkg/client github.com/stefanprodan/flagger/pkg/apis \ - "istio:v1alpha3 flagger:v1alpha3" \ + "appmesh:v1alpha1 istio:v1alpha3 flagger:v1alpha3" \ --go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt - diff --git a/pkg/apis/appmesh/register.go b/pkg/apis/appmesh/register.go new file mode 100644 index 00000000..2e54ff10 --- /dev/null +++ b/pkg/apis/appmesh/register.go @@ -0,0 +1,5 @@ +package appmesh + +const ( + GroupName = "appmesh.k8s.aws" +) diff --git a/pkg/apis/appmesh/v1alpha1/doc.go b/pkg/apis/appmesh/v1alpha1/doc.go new file mode 100644 index 00000000..40089cb9 --- /dev/null +++ b/pkg/apis/appmesh/v1alpha1/doc.go @@ -0,0 +1,5 @@ +// +k8s:deepcopy-gen=package + +// Package v1alpha1 is the v1alpha1 version of the API. +// +groupName=appmesh.k8s.aws +package v1alpha1 diff --git a/pkg/apis/appmesh/v1alpha1/register.go b/pkg/apis/appmesh/v1alpha1/register.go new file mode 100644 index 00000000..e8b4d04d --- /dev/null +++ b/pkg/apis/appmesh/v1alpha1/register.go @@ -0,0 +1,40 @@ +package v1alpha1 + +import ( + "github.com/stefanprodan/flagger/pkg/apis/appmesh" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: appmesh.GroupName, Version: "v1alpha1"} + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &Mesh{}, + &MeshList{}, + &VirtualService{}, + &VirtualServiceList{}, + &VirtualNode{}, + &VirtualNodeList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/pkg/apis/appmesh/v1alpha1/types.go b/pkg/apis/appmesh/v1alpha1/types.go new file mode 100644 index 00000000..04b014c8 --- /dev/null +++ b/pkg/apis/appmesh/v1alpha1/types.go @@ -0,0 +1,289 @@ +package v1alpha1 + +import ( + api "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// App Mesh Custom Resource API types. +// This API follows the conventions described in +// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Mesh is a specification for a Mesh resource +type Mesh struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // +optional + Spec *MeshSpec `json:"spec,omitempty"` + // +optional + Status *MeshStatus `json:"status,omitempty"` +} + +type MeshServiceDiscoveryType string + +const ( + CloudMapHttp MeshServiceDiscoveryType = "CloudMapHttp" +) + +// MeshSpec is the spec for a Mesh resource +type MeshSpec struct { + // CloudMapNamespaceName can be specified if it should be different than the mesh name. + // +optional + CloudMapNamespaceName *string `json:"cloudMapNamespaceName,omitempty"` + // +optional + ServiceDiscoveryType *MeshServiceDiscoveryType `json:"serviceDiscoveryType,omitempty"` +} + +// MeshStatus is the status for a Mesh resource +type MeshStatus struct { + // MeshArn is the AppMesh Mesh object's Amazon Resource Name + // +optional + MeshArn *string `json:"meshArn,omitempty"` + // NamespaceArn is the CloudMap NameSpace object's Amazon Resource Name + // +optional + CloudMapNamespaceArn *string `json:"cloudMapNamespaceArn,omitempty"` + // +optional + CloudMapRoleArn *string `json:"cloudMapRoleArn,omitempty"` + Conditions []MeshCondition `json:"meshCondition"` +} + +type MeshConditionType string + +const ( + // MeshActive is Active when the Appmesh Mesh has been created or found via the API + MeshActive MeshConditionType = "Active" +) + +type MeshCondition struct { + // Type of mesh condition. + Type MeshConditionType `json:"type"` + // Status of the condition, one of True, False, Unknown. + Status api.ConditionStatus `json:"status"` + // Last time the condition transitioned from one status to another. + // +optional + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + // The reason for the condition's last transition. + // +optional + Reason *string `json:"reason,omitempty"` + // A human readable message indicating details about the transition. + // +optional + Message *string `json:"message,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// MeshList is a list of Mesh resources +type MeshList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []Mesh `json:"items"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VirtualService is a specification for a VirtualService resource +type VirtualService struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // +optional + Spec *VirtualServiceSpec `json:"spec,omitempty"` + // +optional + Status *VirtualServiceStatus `json:"status,omitempty"` +} + +// VirtualServiceSpec is the spec for a VirtualService resource +type VirtualServiceSpec struct { + MeshName string `json:"meshName"` + // +optional + VirtualRouter *VirtualRouter `json:"virtualRouter,omitempty"` + // +optional + Routes []Route `json:"routes,omitempty"` +} + +type VirtualRouter struct { + Name string `json:"name"` +} + +type Route struct { + Name string `json:"name"` + Http HttpRoute `json:"http"` +} + +type HttpRoute struct { + Match HttpRouteMatch `json:"match"` + Action HttpRouteAction `json:"action"` +} + +type HttpRouteMatch struct { + Prefix string `json:"prefix"` +} + +type HttpRouteAction struct { + WeightedTargets []WeightedTarget `json:"weightedTargets"` +} + +type WeightedTarget struct { + VirtualNodeName string `json:"virtualNodeName"` + Weight int64 `json:"weight"` +} + +// VirtualServiceStatus is the status for a VirtualService resource +type VirtualServiceStatus struct { + // VirtualServiceArn is the AppMesh VirtualService object's Amazon Resource Name + // +optional + VirtualServiceArn *string `json:"virtualServiceArn,omitempty"` + // VirtualRouterArn is the AppMesh VirtualRouter object's Amazon Resource Name + // +optional + VirtualRouterArn *string `json:"virtualRouterArn,omitempty"` + // RouteArns is a list of AppMesh Route objects' Amazon Resource Names + // +optional + RouteArns []string `json:"routeArns,omitempty"` + Conditions []VirtualServiceCondition `json:"conditions"` +} + +type VirtualServiceConditionType string + +const ( + // VirtualServiceActive is Active when the Appmesh Service has been created or found via the API + VirtualServiceActive VirtualServiceConditionType = "Active" +) + +type VirtualServiceCondition struct { + // Type of mesh service condition. + Type VirtualServiceConditionType `json:"type"` + // Status of the condition, one of True, False, Unknown. + Status api.ConditionStatus `json:"status"` + // Last time the condition transitioned from one status to another. + // +optional + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + // The reason for the condition's last transition. + // +optional + Reason *string `json:"reason,omitempty"` + // A human readable message indicating details about the transition. + // +optional + Message *string `json:"message,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VirtualServiceList is a list of VirtualService resources +type VirtualServiceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []VirtualService `json:"items"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VirtualNode is a specification for a VirtualNode resource +type VirtualNode struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // +optional + Spec *VirtualNodeSpec `json:"spec,omitempty"` + // +optional + Status *VirtualNodeStatus `json:"status,omitempty"` +} + +// VirtualNodeSpec is the spec for a VirtualNode resource +type VirtualNodeSpec struct { + MeshName string `json:"meshName"` + // +optional + Listeners []Listener `json:"listeners,omitempty"` + // +optional + ServiceDiscovery *ServiceDiscovery `json:"serviceDiscovery,omitempty"` + // +optional + Backends []Backend `json:"backends,omitempty"` +} + +type Listener struct { + PortMapping PortMapping `json:"portMapping"` +} + +type PortMapping struct { + Port int64 `json:"port"` + Protocol string `json:"protocol"` +} + +type ServiceDiscovery struct { + // +optional + CloudMap *CloudMapServiceDiscovery `json:"cloudMap,omitempty"` + // +optional + Dns *DnsServiceDiscovery `json:"dns,omitempty"` +} + +type CloudMapServiceDiscovery struct { + CloudMapServiceName string `json:"cloudMapServiceName"` +} + +type DnsServiceDiscovery struct { + HostName string `json:"hostName"` +} + +type Backend struct { + VirtualService VirtualServiceBackend `json:"virtualService"` +} + +type VirtualServiceBackend struct { + VirtualServiceName string `json:"virtualServiceName"` +} + +// VirtualNodeStatus is the status for a VirtualNode resource +type VirtualNodeStatus struct { + MeshArn *string `json:"meshArn,omitempty"` + // VirtualNodeArn is the AppMesh VirtualNode object's Amazon Resource Name + // +optional + VirtualNodeArn *string `json:"virtualNodeArn,omitempty"` + // CloudMapServiceArn is a CloudMap Service object's Amazon Resource Name + // +optional + CloudMapServiceArn *string `json:"cloudMapServiceArn,omitempty"` + // +optional + QueryParameters map[string]string `json:"queryParameters,omitempty"` + Conditions []VirtualNodeCondition `json:"conditions"` +} + +type VirtualNodeConditionType string + +const ( + // VirtualNodeActive is Active when the Appmesh Node has been created or found via the API + VirtualNodeActive VirtualNodeConditionType = "Active" +) + +type VirtualNodeCondition struct { + // Type of mesh node condition. + Type VirtualNodeConditionType `json:"type"` + // Status of the condition, one of True, False, Unknown. + Status api.ConditionStatus `json:"status"` + // Last time the condition transitioned from one status to another. + // +optional + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + // The reason for the condition's last transition. + // +optional + Reason *string `json:"reason,omitempty"` + // A human readable message indicating details about the transition. + // +optional + Message *string `json:"reason,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VirtualNodeList is a list of VirtualNode resources +type VirtualNodeList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []VirtualNode `json:"items"` +} diff --git a/pkg/apis/appmesh/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/appmesh/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 00000000..f5a06280 --- /dev/null +++ b/pkg/apis/appmesh/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,756 @@ +// +build !ignore_autogenerated + +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +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 *Backend) DeepCopyInto(out *Backend) { + *out = *in + out.VirtualService = in.VirtualService + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backend. +func (in *Backend) DeepCopy() *Backend { + if in == nil { + return nil + } + out := new(Backend) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudMapServiceDiscovery) DeepCopyInto(out *CloudMapServiceDiscovery) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudMapServiceDiscovery. +func (in *CloudMapServiceDiscovery) DeepCopy() *CloudMapServiceDiscovery { + if in == nil { + return nil + } + out := new(CloudMapServiceDiscovery) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DnsServiceDiscovery) DeepCopyInto(out *DnsServiceDiscovery) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DnsServiceDiscovery. +func (in *DnsServiceDiscovery) DeepCopy() *DnsServiceDiscovery { + if in == nil { + return nil + } + out := new(DnsServiceDiscovery) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HttpRoute) DeepCopyInto(out *HttpRoute) { + *out = *in + out.Match = in.Match + in.Action.DeepCopyInto(&out.Action) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HttpRoute. +func (in *HttpRoute) DeepCopy() *HttpRoute { + if in == nil { + return nil + } + out := new(HttpRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HttpRouteAction) DeepCopyInto(out *HttpRouteAction) { + *out = *in + if in.WeightedTargets != nil { + in, out := &in.WeightedTargets, &out.WeightedTargets + *out = make([]WeightedTarget, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HttpRouteAction. +func (in *HttpRouteAction) DeepCopy() *HttpRouteAction { + if in == nil { + return nil + } + out := new(HttpRouteAction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HttpRouteMatch) DeepCopyInto(out *HttpRouteMatch) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HttpRouteMatch. +func (in *HttpRouteMatch) DeepCopy() *HttpRouteMatch { + if in == nil { + return nil + } + out := new(HttpRouteMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Listener) DeepCopyInto(out *Listener) { + *out = *in + out.PortMapping = in.PortMapping + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Listener. +func (in *Listener) DeepCopy() *Listener { + if in == nil { + return nil + } + out := new(Listener) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Mesh) DeepCopyInto(out *Mesh) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = new(MeshSpec) + (*in).DeepCopyInto(*out) + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(MeshStatus) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Mesh. +func (in *Mesh) DeepCopy() *Mesh { + if in == nil { + return nil + } + out := new(Mesh) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Mesh) 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 *MeshCondition) DeepCopyInto(out *MeshCondition) { + *out = *in + if in.LastTransitionTime != nil { + in, out := &in.LastTransitionTime, &out.LastTransitionTime + *out = (*in).DeepCopy() + } + if in.Reason != nil { + in, out := &in.Reason, &out.Reason + *out = new(string) + **out = **in + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshCondition. +func (in *MeshCondition) DeepCopy() *MeshCondition { + if in == nil { + return nil + } + out := new(MeshCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MeshList) DeepCopyInto(out *MeshList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Mesh, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshList. +func (in *MeshList) DeepCopy() *MeshList { + if in == nil { + return nil + } + out := new(MeshList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MeshList) 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 *MeshSpec) DeepCopyInto(out *MeshSpec) { + *out = *in + if in.CloudMapNamespaceName != nil { + in, out := &in.CloudMapNamespaceName, &out.CloudMapNamespaceName + *out = new(string) + **out = **in + } + if in.ServiceDiscoveryType != nil { + in, out := &in.ServiceDiscoveryType, &out.ServiceDiscoveryType + *out = new(MeshServiceDiscoveryType) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshSpec. +func (in *MeshSpec) DeepCopy() *MeshSpec { + if in == nil { + return nil + } + out := new(MeshSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MeshStatus) DeepCopyInto(out *MeshStatus) { + *out = *in + if in.MeshArn != nil { + in, out := &in.MeshArn, &out.MeshArn + *out = new(string) + **out = **in + } + if in.CloudMapNamespaceArn != nil { + in, out := &in.CloudMapNamespaceArn, &out.CloudMapNamespaceArn + *out = new(string) + **out = **in + } + if in.CloudMapRoleArn != nil { + in, out := &in.CloudMapRoleArn, &out.CloudMapRoleArn + *out = new(string) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]MeshCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshStatus. +func (in *MeshStatus) DeepCopy() *MeshStatus { + if in == nil { + return nil + } + out := new(MeshStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PortMapping) DeepCopyInto(out *PortMapping) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PortMapping. +func (in *PortMapping) DeepCopy() *PortMapping { + if in == nil { + return nil + } + out := new(PortMapping) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Route) DeepCopyInto(out *Route) { + *out = *in + in.Http.DeepCopyInto(&out.Http) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Route. +func (in *Route) DeepCopy() *Route { + if in == nil { + return nil + } + out := new(Route) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceDiscovery) DeepCopyInto(out *ServiceDiscovery) { + *out = *in + if in.CloudMap != nil { + in, out := &in.CloudMap, &out.CloudMap + *out = new(CloudMapServiceDiscovery) + **out = **in + } + if in.Dns != nil { + in, out := &in.Dns, &out.Dns + *out = new(DnsServiceDiscovery) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDiscovery. +func (in *ServiceDiscovery) DeepCopy() *ServiceDiscovery { + if in == nil { + return nil + } + out := new(ServiceDiscovery) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualNode) DeepCopyInto(out *VirtualNode) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = new(VirtualNodeSpec) + (*in).DeepCopyInto(*out) + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(VirtualNodeStatus) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualNode. +func (in *VirtualNode) DeepCopy() *VirtualNode { + if in == nil { + return nil + } + out := new(VirtualNode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualNode) 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 *VirtualNodeCondition) DeepCopyInto(out *VirtualNodeCondition) { + *out = *in + if in.LastTransitionTime != nil { + in, out := &in.LastTransitionTime, &out.LastTransitionTime + *out = (*in).DeepCopy() + } + if in.Reason != nil { + in, out := &in.Reason, &out.Reason + *out = new(string) + **out = **in + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualNodeCondition. +func (in *VirtualNodeCondition) DeepCopy() *VirtualNodeCondition { + if in == nil { + return nil + } + out := new(VirtualNodeCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualNodeList) DeepCopyInto(out *VirtualNodeList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualNode, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualNodeList. +func (in *VirtualNodeList) DeepCopy() *VirtualNodeList { + if in == nil { + return nil + } + out := new(VirtualNodeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualNodeList) 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 *VirtualNodeSpec) DeepCopyInto(out *VirtualNodeSpec) { + *out = *in + if in.Listeners != nil { + in, out := &in.Listeners, &out.Listeners + *out = make([]Listener, len(*in)) + copy(*out, *in) + } + if in.ServiceDiscovery != nil { + in, out := &in.ServiceDiscovery, &out.ServiceDiscovery + *out = new(ServiceDiscovery) + (*in).DeepCopyInto(*out) + } + if in.Backends != nil { + in, out := &in.Backends, &out.Backends + *out = make([]Backend, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualNodeSpec. +func (in *VirtualNodeSpec) DeepCopy() *VirtualNodeSpec { + if in == nil { + return nil + } + out := new(VirtualNodeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualNodeStatus) DeepCopyInto(out *VirtualNodeStatus) { + *out = *in + if in.MeshArn != nil { + in, out := &in.MeshArn, &out.MeshArn + *out = new(string) + **out = **in + } + if in.VirtualNodeArn != nil { + in, out := &in.VirtualNodeArn, &out.VirtualNodeArn + *out = new(string) + **out = **in + } + if in.CloudMapServiceArn != nil { + in, out := &in.CloudMapServiceArn, &out.CloudMapServiceArn + *out = new(string) + **out = **in + } + if in.QueryParameters != nil { + in, out := &in.QueryParameters, &out.QueryParameters + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]VirtualNodeCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualNodeStatus. +func (in *VirtualNodeStatus) DeepCopy() *VirtualNodeStatus { + if in == nil { + return nil + } + out := new(VirtualNodeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualRouter) DeepCopyInto(out *VirtualRouter) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualRouter. +func (in *VirtualRouter) DeepCopy() *VirtualRouter { + if in == nil { + return nil + } + out := new(VirtualRouter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualService) DeepCopyInto(out *VirtualService) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = new(VirtualServiceSpec) + (*in).DeepCopyInto(*out) + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(VirtualServiceStatus) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualService. +func (in *VirtualService) DeepCopy() *VirtualService { + if in == nil { + return nil + } + out := new(VirtualService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualService) 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 *VirtualServiceBackend) DeepCopyInto(out *VirtualServiceBackend) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualServiceBackend. +func (in *VirtualServiceBackend) DeepCopy() *VirtualServiceBackend { + if in == nil { + return nil + } + out := new(VirtualServiceBackend) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualServiceCondition) DeepCopyInto(out *VirtualServiceCondition) { + *out = *in + if in.LastTransitionTime != nil { + in, out := &in.LastTransitionTime, &out.LastTransitionTime + *out = (*in).DeepCopy() + } + if in.Reason != nil { + in, out := &in.Reason, &out.Reason + *out = new(string) + **out = **in + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualServiceCondition. +func (in *VirtualServiceCondition) DeepCopy() *VirtualServiceCondition { + if in == nil { + return nil + } + out := new(VirtualServiceCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualServiceList) DeepCopyInto(out *VirtualServiceList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualService, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualServiceList. +func (in *VirtualServiceList) DeepCopy() *VirtualServiceList { + if in == nil { + return nil + } + out := new(VirtualServiceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualServiceList) 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 *VirtualServiceSpec) DeepCopyInto(out *VirtualServiceSpec) { + *out = *in + if in.VirtualRouter != nil { + in, out := &in.VirtualRouter, &out.VirtualRouter + *out = new(VirtualRouter) + **out = **in + } + if in.Routes != nil { + in, out := &in.Routes, &out.Routes + *out = make([]Route, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualServiceSpec. +func (in *VirtualServiceSpec) DeepCopy() *VirtualServiceSpec { + if in == nil { + return nil + } + out := new(VirtualServiceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualServiceStatus) DeepCopyInto(out *VirtualServiceStatus) { + *out = *in + if in.VirtualServiceArn != nil { + in, out := &in.VirtualServiceArn, &out.VirtualServiceArn + *out = new(string) + **out = **in + } + if in.VirtualRouterArn != nil { + in, out := &in.VirtualRouterArn, &out.VirtualRouterArn + *out = new(string) + **out = **in + } + if in.RouteArns != nil { + in, out := &in.RouteArns, &out.RouteArns + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]VirtualServiceCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualServiceStatus. +func (in *VirtualServiceStatus) DeepCopy() *VirtualServiceStatus { + if in == nil { + return nil + } + out := new(VirtualServiceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WeightedTarget) DeepCopyInto(out *WeightedTarget) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WeightedTarget. +func (in *WeightedTarget) DeepCopy() *WeightedTarget { + if in == nil { + return nil + } + out := new(WeightedTarget) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index ced1c7a9..88fe55c0 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -19,6 +19,7 @@ limitations under the License. package versioned import ( + appmeshv1alpha1 "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/typed/appmesh/v1alpha1" flaggerv1alpha3 "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/typed/flagger/v1alpha3" networkingv1alpha3 "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/typed/istio/v1alpha3" discovery "k8s.io/client-go/discovery" @@ -28,6 +29,9 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface + AppmeshV1alpha1() appmeshv1alpha1.AppmeshV1alpha1Interface + // Deprecated: please explicitly pick a version if possible. + Appmesh() appmeshv1alpha1.AppmeshV1alpha1Interface FlaggerV1alpha3() flaggerv1alpha3.FlaggerV1alpha3Interface // Deprecated: please explicitly pick a version if possible. Flagger() flaggerv1alpha3.FlaggerV1alpha3Interface @@ -40,10 +44,22 @@ type Interface interface { // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient + appmeshV1alpha1 *appmeshv1alpha1.AppmeshV1alpha1Client flaggerV1alpha3 *flaggerv1alpha3.FlaggerV1alpha3Client networkingV1alpha3 *networkingv1alpha3.NetworkingV1alpha3Client } +// AppmeshV1alpha1 retrieves the AppmeshV1alpha1Client +func (c *Clientset) AppmeshV1alpha1() appmeshv1alpha1.AppmeshV1alpha1Interface { + return c.appmeshV1alpha1 +} + +// Deprecated: Appmesh retrieves the default version of AppmeshClient. +// Please explicitly pick a version. +func (c *Clientset) Appmesh() appmeshv1alpha1.AppmeshV1alpha1Interface { + return c.appmeshV1alpha1 +} + // FlaggerV1alpha3 retrieves the FlaggerV1alpha3Client func (c *Clientset) FlaggerV1alpha3() flaggerv1alpha3.FlaggerV1alpha3Interface { return c.flaggerV1alpha3 @@ -82,6 +98,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error + cs.appmeshV1alpha1, err = appmeshv1alpha1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } cs.flaggerV1alpha3, err = flaggerv1alpha3.NewForConfig(&configShallowCopy) if err != nil { return nil, err @@ -102,6 +122,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset + cs.appmeshV1alpha1 = appmeshv1alpha1.NewForConfigOrDie(c) cs.flaggerV1alpha3 = flaggerv1alpha3.NewForConfigOrDie(c) cs.networkingV1alpha3 = networkingv1alpha3.NewForConfigOrDie(c) @@ -112,6 +133,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset + cs.appmeshV1alpha1 = appmeshv1alpha1.New(c) cs.flaggerV1alpha3 = flaggerv1alpha3.New(c) cs.networkingV1alpha3 = networkingv1alpha3.New(c) diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 96166729..6ca8abb1 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -20,6 +20,8 @@ package fake import ( clientset "github.com/stefanprodan/flagger/pkg/client/clientset/versioned" + appmeshv1alpha1 "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/typed/appmesh/v1alpha1" + fakeappmeshv1alpha1 "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake" flaggerv1alpha3 "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/typed/flagger/v1alpha3" fakeflaggerv1alpha3 "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/typed/flagger/v1alpha3/fake" networkingv1alpha3 "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/typed/istio/v1alpha3" @@ -73,6 +75,16 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { var _ clientset.Interface = &Clientset{} +// AppmeshV1alpha1 retrieves the AppmeshV1alpha1Client +func (c *Clientset) AppmeshV1alpha1() appmeshv1alpha1.AppmeshV1alpha1Interface { + return &fakeappmeshv1alpha1.FakeAppmeshV1alpha1{Fake: &c.Fake} +} + +// Appmesh retrieves the AppmeshV1alpha1Client +func (c *Clientset) Appmesh() appmeshv1alpha1.AppmeshV1alpha1Interface { + return &fakeappmeshv1alpha1.FakeAppmeshV1alpha1{Fake: &c.Fake} +} + // FlaggerV1alpha3 retrieves the FlaggerV1alpha3Client func (c *Clientset) FlaggerV1alpha3() flaggerv1alpha3.FlaggerV1alpha3Interface { return &fakeflaggerv1alpha3.FakeFlaggerV1alpha3{Fake: &c.Fake} diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 4a99c6c4..328bd8b0 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -19,6 +19,7 @@ limitations under the License. package fake import ( + appmeshv1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" flaggerv1alpha3 "github.com/stefanprodan/flagger/pkg/apis/flagger/v1alpha3" networkingv1alpha3 "github.com/stefanprodan/flagger/pkg/apis/istio/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -51,6 +52,7 @@ func init() { // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. func AddToScheme(scheme *runtime.Scheme) { + appmeshv1alpha1.AddToScheme(scheme) flaggerv1alpha3.AddToScheme(scheme) networkingv1alpha3.AddToScheme(scheme) } diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 5da13d21..fa4b0edd 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -19,6 +19,7 @@ limitations under the License. package scheme import ( + appmeshv1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" flaggerv1alpha3 "github.com/stefanprodan/flagger/pkg/apis/flagger/v1alpha3" networkingv1alpha3 "github.com/stefanprodan/flagger/pkg/apis/istio/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -51,6 +52,7 @@ func init() { // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. func AddToScheme(scheme *runtime.Scheme) { + appmeshv1alpha1.AddToScheme(scheme) flaggerv1alpha3.AddToScheme(scheme) networkingv1alpha3.AddToScheme(scheme) } diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/appmesh_client.go b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/appmesh_client.go new file mode 100644 index 00000000..98e28b86 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/appmesh_client.go @@ -0,0 +1,100 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" + "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/scheme" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + rest "k8s.io/client-go/rest" +) + +type AppmeshV1alpha1Interface interface { + RESTClient() rest.Interface + MeshesGetter + VirtualNodesGetter + VirtualServicesGetter +} + +// AppmeshV1alpha1Client is used to interact with features provided by the appmesh.k8s.aws group. +type AppmeshV1alpha1Client struct { + restClient rest.Interface +} + +func (c *AppmeshV1alpha1Client) Meshes(namespace string) MeshInterface { + return newMeshes(c, namespace) +} + +func (c *AppmeshV1alpha1Client) VirtualNodes(namespace string) VirtualNodeInterface { + return newVirtualNodes(c, namespace) +} + +func (c *AppmeshV1alpha1Client) VirtualServices(namespace string) VirtualServiceInterface { + return newVirtualServices(c, namespace) +} + +// NewForConfig creates a new AppmeshV1alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*AppmeshV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &AppmeshV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new AppmeshV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *AppmeshV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new AppmeshV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *AppmeshV1alpha1Client { + return &AppmeshV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} + + 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 *AppmeshV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/doc.go new file mode 100644 index 00000000..20b3d7fd --- /dev/null +++ b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/doc.go new file mode 100644 index 00000000..7a3b19cb --- /dev/null +++ b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_appmesh_client.go b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_appmesh_client.go new file mode 100644 index 00000000..05a3b931 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_appmesh_client.go @@ -0,0 +1,48 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/typed/appmesh/v1alpha1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeAppmeshV1alpha1 struct { + *testing.Fake +} + +func (c *FakeAppmeshV1alpha1) Meshes(namespace string) v1alpha1.MeshInterface { + return &FakeMeshes{c, namespace} +} + +func (c *FakeAppmeshV1alpha1) VirtualNodes(namespace string) v1alpha1.VirtualNodeInterface { + return &FakeVirtualNodes{c, namespace} +} + +func (c *FakeAppmeshV1alpha1) VirtualServices(namespace string) v1alpha1.VirtualServiceInterface { + return &FakeVirtualServices{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeAppmeshV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_mesh.go b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_mesh.go new file mode 100644 index 00000000..759c4cd2 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_mesh.go @@ -0,0 +1,140 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" + 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" +) + +// FakeMeshes implements MeshInterface +type FakeMeshes struct { + Fake *FakeAppmeshV1alpha1 + ns string +} + +var meshesResource = schema.GroupVersionResource{Group: "appmesh.k8s.aws", Version: "v1alpha1", Resource: "meshes"} + +var meshesKind = schema.GroupVersionKind{Group: "appmesh.k8s.aws", Version: "v1alpha1", Kind: "Mesh"} + +// Get takes name of the mesh, and returns the corresponding mesh object, and an error if there is any. +func (c *FakeMeshes) Get(name string, options v1.GetOptions) (result *v1alpha1.Mesh, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(meshesResource, c.ns, name), &v1alpha1.Mesh{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Mesh), err +} + +// List takes label and field selectors, and returns the list of Meshes that match those selectors. +func (c *FakeMeshes) List(opts v1.ListOptions) (result *v1alpha1.MeshList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(meshesResource, meshesKind, c.ns, opts), &v1alpha1.MeshList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.MeshList{ListMeta: obj.(*v1alpha1.MeshList).ListMeta} + for _, item := range obj.(*v1alpha1.MeshList).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 meshes. +func (c *FakeMeshes) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(meshesResource, c.ns, opts)) + +} + +// Create takes the representation of a mesh and creates it. Returns the server's representation of the mesh, and an error, if there is any. +func (c *FakeMeshes) Create(mesh *v1alpha1.Mesh) (result *v1alpha1.Mesh, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(meshesResource, c.ns, mesh), &v1alpha1.Mesh{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Mesh), err +} + +// Update takes the representation of a mesh and updates it. Returns the server's representation of the mesh, and an error, if there is any. +func (c *FakeMeshes) Update(mesh *v1alpha1.Mesh) (result *v1alpha1.Mesh, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(meshesResource, c.ns, mesh), &v1alpha1.Mesh{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Mesh), 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 *FakeMeshes) UpdateStatus(mesh *v1alpha1.Mesh) (*v1alpha1.Mesh, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(meshesResource, "status", c.ns, mesh), &v1alpha1.Mesh{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Mesh), err +} + +// Delete takes name of the mesh and deletes it. Returns an error if one occurs. +func (c *FakeMeshes) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(meshesResource, c.ns, name), &v1alpha1.Mesh{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeMeshes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(meshesResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.MeshList{}) + return err +} + +// Patch applies the patch and returns the patched mesh. +func (c *FakeMeshes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Mesh, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(meshesResource, c.ns, name, data, subresources...), &v1alpha1.Mesh{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.Mesh), err +} diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_virtualnode.go b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_virtualnode.go new file mode 100644 index 00000000..30df5125 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_virtualnode.go @@ -0,0 +1,140 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" + 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" +) + +// FakeVirtualNodes implements VirtualNodeInterface +type FakeVirtualNodes struct { + Fake *FakeAppmeshV1alpha1 + ns string +} + +var virtualnodesResource = schema.GroupVersionResource{Group: "appmesh.k8s.aws", Version: "v1alpha1", Resource: "virtualnodes"} + +var virtualnodesKind = schema.GroupVersionKind{Group: "appmesh.k8s.aws", Version: "v1alpha1", Kind: "VirtualNode"} + +// Get takes name of the virtualNode, and returns the corresponding virtualNode object, and an error if there is any. +func (c *FakeVirtualNodes) Get(name string, options v1.GetOptions) (result *v1alpha1.VirtualNode, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(virtualnodesResource, c.ns, name), &v1alpha1.VirtualNode{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.VirtualNode), err +} + +// List takes label and field selectors, and returns the list of VirtualNodes that match those selectors. +func (c *FakeVirtualNodes) List(opts v1.ListOptions) (result *v1alpha1.VirtualNodeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(virtualnodesResource, virtualnodesKind, c.ns, opts), &v1alpha1.VirtualNodeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.VirtualNodeList{ListMeta: obj.(*v1alpha1.VirtualNodeList).ListMeta} + for _, item := range obj.(*v1alpha1.VirtualNodeList).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 virtualNodes. +func (c *FakeVirtualNodes) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(virtualnodesResource, c.ns, opts)) + +} + +// Create takes the representation of a virtualNode and creates it. Returns the server's representation of the virtualNode, and an error, if there is any. +func (c *FakeVirtualNodes) Create(virtualNode *v1alpha1.VirtualNode) (result *v1alpha1.VirtualNode, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(virtualnodesResource, c.ns, virtualNode), &v1alpha1.VirtualNode{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.VirtualNode), err +} + +// Update takes the representation of a virtualNode and updates it. Returns the server's representation of the virtualNode, and an error, if there is any. +func (c *FakeVirtualNodes) Update(virtualNode *v1alpha1.VirtualNode) (result *v1alpha1.VirtualNode, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(virtualnodesResource, c.ns, virtualNode), &v1alpha1.VirtualNode{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.VirtualNode), 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 *FakeVirtualNodes) UpdateStatus(virtualNode *v1alpha1.VirtualNode) (*v1alpha1.VirtualNode, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(virtualnodesResource, "status", c.ns, virtualNode), &v1alpha1.VirtualNode{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.VirtualNode), err +} + +// Delete takes name of the virtualNode and deletes it. Returns an error if one occurs. +func (c *FakeVirtualNodes) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(virtualnodesResource, c.ns, name), &v1alpha1.VirtualNode{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVirtualNodes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(virtualnodesResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.VirtualNodeList{}) + return err +} + +// Patch applies the patch and returns the patched virtualNode. +func (c *FakeVirtualNodes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VirtualNode, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualnodesResource, c.ns, name, data, subresources...), &v1alpha1.VirtualNode{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.VirtualNode), err +} diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_virtualservice.go b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_virtualservice.go new file mode 100644 index 00000000..91377fad --- /dev/null +++ b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_virtualservice.go @@ -0,0 +1,140 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" + 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" +) + +// FakeVirtualServices implements VirtualServiceInterface +type FakeVirtualServices struct { + Fake *FakeAppmeshV1alpha1 + ns string +} + +var virtualservicesResource = schema.GroupVersionResource{Group: "appmesh.k8s.aws", Version: "v1alpha1", Resource: "virtualservices"} + +var virtualservicesKind = schema.GroupVersionKind{Group: "appmesh.k8s.aws", Version: "v1alpha1", Kind: "VirtualService"} + +// Get takes name of the virtualService, and returns the corresponding virtualService object, and an error if there is any. +func (c *FakeVirtualServices) Get(name string, options v1.GetOptions) (result *v1alpha1.VirtualService, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(virtualservicesResource, c.ns, name), &v1alpha1.VirtualService{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.VirtualService), err +} + +// List takes label and field selectors, and returns the list of VirtualServices that match those selectors. +func (c *FakeVirtualServices) List(opts v1.ListOptions) (result *v1alpha1.VirtualServiceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(virtualservicesResource, virtualservicesKind, c.ns, opts), &v1alpha1.VirtualServiceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.VirtualServiceList{ListMeta: obj.(*v1alpha1.VirtualServiceList).ListMeta} + for _, item := range obj.(*v1alpha1.VirtualServiceList).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 virtualServices. +func (c *FakeVirtualServices) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(virtualservicesResource, c.ns, opts)) + +} + +// Create takes the representation of a virtualService and creates it. Returns the server's representation of the virtualService, and an error, if there is any. +func (c *FakeVirtualServices) Create(virtualService *v1alpha1.VirtualService) (result *v1alpha1.VirtualService, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(virtualservicesResource, c.ns, virtualService), &v1alpha1.VirtualService{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.VirtualService), err +} + +// Update takes the representation of a virtualService and updates it. Returns the server's representation of the virtualService, and an error, if there is any. +func (c *FakeVirtualServices) Update(virtualService *v1alpha1.VirtualService) (result *v1alpha1.VirtualService, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(virtualservicesResource, c.ns, virtualService), &v1alpha1.VirtualService{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.VirtualService), 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 *FakeVirtualServices) UpdateStatus(virtualService *v1alpha1.VirtualService) (*v1alpha1.VirtualService, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(virtualservicesResource, "status", c.ns, virtualService), &v1alpha1.VirtualService{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.VirtualService), err +} + +// Delete takes name of the virtualService and deletes it. Returns an error if one occurs. +func (c *FakeVirtualServices) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(virtualservicesResource, c.ns, name), &v1alpha1.VirtualService{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVirtualServices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(virtualservicesResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.VirtualServiceList{}) + return err +} + +// Patch applies the patch and returns the patched virtualService. +func (c *FakeVirtualServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VirtualService, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualservicesResource, c.ns, name, data, subresources...), &v1alpha1.VirtualService{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.VirtualService), err +} diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/generated_expansion.go new file mode 100644 index 00000000..8b4bb09c --- /dev/null +++ b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/generated_expansion.go @@ -0,0 +1,25 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type MeshExpansion interface{} + +type VirtualNodeExpansion interface{} + +type VirtualServiceExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/mesh.go b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/mesh.go new file mode 100644 index 00000000..92ffc45d --- /dev/null +++ b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/mesh.go @@ -0,0 +1,174 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" + scheme "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// MeshesGetter has a method to return a MeshInterface. +// A group's client should implement this interface. +type MeshesGetter interface { + Meshes(namespace string) MeshInterface +} + +// MeshInterface has methods to work with Mesh resources. +type MeshInterface interface { + Create(*v1alpha1.Mesh) (*v1alpha1.Mesh, error) + Update(*v1alpha1.Mesh) (*v1alpha1.Mesh, error) + UpdateStatus(*v1alpha1.Mesh) (*v1alpha1.Mesh, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.Mesh, error) + List(opts v1.ListOptions) (*v1alpha1.MeshList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Mesh, err error) + MeshExpansion +} + +// meshes implements MeshInterface +type meshes struct { + client rest.Interface + ns string +} + +// newMeshes returns a Meshes +func newMeshes(c *AppmeshV1alpha1Client, namespace string) *meshes { + return &meshes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the mesh, and returns the corresponding mesh object, and an error if there is any. +func (c *meshes) Get(name string, options v1.GetOptions) (result *v1alpha1.Mesh, err error) { + result = &v1alpha1.Mesh{} + err = c.client.Get(). + Namespace(c.ns). + Resource("meshes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Meshes that match those selectors. +func (c *meshes) List(opts v1.ListOptions) (result *v1alpha1.MeshList, err error) { + result = &v1alpha1.MeshList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("meshes"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested meshes. +func (c *meshes) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("meshes"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a mesh and creates it. Returns the server's representation of the mesh, and an error, if there is any. +func (c *meshes) Create(mesh *v1alpha1.Mesh) (result *v1alpha1.Mesh, err error) { + result = &v1alpha1.Mesh{} + err = c.client.Post(). + Namespace(c.ns). + Resource("meshes"). + Body(mesh). + Do(). + Into(result) + return +} + +// Update takes the representation of a mesh and updates it. Returns the server's representation of the mesh, and an error, if there is any. +func (c *meshes) Update(mesh *v1alpha1.Mesh) (result *v1alpha1.Mesh, err error) { + result = &v1alpha1.Mesh{} + err = c.client.Put(). + Namespace(c.ns). + Resource("meshes"). + Name(mesh.Name). + Body(mesh). + Do(). + 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 *meshes) UpdateStatus(mesh *v1alpha1.Mesh) (result *v1alpha1.Mesh, err error) { + result = &v1alpha1.Mesh{} + err = c.client.Put(). + Namespace(c.ns). + Resource("meshes"). + Name(mesh.Name). + SubResource("status"). + Body(mesh). + Do(). + Into(result) + return +} + +// Delete takes name of the mesh and deletes it. Returns an error if one occurs. +func (c *meshes) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("meshes"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *meshes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("meshes"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched mesh. +func (c *meshes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Mesh, err error) { + result = &v1alpha1.Mesh{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("meshes"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/virtualnode.go b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/virtualnode.go new file mode 100644 index 00000000..b202ee4a --- /dev/null +++ b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/virtualnode.go @@ -0,0 +1,174 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" + scheme "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// VirtualNodesGetter has a method to return a VirtualNodeInterface. +// A group's client should implement this interface. +type VirtualNodesGetter interface { + VirtualNodes(namespace string) VirtualNodeInterface +} + +// VirtualNodeInterface has methods to work with VirtualNode resources. +type VirtualNodeInterface interface { + Create(*v1alpha1.VirtualNode) (*v1alpha1.VirtualNode, error) + Update(*v1alpha1.VirtualNode) (*v1alpha1.VirtualNode, error) + UpdateStatus(*v1alpha1.VirtualNode) (*v1alpha1.VirtualNode, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.VirtualNode, error) + List(opts v1.ListOptions) (*v1alpha1.VirtualNodeList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VirtualNode, err error) + VirtualNodeExpansion +} + +// virtualNodes implements VirtualNodeInterface +type virtualNodes struct { + client rest.Interface + ns string +} + +// newVirtualNodes returns a VirtualNodes +func newVirtualNodes(c *AppmeshV1alpha1Client, namespace string) *virtualNodes { + return &virtualNodes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the virtualNode, and returns the corresponding virtualNode object, and an error if there is any. +func (c *virtualNodes) Get(name string, options v1.GetOptions) (result *v1alpha1.VirtualNode, err error) { + result = &v1alpha1.VirtualNode{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualnodes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VirtualNodes that match those selectors. +func (c *virtualNodes) List(opts v1.ListOptions) (result *v1alpha1.VirtualNodeList, err error) { + result = &v1alpha1.VirtualNodeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualnodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested virtualNodes. +func (c *virtualNodes) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("virtualnodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a virtualNode and creates it. Returns the server's representation of the virtualNode, and an error, if there is any. +func (c *virtualNodes) Create(virtualNode *v1alpha1.VirtualNode) (result *v1alpha1.VirtualNode, err error) { + result = &v1alpha1.VirtualNode{} + err = c.client.Post(). + Namespace(c.ns). + Resource("virtualnodes"). + Body(virtualNode). + Do(). + Into(result) + return +} + +// Update takes the representation of a virtualNode and updates it. Returns the server's representation of the virtualNode, and an error, if there is any. +func (c *virtualNodes) Update(virtualNode *v1alpha1.VirtualNode) (result *v1alpha1.VirtualNode, err error) { + result = &v1alpha1.VirtualNode{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualnodes"). + Name(virtualNode.Name). + Body(virtualNode). + Do(). + 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 *virtualNodes) UpdateStatus(virtualNode *v1alpha1.VirtualNode) (result *v1alpha1.VirtualNode, err error) { + result = &v1alpha1.VirtualNode{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualnodes"). + Name(virtualNode.Name). + SubResource("status"). + Body(virtualNode). + Do(). + Into(result) + return +} + +// Delete takes name of the virtualNode and deletes it. Returns an error if one occurs. +func (c *virtualNodes) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualnodes"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *virtualNodes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualnodes"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched virtualNode. +func (c *virtualNodes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VirtualNode, err error) { + result = &v1alpha1.VirtualNode{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("virtualnodes"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/virtualservice.go b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/virtualservice.go new file mode 100644 index 00000000..5579798b --- /dev/null +++ b/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/virtualservice.go @@ -0,0 +1,174 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" + scheme "github.com/stefanprodan/flagger/pkg/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// VirtualServicesGetter has a method to return a VirtualServiceInterface. +// A group's client should implement this interface. +type VirtualServicesGetter interface { + VirtualServices(namespace string) VirtualServiceInterface +} + +// VirtualServiceInterface has methods to work with VirtualService resources. +type VirtualServiceInterface interface { + Create(*v1alpha1.VirtualService) (*v1alpha1.VirtualService, error) + Update(*v1alpha1.VirtualService) (*v1alpha1.VirtualService, error) + UpdateStatus(*v1alpha1.VirtualService) (*v1alpha1.VirtualService, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.VirtualService, error) + List(opts v1.ListOptions) (*v1alpha1.VirtualServiceList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VirtualService, err error) + VirtualServiceExpansion +} + +// virtualServices implements VirtualServiceInterface +type virtualServices struct { + client rest.Interface + ns string +} + +// newVirtualServices returns a VirtualServices +func newVirtualServices(c *AppmeshV1alpha1Client, namespace string) *virtualServices { + return &virtualServices{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the virtualService, and returns the corresponding virtualService object, and an error if there is any. +func (c *virtualServices) Get(name string, options v1.GetOptions) (result *v1alpha1.VirtualService, err error) { + result = &v1alpha1.VirtualService{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualservices"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VirtualServices that match those selectors. +func (c *virtualServices) List(opts v1.ListOptions) (result *v1alpha1.VirtualServiceList, err error) { + result = &v1alpha1.VirtualServiceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested virtualServices. +func (c *virtualServices) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("virtualservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a virtualService and creates it. Returns the server's representation of the virtualService, and an error, if there is any. +func (c *virtualServices) Create(virtualService *v1alpha1.VirtualService) (result *v1alpha1.VirtualService, err error) { + result = &v1alpha1.VirtualService{} + err = c.client.Post(). + Namespace(c.ns). + Resource("virtualservices"). + Body(virtualService). + Do(). + Into(result) + return +} + +// Update takes the representation of a virtualService and updates it. Returns the server's representation of the virtualService, and an error, if there is any. +func (c *virtualServices) Update(virtualService *v1alpha1.VirtualService) (result *v1alpha1.VirtualService, err error) { + result = &v1alpha1.VirtualService{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualservices"). + Name(virtualService.Name). + Body(virtualService). + Do(). + 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 *virtualServices) UpdateStatus(virtualService *v1alpha1.VirtualService) (result *v1alpha1.VirtualService, err error) { + result = &v1alpha1.VirtualService{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualservices"). + Name(virtualService.Name). + SubResource("status"). + Body(virtualService). + Do(). + Into(result) + return +} + +// Delete takes name of the virtualService and deletes it. Returns an error if one occurs. +func (c *virtualServices) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualservices"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *virtualServices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualservices"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched virtualService. +func (c *virtualServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VirtualService, err error) { + result = &v1alpha1.VirtualService{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("virtualservices"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/informers/externalversions/appmesh/interface.go b/pkg/client/informers/externalversions/appmesh/interface.go new file mode 100644 index 00000000..e08388fc --- /dev/null +++ b/pkg/client/informers/externalversions/appmesh/interface.go @@ -0,0 +1,46 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package appmesh + +import ( + v1alpha1 "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/appmesh/v1alpha1" + internalinterfaces "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.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} +} + +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/pkg/client/informers/externalversions/appmesh/v1alpha1/interface.go b/pkg/client/informers/externalversions/appmesh/v1alpha1/interface.go new file mode 100644 index 00000000..8037907f --- /dev/null +++ b/pkg/client/informers/externalversions/appmesh/v1alpha1/interface.go @@ -0,0 +1,59 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + internalinterfaces "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // Meshes returns a MeshInformer. + Meshes() MeshInformer + // VirtualNodes returns a VirtualNodeInformer. + VirtualNodes() VirtualNodeInformer + // VirtualServices returns a VirtualServiceInformer. + VirtualServices() VirtualServiceInformer +} + +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} +} + +// Meshes returns a MeshInformer. +func (v *version) Meshes() MeshInformer { + return &meshInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// VirtualNodes returns a VirtualNodeInformer. +func (v *version) VirtualNodes() VirtualNodeInformer { + return &virtualNodeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// VirtualServices returns a VirtualServiceInformer. +func (v *version) VirtualServices() VirtualServiceInformer { + return &virtualServiceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/client/informers/externalversions/appmesh/v1alpha1/mesh.go b/pkg/client/informers/externalversions/appmesh/v1alpha1/mesh.go new file mode 100644 index 00000000..a66fb56b --- /dev/null +++ b/pkg/client/informers/externalversions/appmesh/v1alpha1/mesh.go @@ -0,0 +1,89 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + time "time" + + appmeshv1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" + versioned "github.com/stefanprodan/flagger/pkg/client/clientset/versioned" + internalinterfaces "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/stefanprodan/flagger/pkg/client/listers/appmesh/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// MeshInformer provides access to a shared informer and lister for +// Meshes. +type MeshInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.MeshLister +} + +type meshInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewMeshInformer constructs a new informer for Mesh 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 NewMeshInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMeshInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredMeshInformer constructs a new informer for Mesh 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 NewFilteredMeshInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppmeshV1alpha1().Meshes(namespace).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppmeshV1alpha1().Meshes(namespace).Watch(options) + }, + }, + &appmeshv1alpha1.Mesh{}, + resyncPeriod, + indexers, + ) +} + +func (f *meshInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMeshInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *meshInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&appmeshv1alpha1.Mesh{}, f.defaultInformer) +} + +func (f *meshInformer) Lister() v1alpha1.MeshLister { + return v1alpha1.NewMeshLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/informers/externalversions/appmesh/v1alpha1/virtualnode.go b/pkg/client/informers/externalversions/appmesh/v1alpha1/virtualnode.go new file mode 100644 index 00000000..18015740 --- /dev/null +++ b/pkg/client/informers/externalversions/appmesh/v1alpha1/virtualnode.go @@ -0,0 +1,89 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + time "time" + + appmeshv1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" + versioned "github.com/stefanprodan/flagger/pkg/client/clientset/versioned" + internalinterfaces "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/stefanprodan/flagger/pkg/client/listers/appmesh/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// VirtualNodeInformer provides access to a shared informer and lister for +// VirtualNodes. +type VirtualNodeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.VirtualNodeLister +} + +type virtualNodeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewVirtualNodeInformer constructs a new informer for VirtualNode 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 NewVirtualNodeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredVirtualNodeInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredVirtualNodeInformer constructs a new informer for VirtualNode 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 NewFilteredVirtualNodeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppmeshV1alpha1().VirtualNodes(namespace).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppmeshV1alpha1().VirtualNodes(namespace).Watch(options) + }, + }, + &appmeshv1alpha1.VirtualNode{}, + resyncPeriod, + indexers, + ) +} + +func (f *virtualNodeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredVirtualNodeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *virtualNodeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&appmeshv1alpha1.VirtualNode{}, f.defaultInformer) +} + +func (f *virtualNodeInformer) Lister() v1alpha1.VirtualNodeLister { + return v1alpha1.NewVirtualNodeLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/informers/externalversions/appmesh/v1alpha1/virtualservice.go b/pkg/client/informers/externalversions/appmesh/v1alpha1/virtualservice.go new file mode 100644 index 00000000..9f0e3470 --- /dev/null +++ b/pkg/client/informers/externalversions/appmesh/v1alpha1/virtualservice.go @@ -0,0 +1,89 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + time "time" + + appmeshv1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" + versioned "github.com/stefanprodan/flagger/pkg/client/clientset/versioned" + internalinterfaces "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/stefanprodan/flagger/pkg/client/listers/appmesh/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// VirtualServiceInformer provides access to a shared informer and lister for +// VirtualServices. +type VirtualServiceInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.VirtualServiceLister +} + +type virtualServiceInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewVirtualServiceInformer constructs a new informer for VirtualService 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 NewVirtualServiceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredVirtualServiceInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredVirtualServiceInformer constructs a new informer for VirtualService 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 NewFilteredVirtualServiceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppmeshV1alpha1().VirtualServices(namespace).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AppmeshV1alpha1().VirtualServices(namespace).Watch(options) + }, + }, + &appmeshv1alpha1.VirtualService{}, + resyncPeriod, + indexers, + ) +} + +func (f *virtualServiceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredVirtualServiceInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *virtualServiceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&appmeshv1alpha1.VirtualService{}, f.defaultInformer) +} + +func (f *virtualServiceInformer) Lister() v1alpha1.VirtualServiceLister { + return v1alpha1.NewVirtualServiceLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 673d8ef4..b1efe190 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -24,6 +24,7 @@ import ( time "time" versioned "github.com/stefanprodan/flagger/pkg/client/clientset/versioned" + appmesh "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/appmesh" flagger "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/flagger" internalinterfaces "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/internalinterfaces" istio "github.com/stefanprodan/flagger/pkg/client/informers/externalversions/istio" @@ -173,10 +174,15 @@ type SharedInformerFactory interface { ForResource(resource schema.GroupVersionResource) (GenericInformer, error) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + Appmesh() appmesh.Interface Flagger() flagger.Interface Networking() istio.Interface } +func (f *sharedInformerFactory) Appmesh() appmesh.Interface { + return appmesh.New(f, f.namespace, f.tweakListOptions) +} + func (f *sharedInformerFactory) Flagger() flagger.Interface { return flagger.New(f, f.namespace, f.tweakListOptions) } diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 4527a9ba..e0c04562 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -21,6 +21,7 @@ package externalversions import ( "fmt" + v1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" v1alpha3 "github.com/stefanprodan/flagger/pkg/apis/flagger/v1alpha3" istiov1alpha3 "github.com/stefanprodan/flagger/pkg/apis/istio/v1alpha3" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -53,7 +54,15 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=flagger.app, Version=v1alpha3 + // Group=appmesh.k8s.aws, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithResource("meshes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Appmesh().V1alpha1().Meshes().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("virtualnodes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Appmesh().V1alpha1().VirtualNodes().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("virtualservices"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Appmesh().V1alpha1().VirtualServices().Informer()}, nil + + // Group=flagger.app, Version=v1alpha3 case v1alpha3.SchemeGroupVersion.WithResource("canaries"): return &genericInformer{resource: resource.GroupResource(), informer: f.Flagger().V1alpha3().Canaries().Informer()}, nil diff --git a/pkg/client/listers/appmesh/v1alpha1/expansion_generated.go b/pkg/client/listers/appmesh/v1alpha1/expansion_generated.go new file mode 100644 index 00000000..2c7aa859 --- /dev/null +++ b/pkg/client/listers/appmesh/v1alpha1/expansion_generated.go @@ -0,0 +1,43 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +// MeshListerExpansion allows custom methods to be added to +// MeshLister. +type MeshListerExpansion interface{} + +// MeshNamespaceListerExpansion allows custom methods to be added to +// MeshNamespaceLister. +type MeshNamespaceListerExpansion interface{} + +// VirtualNodeListerExpansion allows custom methods to be added to +// VirtualNodeLister. +type VirtualNodeListerExpansion interface{} + +// VirtualNodeNamespaceListerExpansion allows custom methods to be added to +// VirtualNodeNamespaceLister. +type VirtualNodeNamespaceListerExpansion interface{} + +// VirtualServiceListerExpansion allows custom methods to be added to +// VirtualServiceLister. +type VirtualServiceListerExpansion interface{} + +// VirtualServiceNamespaceListerExpansion allows custom methods to be added to +// VirtualServiceNamespaceLister. +type VirtualServiceNamespaceListerExpansion interface{} diff --git a/pkg/client/listers/appmesh/v1alpha1/mesh.go b/pkg/client/listers/appmesh/v1alpha1/mesh.go new file mode 100644 index 00000000..7e40928e --- /dev/null +++ b/pkg/client/listers/appmesh/v1alpha1/mesh.go @@ -0,0 +1,94 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// MeshLister helps list Meshes. +type MeshLister interface { + // List lists all Meshes in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.Mesh, err error) + // Meshes returns an object that can list and get Meshes. + Meshes(namespace string) MeshNamespaceLister + MeshListerExpansion +} + +// meshLister implements the MeshLister interface. +type meshLister struct { + indexer cache.Indexer +} + +// NewMeshLister returns a new MeshLister. +func NewMeshLister(indexer cache.Indexer) MeshLister { + return &meshLister{indexer: indexer} +} + +// List lists all Meshes in the indexer. +func (s *meshLister) List(selector labels.Selector) (ret []*v1alpha1.Mesh, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.Mesh)) + }) + return ret, err +} + +// Meshes returns an object that can list and get Meshes. +func (s *meshLister) Meshes(namespace string) MeshNamespaceLister { + return meshNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// MeshNamespaceLister helps list and get Meshes. +type MeshNamespaceLister interface { + // List lists all Meshes in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.Mesh, err error) + // Get retrieves the Mesh from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.Mesh, error) + MeshNamespaceListerExpansion +} + +// meshNamespaceLister implements the MeshNamespaceLister +// interface. +type meshNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Meshes in the indexer for a given namespace. +func (s meshNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Mesh, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.Mesh)) + }) + return ret, err +} + +// Get retrieves the Mesh from the indexer for a given namespace and name. +func (s meshNamespaceLister) Get(name string) (*v1alpha1.Mesh, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("mesh"), name) + } + return obj.(*v1alpha1.Mesh), nil +} diff --git a/pkg/client/listers/appmesh/v1alpha1/virtualnode.go b/pkg/client/listers/appmesh/v1alpha1/virtualnode.go new file mode 100644 index 00000000..79a7946e --- /dev/null +++ b/pkg/client/listers/appmesh/v1alpha1/virtualnode.go @@ -0,0 +1,94 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// VirtualNodeLister helps list VirtualNodes. +type VirtualNodeLister interface { + // List lists all VirtualNodes in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.VirtualNode, err error) + // VirtualNodes returns an object that can list and get VirtualNodes. + VirtualNodes(namespace string) VirtualNodeNamespaceLister + VirtualNodeListerExpansion +} + +// virtualNodeLister implements the VirtualNodeLister interface. +type virtualNodeLister struct { + indexer cache.Indexer +} + +// NewVirtualNodeLister returns a new VirtualNodeLister. +func NewVirtualNodeLister(indexer cache.Indexer) VirtualNodeLister { + return &virtualNodeLister{indexer: indexer} +} + +// List lists all VirtualNodes in the indexer. +func (s *virtualNodeLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualNode, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.VirtualNode)) + }) + return ret, err +} + +// VirtualNodes returns an object that can list and get VirtualNodes. +func (s *virtualNodeLister) VirtualNodes(namespace string) VirtualNodeNamespaceLister { + return virtualNodeNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// VirtualNodeNamespaceLister helps list and get VirtualNodes. +type VirtualNodeNamespaceLister interface { + // List lists all VirtualNodes in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.VirtualNode, err error) + // Get retrieves the VirtualNode from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.VirtualNode, error) + VirtualNodeNamespaceListerExpansion +} + +// virtualNodeNamespaceLister implements the VirtualNodeNamespaceLister +// interface. +type virtualNodeNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all VirtualNodes in the indexer for a given namespace. +func (s virtualNodeNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualNode, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.VirtualNode)) + }) + return ret, err +} + +// Get retrieves the VirtualNode from the indexer for a given namespace and name. +func (s virtualNodeNamespaceLister) Get(name string) (*v1alpha1.VirtualNode, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("virtualnode"), name) + } + return obj.(*v1alpha1.VirtualNode), nil +} diff --git a/pkg/client/listers/appmesh/v1alpha1/virtualservice.go b/pkg/client/listers/appmesh/v1alpha1/virtualservice.go new file mode 100644 index 00000000..5679d07b --- /dev/null +++ b/pkg/client/listers/appmesh/v1alpha1/virtualservice.go @@ -0,0 +1,94 @@ +/* +Copyright The Flagger Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/stefanprodan/flagger/pkg/apis/appmesh/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// VirtualServiceLister helps list VirtualServices. +type VirtualServiceLister interface { + // List lists all VirtualServices in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.VirtualService, err error) + // VirtualServices returns an object that can list and get VirtualServices. + VirtualServices(namespace string) VirtualServiceNamespaceLister + VirtualServiceListerExpansion +} + +// virtualServiceLister implements the VirtualServiceLister interface. +type virtualServiceLister struct { + indexer cache.Indexer +} + +// NewVirtualServiceLister returns a new VirtualServiceLister. +func NewVirtualServiceLister(indexer cache.Indexer) VirtualServiceLister { + return &virtualServiceLister{indexer: indexer} +} + +// List lists all VirtualServices in the indexer. +func (s *virtualServiceLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualService, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.VirtualService)) + }) + return ret, err +} + +// VirtualServices returns an object that can list and get VirtualServices. +func (s *virtualServiceLister) VirtualServices(namespace string) VirtualServiceNamespaceLister { + return virtualServiceNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// VirtualServiceNamespaceLister helps list and get VirtualServices. +type VirtualServiceNamespaceLister interface { + // List lists all VirtualServices in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.VirtualService, err error) + // Get retrieves the VirtualService from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.VirtualService, error) + VirtualServiceNamespaceListerExpansion +} + +// virtualServiceNamespaceLister implements the VirtualServiceNamespaceLister +// interface. +type virtualServiceNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all VirtualServices in the indexer for a given namespace. +func (s virtualServiceNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualService, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.VirtualService)) + }) + return ret, err +} + +// Get retrieves the VirtualService from the indexer for a given namespace and name. +func (s virtualServiceNamespaceLister) Get(name string) (*v1alpha1.VirtualService, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("virtualservice"), name) + } + return obj.(*v1alpha1.VirtualService), nil +}