Skip to content

Commit 2a327ce

Browse files
committed
fix ci
1 parent b5e86ab commit 2a327ce

File tree

8 files changed

+26
-22
lines changed

8 files changed

+26
-22
lines changed

internal/controller/apisixconsumer_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type ApisixConsumerReconciler struct {
5555
Updater status.Updater
5656
Readier readiness.ReadinessManager
5757

58-
ICGVK schema.GroupVersionKind
58+
ICGV schema.GroupVersion
5959
}
6060

6161
// Reconcile FIXME: implement the reconcile logic (For now, it dose nothing other than directly accepting)
@@ -90,7 +90,7 @@ func (r *ApisixConsumerReconciler) Reconcile(ctx context.Context, req ctrl.Reque
9090
r.updateStatus(ac, err)
9191
}()
9292

93-
ingressClass, err = GetIngressClass(tctx, r.Client, r.Log, ac.Spec.IngressClassName, r.ICGVK.Version)
93+
ingressClass, err = GetIngressClass(tctx, r.Client, r.Log, ac.Spec.IngressClassName, r.ICGV.String())
9494
if err != nil {
9595
r.Log.Error(err, "failed to get IngressClass")
9696
return ctrl.Result{}, err
@@ -149,7 +149,7 @@ func (r *ApisixConsumerReconciler) checkIngressClass(obj client.Object) bool {
149149
return false
150150
}
151151

152-
return matchesIngressClass(context.Background(), r.Client, r.Log, ac.Spec.IngressClassName, r.ICGVK.Version)
152+
return matchesIngressClass(context.Background(), r.Client, r.Log, ac.Spec.IngressClassName, r.ICGV.String())
153153
}
154154

155155
func (r *ApisixConsumerReconciler) listApisixConsumerForGatewayProxy(ctx context.Context, obj client.Object) []reconcile.Request {

internal/controller/apisixglobalrule_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type ApisixGlobalRuleReconciler struct {
5252

5353
Readier readiness.ReadinessManager
5454

55-
ICGVK schema.GroupVersionKind
55+
ICGV schema.GroupVersion
5656
}
5757

5858
// Reconcile implements the reconciliation logic for ApisixGlobalRule
@@ -85,7 +85,7 @@ func (r *ApisixGlobalRuleReconciler) Reconcile(ctx context.Context, req ctrl.Req
8585
tctx := provider.NewDefaultTranslateContext(ctx)
8686

8787
// get the ingress class
88-
ingressClass, err := GetIngressClass(tctx, r.Client, r.Log, globalRule.Spec.IngressClassName, r.ICGVK.Version)
88+
ingressClass, err := GetIngressClass(tctx, r.Client, r.Log, globalRule.Spec.IngressClassName, r.ICGV.String())
8989
if err != nil {
9090
r.Log.Error(err, "failed to get IngressClass")
9191
return ctrl.Result{}, err
@@ -160,7 +160,7 @@ func (r *ApisixGlobalRuleReconciler) checkIngressClass(obj client.Object) bool {
160160
return false
161161
}
162162

163-
return matchesIngressClass(context.Background(), r.Client, r.Log, globalRule.Spec.IngressClassName, r.ICGVK.Version)
163+
return matchesIngressClass(context.Background(), r.Client, r.Log, globalRule.Spec.IngressClassName, r.ICGV.Version)
164164
}
165165

166166
// listGlobalRulesForIngressClass list all global rules that use a specific ingress class

internal/controller/apisixpluginconfig_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type ApisixPluginConfigReconciler struct {
4040
Log logr.Logger
4141
Updater status.Updater
4242

43-
ICGVK schema.GroupVersionKind
43+
ICGV schema.GroupVersion
4444
}
4545

4646
// SetupWithManager sets up the controller with the Manager.

internal/controller/apisixroute_controller.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ type ApisixRouteReconciler struct {
6363
Updater status.Updater
6464
Readier readiness.ReadinessManager
6565

66-
ICGVK schema.GroupVersionKind
66+
ICGV schema.GroupVersion
6767
// supportsEndpointSlice indicates whether the cluster supports EndpointSlice API
6868
supportsEndpointSlice bool
6969
}
@@ -150,7 +150,7 @@ func (r *ApisixRouteReconciler) Reconcile(ctx context.Context, req ctrl.Request)
150150
r.updateStatus(&ar, err)
151151
}()
152152

153-
if ic, err = GetIngressClass(tctx, r.Client, r.Log, ar.Spec.IngressClassName, r.ICGVK.Version); err != nil {
153+
if ic, err = GetIngressClass(tctx, r.Client, r.Log, ar.Spec.IngressClassName, r.ICGV.String()); err != nil {
154154
return ctrl.Result{}, err
155155
}
156156
if err = ProcessIngressClassParameters(tctx, r.Client, r.Log, &ar, ic); err != nil {
@@ -255,7 +255,11 @@ func (r *ApisixRouteReconciler) validatePluginConfig(ctx context.Context, tc *pr
255255
// Check if ApisixPluginConfig has IngressClassName and if it matches
256256
if in.Spec.IngressClassName != pc.Spec.IngressClassName && pc.Spec.IngressClassName != "" {
257257
ic := &unstructured.Unstructured{}
258-
ic.SetGroupVersionKind(r.ICGVK)
258+
ic.SetGroupVersionKind(schema.GroupVersionKind{
259+
Group: r.ICGV.Group,
260+
Version: r.ICGV.Version,
261+
Kind: types.KindIngressClass,
262+
})
259263
if err := r.Get(ctx, client.ObjectKey{Name: pc.Spec.IngressClassName}, ic); err != nil {
260264
return types.ReasonError{
261265
Reason: string(apiv2.ConditionReasonInvalidSpec),

internal/controller/apisixtls_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type ApisixTlsReconciler struct {
5353
Updater status.Updater
5454
Readier readiness.ReadinessManager
5555

56-
ICGVK schema.GroupVersionKind
56+
ICGV schema.GroupVersion
5757
}
5858

5959
// SetupWithManager sets up the controller with the Manager.
@@ -117,7 +117,7 @@ func (r *ApisixTlsReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
117117
tctx := provider.NewDefaultTranslateContext(ctx)
118118

119119
// get the ingress class
120-
ingressClass, err := GetIngressClass(tctx, r.Client, r.Log, tls.Spec.IngressClassName, r.ICGVK.Version)
120+
ingressClass, err := GetIngressClass(tctx, r.Client, r.Log, tls.Spec.IngressClassName, r.ICGV.String())
121121
if err != nil {
122122
r.Log.Error(err, "failed to get IngressClass")
123123
r.updateStatus(&tls, metav1.Condition{
@@ -242,7 +242,7 @@ func (r *ApisixTlsReconciler) checkIngressClass(obj client.Object) bool {
242242
return false
243243
}
244244

245-
return matchesIngressClass(context.Background(), r.Client, r.Log, tls.Spec.IngressClassName, r.ICGVK.Version)
245+
return matchesIngressClass(context.Background(), r.Client, r.Log, tls.Spec.IngressClassName, r.ICGV.String())
246246
}
247247

248248
func (r *ApisixTlsReconciler) listApisixTlsForSecret(ctx context.Context, obj client.Object) []reconcile.Request {

internal/controller/apisixupstream_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type ApisixUpstreamReconciler struct {
3939
Log logr.Logger
4040
Updater status.Updater
4141

42-
ICGVK schema.GroupVersionKind
42+
ICGV schema.GroupVersion
4343
}
4444

4545
// SetupWithManager sets up the controller with the Manager.

internal/controller/gatewayproxy_controller.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type GatewayProxyController struct {
5252
Log logr.Logger
5353
Provider provider.Provider
5454

55-
ICGVK schema.GroupVersionKind
55+
ICGV schema.GroupVersion
5656
// supportsEndpointSlice indicates whether the cluster supports EndpointSlice API
5757
supportsEndpointSlice bool
5858
supportsGateway bool
@@ -158,8 +158,8 @@ func (r *GatewayProxyController) Reconcile(ctx context.Context, req ctrl.Request
158158
}
159159
}
160160

161-
switch r.ICGVK.Version {
162-
case networkingv1.SchemeGroupVersion.Version, "":
161+
switch r.ICGV.String() {
162+
case networkingv1.SchemeGroupVersion.String(), "":
163163
var ingressClassList networkingv1.IngressClassList
164164
// list IngressClasses that reference the GatewayProxy
165165
if err := r.List(ctx, &ingressClassList, client.MatchingFields{indexer.IngressClassParametersRef: indexKey}); err != nil {
@@ -170,7 +170,7 @@ func (r *GatewayProxyController) Reconcile(ctx context.Context, req ctrl.Request
170170
for _, item := range ingressClassList.Items {
171171
tctx.GatewayProxyReferrers[req.NamespacedName] = append(tctx.GatewayProxyReferrers[req.NamespacedName], utils.NamespacedNameKind(&item))
172172
}
173-
case networkingv1beta1.SchemeGroupVersion.Version:
173+
case networkingv1beta1.SchemeGroupVersion.String():
174174
var ingressClassList networkingv1beta1.IngressClassList
175175
// list IngressClasses that reference the GatewayProxy
176176
if err := r.List(ctx, &ingressClassList, client.MatchingFields{indexer.IngressClassParametersRef: indexKey}); err != nil {

internal/manager/controllers.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ func setupControllers(ctx context.Context, mgr manager.Manager, pro provider.Pro
105105
setupLog := ctrl.LoggerFrom(ctx).WithName("setup")
106106
var controllers []Controller
107107

108-
icgvk := types.GvkOf(&v1.IngressClass{})
108+
icgv := v1.SchemeGroupVersion
109109
if !utils.HasAPIResource(mgr, &v1.IngressClass{}) {
110110
setupLog.Info("IngressClass v1 not found, falling back to IngressClass v1beta1")
111-
icgvk = types.GvkOf(&v1beta1.IngressClass{})
111+
icgv = v1beta1.SchemeGroupVersion
112112
controllers = append(controllers, &controller.IngressClassV1beta1Reconciler{
113113
Client: mgr.GetClient(),
114114
Scheme: mgr.GetScheme(),
@@ -177,7 +177,7 @@ func setupControllers(ctx context.Context, mgr manager.Manager, pro provider.Pro
177177
Scheme: mgr.GetScheme(),
178178
Log: ctrl.LoggerFrom(ctx).WithName("controllers").WithName("GatewayProxy"),
179179
Provider: pro,
180-
ICGVK: icgvk,
180+
ICGV: icgv,
181181
},
182182
&controller.ApisixRouteReconciler{
183183
Client: mgr.GetClient(),
@@ -186,7 +186,7 @@ func setupControllers(ctx context.Context, mgr manager.Manager, pro provider.Pro
186186
Provider: pro,
187187
Updater: updater,
188188
Readier: readier,
189-
ICGVK: icgvk,
189+
ICGV: icgv,
190190
},
191191
/*
192192
&controller.ApisixGlobalRuleReconciler{

0 commit comments

Comments
 (0)