Skip to content

Commit

Permalink
[Platform][Kubernetes] Use az.updateConfig for incluster credentials
Browse files Browse the repository at this point in the history
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
yugabyte#8371 against latest
changes.

Fixes yugabyte#10860

Signed-off-by: Bhavin Gandhi <bhavin7392@gmail.com>
  • Loading branch information
bhavin192 committed Dec 22, 2021
1 parent aeb5331 commit 8c8a553
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,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 @@ -287,7 +287,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 8c8a553

Please sign in to comment.