From 2c54de2ae85cc6f4e149458fa6b551345fc362da Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Wed, 21 Aug 2024 21:23:50 -0700 Subject: [PATCH] support custom name for ratelimit deployment (#4094) --- .../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{