Last active
February 25, 2021 21:16
-
-
Save mjaromi/514258f3d01316f25d693c184070a43c to your computer and use it in GitHub Desktop.
Workaround for https://github.com/aws/aws-cli/issues/4843
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The problem is that if you have only one definition of a cluster, context or user in the `~/.kube/config` file | |
and you delete one of them then `kubectl` will set deleted type to `null` instead of `[]`. | |
Then if you try to `update-kubeconfig` using aws cli command you will see an error: | |
* if `contexts: null`: Tried to insert into contexts,which is a <class 'NoneType'> not a <class 'list'> | |
* if `users: null`: Tried to insert into users,which is a <class 'NoneType'> not a <class 'list'> | |
* if `clusters: null`: 'NoneType' object is not iterable | |
Simple workaround for above cases is to replace all `null` with `[]` then run aws cli `update-kubeconfig` command, like this: | |
sed -i 's/: null/: []/g' ~/.kube/config && \ | |
aws eks --region ${AWS_REGION} update-kubeconfig --name ${EKS_CLUSTER_NAME} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment