Skip to content

Commit 277cd1a

Browse files
adammwjoshfrench
authored andcommitted
Make revive happy on naming
1 parent 52d0e7c commit 277cd1a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

controlplane/eks/api/v1beta2/awsmanagedcontrolplane_webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ func (r *AWSManagedControlPlane) validateAccessConfig(old *AWSManagedControlPlan
331331

332332
// AuthenticationMode is ratcheting - do not allow downgrades
333333
if old.Spec.AccessConfig != nil && old.Spec.AccessConfig.AuthenticationMode != r.Spec.AccessConfig.AuthenticationMode &&
334-
((old.Spec.AccessConfig.AuthenticationMode == EKSAuthenticationModeApiAndConfigMap && r.Spec.AccessConfig.AuthenticationMode == EKSAuthenticationModeConfigMap) ||
335-
old.Spec.AccessConfig.AuthenticationMode == EKSAuthenticationModeApi) {
334+
((old.Spec.AccessConfig.AuthenticationMode == EKSAuthenticationModeAPIAndConfigMap && r.Spec.AccessConfig.AuthenticationMode == EKSAuthenticationModeConfigMap) ||
335+
old.Spec.AccessConfig.AuthenticationMode == EKSAuthenticationModeAPI) {
336336
allErrs = append(allErrs,
337337
field.Invalid(field.NewPath("spec", "accessConfig", "authenticationMode"), r.Spec.AccessConfig.AuthenticationMode, "downgrading authentication mode is not allowed after it has been enabled"),
338338
)

controlplane/eks/api/v1beta2/awsmanagedcontrolplane_webhook_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -716,13 +716,13 @@ func TestWebhookUpdate(t *testing.T) {
716716
oldClusterSpec: AWSManagedControlPlaneSpec{
717717
EKSClusterName: "default_cluster1",
718718
AccessConfig: &AccessConfig{
719-
AuthenticationMode: EKSAuthenticationModeApiAndConfigMap,
719+
AuthenticationMode: EKSAuthenticationModeAPIAndConfigMap,
720720
},
721721
},
722722
newClusterSpec: AWSManagedControlPlaneSpec{
723723
EKSClusterName: "default_cluster1",
724724
AccessConfig: &AccessConfig{
725-
AuthenticationMode: EKSAuthenticationModeApi,
725+
AuthenticationMode: EKSAuthenticationModeAPI,
726726
},
727727
},
728728
expectError: false,
@@ -732,7 +732,7 @@ func TestWebhookUpdate(t *testing.T) {
732732
oldClusterSpec: AWSManagedControlPlaneSpec{
733733
EKSClusterName: "default_cluster1",
734734
AccessConfig: &AccessConfig{
735-
AuthenticationMode: EKSAuthenticationModeApi,
735+
AuthenticationMode: EKSAuthenticationModeAPI,
736736
},
737737
},
738738
newClusterSpec: AWSManagedControlPlaneSpec{
@@ -748,7 +748,7 @@ func TestWebhookUpdate(t *testing.T) {
748748
oldClusterSpec: AWSManagedControlPlaneSpec{
749749
EKSClusterName: "default_cluster1",
750750
AccessConfig: &AccessConfig{
751-
AuthenticationMode: EKSAuthenticationModeApiAndConfigMap,
751+
AuthenticationMode: EKSAuthenticationModeAPIAndConfigMap,
752752
},
753753
},
754754
newClusterSpec: AWSManagedControlPlaneSpec{

controlplane/eks/api/v1beta2/types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ var (
8686
// EKSAuthenticationModeConfigMap indicates that only `aws-auth` ConfigMap will be used for authentication
8787
EKSAuthenticationModeConfigMap = EKSAuthenticationMode("CONFIG_MAP")
8888

89-
// EKSAuthenticationModeApi indicates that only AWS Access Entries will be used for authentication
90-
EKSAuthenticationModeApi = EKSAuthenticationMode("API")
89+
// EKSAuthenticationModeAPI indicates that only AWS Access Entries will be used for authentication
90+
EKSAuthenticationModeAPI = EKSAuthenticationMode("API")
9191

92-
// EKSAuthenticationModeApiAndConfigMap indicates that both `aws-auth` ConfigMap and AWS Access Entries will
92+
// EKSAuthenticationModeAPIAndConfigMap indicates that both `aws-auth` ConfigMap and AWS Access Entries will
9393
// be used for authentication
94-
EKSAuthenticationModeApiAndConfigMap = EKSAuthenticationMode("API_AND_CONFIG_MAP")
94+
EKSAuthenticationModeAPIAndConfigMap = EKSAuthenticationMode("API_AND_CONFIG_MAP")
9595
)
9696

9797
var (

0 commit comments

Comments
 (0)