From 28ce1779eadb7c6ff584413823322907fba38885 Mon Sep 17 00:00:00 2001 From: Rohan Date: Wed, 5 Jul 2023 13:04:39 +0000 Subject: [PATCH] AV-183200 Golang lint and TF tests failure --- .github/workflows/golangci-lint.yml | 4 +- .github/workflows/release.yml | 4 +- .golangci.yml | 8 +-- GNUmakefile | 4 +- ...data_source_avi_applicationprofile_test.go | 9 +++ ...ta_source_avi_controllerproperties_test.go | 2 +- ...ta_source_avi_customipamdnsprofile_test.go | 2 +- avi/data_source_avi_dnspolicy_test.go | 2 +- avi/data_source_avi_ipaddrgroup_test.go | 2 +- ..._source_avi_ipamdnsproviderprofile_test.go | 2 +- avi/data_source_avi_sslprofile_test.go | 10 +-- avi/datasource_avi_backupconfiguration.go | 4 ++ avi/datasource_avi_customipamdnsprofile.go | 2 +- avi/datasource_avi_dnspolicy.go | 2 +- avi/datasource_avi_dynamicdnsrecord.go | 2 +- avi/datasource_avi_ipaddrgroup.go | 2 +- avi/datasource_avi_ipamdnsproviderprofile.go | 2 +- avi/provider.go | 20 +++--- avi/resource_avi_applicationprofile_test.go | 18 +++++ avi/resource_avi_backupconfiguration.go | 5 ++ avi/resource_avi_controllerproperties_test.go | 4 +- avi/resource_avi_customipamdnsprofile.go | 14 ++-- avi/resource_avi_customipamdnsprofile_test.go | 8 +-- avi/resource_avi_dnspolicy.go | 14 ++-- avi/resource_avi_dnspolicy_test.go | 8 +-- avi/resource_avi_dynamicdnsrecord.go | 14 ++-- avi/resource_avi_ipaddrgroup.go | 14 ++-- avi/resource_avi_ipaddrgroup_test.go | 8 +-- avi/resource_avi_ipamdnsproviderprofile.go | 14 ++-- ...esource_avi_ipamdnsproviderprofile_test.go | 8 +-- avi/resource_avi_sslprofile_test.go | 20 +++--- avi/resource_avi_user.go | 8 ++- go.mod | 2 +- go.sum | 70 +------------------ .../d/avi_backupconfiguration.html.markdown | 1 + website/docs/d/avi_gslb.html.markdown | 2 +- .../r/avi_backupconfiguration.html.markdown | 1 + website/docs/r/avi_gslb.html.markdown | 2 +- 38 files changed, 143 insertions(+), 175 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index fbf80dda1..7c208b1af 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -14,8 +14,8 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: - version: v1.48.0 - args: --issues-exit-code=1 + version: v1.53.3 + args: run --issues-exit-code=1 only-new-issues: true skip-pkg-cache: true skip-build-cache: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cf1465ef6..556d9ab3f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,8 +22,8 @@ jobs: name: golangci-lint uses: golangci/golangci-lint-action@v2 with: - version: v1.48.0 - args: --issues-exit-code=1 + version: v1.53.3 + args: run --issues-exit-code=1 skip-pkg-cache: true skip-build-cache: true - diff --git a/.golangci.yml b/.golangci.yml index 7f5b3f1c2..f816bc332 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,8 +2,7 @@ issues: max-per-linter: 0 max-same-issues: 0 exclude: - - SA1019 - + - SA1019 run: deadline: 5m skip-files: @@ -12,23 +11,18 @@ run: linters: disable-all: true enable: - - deadcode - errcheck - gofmt - goimports - - golint - gosimple - govet - ineffassign - - interfacer - nakedret - misspell - staticcheck - - structcheck - typecheck - unused - unconvert - - varcheck - vet - vetshadow diff --git a/GNUmakefile b/GNUmakefile index 376928bce..22e3343b2 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -9,11 +9,11 @@ build: fmtcheck build13: GOOS=$(shell go env GOOS) build13: GOARCH=$(shell go env GOARCH) -build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(AVI_PROVIDER_NAMESPACE)/22.1.3/$(GOOS)_$(GOARCH) +build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(AVI_PROVIDER_NAMESPACE)/30.1.1/$(GOOS)_$(GOARCH) build13: fmtcheck @echo "==> Installing plugin to $(DESTINATION)" @mkdir -p $(DESTINATION) - go build -o $(DESTINATION)/terraform-provider-avi_v22.1.3 + go build -o $(DESTINATION)/terraform-provider-avi_v30.1.1 test: fmtcheck go test -i $(TEST) || exit 1 diff --git a/avi/data_source_avi_applicationprofile_test.go b/avi/data_source_avi_applicationprofile_test.go index afc35b981..bb1f11cc4 100644 --- a/avi/data_source_avi_applicationprofile_test.go +++ b/avi/data_source_avi_applicationprofile_test.go @@ -92,6 +92,15 @@ resource "avi_applicationprofile" "testApplicationProfile" { max_object_size = "4194304" mime_types_group_refs = [data.avi_stringgroup.system_cacheablestringgroup.id] } + http2_profile { + http2_initial_window_size = "64" + max_http2_concurrent_streams_per_connection = "128" + max_http2_control_frames_per_connection = "1000" + max_http2_empty_data_frames_per_connection = "1000" + max_http2_header_field_size = "4096" + max_http2_queued_frames_to_client_per_connection = "1000" + max_http2_requests_per_connection = "1000" + } max_rps_unknown_uri = "0" post_accept_timeout = "30000" client_header_timeout = "10000" diff --git a/avi/data_source_avi_controllerproperties_test.go b/avi/data_source_avi_controllerproperties_test.go index eaa66c4cf..ab0a9bcee 100644 --- a/avi/data_source_avi_controllerproperties_test.go +++ b/avi/data_source_avi_controllerproperties_test.go @@ -147,7 +147,7 @@ resource "avi_controllerproperties" "testControllerProperties" { max_seq_attach_ip_failures = "3" secure_channel_cleanup_timeout = "60" vs_se_vnic_ip_fail = "120" - ssl_certificate_expiry_warning_days = ["30","7","1"] + ssl_certificate_expiry_warning_days = ["1","7","30"] secure_channel_se_token_timeout = "60" secure_channel_controller_token_timeout = "60" api_idle_timeout = "15" diff --git a/avi/data_source_avi_customipamdnsprofile_test.go b/avi/data_source_avi_customipamdnsprofile_test.go index a5e398f01..ecd7cd3f1 100644 --- a/avi/data_source_avi_customipamdnsprofile_test.go +++ b/avi/data_source_avi_customipamdnsprofile_test.go @@ -26,7 +26,7 @@ func TestAVIDataSourceCustomIpamDnsProfileBasic(t *testing.T) { } -//nolint +// nolint const testAccAVIDSCustomIpamDnsProfileConfig = ` data "avi_tenant" "default_tenant"{ name= "admin" diff --git a/avi/data_source_avi_dnspolicy_test.go b/avi/data_source_avi_dnspolicy_test.go index ab54f500f..1d4800d58 100644 --- a/avi/data_source_avi_dnspolicy_test.go +++ b/avi/data_source_avi_dnspolicy_test.go @@ -26,7 +26,7 @@ func TestAVIDataSourceDnsPolicyBasic(t *testing.T) { } -//nolint +// nolint const testAccAVIDSDnsPolicyConfig = ` data "avi_tenant" "default_tenant"{ name= "admin" diff --git a/avi/data_source_avi_ipaddrgroup_test.go b/avi/data_source_avi_ipaddrgroup_test.go index d33d34b98..c3e1901c1 100644 --- a/avi/data_source_avi_ipaddrgroup_test.go +++ b/avi/data_source_avi_ipaddrgroup_test.go @@ -26,7 +26,7 @@ func TestAVIDataSourceIpAddrGroupBasic(t *testing.T) { } -//nolint +// nolint const testAccAVIDSIpAddrGroupConfig = ` data "avi_tenant" "default_tenant"{ name= "admin" diff --git a/avi/data_source_avi_ipamdnsproviderprofile_test.go b/avi/data_source_avi_ipamdnsproviderprofile_test.go index 342402295..c46e3b5f9 100644 --- a/avi/data_source_avi_ipamdnsproviderprofile_test.go +++ b/avi/data_source_avi_ipamdnsproviderprofile_test.go @@ -28,7 +28,7 @@ func TestAVIDataSourceIpamDnsProviderProfileBasic(t *testing.T) { } -//nolint +// nolint const testAccAVIDSIpamDnsProviderProfileConfig = ` data "avi_tenant" "default_tenant"{ name= "admin" diff --git a/avi/data_source_avi_sslprofile_test.go b/avi/data_source_avi_sslprofile_test.go index 3f66a47a4..6f57174ed 100644 --- a/avi/data_source_avi_sslprofile_test.go +++ b/avi/data_source_avi_sslprofile_test.go @@ -42,7 +42,7 @@ resource "avi_sslprofile" "testSSLProfile" { name = "test-System-Standard-abc" tenant_ref = data.avi_tenant.default_tenant.id ssl_session_timeout = "86400" - 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" + accepted_ciphers = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384" prefer_client_cipher_ordering = false accepted_versions { type = "SSL_VERSION_TLS1" @@ -54,12 +54,12 @@ accepted_versions { type = "SSL_VERSION_TLS1_2" } enable_ssl_session_reuse = true - 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"] + 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"] send_close_notify = true ssl_rating { - performance_rating = "SSL_SCORE_EXCELLENT" - security_score = "100.0" - compatibility_rating = "SSL_SCORE_EXCELLENT" + performance_rating = "SSL_SCORE_NOT_SECURE" + security_score = "100" + compatibility_rating = "SSL_SCORE_GOOD" } dhparam = <