diff --git a/src/Microsoft.Tye.Core/DeployApplicationKubernetesManifestStep.cs b/src/Microsoft.Tye.Core/DeployApplicationKubernetesManifestStep.cs index 23794036..8e8d5140 100644 --- a/src/Microsoft.Tye.Core/DeployApplicationKubernetesManifestStep.cs +++ b/src/Microsoft.Tye.Core/DeployApplicationKubernetesManifestStep.cs @@ -79,11 +79,14 @@ namespace Microsoft.Tye }; var retries = 0; + var namespaceParameter = !string.IsNullOrEmpty(application.Namespace) + ? $"--namespace \"{application.Namespace}\"" + : ""; while (!done && retries < 60) { var ingressExitCode = await ProcessUtil.ExecuteAsync( "kubectl", - $"get ingress {ingress.Name} -o jsonpath='{{..ip}}'", + $"get ingress {ingress.Name} {namespaceParameter} -o jsonpath='{{..ip}}'", Environment.CurrentDirectory, complete, capture.StdErr); diff --git a/src/Microsoft.Tye.Core/ValidateSecretStep.cs b/src/Microsoft.Tye.Core/ValidateSecretStep.cs index 7a887af2..cb9abc2f 100644 --- a/src/Microsoft.Tye.Core/ValidateSecretStep.cs +++ b/src/Microsoft.Tye.Core/ValidateSecretStep.cs @@ -56,6 +56,11 @@ namespace Microsoft.Tye var config = KubernetesClientConfiguration.BuildDefaultConfig(); + if (!string.IsNullOrEmpty(application.Namespace)) + { + config.Namespace = application.Namespace; + } + // If namespace is null, set it to default config.Namespace ??= "default";