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