Ensure error messages display the correct namespace (#458)

* Ensure the kubectl is configured with a default namespace, and override it on the deployment resource

* Provide a helper method to get the namespace of a resource but fallback to the default if unavailable

* Ensure error messages display the correct namespace
This commit is contained in:
Craig Duncan
2025-10-08 19:40:50 +01:00
committed by GitHub
parent f647f23716
commit 862964743d
3 changed files with 52 additions and 6 deletions
+2 -2
View File
@@ -46,7 +46,7 @@ export async function checkManifestStability(
)
checkForErrors([result])
} catch (ex) {
const errorMessage = `Rollout failed for ${resource.type}/${resource.name} in namespace ${resource.namespace}: ${ex.message || ex}`
const errorMessage = `Rollout failed for ${resource.type}/${resource.name} in namespace ${kubectl.getNamespace(resource.namespace)}: ${ex.message || ex}`
core.error(errorMessage)
rolloutErrors.push(errorMessage)
@@ -106,7 +106,7 @@ export async function checkManifestStability(
}
}
} catch (ex) {
const errorMessage = `Could not determine service status of: ${resource.name} in namespace ${resource.namespace}. Error: ${ex.message || ex}`
const errorMessage = `Could not determine service status of: ${resource.name} in namespace ${kubectl.getNamespace(resource.namespace)}. Error: ${ex.message || ex}`
core.warning(errorMessage)
try {