Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Refactor to account for -f/--file being used.
  • Loading branch information
Volatus committed Jul 1, 2021
commit bea5b9d486bc5fe80415162e2e32e22f814935de
13 changes: 5 additions & 8 deletions src/azure-cli/azure/cli/command_modules/acs/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2488,14 +2488,11 @@ def aks_get_credentials(cmd, client, resource_group_name, name, admin=False,
resource_group_name, name)

# Check if KUBECONFIG environmental variable is set
path = os.environ.get(
"KUBECONFIG",
os.path.join(
os.path.expanduser('~'),
'.kube',
'config'
)
)
# If path is different than default then that means -f/--file is passed
# in which case we ignore the KUBECONFIG variable
if "KUBECONFIG" in os.environ and path == os.path.join(os.path.expanduser('~'), '.kube', 'config'):
path = os.environ["KUBECONFIG"]

if not credentialResults:
raise CLIError("No Kubernetes credentials found.")
try:
Expand Down