chore: Cleanup Namespace.isControlledByHNC

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-04-21 14:11:15 -04:00
1 parent f0e0dd1ba7
commit bdc42901ba
1 file changed
+2 -4
@@ -34,7 +34,7 @@ export class Namespace extends KubeObject<
return this.status?.phase ?? "-";
}
isSubnamespace() {
isSubnamespace() {
return this.getAnnotations().find(annotation => annotation.includes("hnc.x-k8s.io/subnamespace-of"));
}
@@ -43,9 +43,7 @@ export class Namespace extends KubeObject<
}
isControlledByHNC() {
const hierarchicalNamesaceControllerLabel = "hnc.x-k8s.io/included-namespace=true";
return this.getLabels().find(label => label === hierarchicalNamesaceControllerLabel);
return this.getLabels().includes("hnc.x-k8s.io/included-namespace=true");
}
}