Cluster-api-provider-azure: AZURE_CLIENT_SECRET with quotes causes cluster failure.

Created on 3 Jun 2020  路  6Comments  路  Source: kubernetes-sigs/cluster-api-provider-azure

/kind bug

Creating an Azure Service Principal where the randomly generated secret contains a ".

This secret then goes into AZURE_CLIENT_SECRET and creates issues, because the output into /etc/kubernetes/azure.json will not properly escape the ", resulting in kubelet failures:

Jun 03 00:03:26 capi-quickstart-control-plane-pvzh4 kubelet[76379]: F0603 00:03:26.581514   76379 server.go:274] failed to run Kubelet: could not init cloud provider "azure": error converting YAML to JSON: yaml: line 5: did not find expected ',' or '}'

What did you expect to happen:

There should be some sort of logic to escape the quotes prior to them going into /etc/kubernetes/azure.json or Azure should stop using " in its randomly generated passwords.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • cluster-api-provider-azure version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):
help wanted kinbug

All 6 comments

There should be some sort of logic to escape the quotes prior to them going into /etc/kubernetes/azure.json or Azure should stop using " in its randomly generated passwords.

We won't be able to make "Azure should stop using " in its randomly generated passwords" happen so let's focus on ways we can document escaping special quotes in the CAPZ documentation about SPs or even better, automate escaping special chars.

/help

@CecileRobertMichon:
This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

There should be some sort of logic to escape the quotes prior to them going into /etc/kubernetes/azure.json or Azure should stop using " in its randomly generated passwords.

We won't be able to make "Azure should stop using " in its randomly generated passwords" happen so let's focus on ways we can document escaping special quotes in the CAPZ documentation about SPs or even better, automate escaping special chars.

/help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

We won't be able to make "Azure should stop using " in its randomly generated passwords" happen

https://github.com/Azure/azure-cli/issues/13625#issuecomment-632667687
https://github.com/Azure/azure-cli/pull/13643

it's fixed in new CLI versions

It's reasonable to escape these, but IMO the CLI introducing it was the real problem

Awesome, I think we can close this then. For anyone running into this, please update to the latest Azure CLI.

/close

@CecileRobertMichon: Closing this issue.

In response to this:

Awesome, I think we can close this then. For anyone running into this, please update to the latest Azure CLI.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mboersma picture mboersma  路  6Comments

mboersma picture mboersma  路  9Comments

abhishek-jnpr picture abhishek-jnpr  路  8Comments

devigned picture devigned  路  9Comments

devigned picture devigned  路  7Comments