Skip to content

Commit b3bb4a4

Browse files
authored
Add warning for exec plugins using v1alpha1 (#1758)
1 parent 85aea8d commit b3bb4a4

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ require (
6868
github.com/hashicorp/errwrap v1.1.0 // indirect
6969
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
7070
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
71-
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
71+
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
7272
github.com/hashicorp/go-multierror v1.1.1 // indirect
7373
github.com/hashicorp/go-uuid v1.0.2 // indirect
7474
github.com/hashicorp/logutils v1.0.0 // indirect

kubernetes/provider.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"path/filepath"
1111
"strconv"
1212

13+
"github.com/hashicorp/go-cty/cty"
1314
"github.com/mitchellh/go-homedir"
1415

1516
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
@@ -127,6 +128,17 @@ func Provider() *schema.Provider {
127128
"api_version": {
128129
Type: schema.TypeString,
129130
Required: true,
131+
ValidateDiagFunc: func(val interface{}, key cty.Path) diag.Diagnostics {
132+
apiVersion := val.(string)
133+
if apiVersion == "client.authentication.k8s.io/v1alpha1" {
134+
return diag.Diagnostics{{
135+
Severity: diag.Warning,
136+
Summary: "v1alpha1 of the client authentication API is deprecated, use v1beta1 or above",
137+
Detail: "v1alpha1 of the client authentication API will be removed in Kubernetes client versions 1.24 and above. You may need to update your exec plugin to use the latest version.",
138+
}}
139+
}
140+
return nil
141+
},
130142
},
131143
"command": {
132144
Type: schema.TypeString,

0 commit comments

Comments
 (0)