Skip to content

Commit d03136c

Browse files
author
Rohan
committed
AV-183200 Golang lint and TF tests failure
Signed-off-by: Rohan Suryawanshi <[email protected]>
1 parent 6aa5d65 commit d03136c

38 files changed

+143
-175
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
- name: golangci-lint
1515
uses: golangci/golangci-lint-action@v2
1616
with:
17-
version: v1.48.0
18-
args: --issues-exit-code=1
17+
version: v1.53.3
18+
args: run --issues-exit-code=1
1919
only-new-issues: true
2020
skip-pkg-cache: true
2121
skip-build-cache: true

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
name: golangci-lint
2323
uses: golangci/golangci-lint-action@v2
2424
with:
25-
version: v1.48.0
26-
args: --issues-exit-code=1
25+
version: v1.53.3
26+
args: run --issues-exit-code=1
2727
skip-pkg-cache: true
2828
skip-build-cache: true
2929
-

.golangci.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ issues:
22
max-per-linter: 0
33
max-same-issues: 0
44
exclude:
5-
- SA1019
6-
5+
- SA1019
76
run:
87
deadline: 5m
98
skip-files:
@@ -12,23 +11,18 @@ run:
1211
linters:
1312
disable-all: true
1413
enable:
15-
- deadcode
1614
- errcheck
1715
- gofmt
1816
- goimports
19-
- golint
2017
- gosimple
2118
- govet
2219
- ineffassign
23-
- interfacer
2420
- nakedret
2521
- misspell
2622
- staticcheck
27-
- structcheck
2823
- typecheck
2924
- unused
3025
- unconvert
31-
- varcheck
3226
- vet
3327
- vetshadow
3428

GNUmakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ build: fmtcheck
99

1010
build13: GOOS=$(shell go env GOOS)
1111
build13: GOARCH=$(shell go env GOARCH)
12-
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(AVI_PROVIDER_NAMESPACE)/22.1.3/$(GOOS)_$(GOARCH)
12+
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(AVI_PROVIDER_NAMESPACE)/30.1.1/$(GOOS)_$(GOARCH)
1313
build13: fmtcheck
1414
@echo "==> Installing plugin to $(DESTINATION)"
1515
@mkdir -p $(DESTINATION)
16-
go build -o $(DESTINATION)/terraform-provider-avi_v22.1.3
16+
go build -o $(DESTINATION)/terraform-provider-avi_v30.1.1
1717

1818
test: fmtcheck
1919
go test -i $(TEST) || exit 1

avi/data_source_avi_applicationprofile_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ resource "avi_applicationprofile" "testApplicationProfile" {
9292
max_object_size = "4194304"
9393
mime_types_group_refs = [data.avi_stringgroup.system_cacheablestringgroup.id]
9494
}
95+
http2_profile {
96+
http2_initial_window_size = "64"
97+
max_http2_concurrent_streams_per_connection = "128"
98+
max_http2_control_frames_per_connection = "1000"
99+
max_http2_empty_data_frames_per_connection = "1000"
100+
max_http2_header_field_size = "4096"
101+
max_http2_queued_frames_to_client_per_connection = "1000"
102+
max_http2_requests_per_connection = "1000"
103+
}
95104
max_rps_unknown_uri = "0"
96105
post_accept_timeout = "30000"
97106
client_header_timeout = "10000"

avi/data_source_avi_controllerproperties_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ resource "avi_controllerproperties" "testControllerProperties" {
147147
max_seq_attach_ip_failures = "3"
148148
secure_channel_cleanup_timeout = "60"
149149
vs_se_vnic_ip_fail = "120"
150-
ssl_certificate_expiry_warning_days = ["30","7","1"]
150+
ssl_certificate_expiry_warning_days = ["1","7","30"]
151151
secure_channel_se_token_timeout = "60"
152152
secure_channel_controller_token_timeout = "60"
153153
api_idle_timeout = "15"

avi/data_source_avi_customipamdnsprofile_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestAVIDataSourceCustomIpamDnsProfileBasic(t *testing.T) {
2626

2727
}
2828

29-
//nolint
29+
// nolint
3030
const testAccAVIDSCustomIpamDnsProfileConfig = `
3131
data "avi_tenant" "default_tenant"{
3232
name= "admin"

avi/data_source_avi_dnspolicy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestAVIDataSourceDnsPolicyBasic(t *testing.T) {
2626

2727
}
2828

29-
//nolint
29+
// nolint
3030
const testAccAVIDSDnsPolicyConfig = `
3131
data "avi_tenant" "default_tenant"{
3232
name= "admin"

avi/data_source_avi_ipaddrgroup_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestAVIDataSourceIpAddrGroupBasic(t *testing.T) {
2626

2727
}
2828

29-
//nolint
29+
// nolint
3030
const testAccAVIDSIpAddrGroupConfig = `
3131
data "avi_tenant" "default_tenant"{
3232
name= "admin"

avi/data_source_avi_ipamdnsproviderprofile_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func TestAVIDataSourceIpamDnsProviderProfileBasic(t *testing.T) {
2828

2929
}
3030

31-
//nolint
31+
// nolint
3232
const testAccAVIDSIpamDnsProviderProfileConfig = `
3333
data "avi_tenant" "default_tenant"{
3434
name= "admin"

avi/data_source_avi_sslprofile_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ resource "avi_sslprofile" "testSSLProfile" {
4242
name = "test-System-Standard-abc"
4343
tenant_ref = data.avi_tenant.default_tenant.id
4444
ssl_session_timeout = "86400"
45-
accepted_ciphers = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA"
45+
accepted_ciphers = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384"
4646
prefer_client_cipher_ordering = false
4747
accepted_versions {
4848
type = "SSL_VERSION_TLS1"
@@ -54,12 +54,12 @@ accepted_versions {
5454
type = "SSL_VERSION_TLS1_2"
5555
}
5656
enable_ssl_session_reuse = true
57-
cipher_enums = ["TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA","TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA","TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384","TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256","TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384","TLS_RSA_WITH_AES_128_GCM_SHA256","TLS_RSA_WITH_AES_256_GCM_SHA384","TLS_RSA_WITH_AES_128_CBC_SHA256","TLS_RSA_WITH_AES_256_CBC_SHA256","TLS_RSA_WITH_AES_128_CBC_SHA","TLS_RSA_WITH_AES_256_CBC_SHA","TLS_RSA_WITH_3DES_EDE_CBC_SHA","TLS_AES_256_GCM_SHA384","TLS_CHACHA20_POLY1305_SHA256","TLS_AES_128_GCM_SHA256"]
57+
cipher_enums = ["TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384","TLS_AES_256_GCM_SHA384","TLS_CHACHA20_POLY1305_SHA256","TLS_AES_128_GCM_SHA256"]
5858
send_close_notify = true
5959
ssl_rating {
60-
performance_rating = "SSL_SCORE_EXCELLENT"
61-
security_score = "100.0"
62-
compatibility_rating = "SSL_SCORE_EXCELLENT"
60+
performance_rating = "SSL_SCORE_NOT_SECURE"
61+
security_score = "100"
62+
compatibility_rating = "SSL_SCORE_GOOD"
6363
}
6464
dhparam = <<EOF
6565
-----BEGIN DH PARAMETERS-----

avi/datasource_avi_backupconfiguration.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ func dataSourceAviBackupConfiguration() *schema.Resource {
5959
Type: schema.TypeString,
6060
Computed: true,
6161
},
62+
"s3_bucket_folder": {
63+
Type: schema.TypeString,
64+
Computed: true,
65+
},
6266
"save_local": {
6367
Type: schema.TypeString,
6468
Computed: true,

avi/datasource_avi_customipamdnsprofile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package avi
55

66
import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
77

8-
//nolint
8+
// nolint
99
func dataSourceAviCustomIpamDnsProfile() *schema.Resource {
1010
return &schema.Resource{
1111
Read: ResourceAviCustomIpamDnsProfileRead,

avi/datasource_avi_dnspolicy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package avi
55

66
import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
77

8-
//nolint
8+
// nolint
99
func dataSourceAviDnsPolicy() *schema.Resource {
1010
return &schema.Resource{
1111
Read: ResourceAviDnsPolicyRead,

avi/datasource_avi_dynamicdnsrecord.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package avi
55

66
import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
77

8-
//nolint
8+
// nolint
99
func dataSourceAviDynamicDnsRecord() *schema.Resource {
1010
return &schema.Resource{
1111
Read: ResourceAviDynamicDnsRecordRead,

avi/datasource_avi_ipaddrgroup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package avi
55

66
import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
77

8-
//nolint
8+
// nolint
99
func dataSourceAviIpAddrGroup() *schema.Resource {
1010
return &schema.Resource{
1111
Read: ResourceAviIpAddrGroupRead,

avi/datasource_avi_ipamdnsproviderprofile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package avi
55

66
import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
77

8-
//nolint
8+
// nolint
99
func dataSourceAviIpamDnsProviderProfile() *schema.Resource {
1010
return &schema.Resource{
1111
Read: ResourceAviIpamDnsProviderProfileRead,

avi/provider.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
315315
Tenant: "admin",
316316
Version: "18.2.8",
317317
AuthToken: d.Get("avi_authtoken").(string),
318-
CSP_TOKEN: d.Get("avi_csp_token").(string),
319-
CSP_HOST: d.Get("avi_csp_host").(string),
318+
CSPToken: d.Get("avi_csp_token").(string),
319+
CSPHost: d.Get("avi_csp_host").(string),
320320
Timeout: time.Duration(d.Get("avi_api_timeout").(int)) * time.Second,
321321
}
322322
if username, ok := d.GetOk("avi_username"); ok {
@@ -332,11 +332,11 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
332332
if timeout, ok := d.GetOk("avi_api_timeout"); ok {
333333
config.Timeout = time.Duration(timeout.(int)) * time.Second
334334
}
335-
if Csp_token, ok := d.GetOk("avi_csp_token"); ok {
336-
config.CSP_TOKEN = Csp_token.(string)
335+
if csptoken, ok := d.GetOk("avi_csp_token"); ok {
336+
config.CSPToken = csptoken.(string)
337337
}
338-
if Csp_host, ok := d.GetOk("avi_csp_host"); ok {
339-
config.CSP_HOST = Csp_host.(string)
338+
if csphost, ok := d.GetOk("avi_csp_host"); ok {
339+
config.CSPHost = csphost.(string)
340340
}
341341

342342
aviClient, err := clients.NewAviClient(
@@ -346,8 +346,8 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
346346
session.SetVersion(config.Version),
347347
session.SetAuthToken(config.AuthToken),
348348
session.SetInsecure, session.SetTimeout(config.Timeout),
349-
session.SetCSPHost(config.CSP_HOST),
350-
session.SetCSPToken(config.CSP_TOKEN),
349+
session.SetCSPHost(config.CSPHost),
350+
session.SetCSPToken(config.CSPToken),
351351
session.SetLazyAuthentication(true))
352352

353353
log.Printf("Avi Client created for user %s tenant %s version %s\n",
@@ -363,7 +363,7 @@ type Credentials struct {
363363
Tenant string
364364
Version string
365365
AuthToken string
366-
CSP_HOST string
367-
CSP_TOKEN string
366+
CSPHost string
367+
CSPToken string
368368
Timeout time.Duration
369369
}

avi/resource_avi_applicationprofile_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,15 @@ resource "avi_applicationprofile" "testApplicationProfile" {
160160
max_object_size = "4194304"
161161
mime_types_group_refs = [data.avi_stringgroup.system_cacheablestringgroup.id]
162162
}
163+
http2_profile {
164+
http2_initial_window_size = "64"
165+
max_http2_concurrent_streams_per_connection = "128"
166+
max_http2_control_frames_per_connection = "1000"
167+
max_http2_empty_data_frames_per_connection = "1000"
168+
max_http2_header_field_size = "4096"
169+
max_http2_queued_frames_to_client_per_connection = "1000"
170+
max_http2_requests_per_connection = "1000"
171+
}
163172
max_rps_unknown_uri = "0"
164173
post_accept_timeout = "30000"
165174
client_header_timeout = "10000"
@@ -239,6 +248,15 @@ resource "avi_applicationprofile" "testApplicationProfile" {
239248
max_object_size = "4194304"
240249
mime_types_group_refs = [data.avi_stringgroup.system_cacheablestringgroup.id]
241250
}
251+
http2_profile {
252+
http2_initial_window_size = "64"
253+
max_http2_concurrent_streams_per_connection = "128"
254+
max_http2_control_frames_per_connection = "1000"
255+
max_http2_empty_data_frames_per_connection = "1000"
256+
max_http2_header_field_size = "4096"
257+
max_http2_queued_frames_to_client_per_connection = "1000"
258+
max_http2_requests_per_connection = "1000"
259+
}
242260
max_rps_unknown_uri = "0"
243261
post_accept_timeout = "30000"
244262
client_header_timeout = "10000"

avi/resource_avi_backupconfiguration.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ func ResourceBackupConfigurationSchema() map[string]*schema.Schema {
8080
Optional: true,
8181
Computed: true,
8282
},
83+
"s3_bucket_folder": {
84+
Type: schema.TypeString,
85+
Optional: true,
86+
Computed: true,
87+
},
8388
"save_local": {
8489
Type: schema.TypeString,
8590
Optional: true,

avi/resource_avi_controllerproperties_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ resource "avi_controllerproperties" "testControllerProperties" {
266266
max_seq_attach_ip_failures = "3"
267267
secure_channel_cleanup_timeout = "60"
268268
vs_se_vnic_ip_fail = "120"
269-
ssl_certificate_expiry_warning_days = ["30","7","1"]
269+
ssl_certificate_expiry_warning_days = ["1","7","30"]
270270
secure_channel_se_token_timeout = "60"
271271
secure_channel_controller_token_timeout = "60"
272272
api_idle_timeout = "15"
@@ -314,7 +314,7 @@ resource "avi_controllerproperties" "testControllerProperties" {
314314
max_seq_attach_ip_failures = "3"
315315
secure_channel_cleanup_timeout = "60"
316316
vs_se_vnic_ip_fail = "120"
317-
ssl_certificate_expiry_warning_days = ["30","7","1"]
317+
ssl_certificate_expiry_warning_days = ["1","7","30"]
318318
secure_channel_se_token_timeout = "60"
319319
secure_channel_controller_token_timeout = "60"
320320
api_idle_timeout = "15"

avi/resource_avi_customipamdnsprofile.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/vmware/alb-sdk/go/clients"
1212
)
1313

14-
//nolint
14+
// nolint
1515
func ResourceCustomIpamDnsProfileSchema() map[string]*schema.Schema {
1616
return map[string]*schema.Schema{
1717
"configpb_attributes": {
@@ -46,7 +46,7 @@ func ResourceCustomIpamDnsProfileSchema() map[string]*schema.Schema {
4646
}
4747
}
4848

49-
//nolint
49+
// nolint
5050
func resourceAviCustomIpamDnsProfile() *schema.Resource {
5151
return &schema.Resource{
5252
Create: resourceAviCustomIpamDnsProfileCreate,
@@ -60,13 +60,13 @@ func resourceAviCustomIpamDnsProfile() *schema.Resource {
6060
}
6161
}
6262

63-
//nolint
63+
// nolint
6464
func ResourceCustomIpamDnsProfileImporter(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) {
6565
s := ResourceCustomIpamDnsProfileSchema()
6666
return ResourceImporter(d, m, "customipamdnsprofile", s)
6767
}
6868

69-
//nolint
69+
// nolint
7070
func ResourceAviCustomIpamDnsProfileRead(d *schema.ResourceData, meta interface{}) error {
7171
s := ResourceCustomIpamDnsProfileSchema()
7272
err := APIRead(d, meta, "customipamdnsprofile", s)
@@ -76,7 +76,7 @@ func ResourceAviCustomIpamDnsProfileRead(d *schema.ResourceData, meta interface{
7676
return err
7777
}
7878

79-
//nolint
79+
// nolint
8080
func resourceAviCustomIpamDnsProfileCreate(d *schema.ResourceData, meta interface{}) error {
8181
s := ResourceCustomIpamDnsProfileSchema()
8282
err := APICreateOrUpdate(d, meta, "customipamdnsprofile", s)
@@ -86,7 +86,7 @@ func resourceAviCustomIpamDnsProfileCreate(d *schema.ResourceData, meta interfac
8686
return err
8787
}
8888

89-
//nolint
89+
// nolint
9090
func resourceAviCustomIpamDnsProfileUpdate(d *schema.ResourceData, meta interface{}) error {
9191
s := ResourceCustomIpamDnsProfileSchema()
9292
var err error
@@ -97,7 +97,7 @@ func resourceAviCustomIpamDnsProfileUpdate(d *schema.ResourceData, meta interfac
9797
return err
9898
}
9999

100-
//nolint
100+
// nolint
101101
func resourceAviCustomIpamDnsProfileDelete(d *schema.ResourceData, meta interface{}) error {
102102
objType := "customipamdnsprofile"
103103
client := meta.(*clients.AviClient)

0 commit comments

Comments
 (0)