Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation scripts all assume default azure CLI output format of JSON #515

Open
swgriffith opened this issue Oct 9, 2024 · 0 comments

Comments

@swgriffith
Copy link
Member

All of the existing setup scripts seem to make the assumption that the user has not changed their default azure cli output (via az configure), and is using the default 'json' format. All azure cli commands that query the response object should specify '-o json' or alternatively '-o tsv' if just trying to get the exact value without passing to jq.

Example:
https://raw.githubusercontent.com/Azure/karpenter-provider-azure/main/hack/deploy/configure-values.sh
AKS_JSON=$(az aks show --name "$CLUSTER_NAME" --resource-group "$AZURE_RESOURCE_GROUP")
AZURE_LOCATION=$(jq -r ".location" <<< "$AKS_JSON")

This could be modified to either of the following:

  1. To use as is with JSON, but to ensure this works for users already:
    AKS_JSON=$(az aks show --name "$CLUSTER_NAME" --resource-group "$AZURE_RESOURCE_GROUP" -o json)
    AZURE_LOCATION=$(jq -r ".location" <<< "$AKS_JSON")

  2. To avoid the need to parse json with jd
    AZURE_LOCATION=$(az aks show --name $CLUSTER_NAME --resource-group $AZURE_RESOURCE_GROUP -o tsv --query location)

@swgriffith swgriffith changed the title Installation script all assume default azure CLI output format of JSON Installation scripts all assume default azure CLI output format of JSON Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant