Skip to content

Commit

Permalink
Merge branch 'release-1.24.0'
Browse files Browse the repository at this point in the history
* release-1.24.0:
  Bumping version to 1.24.0
  Add changelog entries from botocore
  Update changelog based on model updates
  Default to beta API for eks get-token
  • Loading branch information
aws-sdk-python-automation committed May 13, 2022
2 parents 5a2fbc1 + b7f026a commit 0d6ba6d
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 32 deletions.
22 changes: 22 additions & 0 deletions .changes/1.24.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"category": "``eks get-token``",
"description": "All eks get-token commands default to api version v1beta1.",
"type": "feature"
},
{
"category": "``grafana``",
"description": "This release adds APIs for creating and deleting API keys in an Amazon Managed Grafana workspace.",
"type": "api-change"
},
{
"category": "Loaders",
"description": "Support for loading gzip compressed model files.",
"type": "feature"
},
{
"category": "``eks get-token``",
"description": "Correctly fallback to client.authentication.k8s.io/v1beta1 API if KUBERNETES_EXEC_INFO is undefined",
"type": "bugfix"
}
]
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
CHANGELOG
=========

1.24.0
======

* feature:``eks get-token``: All eks get-token commands default to api version v1beta1.
* api-change:``grafana``: This release adds APIs for creating and deleting API keys in an Amazon Managed Grafana workspace.
* feature:Loaders: Support for loading gzip compressed model files.
* bugfix:``eks get-token``: Correctly fallback to client.authentication.k8s.io/v1beta1 API if KUBERNETES_EXEC_INFO is undefined


1.23.13
=======

Expand Down
2 changes: 1 addition & 1 deletion awscli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""
import os

__version__ = '1.23.13'
__version__ = '1.24.0'

#
# Get our data path to be added to botocore's search path
Expand Down
24 changes: 10 additions & 14 deletions awscli/customizations/eks/get_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ def _run_main(self, parsed_args, parsed_globals):
def discover_api_version(self):
"""
Parses the KUBERNETES_EXEC_INFO environment variable and returns the
API version. If the environment variable is empty, malformed, or
invalid, return the v1alpha1 response and print a message to stderr.
API version. If the environment variable is malformed or invalid,
return the v1beta1 response and print a message to stderr.
If the v1alpha1 API is specified explicitly, a message is printed to
stderr with instructions to update.
Expand All @@ -139,7 +139,7 @@ def discover_api_version(self):
# "v1beta1" will be removed. At or around that time, EKS will likely
# support v1.22 through v1.28, in which client API version "v1beta1"
# will be supported by all EKS versions.
fallback_api_version = ALPHA_API
fallback_api_version = BETA_API

error_prefixes = {
"error": "Error parsing",
Expand All @@ -148,16 +148,12 @@ def discover_api_version(self):

exec_info_raw = os.environ.get("KUBERNETES_EXEC_INFO", "")
if not exec_info_raw:
# All kube clients should be setting this. Otherewise, we'll return
# the fallback and write an error.
uni_print(
ERROR_MSG_TPL.format(
error_prefixes["empty"],
fallback_api_version,
),
sys.stderr,
)
uni_print("\n", sys.stderr)
# All kube clients should be setting this, but client-go clients
# (kubectl, kubelet, etc) < 1.20 were not setting this if the API
# version defined in the kubeconfig was not v1alpha1.
#
# This was changed in kubernetes/kubernetes#95489 so that
# KUBERNETES_EXEC_INFO is always provided
return fallback_api_version
try:
exec_info = json.loads(exec_info_raw)
Expand All @@ -177,7 +173,7 @@ def discover_api_version(self):
if api_version_raw in FULLY_SUPPORTED_API_VERSIONS:
return api_version_raw
elif api_version_raw in DEPRECATED_API_VERSIONS:
uni_print(DEPRECATION_MSG_TPL.format(ALPHA_API), sys.stderr)
uni_print(DEPRECATION_MSG_TPL.format(api_version_raw), sys.stderr)
uni_print("\n", sys.stderr)
return api_version_raw
else:
Expand Down
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
# built documents.
#
# The short X.Y version.
version = '1.23.'
version = '1.24'
# The full version, including alpha/beta/rc tags.
release = '1.23.13'
release = '1.24.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ universal = 0

[metadata]
requires_dist =
botocore==1.25.13
botocore==1.26.0
docutils>=0.10,<0.16
s3transfer>=0.5.0,<0.6.0
PyYAML>=3.10,<5.5
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def find_version(*file_paths):


install_requires = [
'botocore==1.25.13',
'botocore==1.26.0',
'docutils>=0.10,<0.16',
's3transfer>=0.5.0,<0.6.0',
'PyYAML>=3.10,<5.5',
Expand Down
20 changes: 7 additions & 13 deletions tests/functional/eks/test_get_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,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 Expand Up @@ -185,13 +185,13 @@ def test_api_version_discovery_malformed(self):

self.assertEqual(
response["apiVersion"],
"client.authentication.k8s.io/v1alpha1",
"client.authentication.k8s.io/v1beta1",
)

self.assertEqual(
stderr,
(
"Error parsing KUBERNETES_EXEC_INFO, defaulting to client.authentication.k8s.io/v1alpha1. "
"Error parsing KUBERNETES_EXEC_INFO, defaulting to client.authentication.k8s.io/v1beta1. "
"This is likely a bug in your Kubernetes client. Please update your Kubernetes client.\n"
),
)
Expand All @@ -203,16 +203,10 @@ def test_api_version_discovery_empty(self):

self.assertEqual(
response["apiVersion"],
"client.authentication.k8s.io/v1alpha1",
"client.authentication.k8s.io/v1beta1",
)

self.assertEqual(
stderr,
(
"Empty KUBERNETES_EXEC_INFO, defaulting to client.authentication.k8s.io/v1alpha1. "
"This is likely a bug in your Kubernetes client. Please update your Kubernetes client.\n"
),
)
self.assertEqual(stderr, "",)

def test_api_version_discovery_v1(self):
self.set_kubernetes_exec_info('v1')
Expand Down Expand Up @@ -248,13 +242,13 @@ def test_api_version_discovery_unknown(self):

self.assertEqual(
response["apiVersion"],
"client.authentication.k8s.io/v1alpha1",
"client.authentication.k8s.io/v1beta1",
)

self.assertEqual(
stderr,
(
"Unrecognized API version in KUBERNETES_EXEC_INFO, defaulting to client.authentication.k8s.io/v1alpha1. "
"Unrecognized API version in KUBERNETES_EXEC_INFO, defaulting to client.authentication.k8s.io/v1beta1. "
"This is likely due to an outdated AWS CLI. Please update your AWS CLI.\n"
),
)

0 comments on commit 0d6ba6d

Please sign in to comment.