From cf707a1644b0a7fea8c17e3d228daba8a09f1981 Mon Sep 17 00:00:00 2001 From: Marques Johansson Date: Sun, 14 Jul 2024 13:15:26 -0400 Subject: [PATCH 1/2] chore(deps): update build/, up, and terraform versions Signed-off-by: Marques Johansson --- .github/workflows/ci.yml | 10 +++++----- Makefile | 9 ++++----- build | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43198bb..2e99ed2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: restore-keys: ${{ runner.os }}-pkg- - name: Vendor Dependencies - run: make vendor vendor.check + run: make go.vendor go.vendor.check # We could run 'make lint' but we prefer this action because it leaves # 'annotations' (i.e. it comments on PRs to point out linter violations). @@ -118,7 +118,7 @@ jobs: restore-keys: ${{ runner.os }}-pkg- - name: Vendor Dependencies - run: make vendor vendor.check + run: make go.vendor go.vendor.check - name: Check Diff run: make check-diff @@ -161,7 +161,7 @@ jobs: restore-keys: ${{ runner.os }}-pkg- - name: Vendor Dependencies - run: make vendor vendor.check + run: make go.vendor go.vendor.check - name: Run Unit Tests run: make -j2 test @@ -222,7 +222,7 @@ jobs: ${{ runner.os }}-pkg- - name: Vendor Dependencies - run: make vendor vendor.check + run: make go.vendor go.vendor.check - name: Build Helm Chart run: make -j2 build @@ -283,7 +283,7 @@ jobs: restore-keys: ${{ runner.os }}-pkg- - name: Vendor Dependencies - run: make vendor vendor.check + run: make go.vendor go.vendor.check - name: Build Artifacts run: make -j2 build.all diff --git a/Makefile b/Makefile index 306f6c7..71e905a 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ PROJECT_REPO := github.com/crossplane-contrib/$(PROJECT_NAME) GO_REQUIRED_VERSION ?= 1.19 GOLANGCILINT_VERSION ?= 1.57.2 -export TERRAFORM_VERSION := 1.3.1 +export TERRAFORM_VERSION := 1.5.5 export TERRAFORM_PROVIDER_SOURCE := equinix/equinix export TERRAFORM_PROVIDER_VERSION := 1.36.0 @@ -52,7 +52,7 @@ GO111MODULE = on # ==================================================================================== # Setup Kubernetes tools -UP_VERSION = v0.13.0 +UP_VERSION = v0.28.0 UP_CHANNEL = stable -include build/makelib/k8s_tools.mk @@ -69,7 +69,7 @@ XPKG_REG_ORGS ?= xpkg.upbound.io/equinix index.docker.io/crossplane # NOTE(hasheddan): skip promoting on xpkg.upbound.io as channel tags are # inferred. XPKG_REG_ORGS_NO_PROMOTE ?= xpkg.upbound.io/equinix -XPKGS = provider-jet-equinix +XPKGS = $(PROJECT_NAME) -include build/makelib/xpkg.mk # NOTE(hasheddan): we force image building to happen prior to xpkg build so that @@ -109,7 +109,7 @@ $(TERRAFORM_PROVIDER_SCHEMA): $(TERRAFORM) @$(INFO) generating provider schema for $(TERRAFORM_PROVIDER_SOURCE) $(TERRAFORM_PROVIDER_VERSION) @mkdir -p $(TERRAFORM_WORKDIR) @echo '{"terraform":[{"required_providers":[{"provider":{"source":"'"$(TERRAFORM_PROVIDER_SOURCE)"'","version":"'"$(TERRAFORM_PROVIDER_VERSION)"'"}}],"required_version":"'"$(TERRAFORM_VERSION)"'"}]}' > $(TERRAFORM_WORKDIR)/main.tf.json - @$(TERRAFORM) -chdir=$(TERRAFORM_WORKDIR) init > $(TERRAFORM_WORKDIR)/terraform-logs.txt 2>&1 + @$(TERRAFORM) -chdir=$(TERRAFORM_WORKDIR) init -upgrade > $(TERRAFORM_WORKDIR)/terraform-logs.txt 2>&1 @$(TERRAFORM) -chdir=$(TERRAFORM_WORKDIR) providers schema -json=true > $(TERRAFORM_PROVIDER_SCHEMA) 2>> $(TERRAFORM_WORKDIR)/terraform-logs.txt @$(OK) generating provider schema for $(TERRAFORM_PROVIDER_SOURCE) $(TERRAFORM_PROVIDER_VERSION) @@ -124,7 +124,6 @@ pull-docs: @rm -f "$(WORK_DIR)/$(TERRAFORM_PROVIDER_SOURCE)/$(TERRAFORM_DOCS_PATH)/equinix_metal_port_vlan_attachment.md" \ "$(WORK_DIR)/$(TERRAFORM_PROVIDER_SOURCE)/$(TERRAFORM_DOCS_PATH)/equinix_fabric_routing_protocol.md" - generate.init: $(TERRAFORM_PROVIDER_SCHEMA) pull-docs generate.init: $(TERRAFORM_PROVIDER_SCHEMA) pull-docs diff --git a/build b/build index 7da2fde..231258d 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 7da2fdeb3dc1ebbce8210a58616debe34ef0fd97 +Subproject commit 231258db281237379d8ec0c6e4af9d7c1ae5cc4a From 21d60f968de73c428549b4c1e57b29a858c556db Mon Sep 17 00:00:00 2001 From: Marques Johansson Date: Sun, 14 Jul 2024 13:48:02 -0400 Subject: [PATCH 2/2] chore(lint): update golangci-lint config to remove deprecations Signed-off-by: Marques Johansson --- .golangci.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index e404d5d..7378286 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,12 +1,11 @@ run: - deadline: 10m - - skip-files: - - "zz_\\..+\\.go$" + deadline: 20m output: # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" - format: colored-line-number + formats: + - format: colored-line-number + path: stdout linters-settings: errcheck: @@ -27,9 +26,9 @@ linters-settings: # report about shadowed variables check-shadowing: false - golint: - # minimal confidence for issues, default is 0.8 - min-confidence: 0.8 + revive: + # confidence for issues, default is 0.8 + confidence: 0.8 gofmt: # simplify code: gofmt with `-s` option, true by default @@ -42,7 +41,7 @@ linters-settings: gocyclo: # minimal code complexity to report, 30 by default (but we recommend 10-20) - min-complexity: 10 + min-complexity: 20 maligned: # print struct with more effective memory layout or not, false by default @@ -108,12 +107,11 @@ linters: - govet - gocyclo - gocritic - - interfacer - goconst - goimports - gofmt # We enable this as well as goimports for its simplify mode. - prealloc - - golint + - revive - unconvert - misspell - nakedret @@ -125,6 +123,10 @@ linters: issues: + # Exclude generated files + exclude-files: + - "zz_\\..+\\.go$" + # Excluding configuration per-path and per-linter exclude-rules: # Exclude some linters from running on tests files.