diff --git a/operator/pkg/ingress/annotations/annotations.go b/operator/pkg/ingress/annotations/annotations.go index be610b2c82b0f..9b9c1fc18b2a0 100644 --- a/operator/pkg/ingress/annotations/annotations.go +++ b/operator/pkg/ingress/annotations/annotations.go @@ -47,6 +47,11 @@ const ( defaultWebsocketEnabled = 0 // 1 - Enabled, 0 - Disabled ) +const ( + LoadbalancerModeDedicated = "dedicated" + LoadbalancerModeShared = "shared" +) + // GetAnnotationIngressLoadbalancerMode returns the loadbalancer mode for the ingress if possible. func GetAnnotationIngressLoadbalancerMode(ingress *networkingv1.Ingress) string { value, _ := annotation.Get(ingress, LBModeAnnotation, LBModeAnnotationAlias) diff --git a/operator/pkg/ingress/ingress.go b/operator/pkg/ingress/ingress.go index dc8acb1802f2e..e1ea216e046c6 100644 --- a/operator/pkg/ingress/ingress.go +++ b/operator/pkg/ingress/ingress.go @@ -17,11 +17,7 @@ import ( const ( ciliumIngressPrefix = "cilium-ingress" - ciliumIngressLabelKey = "cilium.io/ingress" ciliumIngressClassName = "cilium" - - dedicatedLoadbalancerMode = "dedicated" - sharedLoadbalancerMode = "shared" ) // ingressReconciler reconciles a Ingress object diff --git a/operator/pkg/ingress/ingress_reconcile.go b/operator/pkg/ingress/ingress_reconcile.go index 80590ac7f77b1..6e091e742683a 100644 --- a/operator/pkg/ingress/ingress_reconcile.go +++ b/operator/pkg/ingress/ingress_reconcile.go @@ -427,11 +427,11 @@ func convertToNetworkV1IngressLoadBalancerIngress(lbIngresses []corev1.LoadBalan func (r *ingressReconciler) isEffectiveLoadbalancerModeDedicated(ing *networkingv1.Ingress) bool { value := annotations.GetAnnotationIngressLoadbalancerMode(ing) switch value { - case dedicatedLoadbalancerMode: + case annotations.LoadbalancerModeDedicated: return true - case sharedLoadbalancerMode: + case annotations.LoadbalancerModeShared: return false default: - return r.defaultLoadbalancerMode == dedicatedLoadbalancerMode + return r.defaultLoadbalancerMode == annotations.LoadbalancerModeDedicated } }