Skip to content

Commit 0221afb

Browse files
committed
[pkg/token]: Update credential API version
Kubernetes has deprecated v1alpha1, v1beta1 has been available since Kubernetes v1.11 (kubernetes/kubernetes#64482). At the time of this commit, community-supported versions are v1.19, v1.20, v1.21. This change will break for Kubernetes clients using client-go or kubectl v1.10 and earlier, which reached end-of-life community support on Feb 13, 2019. EKS ended support for 1.10 in September of 2019. Kubernetes 1.22 will introduce v1 of this API, but v1beta1 will likely be supported for a period of 2 more years. Signed-off-by: Micah Hausler <[email protected]>
1 parent 4c5c6d9 commit 0221afb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ users:
171171
- name: kubernetes-admin
172172
user:
173173
exec:
174-
apiVersion: client.authentication.k8s.io/v1alpha1
174+
apiVersion: client.authentication.k8s.io/v1beta1
175175
command: aws-iam-authenticator
176176
args:
177177
- "token"
@@ -260,7 +260,7 @@ users:
260260
- name: aws
261261
user:
262262
exec:
263-
apiVersion: client.authentication.k8s.io/v1alpha1
263+
apiVersion: client.authentication.k8s.io/v1beta1
264264
command: aws-iam-authenticator
265265
env:
266266
- name: "AWS_PROFILE"

pkg/token/token.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import (
3838
"github.com/aws/aws-sdk-go/service/sts/stsiface"
3939
"github.com/sirupsen/logrus"
4040
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
41-
clientauthv1alpha1 "k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1"
41+
clientauthv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1"
4242
"sigs.k8s.io/aws-iam-authenticator/pkg"
4343
"sigs.k8s.io/aws-iam-authenticator/pkg/arn"
4444
)
@@ -338,12 +338,12 @@ func (g generator) GetWithSTS(clusterID string, stsAPI stsiface.STSAPI) (Token,
338338
// FormatJSON formats the json to support ExecCredential authentication
339339
func (g generator) FormatJSON(token Token) string {
340340
expirationTimestamp := metav1.NewTime(token.Expiration)
341-
execInput := &clientauthv1alpha1.ExecCredential{
341+
execInput := &clientauthv1beta1.ExecCredential{
342342
TypeMeta: metav1.TypeMeta{
343-
APIVersion: "client.authentication.k8s.io/v1alpha1",
343+
APIVersion: "client.authentication.k8s.io/v1beta1",
344344
Kind: "ExecCredential",
345345
},
346-
Status: &clientauthv1alpha1.ExecCredentialStatus{
346+
Status: &clientauthv1beta1.ExecCredentialStatus{
347347
ExpirationTimestamp: &expirationTimestamp,
348348
Token: token.Token,
349349
},

0 commit comments

Comments
 (0)