From 6426e9d901bd21d605bd57150b017f942ca2760e Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 10 Nov 2022 16:48:56 -0500 Subject: [PATCH] Handle possible strict mode bugs (#4106) Co-authored-by: Ben Broderick Phillips --- .../scripts/stress-testing/stress-test-deployment-lib.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 index 91d7734a9..f6d1ada17 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -56,7 +56,7 @@ function Login([string]$subscription, [string]$clusterGroup, [switch]$pushImages $kubeContext = (RunOrExitOnFailure kubectl config view -o json) | ConvertFrom-Json -AsHashtable $defaultNamespace = $null $targetContext = $kubeContext.contexts.Where({ $_.name -eq $clusterName }) | Select -First 1 - if ($targetContext -ne $null) { + if ($targetContext -ne $null -and $targetContext.PSObject.Properties.Name -match "namespace") { $defaultNamespace = $targetContext.context.namespace }