Skip to content

Commit

Permalink
[customizations/eks]: Update credential API version
Browse files Browse the repository at this point in the history
Kubernetes has deprecated v1alpha1, v1beta1 has been available since Kubernetes
v1.11 (kubernetes/kubernetes#64482), and EKS currently supports Kubernetes
versions v1.16 through v1.21. This is a breaking change for clients running
versions v1.10 and older, which haven't been supported by EKS since September
2019.

Signed-off-by: Micah Hausler <mhausler@amazon.com>
  • Loading branch information
micahhausler committed Jul 28, 2021
1 parent 7734cee commit 3569d49
Show file tree
Hide file tree
Showing 23 changed files with 30 additions and 25 deletions.
5 changes: 5 additions & 0 deletions .changes/next-release/enhancement-eks-98667.json
@@ -0,0 +1,5 @@
{
"category": "eks",
"type": "enhancement",
"description": "Updated Kubernetes client authentication API version"
}
2 changes: 1 addition & 1 deletion awscli/customizations/eks/get_token.py
Expand Up @@ -74,7 +74,7 @@ def _run_main(self, parsed_args, parsed_globals):

full_object = {
"kind": "ExecCredential",
"apiVersion": "client.authentication.k8s.io/v1alpha1",
"apiVersion": "client.authentication.k8s.io/v1beta1",
"spec": {},
"status": {
"expirationTimestamp": token_expiration,
Expand Down
2 changes: 1 addition & 1 deletion awscli/customizations/eks/update_kubeconfig.py
Expand Up @@ -34,7 +34,7 @@
# Use the endpoint for kubernetes 1.10
# To get the most recent endpoint we will need to
# Do a check on the cluster's version number
API_VERSION = "client.authentication.k8s.io/v1alpha1"
API_VERSION = "client.authentication.k8s.io/v1beta1"

class UpdateKubeconfigCommand(BasicCommand):
NAME = 'update-kubeconfig'
Expand Down
2 changes: 1 addition & 1 deletion awscli/examples/eks/get-token.rst
Expand Up @@ -10,7 +10,7 @@ Output::

{
"kind": "ExecCredential",
"apiVersion": "client.authentication.k8s.io/v1alpha1",
"apiVersion": "client.authentication.k8s.io/v1beta1",
"spec": {},
"status": {
"expirationTimestamp": "2019-08-14T18:44:27Z",
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/test_get_token.py
Expand Up @@ -72,7 +72,7 @@ def test_get_token(self, mock_datetime):
response,
{
"kind": "ExecCredential",
"apiVersion": "client.authentication.k8s.io/v1alpha1",
"apiVersion": "client.authentication.k8s.io/v1beta1",
"spec": {},
"status": {
"expirationTimestamp": "2019-10-23T23:14:00Z",
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/testdata/invalid_string_cluster_entry
Expand Up @@ -13,7 +13,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/testdata/invalid_string_clusters
Expand Up @@ -12,7 +12,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/testdata/invalid_string_context_entry
Expand Up @@ -13,7 +13,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/testdata/invalid_string_contexts
Expand Up @@ -12,7 +12,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/eks/testdata/output_combined
Expand Up @@ -24,7 +24,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand All @@ -36,7 +36,7 @@ users:
- name: arn:aws:eks:region:111222333444:cluster/ExampleCluster
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- region
Expand Down
Expand Up @@ -2,7 +2,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand All @@ -14,7 +14,7 @@ users:
- name: arn:aws:eks:region:111222333444:cluster/ExampleCluster
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- region
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/testdata/output_single
Expand Up @@ -16,7 +16,7 @@ users:
- name: arn:aws:eks:region:111222333444:cluster/ExampleCluster
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- region
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/testdata/valid_bad_cluster
Expand Up @@ -13,7 +13,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/testdata/valid_bad_cluster2
Expand Up @@ -15,7 +15,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/testdata/valid_bad_context
Expand Up @@ -13,7 +13,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/testdata/valid_bad_context2
Expand Up @@ -15,7 +15,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/testdata/valid_bad_user
Expand Up @@ -15,7 +15,7 @@ preferences: {}
users:
- user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/testdata/valid_changed_ordering
Expand Up @@ -2,7 +2,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/testdata/valid_existing
Expand Up @@ -16,7 +16,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/testdata/valid_no_cluster
Expand Up @@ -11,7 +11,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/testdata/valid_no_context
Expand Up @@ -11,7 +11,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/eks/testdata/valid_no_current_context
Expand Up @@ -15,7 +15,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/eks/testdata/valid_old_data
Expand Up @@ -24,7 +24,7 @@ users:
- name: arn:aws:eks:us-west-2:111222333444:cluster/Existing
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- --region
- us-west-2
Expand All @@ -36,7 +36,7 @@ users:
- name: arn:aws:eks:region:111222333444:cluster/ExampleCluster
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
apiVersion: client.authentication.k8s.io/v1beta1
args:
- token
- -i
Expand Down

0 comments on commit 3569d49

Please sign in to comment.