Skip to content

Commit abb3a12

Browse files
committed
fix: r
Signed-off-by: ashing <[email protected]>
1 parent 3f0e5f1 commit abb3a12

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

internal/controller/ingress_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ func (r *IngressReconciler) processIngressClassParameters(ctx context.Context, t
647647

648648
parameters := ingressClass.Spec.Parameters
649649
// check if the parameters reference GatewayProxy
650-
if parameters.APIGroup != nil && *parameters.APIGroup == v1alpha1.GroupVersion.Group && parameters.Kind == "GatewayProxy" {
650+
if parameters.APIGroup != nil && *parameters.APIGroup == v1alpha1.GroupVersion.Group && parameters.Kind == KindGatewayProxy {
651651
ns := ingress.GetNamespace()
652652
if parameters.Namespace != nil {
653653
ns = *parameters.Namespace

internal/controller/ingressclass_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (r *IngressClassReconciler) processInfrastructure(tctx *provider.TranslateC
129129

130130
if ingressClass.Spec.Parameters.APIGroup == nil ||
131131
*ingressClass.Spec.Parameters.APIGroup != v1alpha1.GroupVersion.Group ||
132-
ingressClass.Spec.Parameters.Kind != "GatewayProxy" {
132+
ingressClass.Spec.Parameters.Kind != KindGatewayProxy {
133133
return nil
134134
}
135135

internal/controller/utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const (
2727
KindGatewayClass = "GatewayClass"
2828
KindIngress = "Ingress"
2929
KindIngressClass = "IngressClass"
30+
KindGatewayProxy = "GatewayProxy"
3031
)
3132

3233
const defaultIngressClassAnnotation = "ingressclass.kubernetes.io/is-default-class"
@@ -783,7 +784,7 @@ func ProcessGatewayProxy(r client.Client, tctx *provider.TranslateContext, gatew
783784

784785
ns := gateway.GetNamespace()
785786
paramRef := infra.ParametersRef
786-
if string(paramRef.Group) == v1alpha1.GroupVersion.Group && string(paramRef.Kind) == "GatewayProxy" {
787+
if string(paramRef.Group) == v1alpha1.GroupVersion.Group && string(paramRef.Kind) == KindGatewayProxy {
787788
gatewayProxy := &v1alpha1.GatewayProxy{}
788789
if err := r.Get(context.Background(), client.ObjectKey{
789790
Namespace: ns,

0 commit comments

Comments
 (0)