Skip to content

Commit

Permalink
[Platform][Kubernetes] Use az.updateConfig for incluster credentials (#…
Browse files Browse the repository at this point in the history
…10928)

c0b9786 changed the behavior of
az.setConfig and added az.updateConfig. This change uses the correct
method to add `{"KUBECONFIG": ""}` to the existing configuration
instead of overwriting the whole AZ configuration.

This was missed when I rebased
#8371 against latest
changes.

Fixes #10860

Signed-off-by: Bhavin Gandhi <[email protected]>
  • Loading branch information
bhavin192 authored Feb 10, 2022
1 parent d29d316 commit 42d85c4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public Provider createKubernetes(Customer customer, KubernetesProviderFormData f
boolean isConfigInZone = updateKubeConfigForZone(provider, region, az, zoneConfig, false);
if (!(isConfigInProvider || isConfigInRegion || isConfigInZone)) {
// Use in-cluster ServiceAccount credentials
az.setConfig(ImmutableMap.of("KUBECONFIG", ""));
az.updateConfig(ImmutableMap.of("KUBECONFIG", ""));
az.save();
}
}
Expand Down Expand Up @@ -290,7 +290,7 @@ public Provider createKubernetesNew(Customer customer, Provider reqProvider) thr
boolean isConfigInZone = updateKubeConfigForZone(provider, region, az, zoneConfig, false);
if (!(isConfigInProvider || isConfigInRegion || isConfigInZone)) {
// Use in-cluster ServiceAccount credentials
az.setConfig(ImmutableMap.of("KUBECONFIG", ""));
az.updateConfig(ImmutableMap.of("KUBECONFIG", ""));
az.save();
}
}
Expand Down

0 comments on commit 42d85c4

Please sign in to comment.