Azure-rest-api-specs: kubeConfig should have "format": "byte" along with "type": "string"

Created on 27 Feb 2018  路  5Comments  路  Source: Azure/azure-rest-api-specs

If "format": "byte" is specified then the generated code will be able to serialize and deserialize this property kubeconfig correctly.

As per swagger specification, this is the recommended way of describing base64 encoded characters.

@mboersma - Please make sure to fix this.
/cc @milismsft

Most helpful comment

This does seem like an obvious improvement.

@milismsft I've encountered a lot of resistance when proposing we rev the AKS API version before, and in this case we're not even changing server-side code. If it's possible to inline such a change into v20170831, that may be the only way to accomplish this in a reasonable time frame.

All 5 comments

/cc @lmazuel - FYI.

@mboersma I was looking at CLI, and it seems this will just change this:

        encoded_kubeconfig = access_profile.kube_config
        kubeconfig = base64.b64decode(encoded_kubeconfig).decode(encoding='UTF-8')

to this:

        kubeconfig = access_profile.kube_config.decode(encoding='UTF-8')

while at the same time providing free base64 decoding for SDK customers

FYI I would prefer if this change is done as part of a new API version rather than using the same version as it was done not to far in the past for other "non-breaking" changes (see access profiles)... Especially since it's not blocking and can be easily worked around in the SDKs for now.

This does seem like an obvious improvement.

@milismsft I've encountered a lot of resistance when proposing we rev the AKS API version before, and in this case we're not even changing server-side code. If it's possible to inline such a change into v20170831, that may be the only way to accomplish this in a reasonable time frame.

@mboersma - I have already made this change in the node sdk over here and published the sdk. This was easier than adding a layer on top that would do the right thing.

Was this page helpful?
0 / 5 - 0 ratings