From f9d26f27bd1f81137d3678bbe024de8de532ead2 Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Wed, 21 Aug 2024 16:45:19 -0700 Subject: [PATCH] support custom name for ratelimit deployment * should have been part of https://github.com/envoyproxy/gateway/pull/3537 Signed-off-by: Arko Dasgupta --- .../kubernetes/ratelimit/resource_provider.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/infrastructure/kubernetes/ratelimit/resource_provider.go b/internal/infrastructure/kubernetes/ratelimit/resource_provider.go index 14d2a3d830b..e7519bb2569 100644 --- a/internal/infrastructure/kubernetes/ratelimit/resource_provider.go +++ b/internal/infrastructure/kubernetes/ratelimit/resource_provider.go @@ -208,7 +208,6 @@ func (r *ResourceRender) Deployment() (*appsv1.Deployment, error) { }, ObjectMeta: metav1.ObjectMeta{ Namespace: r.Namespace, - Name: InfraName, Labels: labels, }, Spec: appsv1.DeploymentSpec{ @@ -242,6 +241,13 @@ func (r *ResourceRender) Deployment() (*appsv1.Deployment, error) { }, } + // set name + if r.rateLimitDeployment.Name != nil { + deployment.ObjectMeta.Name = *r.rateLimitDeployment.Name + } else { + deployment.ObjectMeta.Name = r.Name() + } + if r.ownerReferenceUID != nil { if uid, ok := r.ownerReferenceUID[ResourceKindDeployment]; ok { deployment.OwnerReferences = []metav1.OwnerReference{