Skip to content

Commit c192252

Browse files
committed
Make revive happy on naming
1 parent 3e5754c commit c192252

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
@@ -302,8 +302,8 @@ func (r *AWSManagedControlPlane) validateAccessConfig(old *AWSManagedControlPlan
302302

303303
// AuthenticationMode is ratcheting - do not allow downgrades
304304
if old.Spec.AccessConfig != nil && old.Spec.AccessConfig.AuthenticationMode != r.Spec.AccessConfig.AuthenticationMode &&
305-
((old.Spec.AccessConfig.AuthenticationMode == EKSAuthenticationModeApiAndConfigMap && r.Spec.AccessConfig.AuthenticationMode == EKSAuthenticationModeConfigMap) ||
306-
old.Spec.AccessConfig.AuthenticationMode == EKSAuthenticationModeApi) {
305+
((old.Spec.AccessConfig.AuthenticationMode == EKSAuthenticationModeAPIAndConfigMap && r.Spec.AccessConfig.AuthenticationMode == EKSAuthenticationModeConfigMap) ||
306+
old.Spec.AccessConfig.AuthenticationMode == EKSAuthenticationModeAPI) {
307307
allErrs = append(allErrs,
308308
field.Invalid(field.NewPath("spec", "accessConfig", "authenticationMode"), r.Spec.AccessConfig.AuthenticationMode, "downgrading authentication mode is not allowed after it has been enabled"),
309309
)

controlplane/eks/api/v1beta2/awsmanagedcontrolplane_webhook_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -650,13 +650,13 @@ func TestWebhookUpdate(t *testing.T) {
650650
oldClusterSpec: AWSManagedControlPlaneSpec{
651651
EKSClusterName: "default_cluster1",
652652
AccessConfig: &AccessConfig{
653-
AuthenticationMode: EKSAuthenticationModeApiAndConfigMap,
653+
AuthenticationMode: EKSAuthenticationModeAPIAndConfigMap,
654654
},
655655
},
656656
newClusterSpec: AWSManagedControlPlaneSpec{
657657
EKSClusterName: "default_cluster1",
658658
AccessConfig: &AccessConfig{
659-
AuthenticationMode: EKSAuthenticationModeApi,
659+
AuthenticationMode: EKSAuthenticationModeAPI,
660660
},
661661
},
662662
expectError: false,
@@ -666,7 +666,7 @@ func TestWebhookUpdate(t *testing.T) {
666666
oldClusterSpec: AWSManagedControlPlaneSpec{
667667
EKSClusterName: "default_cluster1",
668668
AccessConfig: &AccessConfig{
669-
AuthenticationMode: EKSAuthenticationModeApi,
669+
AuthenticationMode: EKSAuthenticationModeAPI,
670670
},
671671
},
672672
newClusterSpec: AWSManagedControlPlaneSpec{
@@ -682,7 +682,7 @@ func TestWebhookUpdate(t *testing.T) {
682682
oldClusterSpec: AWSManagedControlPlaneSpec{
683683
EKSClusterName: "default_cluster1",
684684
AccessConfig: &AccessConfig{
685-
AuthenticationMode: EKSAuthenticationModeApiAndConfigMap,
685+
AuthenticationMode: EKSAuthenticationModeAPIAndConfigMap,
686686
},
687687
},
688688
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)