Skip to content

Commit

Permalink
support custom name for ratelimit deployment
Browse files Browse the repository at this point in the history
* should have been part of envoyproxy#3537

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
  • Loading branch information
arkodg committed Aug 21, 2024
1 parent 0926b38 commit f9d26f2
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ func (r *ResourceRender) Deployment() (*appsv1.Deployment, error) {
},
ObjectMeta: metav1.ObjectMeta{
Namespace: r.Namespace,
Name: InfraName,
Labels: labels,
},
Spec: appsv1.DeploymentSpec{
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit f9d26f2

Please sign in to comment.