Skip to content

Commit

Permalink
support custom name for ratelimit deployment (envoyproxy#4094)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkodg authored Aug 22, 2024
1 parent 0926b38 commit 2c54de2
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 2c54de2

Please sign in to comment.