Make namespace input optional (#420)

Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tatsinnit <tamishra@microsoft.com>
This commit is contained in:
benjamin
2025-07-01 17:28:12 -04:00
committed by GitHub
parent 5b189c0bf7
commit b9529f8427
9 changed files with 511 additions and 15 deletions
+4 -2
View File
@@ -196,7 +196,7 @@ async function annotateResources(
deploymentConfig: DeploymentConfig
) {
const annotateResults: ExecOutput[] = []
const namespace = core.getInput('namespace') || 'default'
const namespace = core.getInput('namespace') || '' // Sets namespace to an empty string if not provided, allowing the manifest-defined namespace to take precedence instead of "default".
const lastSuccessSha = await getLastSuccessfulRunSha(
kubectl,
namespace,
@@ -227,8 +227,10 @@ async function annotateResources(
)}`
const annotateNamespace = !(
namespace === '' ||
core.getInput('annotate-namespace').toLowerCase() === 'false'
)
) // If namespace is empty, we don't annotate it. If the input is false, we also don't annotate it.
if (annotateNamespace) {
annotateResults.push(
await kubectl.annotate(