mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-29 08:19:26 +08:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user