Skip to content

Commit b0772a9

Browse files
authored
Used "kubectl config view" instead of printing raw config (#404)
* Used "kubectl config view" instead of printing raw config * Removed the variable guard, as we now rely on kubectl to mask for us * Restored the variable guard, because config view can still leak details
1 parent 41fc3fa commit b0772a9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

source/Calamari/Kubernetes/Scripts/KubectlBashContext.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ configure_kubectl_path
165165
setup_context
166166
create_namespace
167167
if [[ "$Octopus_K8S_OutputKubeConfig" = true ]]; then
168-
cat $KUBECONFIG
168+
kubectl config view
169169
fi
170170
echo "Invoking target script \"$(get_octopusvariable "OctopusKubernetesTargetScript")\" with $(get_octopusvariable "OctopusKubernetesTargetScriptParameters") parameters"
171171
echo "##octopus[stdout-default]"

source/Calamari/Kubernetes/Scripts/KubectlPowershellContext.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ ConfigureKubeCtlPath
189189
SetupContext
190190
CreateNamespace
191191
if ($K8S_OutputKubeConfig -eq $true) {
192-
Get-Content $env:KUBECONFIG
192+
& $Kubectl_Exe config view
193193
}
194194
Write-Verbose "Invoking target script $OctopusKubernetesTargetScript with $OctopusKubernetesTargetScriptParameters parameters"
195195
Write-Host "##octopus[stdout-default]"

0 commit comments

Comments
 (0)