From d754599d03be84a74b1d511f18dfdd3775791561 Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Fri, 30 Jul 2021 16:07:59 -0700 Subject: [PATCH] Revert "[customizations/eks]: Update credential API version" (#6309) --- .changes/next-release/bugfix-EKS-22364.json | 5 +++++ awscli/customizations/eks/get_token.py | 2 +- awscli/customizations/eks/update_kubeconfig.py | 2 +- awscli/examples/eks/get-token.rst | 2 +- tests/functional/eks/test_get_token.py | 2 +- tests/functional/eks/testdata/invalid_string_cluster_entry | 2 +- tests/functional/eks/testdata/invalid_string_clusters | 2 +- tests/functional/eks/testdata/invalid_string_context_entry | 2 +- tests/functional/eks/testdata/invalid_string_contexts | 2 +- tests/functional/eks/testdata/output_combined | 4 ++-- .../functional/eks/testdata/output_combined_changed_ordering | 4 ++-- tests/functional/eks/testdata/output_single | 2 +- tests/functional/eks/testdata/valid_bad_cluster | 2 +- tests/functional/eks/testdata/valid_bad_cluster2 | 2 +- tests/functional/eks/testdata/valid_bad_context | 2 +- tests/functional/eks/testdata/valid_bad_context2 | 2 +- tests/functional/eks/testdata/valid_bad_user | 2 +- tests/functional/eks/testdata/valid_changed_ordering | 2 +- tests/functional/eks/testdata/valid_existing | 2 +- tests/functional/eks/testdata/valid_no_cluster | 2 +- tests/functional/eks/testdata/valid_no_context | 2 +- tests/functional/eks/testdata/valid_no_current_context | 2 +- tests/functional/eks/testdata/valid_old_data | 4 ++-- 23 files changed, 30 insertions(+), 25 deletions(-) create mode 100644 .changes/next-release/bugfix-EKS-22364.json diff --git a/.changes/next-release/bugfix-EKS-22364.json b/.changes/next-release/bugfix-EKS-22364.json new file mode 100644 index 000000000000..11146b604df4 --- /dev/null +++ b/.changes/next-release/bugfix-EKS-22364.json @@ -0,0 +1,5 @@ +{ + "type": "bugfix", + "category": "``eks``", + "description": "Fixes `#6308 `__ version mismatch running eks get-login without eks update-config" +} diff --git a/awscli/customizations/eks/get_token.py b/awscli/customizations/eks/get_token.py index ecaecdfc1231..1208f965505d 100644 --- a/awscli/customizations/eks/get_token.py +++ b/awscli/customizations/eks/get_token.py @@ -74,7 +74,7 @@ def _run_main(self, parsed_args, parsed_globals): full_object = { "kind": "ExecCredential", - "apiVersion": "client.authentication.k8s.io/v1beta1", + "apiVersion": "client.authentication.k8s.io/v1alpha1", "spec": {}, "status": { "expirationTimestamp": token_expiration, diff --git a/awscli/customizations/eks/update_kubeconfig.py b/awscli/customizations/eks/update_kubeconfig.py index 76e3e4e1b341..cf9d02c64510 100644 --- a/awscli/customizations/eks/update_kubeconfig.py +++ b/awscli/customizations/eks/update_kubeconfig.py @@ -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/v1beta1" +API_VERSION = "client.authentication.k8s.io/v1alpha1" class UpdateKubeconfigCommand(BasicCommand): NAME = 'update-kubeconfig' diff --git a/awscli/examples/eks/get-token.rst b/awscli/examples/eks/get-token.rst index 6a5c7b25c2f0..92a94e5be01b 100644 --- a/awscli/examples/eks/get-token.rst +++ b/awscli/examples/eks/get-token.rst @@ -10,7 +10,7 @@ Output:: { "kind": "ExecCredential", - "apiVersion": "client.authentication.k8s.io/v1beta1", + "apiVersion": "client.authentication.k8s.io/v1alpha1", "spec": {}, "status": { "expirationTimestamp": "2019-08-14T18:44:27Z", diff --git a/tests/functional/eks/test_get_token.py b/tests/functional/eks/test_get_token.py index a5bafb0f2ba8..379c2a090214 100644 --- a/tests/functional/eks/test_get_token.py +++ b/tests/functional/eks/test_get_token.py @@ -72,7 +72,7 @@ def test_get_token(self, mock_datetime): response, { "kind": "ExecCredential", - "apiVersion": "client.authentication.k8s.io/v1beta1", + "apiVersion": "client.authentication.k8s.io/v1alpha1", "spec": {}, "status": { "expirationTimestamp": "2019-10-23T23:14:00Z", diff --git a/tests/functional/eks/testdata/invalid_string_cluster_entry b/tests/functional/eks/testdata/invalid_string_cluster_entry index 6ddbe5038426..3445428dfa90 100644 --- a/tests/functional/eks/testdata/invalid_string_cluster_entry +++ b/tests/functional/eks/testdata/invalid_string_cluster_entry @@ -13,7 +13,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 diff --git a/tests/functional/eks/testdata/invalid_string_clusters b/tests/functional/eks/testdata/invalid_string_clusters index 664414392d20..f6eeb57fd9a8 100644 --- a/tests/functional/eks/testdata/invalid_string_clusters +++ b/tests/functional/eks/testdata/invalid_string_clusters @@ -12,7 +12,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 diff --git a/tests/functional/eks/testdata/invalid_string_context_entry b/tests/functional/eks/testdata/invalid_string_context_entry index 038276cb80cd..3762197aaf6b 100644 --- a/tests/functional/eks/testdata/invalid_string_context_entry +++ b/tests/functional/eks/testdata/invalid_string_context_entry @@ -13,7 +13,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 diff --git a/tests/functional/eks/testdata/invalid_string_contexts b/tests/functional/eks/testdata/invalid_string_contexts index be84d241734b..07c34aa406f3 100644 --- a/tests/functional/eks/testdata/invalid_string_contexts +++ b/tests/functional/eks/testdata/invalid_string_contexts @@ -12,7 +12,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 diff --git a/tests/functional/eks/testdata/output_combined b/tests/functional/eks/testdata/output_combined index ed2e94a07326..4c097a5a4e03 100644 --- a/tests/functional/eks/testdata/output_combined +++ b/tests/functional/eks/testdata/output_combined @@ -24,7 +24,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 @@ -36,7 +36,7 @@ users: - name: arn:aws:eks:region:111222333444:cluster/ExampleCluster user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - region diff --git a/tests/functional/eks/testdata/output_combined_changed_ordering b/tests/functional/eks/testdata/output_combined_changed_ordering index 3e489d3351cb..fea7a86524c6 100644 --- a/tests/functional/eks/testdata/output_combined_changed_ordering +++ b/tests/functional/eks/testdata/output_combined_changed_ordering @@ -2,7 +2,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 @@ -14,7 +14,7 @@ users: - name: arn:aws:eks:region:111222333444:cluster/ExampleCluster user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - region diff --git a/tests/functional/eks/testdata/output_single b/tests/functional/eks/testdata/output_single index 382c1c2400f3..20e776b5fc39 100644 --- a/tests/functional/eks/testdata/output_single +++ b/tests/functional/eks/testdata/output_single @@ -16,7 +16,7 @@ users: - name: arn:aws:eks:region:111222333444:cluster/ExampleCluster user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - region diff --git a/tests/functional/eks/testdata/valid_bad_cluster b/tests/functional/eks/testdata/valid_bad_cluster index 1cefd5d84a3e..3c3ae4702c0d 100644 --- a/tests/functional/eks/testdata/valid_bad_cluster +++ b/tests/functional/eks/testdata/valid_bad_cluster @@ -13,7 +13,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 diff --git a/tests/functional/eks/testdata/valid_bad_cluster2 b/tests/functional/eks/testdata/valid_bad_cluster2 index b9aa058f716f..a99fe2ffc6ef 100644 --- a/tests/functional/eks/testdata/valid_bad_cluster2 +++ b/tests/functional/eks/testdata/valid_bad_cluster2 @@ -15,7 +15,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 diff --git a/tests/functional/eks/testdata/valid_bad_context b/tests/functional/eks/testdata/valid_bad_context index 25822d2ff511..cadf61557e60 100644 --- a/tests/functional/eks/testdata/valid_bad_context +++ b/tests/functional/eks/testdata/valid_bad_context @@ -13,7 +13,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 diff --git a/tests/functional/eks/testdata/valid_bad_context2 b/tests/functional/eks/testdata/valid_bad_context2 index b3fa13325d7c..b3e1e6f2c29b 100644 --- a/tests/functional/eks/testdata/valid_bad_context2 +++ b/tests/functional/eks/testdata/valid_bad_context2 @@ -15,7 +15,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 diff --git a/tests/functional/eks/testdata/valid_bad_user b/tests/functional/eks/testdata/valid_bad_user index 606958ffa944..30287eadb34e 100644 --- a/tests/functional/eks/testdata/valid_bad_user +++ b/tests/functional/eks/testdata/valid_bad_user @@ -15,7 +15,7 @@ preferences: {} users: - user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 diff --git a/tests/functional/eks/testdata/valid_changed_ordering b/tests/functional/eks/testdata/valid_changed_ordering index 08752be0d3e6..5dc823f7a925 100644 --- a/tests/functional/eks/testdata/valid_changed_ordering +++ b/tests/functional/eks/testdata/valid_changed_ordering @@ -2,7 +2,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 diff --git a/tests/functional/eks/testdata/valid_existing b/tests/functional/eks/testdata/valid_existing index 34efc84a18be..9a00b4e3ef14 100644 --- a/tests/functional/eks/testdata/valid_existing +++ b/tests/functional/eks/testdata/valid_existing @@ -16,7 +16,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 diff --git a/tests/functional/eks/testdata/valid_no_cluster b/tests/functional/eks/testdata/valid_no_cluster index 01c73a713d41..4da6bae2e105 100644 --- a/tests/functional/eks/testdata/valid_no_cluster +++ b/tests/functional/eks/testdata/valid_no_cluster @@ -11,7 +11,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 diff --git a/tests/functional/eks/testdata/valid_no_context b/tests/functional/eks/testdata/valid_no_context index 00a36d1a0da2..d98d38ed6af9 100644 --- a/tests/functional/eks/testdata/valid_no_context +++ b/tests/functional/eks/testdata/valid_no_context @@ -11,7 +11,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 diff --git a/tests/functional/eks/testdata/valid_no_current_context b/tests/functional/eks/testdata/valid_no_current_context index b8399db64ec1..0bb78320e3bd 100644 --- a/tests/functional/eks/testdata/valid_no_current_context +++ b/tests/functional/eks/testdata/valid_no_current_context @@ -15,7 +15,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 diff --git a/tests/functional/eks/testdata/valid_old_data b/tests/functional/eks/testdata/valid_old_data index 6850397cdb7f..525c7e56da08 100644 --- a/tests/functional/eks/testdata/valid_old_data +++ b/tests/functional/eks/testdata/valid_old_data @@ -24,7 +24,7 @@ users: - name: arn:aws:eks:us-west-2:111222333444:cluster/Existing user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - --region - us-west-2 @@ -36,7 +36,7 @@ users: - name: arn:aws:eks:region:111222333444:cluster/ExampleCluster user: exec: - apiVersion: client.authentication.k8s.io/v1beta1 + apiVersion: client.authentication.k8s.io/v1alpha1 args: - token - -i