diff --git a/Makefile b/Makefile index bb5dc8669..ef4b48684 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # Produce CRDs that work back to Kubernetes 1.11 (no version conversion) CRD_OPTIONS ?= "crd:trivialVersions=true" -GV="network:v1alpha1 servicemesh:v1alpha2 tenant:v1alpha1 tenant:v1alpha2 devops:v1alpha1 iam:v1alpha2 devops:v1alpha3 cluster:v1alpha1 storage:v1alpha1 auditing:v1alpha1 types:v1beta1 quota:v1alpha2 application:v1alpha1 notification:v2beta1" +GV="network:v1alpha1 servicemesh:v1alpha2 tenant:v1alpha1 tenant:v1alpha2 devops:v1alpha1 iam:v1alpha2 devops:v1alpha3 cluster:v1alpha1 storage:v1alpha1 auditing:v1alpha1 types:v1beta1 quota:v1alpha2 application:v1alpha1 notification:v2beta1 gateway:v1alpha1" MANIFESTS="application/* cluster/* iam/* network/v1alpha1 quota/* storage/* tenant/*" # App Version diff --git a/pkg/models/gateway/gateway.go b/pkg/models/gateway/gateway.go index 18108ca93..240581785 100644 --- a/pkg/models/gateway/gateway.go +++ b/pkg/models/gateway/gateway.go @@ -98,7 +98,7 @@ func (c *gatewayOperator) overideDefaultValue(gateway *v1alpha1.Gateway, namespa // overide default name gateway.Name = fmt.Sprint(gatewayPrefix, namespace) if gateway.Name != globalGatewayname { - gateway.Spec.Conroller.Scope = v1alpha1.Scope{Enabled: true, Namespace: namespace} + gateway.Spec.Controller.Scope = v1alpha1.Scope{Enabled: true, Namespace: namespace} } gateway.Namespace = c.getWorkingNamespace(namespace) return gateway @@ -155,7 +155,7 @@ func (c *gatewayOperator) convert(namespace string, svc *corev1.Service, deploy Namespace: svc.Namespace, }, Spec: v1alpha1.GatewaySpec{ - Conroller: v1alpha1.ControllerSpec{ + Controller: v1alpha1.ControllerSpec{ Scope: v1alpha1.Scope{ Enabled: true, Namespace: namespace, @@ -336,7 +336,7 @@ func (c *gatewayOperator) UpgradeGateway(namespace string) (*v1alpha1.Gateway, e cm := &corev1.ConfigMap{} err := c.client.Get(context.TODO(), client.ObjectKey{Namespace: l.Namespace, Name: fmt.Sprintf("%s-nginx", l.Name)}, cm) if err == nil { - l.Spec.Conroller.Config = cm.Data + l.Spec.Controller.Config = cm.Data defer func() { c.client.Delete(context.TODO(), cm) }() @@ -459,7 +459,7 @@ func (c *gatewayOperator) filter(object runtime.Object, filter query.Filter) boo namesapce = svc.Labels["project"] objMeta = svc.ObjectMeta } else { - namesapce = gateway.Spec.Conroller.Scope.Namespace + namesapce = gateway.Spec.Controller.Scope.Namespace objMeta = gateway.ObjectMeta } diff --git a/pkg/models/gateway/gateway_test.go b/pkg/models/gateway/gateway_test.go index 6a272566c..95f013605 100644 --- a/pkg/models/gateway/gateway_test.go +++ b/pkg/models/gateway/gateway_test.go @@ -169,7 +169,7 @@ func Test_gatewayOperator_GetGateways(t *testing.T) { Namespace: "kubesphere-controls-system", }, Spec: v1alpha1.GatewaySpec{ - Conroller: v1alpha1.ControllerSpec{ + Controller: v1alpha1.ControllerSpec{ Scope: v1alpha1.Scope{ Enabled: true, Namespace: "project6", @@ -343,7 +343,7 @@ func Test_gatewayOperator_CreateGateway(t *testing.T) { APIVersion: "gateway.kubesphere.io/v1alpha1", }, Spec: v1alpha1.GatewaySpec{ - Conroller: v1alpha1.ControllerSpec{ + Controller: v1alpha1.ControllerSpec{ Scope: v1alpha1.Scope{ Enabled: true, Namespace: "projct1", @@ -374,7 +374,7 @@ func Test_gatewayOperator_CreateGateway(t *testing.T) { APIVersion: "gateway.kubesphere.io/v1alpha1", }, Spec: v1alpha1.GatewaySpec{ - Conroller: v1alpha1.ControllerSpec{ + Controller: v1alpha1.ControllerSpec{ Scope: v1alpha1.Scope{ Enabled: true, Namespace: "projct2", @@ -506,7 +506,7 @@ func Test_gatewayOperator_UpdateGateway(t *testing.T) { ResourceVersion: "1", }, Spec: v1alpha1.GatewaySpec{ - Conroller: v1alpha1.ControllerSpec{ + Controller: v1alpha1.ControllerSpec{ Scope: v1alpha1.Scope{ Enabled: true, Namespace: "project3", @@ -615,7 +615,7 @@ func Test_gatewayOperator_UpgradeGateway(t *testing.T) { ResourceVersion: "1", }, Spec: v1alpha1.GatewaySpec{ - Conroller: v1alpha1.ControllerSpec{ + Controller: v1alpha1.ControllerSpec{ Scope: v1alpha1.Scope{ Enabled: true, Namespace: "project2", @@ -691,7 +691,7 @@ func Test_gatewayOperator_ListGateways(t *testing.T) { Namespace: "kubesphere-controls-system", }, Spec: v1alpha1.GatewaySpec{ - Conroller: v1alpha1.ControllerSpec{ + Controller: v1alpha1.ControllerSpec{ Scope: v1alpha1.Scope{ Enabled: true, Namespace: "project2", diff --git a/staging/src/kubesphere.io/api/gateway/v1alpha1/gateway_types.go b/staging/src/kubesphere.io/api/gateway/v1alpha1/gateway_types.go index 7a29220d4..8c461b806 100644 --- a/staging/src/kubesphere.io/api/gateway/v1alpha1/gateway_types.go +++ b/staging/src/kubesphere.io/api/gateway/v1alpha1/gateway_types.go @@ -24,7 +24,7 @@ import ( // GatewaySpec defines the desired state of Gateway type GatewaySpec struct { - Conroller ControllerSpec `json:"controller,omitempty"` + Controller ControllerSpec `json:"controller,omitempty"` Service ServiceSpec `json:"service,omitempty"` Deployment DeploymentSpec `json:"deployment,omitempty"` } diff --git a/staging/src/kubesphere.io/api/gateway/v1alpha1/zz_generated.deepcopy.go b/staging/src/kubesphere.io/api/gateway/v1alpha1/zz_generated.deepcopy.go index 07b724c38..733868269 100644 --- a/staging/src/kubesphere.io/api/gateway/v1alpha1/zz_generated.deepcopy.go +++ b/staging/src/kubesphere.io/api/gateway/v1alpha1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* @@ -141,7 +142,7 @@ func (in *GatewayList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GatewaySpec) DeepCopyInto(out *GatewaySpec) { *out = *in - in.Conroller.DeepCopyInto(&out.Conroller) + in.Controller.DeepCopyInto(&out.Controller) in.Service.DeepCopyInto(&out.Service) in.Deployment.DeepCopyInto(&out.Deployment) }