diff --git a/artifacts/appmesh/canary.yaml b/artifacts/appmesh/canary.yaml index d2b00e03a..b89dc9037 100644 --- a/artifacts/appmesh/canary.yaml +++ b/artifacts/appmesh/canary.yaml @@ -21,7 +21,7 @@ spec: # container port port: 9898 # App Mesh reference - meshName: global.appmesh-system + meshName: global # define the canary analysis timing and KPIs canaryAnalysis: # schedule interval (default 60s) diff --git a/artifacts/appmesh/ingress.yaml b/artifacts/appmesh/ingress.yaml index cf5bc694f..188717d2b 100644 --- a/artifacts/appmesh/ingress.yaml +++ b/artifacts/appmesh/ingress.yaml @@ -158,13 +158,13 @@ spec: targetPort: 443 type: LoadBalancer --- -apiVersion: appmesh.k8s.aws/v1alpha1 +apiVersion: appmesh.k8s.aws/v1beta1 kind: VirtualNode metadata: name: ingress namespace: test spec: - meshName: global.appmesh-system + meshName: global listeners: - portMapping: port: 80 diff --git a/charts/grafana/dashboards/appmesh.json b/charts/grafana/dashboards/appmesh.json index c66a22177..1544ee5bc 100644 --- a/charts/grafana/dashboards/appmesh.json +++ b/charts/grafana/dashboards/appmesh.json @@ -179,7 +179,7 @@ "tableColumn": "", "targets": [ { - "expr": "sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$primary\",response_code!~\"5.*\"}[30s])) / sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$primary\"}[30s]))", + "expr": "sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$primary\",envoy_response_code!~\"5.*\"}[30s])) / sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$primary\"}[30s]))", "format": "time_series", "intervalFactor": 1, "legendFormat": "", @@ -345,7 +345,7 @@ "tableColumn": "", "targets": [ { - "expr": "sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$canary\",response_code!~\"5.*\"}[30s])) / sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$canary\"}[30s]))", + "expr": "sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$canary\",envoy_response_code!~\"5.*\"}[30s])) / sum(irate(envoy_cluster_upstream_rq{kubernetes_namespace=~\"$namespace\",app=~\"$canary\"}[30s]))", "format": "time_series", "intervalFactor": 1, "legendFormat": "", diff --git a/charts/grafana/templates/NOTES.txt b/charts/grafana/templates/NOTES.txt index dd7aa861b..f3f868aa3 100644 --- a/charts/grafana/templates/NOTES.txt +++ b/charts/grafana/templates/NOTES.txt @@ -1,3 +1,7 @@ -1. Get the application URL with: +1. Run the port forward command: kubectl -n {{ .Release.Namespace }} port-forward svc/{{ .Release.Name }} 3000:80 + +2. Navigate to: + +http://localhost:3000 \ No newline at end of file diff --git a/charts/loadtester/templates/virtual-node.yaml b/charts/loadtester/templates/virtual-node.yaml index 2853de717..d6520ba17 100644 --- a/charts/loadtester/templates/virtual-node.yaml +++ b/charts/loadtester/templates/virtual-node.yaml @@ -1,5 +1,5 @@ {{- if .Values.meshName }} -apiVersion: appmesh.k8s.aws/v1alpha1 +apiVersion: appmesh.k8s.aws/v1beta1 kind: VirtualNode metadata: name: {{ include "loadtester.fullname" . }} diff --git a/docs/gitbook/install/flagger-install-on-eks-appmesh.md b/docs/gitbook/install/flagger-install-on-eks-appmesh.md index 6b046289c..79da4438f 100644 --- a/docs/gitbook/install/flagger-install-on-eks-appmesh.md +++ b/docs/gitbook/install/flagger-install-on-eks-appmesh.md @@ -104,20 +104,20 @@ Run the App Mesh installer: curl -fsSL https://git.io/get-app-mesh-eks.sh | bash - ``` -The installer will do the following: +The installer does the following: * creates the `appmesh-system` namespace -* generates a certificate with openssl signed by Kubernetes CA +* generates a certificate signed by Kubernetes CA * registers the App Mesh mutating webhook -* deploys the App Mesh webhook +* deploys the App Mesh webhook in `appmesh-system` namespace * deploys the App Mesh CRDs -* deploys the App Mesh controller -* creates a mesh called `global` in the `appmesh-system` namespace +* deploys the App Mesh controller `appmesh-system` namespace +* creates a mesh called `global` Verify that the global mesh is active: ```bash -kubectl -n appmesh-system describe mesh +kubectl describe mesh Status: Mesh Condition: diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index fbcd10f9b..4cdcbb363 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -23,5 +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/weaveworks/flagger/pkg/client github.com/weaveworks/flagger/pkg/apis \ - "appmesh:v1alpha1 istio:v1alpha3 flagger:v1alpha3" \ + "appmesh:v1beta1 istio:v1alpha3 flagger:v1alpha3" \ --go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt diff --git a/pkg/apis/appmesh/v1alpha1/doc.go b/pkg/apis/appmesh/v1alpha1/doc.go deleted file mode 100644 index 40089cb92..000000000 --- a/pkg/apis/appmesh/v1alpha1/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// +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/v1beta1/doc.go b/pkg/apis/appmesh/v1beta1/doc.go new file mode 100644 index 000000000..d0c252238 --- /dev/null +++ b/pkg/apis/appmesh/v1beta1/doc.go @@ -0,0 +1,5 @@ +// +k8s:deepcopy-gen=package + +// Package v1beta1 is the v1beta1 version of the API. +// +groupName=appmesh.k8s.aws +package v1beta1 diff --git a/pkg/apis/appmesh/v1alpha1/register.go b/pkg/apis/appmesh/v1beta1/register.go similarity index 96% rename from pkg/apis/appmesh/v1alpha1/register.go rename to pkg/apis/appmesh/v1beta1/register.go index 6be864557..259af34da 100644 --- a/pkg/apis/appmesh/v1alpha1/register.go +++ b/pkg/apis/appmesh/v1beta1/register.go @@ -1,14 +1,15 @@ -package v1alpha1 +package v1beta1 import ( - "github.com/weaveworks/flagger/pkg/apis/appmesh" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/weaveworks/flagger/pkg/apis/appmesh" ) // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: appmesh.GroupName, Version: "v1alpha1"} +var SchemeGroupVersion = schema.GroupVersion{Group: appmesh.GroupName, Version: "v1beta1"} // Kind takes an unqualified kind and returns back a Group qualified GroupKind func Kind(kind string) schema.GroupKind { diff --git a/pkg/apis/appmesh/v1alpha1/types.go b/pkg/apis/appmesh/v1beta1/types.go similarity index 88% rename from pkg/apis/appmesh/v1alpha1/types.go rename to pkg/apis/appmesh/v1beta1/types.go index 04b014c81..86189e4d6 100644 --- a/pkg/apis/appmesh/v1alpha1/types.go +++ b/pkg/apis/appmesh/v1beta1/types.go @@ -1,4 +1,4 @@ -package v1alpha1 +package v1beta1 import ( api "k8s.io/api/core/v1" @@ -10,6 +10,7 @@ import ( // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md // +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Mesh is a specification for a Mesh resource @@ -19,22 +20,19 @@ type Mesh struct { metav1.ObjectMeta `json:"metadata,omitempty"` // +optional - Spec *MeshSpec `json:"spec,omitempty"` + Spec MeshSpec `json:"spec,omitempty"` // +optional - Status *MeshStatus `json:"status,omitempty"` + Status MeshStatus `json:"status,omitempty"` } type MeshServiceDiscoveryType string const ( - CloudMapHttp MeshServiceDiscoveryType = "CloudMapHttp" + Dns MeshServiceDiscoveryType = "Dns" ) // 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"` } @@ -43,20 +41,15 @@ type MeshSpec struct { 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"` + MeshArn *string `json:"meshArn,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" + MeshActive MeshConditionType = "MeshActive" ) type MeshCondition struct { @@ -95,9 +88,9 @@ type VirtualService struct { metav1.ObjectMeta `json:"metadata,omitempty"` // +optional - Spec *VirtualServiceSpec `json:"spec,omitempty"` + Spec VirtualServiceSpec `json:"spec,omitempty"` // +optional - Status *VirtualServiceStatus `json:"status,omitempty"` + Status VirtualServiceStatus `json:"status,omitempty"` } // VirtualServiceSpec is the spec for a VirtualService resource @@ -154,7 +147,10 @@ type VirtualServiceConditionType string const ( // VirtualServiceActive is Active when the Appmesh Service has been created or found via the API - VirtualServiceActive VirtualServiceConditionType = "Active" + VirtualServiceActive VirtualServiceConditionType = "VirtualServiceActive" + VirtualRouterActive VirtualServiceConditionType = "VirtualRouterActive" + RoutesActive VirtualServiceConditionType = "RoutesActive" + VirtualServiceMeshMarkedForDeletion VirtualServiceConditionType = "MeshMarkedForDeletion" ) type VirtualServiceCondition struct { @@ -193,9 +189,9 @@ type VirtualNode struct { metav1.ObjectMeta `json:"metadata,omitempty"` // +optional - Spec *VirtualNodeSpec `json:"spec,omitempty"` + Spec VirtualNodeSpec `json:"spec,omitempty"` // +optional - Status *VirtualNodeStatus `json:"status,omitempty"` + Status VirtualNodeStatus `json:"status,omitempty"` } // VirtualNodeSpec is the spec for a VirtualNode resource @@ -259,7 +255,8 @@ type VirtualNodeConditionType string const ( // VirtualNodeActive is Active when the Appmesh Node has been created or found via the API - VirtualNodeActive VirtualNodeConditionType = "Active" + VirtualNodeActive VirtualNodeConditionType = "VirtualNodeActive" + VirtualNodeMeshMarkedForDeletion VirtualNodeConditionType = "MeshMarkedForDeletion" ) type VirtualNodeCondition struct { diff --git a/pkg/apis/appmesh/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/appmesh/v1beta1/zz_generated.deepcopy.go similarity index 94% rename from pkg/apis/appmesh/v1alpha1/zz_generated.deepcopy.go rename to pkg/apis/appmesh/v1beta1/zz_generated.deepcopy.go index f5a062809..ae356ccdc 100644 --- a/pkg/apis/appmesh/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/appmesh/v1beta1/zz_generated.deepcopy.go @@ -18,7 +18,7 @@ limitations under the License. // Code generated by deepcopy-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( runtime "k8s.io/apimachinery/pkg/runtime" @@ -150,16 +150,8 @@ 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) - } + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) return } @@ -247,11 +239,6 @@ func (in *MeshList) DeepCopyObject() runtime.Object { // 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) @@ -278,16 +265,6 @@ func (in *MeshStatus) DeepCopyInto(out *MeshStatus) { *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)) @@ -372,16 +349,8 @@ 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) - } + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) return } @@ -563,16 +532,8 @@ 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) - } + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) return } diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 508cfe367..c6039c8f1 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -19,7 +19,7 @@ limitations under the License. package versioned import ( - appmeshv1alpha1 "github.com/weaveworks/flagger/pkg/client/clientset/versioned/typed/appmesh/v1alpha1" + appmeshv1beta1 "github.com/weaveworks/flagger/pkg/client/clientset/versioned/typed/appmesh/v1beta1" flaggerv1alpha3 "github.com/weaveworks/flagger/pkg/client/clientset/versioned/typed/flagger/v1alpha3" networkingv1alpha3 "github.com/weaveworks/flagger/pkg/client/clientset/versioned/typed/istio/v1alpha3" discovery "k8s.io/client-go/discovery" @@ -29,9 +29,9 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface - AppmeshV1alpha1() appmeshv1alpha1.AppmeshV1alpha1Interface + AppmeshV1beta1() appmeshv1beta1.AppmeshV1beta1Interface // Deprecated: please explicitly pick a version if possible. - Appmesh() appmeshv1alpha1.AppmeshV1alpha1Interface + Appmesh() appmeshv1beta1.AppmeshV1beta1Interface FlaggerV1alpha3() flaggerv1alpha3.FlaggerV1alpha3Interface // Deprecated: please explicitly pick a version if possible. Flagger() flaggerv1alpha3.FlaggerV1alpha3Interface @@ -44,20 +44,20 @@ type Interface interface { // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - appmeshV1alpha1 *appmeshv1alpha1.AppmeshV1alpha1Client + appmeshV1beta1 *appmeshv1beta1.AppmeshV1beta1Client flaggerV1alpha3 *flaggerv1alpha3.FlaggerV1alpha3Client networkingV1alpha3 *networkingv1alpha3.NetworkingV1alpha3Client } -// AppmeshV1alpha1 retrieves the AppmeshV1alpha1Client -func (c *Clientset) AppmeshV1alpha1() appmeshv1alpha1.AppmeshV1alpha1Interface { - return c.appmeshV1alpha1 +// AppmeshV1beta1 retrieves the AppmeshV1beta1Client +func (c *Clientset) AppmeshV1beta1() appmeshv1beta1.AppmeshV1beta1Interface { + return c.appmeshV1beta1 } // Deprecated: Appmesh retrieves the default version of AppmeshClient. // Please explicitly pick a version. -func (c *Clientset) Appmesh() appmeshv1alpha1.AppmeshV1alpha1Interface { - return c.appmeshV1alpha1 +func (c *Clientset) Appmesh() appmeshv1beta1.AppmeshV1beta1Interface { + return c.appmeshV1beta1 } // FlaggerV1alpha3 retrieves the FlaggerV1alpha3Client @@ -98,7 +98,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error - cs.appmeshV1alpha1, err = appmeshv1alpha1.NewForConfig(&configShallowCopy) + cs.appmeshV1beta1, err = appmeshv1beta1.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -122,7 +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.appmeshV1beta1 = appmeshv1beta1.NewForConfigOrDie(c) cs.flaggerV1alpha3 = flaggerv1alpha3.NewForConfigOrDie(c) cs.networkingV1alpha3 = networkingv1alpha3.NewForConfigOrDie(c) @@ -133,7 +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.appmeshV1beta1 = appmeshv1beta1.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 24fdd107b..abb769814 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -20,8 +20,8 @@ package fake import ( clientset "github.com/weaveworks/flagger/pkg/client/clientset/versioned" - appmeshv1alpha1 "github.com/weaveworks/flagger/pkg/client/clientset/versioned/typed/appmesh/v1alpha1" - fakeappmeshv1alpha1 "github.com/weaveworks/flagger/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake" + appmeshv1beta1 "github.com/weaveworks/flagger/pkg/client/clientset/versioned/typed/appmesh/v1beta1" + fakeappmeshv1beta1 "github.com/weaveworks/flagger/pkg/client/clientset/versioned/typed/appmesh/v1beta1/fake" flaggerv1alpha3 "github.com/weaveworks/flagger/pkg/client/clientset/versioned/typed/flagger/v1alpha3" fakeflaggerv1alpha3 "github.com/weaveworks/flagger/pkg/client/clientset/versioned/typed/flagger/v1alpha3/fake" networkingv1alpha3 "github.com/weaveworks/flagger/pkg/client/clientset/versioned/typed/istio/v1alpha3" @@ -75,14 +75,14 @@ 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} +// AppmeshV1beta1 retrieves the AppmeshV1beta1Client +func (c *Clientset) AppmeshV1beta1() appmeshv1beta1.AppmeshV1beta1Interface { + return &fakeappmeshv1beta1.FakeAppmeshV1beta1{Fake: &c.Fake} } -// Appmesh retrieves the AppmeshV1alpha1Client -func (c *Clientset) Appmesh() appmeshv1alpha1.AppmeshV1alpha1Interface { - return &fakeappmeshv1alpha1.FakeAppmeshV1alpha1{Fake: &c.Fake} +// Appmesh retrieves the AppmeshV1beta1Client +func (c *Clientset) Appmesh() appmeshv1beta1.AppmeshV1beta1Interface { + return &fakeappmeshv1beta1.FakeAppmeshV1beta1{Fake: &c.Fake} } // FlaggerV1alpha3 retrieves the FlaggerV1alpha3Client diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index a68fe7bc5..c95b822db 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - appmeshv1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + appmeshv1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" flaggerv1alpha3 "github.com/weaveworks/flagger/pkg/apis/flagger/v1alpha3" networkingv1alpha3 "github.com/weaveworks/flagger/pkg/apis/istio/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -52,7 +52,7 @@ func init() { // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. func AddToScheme(scheme *runtime.Scheme) { - appmeshv1alpha1.AddToScheme(scheme) + appmeshv1beta1.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 a177d7ee7..ced6781a8 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -19,7 +19,7 @@ limitations under the License. package scheme import ( - appmeshv1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + appmeshv1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" flaggerv1alpha3 "github.com/weaveworks/flagger/pkg/apis/flagger/v1alpha3" networkingv1alpha3 "github.com/weaveworks/flagger/pkg/apis/istio/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -52,7 +52,7 @@ func init() { // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. func AddToScheme(scheme *runtime.Scheme) { - appmeshv1alpha1.AddToScheme(scheme) + appmeshv1beta1.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/v1beta1/appmesh_client.go similarity index 60% rename from pkg/client/clientset/versioned/typed/appmesh/v1alpha1/appmesh_client.go rename to pkg/client/clientset/versioned/typed/appmesh/v1beta1/appmesh_client.go index ed77f578f..73039e388 100644 --- a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/appmesh_client.go +++ b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/appmesh_client.go @@ -16,41 +16,41 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( - v1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + v1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" "github.com/weaveworks/flagger/pkg/client/clientset/versioned/scheme" serializer "k8s.io/apimachinery/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) -type AppmeshV1alpha1Interface interface { +type AppmeshV1beta1Interface interface { RESTClient() rest.Interface MeshesGetter VirtualNodesGetter VirtualServicesGetter } -// AppmeshV1alpha1Client is used to interact with features provided by the appmesh.k8s.aws group. -type AppmeshV1alpha1Client struct { +// AppmeshV1beta1Client is used to interact with features provided by the appmesh.k8s.aws group. +type AppmeshV1beta1Client struct { restClient rest.Interface } -func (c *AppmeshV1alpha1Client) Meshes(namespace string) MeshInterface { - return newMeshes(c, namespace) +func (c *AppmeshV1beta1Client) Meshes() MeshInterface { + return newMeshes(c) } -func (c *AppmeshV1alpha1Client) VirtualNodes(namespace string) VirtualNodeInterface { +func (c *AppmeshV1beta1Client) VirtualNodes(namespace string) VirtualNodeInterface { return newVirtualNodes(c, namespace) } -func (c *AppmeshV1alpha1Client) VirtualServices(namespace string) VirtualServiceInterface { +func (c *AppmeshV1beta1Client) VirtualServices(namespace string) VirtualServiceInterface { return newVirtualServices(c, namespace) } -// NewForConfig creates a new AppmeshV1alpha1Client for the given config. -func NewForConfig(c *rest.Config) (*AppmeshV1alpha1Client, error) { +// NewForConfig creates a new AppmeshV1beta1Client for the given config. +func NewForConfig(c *rest.Config) (*AppmeshV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -59,12 +59,12 @@ func NewForConfig(c *rest.Config) (*AppmeshV1alpha1Client, error) { if err != nil { return nil, err } - return &AppmeshV1alpha1Client{client}, nil + return &AppmeshV1beta1Client{client}, nil } -// NewForConfigOrDie creates a new AppmeshV1alpha1Client for the given config and +// NewForConfigOrDie creates a new AppmeshV1beta1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *AppmeshV1alpha1Client { +func NewForConfigOrDie(c *rest.Config) *AppmeshV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -72,13 +72,13 @@ func NewForConfigOrDie(c *rest.Config) *AppmeshV1alpha1Client { return client } -// New creates a new AppmeshV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *AppmeshV1alpha1Client { - return &AppmeshV1alpha1Client{c} +// New creates a new AppmeshV1beta1Client for the given RESTClient. +func New(c rest.Interface) *AppmeshV1beta1Client { + return &AppmeshV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion + gv := v1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} @@ -92,7 +92,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *AppmeshV1alpha1Client) RESTClient() rest.Interface { +func (c *AppmeshV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/doc.go similarity index 97% rename from pkg/client/clientset/versioned/typed/appmesh/v1alpha1/doc.go rename to pkg/client/clientset/versioned/typed/appmesh/v1beta1/doc.go index 20b3d7fd1..4796e1821 100644 --- a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/doc.go +++ b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/doc.go @@ -17,4 +17,4 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. -package v1alpha1 +package v1beta1 diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/fake/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/doc.go rename to pkg/client/clientset/versioned/typed/appmesh/v1beta1/fake/doc.go diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_appmesh_client.go b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/fake/fake_appmesh_client.go similarity index 66% rename from pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_appmesh_client.go rename to pkg/client/clientset/versioned/typed/appmesh/v1beta1/fake/fake_appmesh_client.go index 5a914750a..8e53acda3 100644 --- a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_appmesh_client.go +++ b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/fake/fake_appmesh_client.go @@ -19,30 +19,30 @@ limitations under the License. package fake import ( - v1alpha1 "github.com/weaveworks/flagger/pkg/client/clientset/versioned/typed/appmesh/v1alpha1" + v1beta1 "github.com/weaveworks/flagger/pkg/client/clientset/versioned/typed/appmesh/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeAppmeshV1alpha1 struct { +type FakeAppmeshV1beta1 struct { *testing.Fake } -func (c *FakeAppmeshV1alpha1) Meshes(namespace string) v1alpha1.MeshInterface { - return &FakeMeshes{c, namespace} +func (c *FakeAppmeshV1beta1) Meshes() v1beta1.MeshInterface { + return &FakeMeshes{c} } -func (c *FakeAppmeshV1alpha1) VirtualNodes(namespace string) v1alpha1.VirtualNodeInterface { +func (c *FakeAppmeshV1beta1) VirtualNodes(namespace string) v1beta1.VirtualNodeInterface { return &FakeVirtualNodes{c, namespace} } -func (c *FakeAppmeshV1alpha1) VirtualServices(namespace string) v1alpha1.VirtualServiceInterface { +func (c *FakeAppmeshV1beta1) VirtualServices(namespace string) v1beta1.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 { +func (c *FakeAppmeshV1beta1) 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/v1beta1/fake/fake_mesh.go similarity index 62% rename from pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_mesh.go rename to pkg/client/clientset/versioned/typed/appmesh/v1beta1/fake/fake_mesh.go index 711c624b2..4bf3a774e 100644 --- a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_mesh.go +++ b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/fake/fake_mesh.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + v1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,30 +30,27 @@ import ( // FakeMeshes implements MeshInterface type FakeMeshes struct { - Fake *FakeAppmeshV1alpha1 - ns string + Fake *FakeAppmeshV1beta1 } -var meshesResource = schema.GroupVersionResource{Group: "appmesh.k8s.aws", Version: "v1alpha1", Resource: "meshes"} +var meshesResource = schema.GroupVersionResource{Group: "appmesh.k8s.aws", Version: "v1beta1", Resource: "meshes"} -var meshesKind = schema.GroupVersionKind{Group: "appmesh.k8s.aws", Version: "v1alpha1", Kind: "Mesh"} +var meshesKind = schema.GroupVersionKind{Group: "appmesh.k8s.aws", Version: "v1beta1", 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) { +func (c *FakeMeshes) Get(name string, options v1.GetOptions) (result *v1beta1.Mesh, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(meshesResource, c.ns, name), &v1alpha1.Mesh{}) - + Invokes(testing.NewRootGetAction(meshesResource, name), &v1beta1.Mesh{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.Mesh), err + return obj.(*v1beta1.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) { +func (c *FakeMeshes) List(opts v1.ListOptions) (result *v1beta1.MeshList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(meshesResource, meshesKind, c.ns, opts), &v1alpha1.MeshList{}) - + Invokes(testing.NewRootListAction(meshesResource, meshesKind, opts), &v1beta1.MeshList{}) if obj == nil { return nil, err } @@ -62,8 +59,8 @@ func (c *FakeMeshes) List(opts v1.ListOptions) (result *v1alpha1.MeshList, err e if label == nil { label = labels.Everything() } - list := &v1alpha1.MeshList{ListMeta: obj.(*v1alpha1.MeshList).ListMeta} - for _, item := range obj.(*v1alpha1.MeshList).Items { + list := &v1beta1.MeshList{ListMeta: obj.(*v1beta1.MeshList).ListMeta} + for _, item := range obj.(*v1beta1.MeshList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -74,67 +71,61 @@ func (c *FakeMeshes) List(opts v1.ListOptions) (result *v1alpha1.MeshList, err e // 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)) - + InvokesWatch(testing.NewRootWatchAction(meshesResource, 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) { +func (c *FakeMeshes) Create(mesh *v1beta1.Mesh) (result *v1beta1.Mesh, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(meshesResource, c.ns, mesh), &v1alpha1.Mesh{}) - + Invokes(testing.NewRootCreateAction(meshesResource, mesh), &v1beta1.Mesh{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.Mesh), err + return obj.(*v1beta1.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) { +func (c *FakeMeshes) Update(mesh *v1beta1.Mesh) (result *v1beta1.Mesh, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(meshesResource, c.ns, mesh), &v1alpha1.Mesh{}) - + Invokes(testing.NewRootUpdateAction(meshesResource, mesh), &v1beta1.Mesh{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.Mesh), err + return obj.(*v1beta1.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) { +func (c *FakeMeshes) UpdateStatus(mesh *v1beta1.Mesh) (*v1beta1.Mesh, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(meshesResource, "status", c.ns, mesh), &v1alpha1.Mesh{}) - + Invokes(testing.NewRootUpdateSubresourceAction(meshesResource, "status", mesh), &v1beta1.Mesh{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.Mesh), err + return obj.(*v1beta1.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{}) - + Invokes(testing.NewRootDeleteAction(meshesResource, name), &v1beta1.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) + action := testing.NewRootDeleteCollectionAction(meshesResource, listOptions) - _, err := c.Fake.Invokes(action, &v1alpha1.MeshList{}) + _, err := c.Fake.Invokes(action, &v1beta1.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) { +func (c *FakeMeshes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Mesh, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(meshesResource, c.ns, name, data, subresources...), &v1alpha1.Mesh{}) - + Invokes(testing.NewRootPatchSubresourceAction(meshesResource, name, data, subresources...), &v1beta1.Mesh{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.Mesh), err + return obj.(*v1beta1.Mesh), err } diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_virtualnode.go b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/fake/fake_virtualnode.go similarity index 72% rename from pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_virtualnode.go rename to pkg/client/clientset/versioned/typed/appmesh/v1beta1/fake/fake_virtualnode.go index 592b21876..b467abc1f 100644 --- a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_virtualnode.go +++ b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/fake/fake_virtualnode.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + v1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakeVirtualNodes implements VirtualNodeInterface type FakeVirtualNodes struct { - Fake *FakeAppmeshV1alpha1 + Fake *FakeAppmeshV1beta1 ns string } -var virtualnodesResource = schema.GroupVersionResource{Group: "appmesh.k8s.aws", Version: "v1alpha1", Resource: "virtualnodes"} +var virtualnodesResource = schema.GroupVersionResource{Group: "appmesh.k8s.aws", Version: "v1beta1", Resource: "virtualnodes"} -var virtualnodesKind = schema.GroupVersionKind{Group: "appmesh.k8s.aws", Version: "v1alpha1", Kind: "VirtualNode"} +var virtualnodesKind = schema.GroupVersionKind{Group: "appmesh.k8s.aws", Version: "v1beta1", 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) { +func (c *FakeVirtualNodes) Get(name string, options v1.GetOptions) (result *v1beta1.VirtualNode, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(virtualnodesResource, c.ns, name), &v1alpha1.VirtualNode{}) + Invokes(testing.NewGetAction(virtualnodesResource, c.ns, name), &v1beta1.VirtualNode{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.VirtualNode), err + return obj.(*v1beta1.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) { +func (c *FakeVirtualNodes) List(opts v1.ListOptions) (result *v1beta1.VirtualNodeList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(virtualnodesResource, virtualnodesKind, c.ns, opts), &v1alpha1.VirtualNodeList{}) + Invokes(testing.NewListAction(virtualnodesResource, virtualnodesKind, c.ns, opts), &v1beta1.VirtualNodeList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeVirtualNodes) List(opts v1.ListOptions) (result *v1alpha1.VirtualNo if label == nil { label = labels.Everything() } - list := &v1alpha1.VirtualNodeList{ListMeta: obj.(*v1alpha1.VirtualNodeList).ListMeta} - for _, item := range obj.(*v1alpha1.VirtualNodeList).Items { + list := &v1beta1.VirtualNodeList{ListMeta: obj.(*v1beta1.VirtualNodeList).ListMeta} + for _, item := range obj.(*v1beta1.VirtualNodeList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,43 +79,43 @@ func (c *FakeVirtualNodes) Watch(opts v1.ListOptions) (watch.Interface, error) { } // 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) { +func (c *FakeVirtualNodes) Create(virtualNode *v1beta1.VirtualNode) (result *v1beta1.VirtualNode, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(virtualnodesResource, c.ns, virtualNode), &v1alpha1.VirtualNode{}) + Invokes(testing.NewCreateAction(virtualnodesResource, c.ns, virtualNode), &v1beta1.VirtualNode{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.VirtualNode), err + return obj.(*v1beta1.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) { +func (c *FakeVirtualNodes) Update(virtualNode *v1beta1.VirtualNode) (result *v1beta1.VirtualNode, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(virtualnodesResource, c.ns, virtualNode), &v1alpha1.VirtualNode{}) + Invokes(testing.NewUpdateAction(virtualnodesResource, c.ns, virtualNode), &v1beta1.VirtualNode{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.VirtualNode), err + return obj.(*v1beta1.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) { +func (c *FakeVirtualNodes) UpdateStatus(virtualNode *v1beta1.VirtualNode) (*v1beta1.VirtualNode, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(virtualnodesResource, "status", c.ns, virtualNode), &v1alpha1.VirtualNode{}) + Invokes(testing.NewUpdateSubresourceAction(virtualnodesResource, "status", c.ns, virtualNode), &v1beta1.VirtualNode{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.VirtualNode), err + return obj.(*v1beta1.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{}) + Invokes(testing.NewDeleteAction(virtualnodesResource, c.ns, name), &v1beta1.VirtualNode{}) return err } @@ -124,17 +124,17 @@ func (c *FakeVirtualNodes) Delete(name string, options *v1.DeleteOptions) error 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{}) + _, err := c.Fake.Invokes(action, &v1beta1.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) { +func (c *FakeVirtualNodes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VirtualNode, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualnodesResource, c.ns, name, data, subresources...), &v1alpha1.VirtualNode{}) + Invokes(testing.NewPatchSubresourceAction(virtualnodesResource, c.ns, name, data, subresources...), &v1beta1.VirtualNode{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.VirtualNode), err + return obj.(*v1beta1.VirtualNode), err } diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_virtualservice.go b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/fake/fake_virtualservice.go similarity index 71% rename from pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_virtualservice.go rename to pkg/client/clientset/versioned/typed/appmesh/v1beta1/fake/fake_virtualservice.go index d12eeb850..6e30558dd 100644 --- a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/fake/fake_virtualservice.go +++ b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/fake/fake_virtualservice.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + v1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakeVirtualServices implements VirtualServiceInterface type FakeVirtualServices struct { - Fake *FakeAppmeshV1alpha1 + Fake *FakeAppmeshV1beta1 ns string } -var virtualservicesResource = schema.GroupVersionResource{Group: "appmesh.k8s.aws", Version: "v1alpha1", Resource: "virtualservices"} +var virtualservicesResource = schema.GroupVersionResource{Group: "appmesh.k8s.aws", Version: "v1beta1", Resource: "virtualservices"} -var virtualservicesKind = schema.GroupVersionKind{Group: "appmesh.k8s.aws", Version: "v1alpha1", Kind: "VirtualService"} +var virtualservicesKind = schema.GroupVersionKind{Group: "appmesh.k8s.aws", Version: "v1beta1", 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) { +func (c *FakeVirtualServices) Get(name string, options v1.GetOptions) (result *v1beta1.VirtualService, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(virtualservicesResource, c.ns, name), &v1alpha1.VirtualService{}) + Invokes(testing.NewGetAction(virtualservicesResource, c.ns, name), &v1beta1.VirtualService{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.VirtualService), err + return obj.(*v1beta1.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) { +func (c *FakeVirtualServices) List(opts v1.ListOptions) (result *v1beta1.VirtualServiceList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(virtualservicesResource, virtualservicesKind, c.ns, opts), &v1alpha1.VirtualServiceList{}) + Invokes(testing.NewListAction(virtualservicesResource, virtualservicesKind, c.ns, opts), &v1beta1.VirtualServiceList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeVirtualServices) List(opts v1.ListOptions) (result *v1alpha1.Virtua if label == nil { label = labels.Everything() } - list := &v1alpha1.VirtualServiceList{ListMeta: obj.(*v1alpha1.VirtualServiceList).ListMeta} - for _, item := range obj.(*v1alpha1.VirtualServiceList).Items { + list := &v1beta1.VirtualServiceList{ListMeta: obj.(*v1beta1.VirtualServiceList).ListMeta} + for _, item := range obj.(*v1beta1.VirtualServiceList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,43 +79,43 @@ func (c *FakeVirtualServices) Watch(opts v1.ListOptions) (watch.Interface, error } // 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) { +func (c *FakeVirtualServices) Create(virtualService *v1beta1.VirtualService) (result *v1beta1.VirtualService, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(virtualservicesResource, c.ns, virtualService), &v1alpha1.VirtualService{}) + Invokes(testing.NewCreateAction(virtualservicesResource, c.ns, virtualService), &v1beta1.VirtualService{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.VirtualService), err + return obj.(*v1beta1.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) { +func (c *FakeVirtualServices) Update(virtualService *v1beta1.VirtualService) (result *v1beta1.VirtualService, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(virtualservicesResource, c.ns, virtualService), &v1alpha1.VirtualService{}) + Invokes(testing.NewUpdateAction(virtualservicesResource, c.ns, virtualService), &v1beta1.VirtualService{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.VirtualService), err + return obj.(*v1beta1.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) { +func (c *FakeVirtualServices) UpdateStatus(virtualService *v1beta1.VirtualService) (*v1beta1.VirtualService, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(virtualservicesResource, "status", c.ns, virtualService), &v1alpha1.VirtualService{}) + Invokes(testing.NewUpdateSubresourceAction(virtualservicesResource, "status", c.ns, virtualService), &v1beta1.VirtualService{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.VirtualService), err + return obj.(*v1beta1.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{}) + Invokes(testing.NewDeleteAction(virtualservicesResource, c.ns, name), &v1beta1.VirtualService{}) return err } @@ -124,17 +124,17 @@ func (c *FakeVirtualServices) Delete(name string, options *v1.DeleteOptions) err 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{}) + _, err := c.Fake.Invokes(action, &v1beta1.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) { +func (c *FakeVirtualServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VirtualService, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualservicesResource, c.ns, name, data, subresources...), &v1alpha1.VirtualService{}) + Invokes(testing.NewPatchSubresourceAction(virtualservicesResource, c.ns, name, data, subresources...), &v1beta1.VirtualService{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.VirtualService), err + return obj.(*v1beta1.VirtualService), err } diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/generated_expansion.go similarity index 97% rename from pkg/client/clientset/versioned/typed/appmesh/v1alpha1/generated_expansion.go rename to pkg/client/clientset/versioned/typed/appmesh/v1beta1/generated_expansion.go index 8b4bb09c1..66f15ec14 100644 --- a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/generated_expansion.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 type MeshExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/mesh.go b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/mesh.go similarity index 74% rename from pkg/client/clientset/versioned/typed/appmesh/v1alpha1/mesh.go rename to pkg/client/clientset/versioned/typed/appmesh/v1beta1/mesh.go index 4ae633546..67332067e 100644 --- a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/mesh.go +++ b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/mesh.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( - v1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + v1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" scheme "github.com/weaveworks/flagger/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -30,42 +30,39 @@ import ( // MeshesGetter has a method to return a MeshInterface. // A group's client should implement this interface. type MeshesGetter interface { - Meshes(namespace string) MeshInterface + Meshes() 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) + Create(*v1beta1.Mesh) (*v1beta1.Mesh, error) + Update(*v1beta1.Mesh) (*v1beta1.Mesh, error) + UpdateStatus(*v1beta1.Mesh) (*v1beta1.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) + Get(name string, options v1.GetOptions) (*v1beta1.Mesh, error) + List(opts v1.ListOptions) (*v1beta1.MeshList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Mesh, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.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 { +func newMeshes(c *AppmeshV1beta1Client) *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{} +func (c *meshes) Get(name string, options v1.GetOptions) (result *v1beta1.Mesh, err error) { + result = &v1beta1.Mesh{} err = c.client.Get(). - Namespace(c.ns). Resource("meshes"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -75,10 +72,9 @@ func (c *meshes) Get(name string, options v1.GetOptions) (result *v1alpha1.Mesh, } // 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{} +func (c *meshes) List(opts v1.ListOptions) (result *v1beta1.MeshList, err error) { + result = &v1beta1.MeshList{} err = c.client.Get(). - Namespace(c.ns). Resource("meshes"). VersionedParams(&opts, scheme.ParameterCodec). Do(). @@ -90,17 +86,15 @@ func (c *meshes) List(opts v1.ListOptions) (result *v1alpha1.MeshList, err error 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{} +func (c *meshes) Create(mesh *v1beta1.Mesh) (result *v1beta1.Mesh, err error) { + result = &v1beta1.Mesh{} err = c.client.Post(). - Namespace(c.ns). Resource("meshes"). Body(mesh). Do(). @@ -109,10 +103,9 @@ func (c *meshes) Create(mesh *v1alpha1.Mesh) (result *v1alpha1.Mesh, err error) } // 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{} +func (c *meshes) Update(mesh *v1beta1.Mesh) (result *v1beta1.Mesh, err error) { + result = &v1beta1.Mesh{} err = c.client.Put(). - Namespace(c.ns). Resource("meshes"). Name(mesh.Name). Body(mesh). @@ -124,10 +117,9 @@ func (c *meshes) Update(mesh *v1alpha1.Mesh) (result *v1alpha1.Mesh, err error) // 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{} +func (c *meshes) UpdateStatus(mesh *v1beta1.Mesh) (result *v1beta1.Mesh, err error) { + result = &v1beta1.Mesh{} err = c.client.Put(). - Namespace(c.ns). Resource("meshes"). Name(mesh.Name). SubResource("status"). @@ -140,7 +132,6 @@ func (c *meshes) UpdateStatus(mesh *v1alpha1.Mesh) (result *v1alpha1.Mesh, err e // 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). @@ -151,7 +142,6 @@ func (c *meshes) Delete(name string, options *v1.DeleteOptions) 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). @@ -160,10 +150,9 @@ func (c *meshes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.List } // 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{} +func (c *meshes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Mesh, err error) { + result = &v1beta1.Mesh{} err = c.client.Patch(pt). - Namespace(c.ns). Resource("meshes"). SubResource(subresources...). Name(name). diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/virtualnode.go b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/virtualnode.go similarity index 77% rename from pkg/client/clientset/versioned/typed/appmesh/v1alpha1/virtualnode.go rename to pkg/client/clientset/versioned/typed/appmesh/v1beta1/virtualnode.go index 7cad65894..714aabf18 100644 --- a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/virtualnode.go +++ b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/virtualnode.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( - v1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + v1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" scheme "github.com/weaveworks/flagger/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -35,15 +35,15 @@ type VirtualNodesGetter interface { // 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) + Create(*v1beta1.VirtualNode) (*v1beta1.VirtualNode, error) + Update(*v1beta1.VirtualNode) (*v1beta1.VirtualNode, error) + UpdateStatus(*v1beta1.VirtualNode) (*v1beta1.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) + Get(name string, options v1.GetOptions) (*v1beta1.VirtualNode, error) + List(opts v1.ListOptions) (*v1beta1.VirtualNodeList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VirtualNode, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VirtualNode, err error) VirtualNodeExpansion } @@ -54,7 +54,7 @@ type virtualNodes struct { } // newVirtualNodes returns a VirtualNodes -func newVirtualNodes(c *AppmeshV1alpha1Client, namespace string) *virtualNodes { +func newVirtualNodes(c *AppmeshV1beta1Client, namespace string) *virtualNodes { return &virtualNodes{ client: c.RESTClient(), ns: namespace, @@ -62,8 +62,8 @@ func newVirtualNodes(c *AppmeshV1alpha1Client, namespace string) *virtualNodes { } // 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{} +func (c *virtualNodes) Get(name string, options v1.GetOptions) (result *v1beta1.VirtualNode, err error) { + result = &v1beta1.VirtualNode{} err = c.client.Get(). Namespace(c.ns). Resource("virtualnodes"). @@ -75,8 +75,8 @@ func (c *virtualNodes) Get(name string, options v1.GetOptions) (result *v1alpha1 } // 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{} +func (c *virtualNodes) List(opts v1.ListOptions) (result *v1beta1.VirtualNodeList, err error) { + result = &v1beta1.VirtualNodeList{} err = c.client.Get(). Namespace(c.ns). Resource("virtualnodes"). @@ -97,8 +97,8 @@ func (c *virtualNodes) Watch(opts v1.ListOptions) (watch.Interface, error) { } // 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{} +func (c *virtualNodes) Create(virtualNode *v1beta1.VirtualNode) (result *v1beta1.VirtualNode, err error) { + result = &v1beta1.VirtualNode{} err = c.client.Post(). Namespace(c.ns). Resource("virtualnodes"). @@ -109,8 +109,8 @@ func (c *virtualNodes) Create(virtualNode *v1alpha1.VirtualNode) (result *v1alph } // 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{} +func (c *virtualNodes) Update(virtualNode *v1beta1.VirtualNode) (result *v1beta1.VirtualNode, err error) { + result = &v1beta1.VirtualNode{} err = c.client.Put(). Namespace(c.ns). Resource("virtualnodes"). @@ -124,8 +124,8 @@ func (c *virtualNodes) Update(virtualNode *v1alpha1.VirtualNode) (result *v1alph // 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{} +func (c *virtualNodes) UpdateStatus(virtualNode *v1beta1.VirtualNode) (result *v1beta1.VirtualNode, err error) { + result = &v1beta1.VirtualNode{} err = c.client.Put(). Namespace(c.ns). Resource("virtualnodes"). @@ -160,8 +160,8 @@ func (c *virtualNodes) DeleteCollection(options *v1.DeleteOptions, listOptions v } // 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{} +func (c *virtualNodes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VirtualNode, err error) { + result = &v1beta1.VirtualNode{} err = c.client.Patch(pt). Namespace(c.ns). Resource("virtualnodes"). diff --git a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/virtualservice.go b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/virtualservice.go similarity index 76% rename from pkg/client/clientset/versioned/typed/appmesh/v1alpha1/virtualservice.go rename to pkg/client/clientset/versioned/typed/appmesh/v1beta1/virtualservice.go index 8ef072379..73ae38feb 100644 --- a/pkg/client/clientset/versioned/typed/appmesh/v1alpha1/virtualservice.go +++ b/pkg/client/clientset/versioned/typed/appmesh/v1beta1/virtualservice.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( - v1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + v1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" scheme "github.com/weaveworks/flagger/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -35,15 +35,15 @@ type VirtualServicesGetter interface { // 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) + Create(*v1beta1.VirtualService) (*v1beta1.VirtualService, error) + Update(*v1beta1.VirtualService) (*v1beta1.VirtualService, error) + UpdateStatus(*v1beta1.VirtualService) (*v1beta1.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) + Get(name string, options v1.GetOptions) (*v1beta1.VirtualService, error) + List(opts v1.ListOptions) (*v1beta1.VirtualServiceList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VirtualService, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VirtualService, err error) VirtualServiceExpansion } @@ -54,7 +54,7 @@ type virtualServices struct { } // newVirtualServices returns a VirtualServices -func newVirtualServices(c *AppmeshV1alpha1Client, namespace string) *virtualServices { +func newVirtualServices(c *AppmeshV1beta1Client, namespace string) *virtualServices { return &virtualServices{ client: c.RESTClient(), ns: namespace, @@ -62,8 +62,8 @@ func newVirtualServices(c *AppmeshV1alpha1Client, namespace string) *virtualServ } // 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{} +func (c *virtualServices) Get(name string, options v1.GetOptions) (result *v1beta1.VirtualService, err error) { + result = &v1beta1.VirtualService{} err = c.client.Get(). Namespace(c.ns). Resource("virtualservices"). @@ -75,8 +75,8 @@ func (c *virtualServices) Get(name string, options v1.GetOptions) (result *v1alp } // 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{} +func (c *virtualServices) List(opts v1.ListOptions) (result *v1beta1.VirtualServiceList, err error) { + result = &v1beta1.VirtualServiceList{} err = c.client.Get(). Namespace(c.ns). Resource("virtualservices"). @@ -97,8 +97,8 @@ func (c *virtualServices) Watch(opts v1.ListOptions) (watch.Interface, error) { } // 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{} +func (c *virtualServices) Create(virtualService *v1beta1.VirtualService) (result *v1beta1.VirtualService, err error) { + result = &v1beta1.VirtualService{} err = c.client.Post(). Namespace(c.ns). Resource("virtualservices"). @@ -109,8 +109,8 @@ func (c *virtualServices) Create(virtualService *v1alpha1.VirtualService) (resul } // 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{} +func (c *virtualServices) Update(virtualService *v1beta1.VirtualService) (result *v1beta1.VirtualService, err error) { + result = &v1beta1.VirtualService{} err = c.client.Put(). Namespace(c.ns). Resource("virtualservices"). @@ -124,8 +124,8 @@ func (c *virtualServices) Update(virtualService *v1alpha1.VirtualService) (resul // 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{} +func (c *virtualServices) UpdateStatus(virtualService *v1beta1.VirtualService) (result *v1beta1.VirtualService, err error) { + result = &v1beta1.VirtualService{} err = c.client.Put(). Namespace(c.ns). Resource("virtualservices"). @@ -160,8 +160,8 @@ func (c *virtualServices) DeleteCollection(options *v1.DeleteOptions, listOption } // 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{} +func (c *virtualServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VirtualService, err error) { + result = &v1beta1.VirtualService{} err = c.client.Patch(pt). Namespace(c.ns). Resource("virtualservices"). diff --git a/pkg/client/informers/externalversions/appmesh/interface.go b/pkg/client/informers/externalversions/appmesh/interface.go index 7b4715e28..376f4361b 100644 --- a/pkg/client/informers/externalversions/appmesh/interface.go +++ b/pkg/client/informers/externalversions/appmesh/interface.go @@ -19,14 +19,14 @@ limitations under the License. package appmesh import ( - v1alpha1 "github.com/weaveworks/flagger/pkg/client/informers/externalversions/appmesh/v1alpha1" + v1beta1 "github.com/weaveworks/flagger/pkg/client/informers/externalversions/appmesh/v1beta1" internalinterfaces "github.com/weaveworks/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 + // V1beta1 provides access to shared informers for resources in V1beta1. + V1beta1() v1beta1.Interface } type group struct { @@ -40,7 +40,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList 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) +// V1beta1 returns a new v1beta1.Interface. +func (g *group) V1beta1() v1beta1.Interface { + return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) } diff --git a/pkg/client/informers/externalversions/appmesh/v1alpha1/interface.go b/pkg/client/informers/externalversions/appmesh/v1beta1/interface.go similarity index 94% rename from pkg/client/informers/externalversions/appmesh/v1alpha1/interface.go rename to pkg/client/informers/externalversions/appmesh/v1beta1/interface.go index 100608007..f26966e5d 100644 --- a/pkg/client/informers/externalversions/appmesh/v1alpha1/interface.go +++ b/pkg/client/informers/externalversions/appmesh/v1beta1/interface.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( internalinterfaces "github.com/weaveworks/flagger/pkg/client/informers/externalversions/internalinterfaces" @@ -45,7 +45,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList // Meshes returns a MeshInformer. func (v *version) Meshes() MeshInformer { - return &meshInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} + return &meshInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } // VirtualNodes returns a VirtualNodeInformer. diff --git a/pkg/client/informers/externalversions/appmesh/v1alpha1/mesh.go b/pkg/client/informers/externalversions/appmesh/v1beta1/mesh.go similarity index 66% rename from pkg/client/informers/externalversions/appmesh/v1alpha1/mesh.go rename to pkg/client/informers/externalversions/appmesh/v1beta1/mesh.go index 3fd5fbeda..ccb9c7114 100644 --- a/pkg/client/informers/externalversions/appmesh/v1alpha1/mesh.go +++ b/pkg/client/informers/externalversions/appmesh/v1beta1/mesh.go @@ -16,15 +16,15 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( time "time" - appmeshv1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + appmeshv1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" versioned "github.com/weaveworks/flagger/pkg/client/clientset/versioned" internalinterfaces "github.com/weaveworks/flagger/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/weaveworks/flagger/pkg/client/listers/appmesh/v1alpha1" + v1beta1 "github.com/weaveworks/flagger/pkg/client/listers/appmesh/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -35,55 +35,54 @@ import ( // Meshes. type MeshInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.MeshLister + Lister() v1beta1.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) +func NewMeshInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMeshInformer(client, 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 { +func NewFilteredMeshInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppmeshV1alpha1().Meshes(namespace).List(options) + return client.AppmeshV1beta1().Meshes().List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppmeshV1alpha1().Meshes(namespace).Watch(options) + return client.AppmeshV1beta1().Meshes().Watch(options) }, }, - &appmeshv1alpha1.Mesh{}, + &appmeshv1beta1.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) + return NewFilteredMeshInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *meshInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&appmeshv1alpha1.Mesh{}, f.defaultInformer) + return f.factory.InformerFor(&appmeshv1beta1.Mesh{}, f.defaultInformer) } -func (f *meshInformer) Lister() v1alpha1.MeshLister { - return v1alpha1.NewMeshLister(f.Informer().GetIndexer()) +func (f *meshInformer) Lister() v1beta1.MeshLister { + return v1beta1.NewMeshLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/appmesh/v1alpha1/virtualnode.go b/pkg/client/informers/externalversions/appmesh/v1beta1/virtualnode.go similarity index 83% rename from pkg/client/informers/externalversions/appmesh/v1alpha1/virtualnode.go rename to pkg/client/informers/externalversions/appmesh/v1beta1/virtualnode.go index 2174bf5fb..bd87c5db5 100644 --- a/pkg/client/informers/externalversions/appmesh/v1alpha1/virtualnode.go +++ b/pkg/client/informers/externalversions/appmesh/v1beta1/virtualnode.go @@ -16,15 +16,15 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( time "time" - appmeshv1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + appmeshv1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" versioned "github.com/weaveworks/flagger/pkg/client/clientset/versioned" internalinterfaces "github.com/weaveworks/flagger/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/weaveworks/flagger/pkg/client/listers/appmesh/v1alpha1" + v1beta1 "github.com/weaveworks/flagger/pkg/client/listers/appmesh/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -35,7 +35,7 @@ import ( // VirtualNodes. type VirtualNodeInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.VirtualNodeLister + Lister() v1beta1.VirtualNodeLister } type virtualNodeInformer struct { @@ -61,16 +61,16 @@ func NewFilteredVirtualNodeInformer(client versioned.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppmeshV1alpha1().VirtualNodes(namespace).List(options) + return client.AppmeshV1beta1().VirtualNodes(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppmeshV1alpha1().VirtualNodes(namespace).Watch(options) + return client.AppmeshV1beta1().VirtualNodes(namespace).Watch(options) }, }, - &appmeshv1alpha1.VirtualNode{}, + &appmeshv1beta1.VirtualNode{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *virtualNodeInformer) defaultInformer(client versioned.Interface, resync } func (f *virtualNodeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&appmeshv1alpha1.VirtualNode{}, f.defaultInformer) + return f.factory.InformerFor(&appmeshv1beta1.VirtualNode{}, f.defaultInformer) } -func (f *virtualNodeInformer) Lister() v1alpha1.VirtualNodeLister { - return v1alpha1.NewVirtualNodeLister(f.Informer().GetIndexer()) +func (f *virtualNodeInformer) Lister() v1beta1.VirtualNodeLister { + return v1beta1.NewVirtualNodeLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/appmesh/v1alpha1/virtualservice.go b/pkg/client/informers/externalversions/appmesh/v1beta1/virtualservice.go similarity index 83% rename from pkg/client/informers/externalversions/appmesh/v1alpha1/virtualservice.go rename to pkg/client/informers/externalversions/appmesh/v1beta1/virtualservice.go index 7f694d8b8..fe8174f39 100644 --- a/pkg/client/informers/externalversions/appmesh/v1alpha1/virtualservice.go +++ b/pkg/client/informers/externalversions/appmesh/v1beta1/virtualservice.go @@ -16,15 +16,15 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( time "time" - appmeshv1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + appmeshv1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" versioned "github.com/weaveworks/flagger/pkg/client/clientset/versioned" internalinterfaces "github.com/weaveworks/flagger/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/weaveworks/flagger/pkg/client/listers/appmesh/v1alpha1" + v1beta1 "github.com/weaveworks/flagger/pkg/client/listers/appmesh/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -35,7 +35,7 @@ import ( // VirtualServices. type VirtualServiceInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.VirtualServiceLister + Lister() v1beta1.VirtualServiceLister } type virtualServiceInformer struct { @@ -61,16 +61,16 @@ func NewFilteredVirtualServiceInformer(client versioned.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppmeshV1alpha1().VirtualServices(namespace).List(options) + return client.AppmeshV1beta1().VirtualServices(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppmeshV1alpha1().VirtualServices(namespace).Watch(options) + return client.AppmeshV1beta1().VirtualServices(namespace).Watch(options) }, }, - &appmeshv1alpha1.VirtualService{}, + &appmeshv1beta1.VirtualService{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *virtualServiceInformer) defaultInformer(client versioned.Interface, res } func (f *virtualServiceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&appmeshv1alpha1.VirtualService{}, f.defaultInformer) + return f.factory.InformerFor(&appmeshv1beta1.VirtualService{}, f.defaultInformer) } -func (f *virtualServiceInformer) Lister() v1alpha1.VirtualServiceLister { - return v1alpha1.NewVirtualServiceLister(f.Informer().GetIndexer()) +func (f *virtualServiceInformer) Lister() v1beta1.VirtualServiceLister { + return v1beta1.NewVirtualServiceLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 83c55d9a3..f938d50b7 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -21,7 +21,7 @@ package externalversions import ( "fmt" - v1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + v1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" v1alpha3 "github.com/weaveworks/flagger/pkg/apis/flagger/v1alpha3" istiov1alpha3 "github.com/weaveworks/flagger/pkg/apis/istio/v1alpha3" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -54,13 +54,13 @@ 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=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=appmesh.k8s.aws, Version=v1beta1 + case v1beta1.SchemeGroupVersion.WithResource("meshes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Appmesh().V1beta1().Meshes().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("virtualnodes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Appmesh().V1beta1().VirtualNodes().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("virtualservices"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Appmesh().V1beta1().VirtualServices().Informer()}, nil // Group=flagger.app, Version=v1alpha3 case v1alpha3.SchemeGroupVersion.WithResource("canaries"): diff --git a/pkg/client/listers/appmesh/v1alpha1/mesh.go b/pkg/client/listers/appmesh/v1alpha1/mesh.go deleted file mode 100644 index 19ba807ae..000000000 --- a/pkg/client/listers/appmesh/v1alpha1/mesh.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -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/weaveworks/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/expansion_generated.go b/pkg/client/listers/appmesh/v1beta1/expansion_generated.go similarity index 89% rename from pkg/client/listers/appmesh/v1alpha1/expansion_generated.go rename to pkg/client/listers/appmesh/v1beta1/expansion_generated.go index 2c7aa859d..c3100366d 100644 --- a/pkg/client/listers/appmesh/v1alpha1/expansion_generated.go +++ b/pkg/client/listers/appmesh/v1beta1/expansion_generated.go @@ -16,16 +16,12 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 // 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{} diff --git a/pkg/client/listers/appmesh/v1beta1/mesh.go b/pkg/client/listers/appmesh/v1beta1/mesh.go new file mode 100644 index 000000000..3d632b668 --- /dev/null +++ b/pkg/client/listers/appmesh/v1beta1/mesh.go @@ -0,0 +1,65 @@ +/* +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 v1beta1 + +import ( + v1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" + "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 []*v1beta1.Mesh, err error) + // Get retrieves the Mesh from the index for a given name. + Get(name string) (*v1beta1.Mesh, error) + 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 []*v1beta1.Mesh, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Mesh)) + }) + return ret, err +} + +// Get retrieves the Mesh from the index for a given name. +func (s *meshLister) Get(name string) (*v1beta1.Mesh, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("mesh"), name) + } + return obj.(*v1beta1.Mesh), nil +} diff --git a/pkg/client/listers/appmesh/v1alpha1/virtualnode.go b/pkg/client/listers/appmesh/v1beta1/virtualnode.go similarity index 80% rename from pkg/client/listers/appmesh/v1alpha1/virtualnode.go rename to pkg/client/listers/appmesh/v1beta1/virtualnode.go index f1bf0d88a..9ec949f5e 100644 --- a/pkg/client/listers/appmesh/v1alpha1/virtualnode.go +++ b/pkg/client/listers/appmesh/v1beta1/virtualnode.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( - v1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + v1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -28,7 +28,7 @@ import ( // VirtualNodeLister helps list VirtualNodes. type VirtualNodeLister interface { // List lists all VirtualNodes in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.VirtualNode, err error) + List(selector labels.Selector) (ret []*v1beta1.VirtualNode, err error) // VirtualNodes returns an object that can list and get VirtualNodes. VirtualNodes(namespace string) VirtualNodeNamespaceLister VirtualNodeListerExpansion @@ -45,9 +45,9 @@ func NewVirtualNodeLister(indexer cache.Indexer) VirtualNodeLister { } // List lists all VirtualNodes in the indexer. -func (s *virtualNodeLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualNode, err error) { +func (s *virtualNodeLister) List(selector labels.Selector) (ret []*v1beta1.VirtualNode, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VirtualNode)) + ret = append(ret, m.(*v1beta1.VirtualNode)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *virtualNodeLister) VirtualNodes(namespace string) VirtualNodeNamespaceL // 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) + List(selector labels.Selector) (ret []*v1beta1.VirtualNode, err error) // Get retrieves the VirtualNode from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.VirtualNode, error) + Get(name string) (*v1beta1.VirtualNode, error) VirtualNodeNamespaceListerExpansion } @@ -74,21 +74,21 @@ type virtualNodeNamespaceLister struct { } // List lists all VirtualNodes in the indexer for a given namespace. -func (s virtualNodeNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualNode, err error) { +func (s virtualNodeNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VirtualNode, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VirtualNode)) + ret = append(ret, m.(*v1beta1.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) { +func (s virtualNodeNamespaceLister) Get(name string) (*v1beta1.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 nil, errors.NewNotFound(v1beta1.Resource("virtualnode"), name) } - return obj.(*v1alpha1.VirtualNode), nil + return obj.(*v1beta1.VirtualNode), nil } diff --git a/pkg/client/listers/appmesh/v1alpha1/virtualservice.go b/pkg/client/listers/appmesh/v1beta1/virtualservice.go similarity index 79% rename from pkg/client/listers/appmesh/v1alpha1/virtualservice.go rename to pkg/client/listers/appmesh/v1beta1/virtualservice.go index 2d6c2118a..cb052d735 100644 --- a/pkg/client/listers/appmesh/v1alpha1/virtualservice.go +++ b/pkg/client/listers/appmesh/v1beta1/virtualservice.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( - v1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + v1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -28,7 +28,7 @@ import ( // VirtualServiceLister helps list VirtualServices. type VirtualServiceLister interface { // List lists all VirtualServices in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.VirtualService, err error) + List(selector labels.Selector) (ret []*v1beta1.VirtualService, err error) // VirtualServices returns an object that can list and get VirtualServices. VirtualServices(namespace string) VirtualServiceNamespaceLister VirtualServiceListerExpansion @@ -45,9 +45,9 @@ func NewVirtualServiceLister(indexer cache.Indexer) VirtualServiceLister { } // List lists all VirtualServices in the indexer. -func (s *virtualServiceLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualService, err error) { +func (s *virtualServiceLister) List(selector labels.Selector) (ret []*v1beta1.VirtualService, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VirtualService)) + ret = append(ret, m.(*v1beta1.VirtualService)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *virtualServiceLister) VirtualServices(namespace string) VirtualServiceN // 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) + List(selector labels.Selector) (ret []*v1beta1.VirtualService, err error) // Get retrieves the VirtualService from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.VirtualService, error) + Get(name string) (*v1beta1.VirtualService, error) VirtualServiceNamespaceListerExpansion } @@ -74,21 +74,21 @@ type virtualServiceNamespaceLister struct { } // List lists all VirtualServices in the indexer for a given namespace. -func (s virtualServiceNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualService, err error) { +func (s virtualServiceNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VirtualService, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VirtualService)) + ret = append(ret, m.(*v1beta1.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) { +func (s virtualServiceNamespaceLister) Get(name string) (*v1beta1.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 nil, errors.NewNotFound(v1beta1.Resource("virtualservice"), name) } - return obj.(*v1alpha1.VirtualService), nil + return obj.(*v1beta1.VirtualService), nil } diff --git a/pkg/router/appmesh.go b/pkg/router/appmesh.go index 027917d1f..6b516b19d 100644 --- a/pkg/router/appmesh.go +++ b/pkg/router/appmesh.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - appmeshv1alpha1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1alpha1" + AppmeshV1beta1 "github.com/weaveworks/flagger/pkg/apis/appmesh/v1beta1" flaggerv1 "github.com/weaveworks/flagger/pkg/apis/flagger/v1alpha3" clientset "github.com/weaveworks/flagger/pkg/client/clientset/versioned" "go.uber.org/zap" @@ -69,27 +69,27 @@ func (ar *AppMeshRouter) Reconcile(canary *flaggerv1.Canary) error { // reconcileVirtualNode creates or updates a virtual node // the virtual node naming format is name-role-namespace func (ar *AppMeshRouter) reconcileVirtualNode(canary *flaggerv1.Canary, name string, host string) error { - vnSpec := &appmeshv1alpha1.VirtualNodeSpec{ + vnSpec := AppmeshV1beta1.VirtualNodeSpec{ MeshName: canary.Spec.Service.MeshName, - Listeners: []appmeshv1alpha1.Listener{ + Listeners: []AppmeshV1beta1.Listener{ { - PortMapping: appmeshv1alpha1.PortMapping{ + PortMapping: AppmeshV1beta1.PortMapping{ Port: int64(canary.Spec.Service.Port), Protocol: "http", }, }, }, - ServiceDiscovery: &appmeshv1alpha1.ServiceDiscovery{ - Dns: &appmeshv1alpha1.DnsServiceDiscovery{ + ServiceDiscovery: &AppmeshV1beta1.ServiceDiscovery{ + Dns: &AppmeshV1beta1.DnsServiceDiscovery{ HostName: host, }, }, } - backends := []appmeshv1alpha1.Backend{} + backends := []AppmeshV1beta1.Backend{} for _, b := range canary.Spec.Service.Backends { - backend := appmeshv1alpha1.Backend{ - VirtualService: appmeshv1alpha1.VirtualServiceBackend{ + backend := AppmeshV1beta1.Backend{ + VirtualService: AppmeshV1beta1.VirtualServiceBackend{ VirtualServiceName: b, }, } @@ -99,11 +99,11 @@ func (ar *AppMeshRouter) reconcileVirtualNode(canary *flaggerv1.Canary, name str vnSpec.Backends = backends } - virtualnode, err := ar.appmeshClient.AppmeshV1alpha1().VirtualNodes(canary.Namespace).Get(name, metav1.GetOptions{}) + virtualnode, err := ar.appmeshClient.AppmeshV1beta1().VirtualNodes(canary.Namespace).Get(name, metav1.GetOptions{}) // create virtual node if errors.IsNotFound(err) { - virtualnode = &appmeshv1alpha1.VirtualNode{ + virtualnode = &AppmeshV1beta1.VirtualNode{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: canary.Namespace, @@ -117,7 +117,7 @@ func (ar *AppMeshRouter) reconcileVirtualNode(canary *flaggerv1.Canary, name str }, Spec: vnSpec, } - _, err = ar.appmeshClient.AppmeshV1alpha1().VirtualNodes(canary.Namespace).Create(virtualnode) + _, err = ar.appmeshClient.AppmeshV1beta1().VirtualNodes(canary.Namespace).Create(virtualnode) if err != nil { return fmt.Errorf("VirtualNode %s.%s create error %v", name, canary.Namespace, err) } @@ -135,7 +135,7 @@ func (ar *AppMeshRouter) reconcileVirtualNode(canary *flaggerv1.Canary, name str if diff := cmp.Diff(vnSpec, virtualnode.Spec); diff != "" { vnClone := virtualnode.DeepCopy() vnClone.Spec = vnSpec - _, err = ar.appmeshClient.AppmeshV1alpha1().VirtualNodes(canary.Namespace).Update(vnClone) + _, err = ar.appmeshClient.AppmeshV1beta1().VirtualNodes(canary.Namespace).Update(vnClone) if err != nil { return fmt.Errorf("VirtualNode %s update error %v", name, err) } @@ -161,20 +161,20 @@ func (ar *AppMeshRouter) reconcileVirtualService(canary *flaggerv1.Canary, name routePrefix = canary.Spec.Service.Match[0].Uri.Prefix } - vsSpec := &appmeshv1alpha1.VirtualServiceSpec{ + vsSpec := AppmeshV1beta1.VirtualServiceSpec{ MeshName: canary.Spec.Service.MeshName, - VirtualRouter: &appmeshv1alpha1.VirtualRouter{ + VirtualRouter: &AppmeshV1beta1.VirtualRouter{ Name: fmt.Sprintf("%s-router", targetName), }, - Routes: []appmeshv1alpha1.Route{ + Routes: []AppmeshV1beta1.Route{ { Name: fmt.Sprintf("%s-route", targetName), - Http: appmeshv1alpha1.HttpRoute{ - Match: appmeshv1alpha1.HttpRouteMatch{ + Http: AppmeshV1beta1.HttpRoute{ + Match: AppmeshV1beta1.HttpRouteMatch{ Prefix: routePrefix, }, - Action: appmeshv1alpha1.HttpRouteAction{ - WeightedTargets: []appmeshv1alpha1.WeightedTarget{ + Action: AppmeshV1beta1.HttpRouteAction{ + WeightedTargets: []AppmeshV1beta1.WeightedTarget{ { VirtualNodeName: canaryVirtualNode, Weight: 0, @@ -190,11 +190,11 @@ func (ar *AppMeshRouter) reconcileVirtualService(canary *flaggerv1.Canary, name }, } - virtualService, err := ar.appmeshClient.AppmeshV1alpha1().VirtualServices(canary.Namespace).Get(name, metav1.GetOptions{}) + virtualService, err := ar.appmeshClient.AppmeshV1beta1().VirtualServices(canary.Namespace).Get(name, metav1.GetOptions{}) // create virtual service if errors.IsNotFound(err) { - virtualService = &appmeshv1alpha1.VirtualService{ + virtualService = &AppmeshV1beta1.VirtualService{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: canary.Namespace, @@ -208,7 +208,7 @@ func (ar *AppMeshRouter) reconcileVirtualService(canary *flaggerv1.Canary, name }, Spec: vsSpec, } - _, err = ar.appmeshClient.AppmeshV1alpha1().VirtualServices(canary.Namespace).Create(virtualService) + _, err = ar.appmeshClient.AppmeshV1beta1().VirtualServices(canary.Namespace).Create(virtualService) if err != nil { return fmt.Errorf("VirtualService %s create error %v", name, err) } @@ -223,12 +223,12 @@ func (ar *AppMeshRouter) reconcileVirtualService(canary *flaggerv1.Canary, name // update virtual service but keep the original target weights if virtualService != nil { - if diff := cmp.Diff(vsSpec, virtualService.Spec, cmpopts.IgnoreTypes(appmeshv1alpha1.WeightedTarget{})); diff != "" { + if diff := cmp.Diff(vsSpec, virtualService.Spec, cmpopts.IgnoreTypes(AppmeshV1beta1.WeightedTarget{})); diff != "" { vsClone := virtualService.DeepCopy() vsClone.Spec = vsSpec vsClone.Spec.Routes[0].Http.Action = virtualService.Spec.Routes[0].Http.Action - _, err = ar.appmeshClient.AppmeshV1alpha1().VirtualServices(canary.Namespace).Update(vsClone) + _, err = ar.appmeshClient.AppmeshV1beta1().VirtualServices(canary.Namespace).Update(vsClone) if err != nil { return fmt.Errorf("VirtualService %s update error %v", name, err) } @@ -248,7 +248,7 @@ func (ar *AppMeshRouter) GetRoutes(canary *flaggerv1.Canary) ( ) { targetName := canary.Spec.TargetRef.Name vsName := fmt.Sprintf("%s.%s", targetName, canary.Namespace) - vs, err := ar.appmeshClient.AppmeshV1alpha1().VirtualServices(canary.Namespace).Get(vsName, metav1.GetOptions{}) + vs, err := ar.appmeshClient.AppmeshV1beta1().VirtualServices(canary.Namespace).Get(vsName, metav1.GetOptions{}) if err != nil { if errors.IsNotFound(err) { err = fmt.Errorf("VirtualService %s not found", vsName) @@ -289,7 +289,7 @@ func (ar *AppMeshRouter) SetRoutes( ) error { targetName := canary.Spec.TargetRef.Name vsName := fmt.Sprintf("%s.%s", targetName, canary.Namespace) - vs, err := ar.appmeshClient.AppmeshV1alpha1().VirtualServices(canary.Namespace).Get(vsName, metav1.GetOptions{}) + vs, err := ar.appmeshClient.AppmeshV1beta1().VirtualServices(canary.Namespace).Get(vsName, metav1.GetOptions{}) if err != nil { if errors.IsNotFound(err) { return fmt.Errorf("VirtualService %s not found", vsName) @@ -298,8 +298,8 @@ func (ar *AppMeshRouter) SetRoutes( } vsClone := vs.DeepCopy() - vsClone.Spec.Routes[0].Http.Action = appmeshv1alpha1.HttpRouteAction{ - WeightedTargets: []appmeshv1alpha1.WeightedTarget{ + vsClone.Spec.Routes[0].Http.Action = AppmeshV1beta1.HttpRouteAction{ + WeightedTargets: []AppmeshV1beta1.WeightedTarget{ { VirtualNodeName: fmt.Sprintf("%s-canary", targetName), Weight: int64(canaryWeight), @@ -311,7 +311,7 @@ func (ar *AppMeshRouter) SetRoutes( }, } - _, err = ar.appmeshClient.AppmeshV1alpha1().VirtualServices(canary.Namespace).Update(vsClone) + _, err = ar.appmeshClient.AppmeshV1beta1().VirtualServices(canary.Namespace).Update(vsClone) if err != nil { return fmt.Errorf("VirtualService %s update error %v", vsName, err) } diff --git a/pkg/router/appmesh_test.go b/pkg/router/appmesh_test.go index 756a77f1e..0fbed858e 100644 --- a/pkg/router/appmesh_test.go +++ b/pkg/router/appmesh_test.go @@ -6,7 +6,7 @@ import ( "testing" ) -func TestAppmeshRouter_Sync(t *testing.T) { +func TestAppmeshRouter_Reconcile(t *testing.T) { mocks := setupfakeClients() router := &AppMeshRouter{ logger: mocks.logger, @@ -22,7 +22,7 @@ func TestAppmeshRouter_Sync(t *testing.T) { // check virtual service vsName := fmt.Sprintf("%s.%s", mocks.appmeshCanary.Spec.TargetRef.Name, mocks.appmeshCanary.Namespace) - vs, err := router.appmeshClient.AppmeshV1alpha1().VirtualServices("default").Get(vsName, metav1.GetOptions{}) + vs, err := router.appmeshClient.AppmeshV1beta1().VirtualServices("default").Get(vsName, metav1.GetOptions{}) if err != nil { t.Fatal(err.Error()) } @@ -39,7 +39,7 @@ func TestAppmeshRouter_Sync(t *testing.T) { // check virtual node vnName := mocks.appmeshCanary.Spec.TargetRef.Name - vn, err := router.appmeshClient.AppmeshV1alpha1().VirtualNodes("default").Get(vnName, metav1.GetOptions{}) + vn, err := router.appmeshClient.AppmeshV1beta1().VirtualNodes("default").Get(vnName, metav1.GetOptions{}) if err != nil { t.Fatal(err.Error()) } @@ -73,7 +73,7 @@ func TestAppmeshRouter_Sync(t *testing.T) { // verify vnCanaryName := fmt.Sprintf("%s-canary", mocks.appmeshCanary.Spec.TargetRef.Name) - vnCanary, err := router.appmeshClient.AppmeshV1alpha1().VirtualNodes("default").Get(vnCanaryName, metav1.GetOptions{}) + vnCanary, err := router.appmeshClient.AppmeshV1beta1().VirtualNodes("default").Get(vnCanaryName, metav1.GetOptions{}) if err != nil { t.Fatal(err.Error()) } @@ -86,7 +86,7 @@ func TestAppmeshRouter_Sync(t *testing.T) { vsClone := vs.DeepCopy() vsClone.Spec.Routes[0].Http.Action.WeightedTargets[0].Weight = 50 vsClone.Spec.Routes[0].Http.Action.WeightedTargets[1].Weight = 50 - vs, err = mocks.meshClient.AppmeshV1alpha1().VirtualServices("default").Update(vsClone) + vs, err = mocks.meshClient.AppmeshV1beta1().VirtualServices("default").Update(vsClone) if err != nil { t.Fatal(err.Error()) } @@ -96,7 +96,7 @@ func TestAppmeshRouter_Sync(t *testing.T) { if err != nil { t.Fatal(err.Error()) } - vs, err = router.appmeshClient.AppmeshV1alpha1().VirtualServices("default").Get(vsName, metav1.GetOptions{}) + vs, err = router.appmeshClient.AppmeshV1beta1().VirtualServices("default").Get(vsName, metav1.GetOptions{}) if err != nil { t.Fatal(err.Error()) } @@ -109,7 +109,7 @@ func TestAppmeshRouter_Sync(t *testing.T) { // test URI update vsClone = vs.DeepCopy() vsClone.Spec.Routes[0].Http.Match.Prefix = "api" - vs, err = mocks.meshClient.AppmeshV1alpha1().VirtualServices("default").Update(vsClone) + vs, err = mocks.meshClient.AppmeshV1beta1().VirtualServices("default").Update(vsClone) if err != nil { t.Fatal(err.Error()) } @@ -119,7 +119,7 @@ func TestAppmeshRouter_Sync(t *testing.T) { if err != nil { t.Fatal(err.Error()) } - vs, err = router.appmeshClient.AppmeshV1alpha1().VirtualServices("default").Get(vsName, metav1.GetOptions{}) + vs, err = router.appmeshClient.AppmeshV1beta1().VirtualServices("default").Get(vsName, metav1.GetOptions{}) if err != nil { t.Fatal(err.Error()) }