@@ -13,9 +13,8 @@ import (
1313)
1414
1515const (
16- hrqNameLabel = "hnc.x-k8s.io/hrq-name"
17- hrqNamespaceLabel = "hnc.x-k8s.io/hrq-namespace"
18- newScopedRQAnnotation = "hnc.x-k8s.io/new-scoped-rq"
16+ hrqNameLabel = "hnc.x-k8s.io/hrq-name"
17+ hrqNamespaceLabel = "hnc.x-k8s.io/hrq-namespace"
1918)
2019
2120const (
@@ -48,10 +47,9 @@ func IsLegacyScopedRQ(rq *v1.ResourceQuota) bool {
4847 if ! IsHNCManagedRQ (rq ) {
4948 return false
5049 }
51- if v , ok := metadata .GetAnnotation (rq , newScopedRQAnnotation ); ok && v == "true" {
52- return false
53- }
54- return true
50+ _ , nsLabelFound := metadata .GetLabel (rq , hrqNamespaceLabel )
51+ _ , nameLabelFound := metadata .GetLabel (rq , hrqNameLabel )
52+ return ! nsLabelFound || ! nameLabelFound
5553}
5654
5755// LegacyScopedRQName generates the legacy RQ name for backward compatibility
@@ -94,7 +92,6 @@ func ScopedHRQNameFromRQ(rq *v1.ResourceQuota) (types.NamespacedName, error) {
9492func SetLabelsAnnotationsForScopedRQ (rq * v1.ResourceQuota , hrqNamespace string , hrqName string ) {
9593 metadata .SetLabel (rq , hrqNamespaceLabel , hrqNamespace )
9694 metadata .SetLabel (rq , hrqNameLabel , hrqName )
97- metadata .SetAnnotation (rq , newScopedRQAnnotation , "true" )
9895}
9996
10097func truncate (s string , n int ) string {
0 commit comments