Fixes multiple namespaces bug (#276)

* fix ns bug

* add tests

* rename some variables

* rename ns to namespace

* fix delete + correctly type

* add typing to input obj parser
This commit is contained in:
Oliver King
2023-02-06 13:42:55 -05:00
committed by GitHub
parent 756cc0a511
commit ecb488266d
14 changed files with 326 additions and 81 deletions
@@ -38,7 +38,8 @@ export async function deleteGreenObjects(
const resourcesToDelete: K8sDeleteObject[] = toDelete.map((obj) => {
return {
name: getBlueGreenResourceName(obj.metadata.name, GREEN_SUFFIX),
kind: obj.kind
kind: obj.kind,
namespace: obj.metadata.namespace
}
})
@@ -234,9 +235,10 @@ export function isServiceSelectorSubsetOfMatchLabel(
export async function fetchResource(
kubectl: Kubectl,
kind: string,
name: string
name: string,
namespace?: string
): Promise<K8sObject> {
const result = await kubectl.getResource(kind, name)
const result = await kubectl.getResource(kind, name, false, namespace)
if (result == null || !!result.stderr) {
return null
}