Files
Oliver BählerandGitHub 2252c530f4 feat(performance): removed duplicate client calls from all admission paths (#2054)
* chore

* perfromance improvements

Signed-off-by: Oliver Baehler <oliver@sudo-i.net>

* perfromance improvements

Signed-off-by: Oliver Baehler <oliver@sudo-i.net>

* feat(performance): removed duplicate client calls from all admission paths

Signed-off-by: Oliver Baehler <oliver@sudo-i.net>

* feat(performance): removed duplicate client calls from all admission paths

Signed-off-by: Oliver Baehler <oliver@sudo-i.net>

* feat(performance): removed duplicate client calls from all admission paths

Signed-off-by: Oliver Baehler <oliver@sudo-i.net>

* feat(performance): removed duplicate client calls from all admission paths

Signed-off-by: Oliver Baehler <oliver@sudo-i.net>

* feat(performance): removed duplicate client calls from all admission paths

Signed-off-by: Oliver Baehler <oliver@sudo-i.net>

* feat(performance): removed duplicate client calls from all admission paths

Signed-off-by: Oliver Baehler <oliver@sudo-i.net>

* feat(performance): removed duplicate client calls from all admission paths

Signed-off-by: Oliver Baehler <oliver@sudo-i.net>

---------

Signed-off-by: Oliver Baehler <oliver@sudo-i.net>
2026-07-28 14:32:42 +02:00

36 lines
844 B
Go

// Copyright 2020-2026 Project Capsule Authors
// SPDX-License-Identifier: Apache-2.0
package quota
import (
"k8s.io/apimachinery/pkg/api/resource"
celruntime "github.com/projectcapsule/capsule/pkg/runtime/cel"
"github.com/projectcapsule/capsule/pkg/runtime/jsonpath"
)
// Overlay for Global/Namespace CustomQuotas.
type MatchedQuota struct {
Key string
Name string
Namespace string
Path string
CompiledPath *jsonpath.CompiledJSONPath
CEL string
CompiledCEL *celruntime.CompiledExpression
Operation Operation
Limit resource.Quantity
Used resource.Quantity
IsGlobal bool
SourceRank int
}
func MakeCustomQuotaCacheKey(namespace, name string) string {
return namespace + "/" + name
}
func MakeGlobalCustomQuotaCacheKey(name string) string {
return "C/" + name
}