Fix minor issue getting stress secret labels with quoting and error handling (#4122)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
This commit is contained in:
Azure SDK Bot 2022-11-16 17:41:02 -05:00 committed by GitHub
parent dd8a5ef542
commit 852c07d16b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -315,10 +315,10 @@ function DeployStressPackage(
# Helm 3 stores release information in kubernetes secrets. The only way to add extra labels around
# specific releases (thereby enabling filtering on `helm list`) is to label the underlying secret resources.
# There is not currently support for setting these labels via the helm cli.
$helmReleaseConfig = kubectl get secrets `
-n $pkg.Namespace `
-l status=deployed,name=$($pkg.ReleaseName) `
-o jsonpath='{.items[0].metadata.name}'
$helmReleaseConfig = RunOrExitOnFailure kubectl get secrets `
-n $pkg.Namespace `
-l "status=deployed,name=$($pkg.ReleaseName)" `
-o jsonpath='{.items[0].metadata.name}'
Run kubectl label secret -n $pkg.Namespace --overwrite $helmReleaseConfig deployId=$deployId
}