Skip to content

Commit

Permalink
Fix rl key not deleted bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Tharsanan1 committed Sep 9, 2024
1 parent 042d015 commit fabe810
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion adapter/internal/operator/controllers/dp/api_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ func (apiReconciler *APIReconciler) getAPIsForAIRatelimitPolicy(ctx context.Cont
}

if aiRatelimitPolicy.Spec.TargetRef.Kind == constants.KindBackend {
backend := &dpv1alpha1.Backend{}
backend := &dpv1alpha2.Backend{}
namespacedName := types.NamespacedName{
Name: string(aiRatelimitPolicy.Spec.TargetRef.Name),
Namespace: utils.GetNamespace(aiRatelimitPolicy.Spec.TargetRef.Namespace, aiRatelimitPolicy.GetNamespace()),
Expand Down
6 changes: 1 addition & 5 deletions common-controller/internal/xds/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,7 @@ func UpdateRateLimitXDSCacheForCustomPolicies(customRateLimitPolicies dpv1alpha1

// UpdateRateLimitXDSCacheForAIRatelimitPolicies updates the xDS cache of the RateLimiter for AI ratelimit policies.
func UpdateRateLimitXDSCacheForAIRatelimitPolicies(aiRatelimitPolicySpecs map[apimachiner_types.NamespacedName]*dpv1alpha3.AIRateLimitPolicySpec) {
loggers.LoggerAPKOperator.Infof("000000")
if len(aiRatelimitPolicySpecs) != 0 {
loggers.LoggerAPKOperator.Infof("1111111")
rlsPolicyCache.ProcessAIRatelimitPolicySpecsAndUpdateCache(aiRatelimitPolicySpecs)
}
rlsPolicyCache.ProcessAIRatelimitPolicySpecsAndUpdateCache(aiRatelimitPolicySpecs)
}

// DeleteAPILevelRateLimitPolicies delete the ratelimit xds cache
Expand Down
16 changes: 16 additions & 0 deletions common-go-libs/apis/cp/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fabe810

Please sign in to comment.