-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tls_mutual_authentication): Ensure that 'enforced' property does …
…not revert to default during changes. (#890) * Use GO_BIN environment variable to find Go binary. * fix(tls_mutual_authentication): Ensure that 'enforced' property does not revert to default during changes. If the 'enforced' property was already set to true in the configuration, and the name (or certificate bundle) of an MTLS authentication resource was changed, the 'enforced' property would revert to 'false'.
- Loading branch information
Showing
3 changed files
with
76 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
TEST?=$$(go list ./... |grep -v 'vendor') | ||
GO_BIN ?= go ## Allows overriding go executable. | ||
|
||
TEST?=$$($(GO_BIN) list ./... |grep -v 'vendor') | ||
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) | ||
WEBSITE_REPO=github.com/hashicorp/terraform-website | ||
PKG_NAME=fastly | ||
|
@@ -9,7 +11,7 @@ VERSION_SHORT=$(shell git describe --tags --always --abbrev=0) | |
DOCS_PROVIDER_VERSION=$(subst v,,$(VERSION_SHORT)) | ||
|
||
# Enables support for tools such as https://github.com/rakyll/gotest | ||
TEST_COMMAND ?= go test | ||
TEST_COMMAND ?= $(GO_BIN) test | ||
|
||
# R019: ignore large number of arguments passed to HasChanges(). | ||
# R018: replace sleep with either resource.Retry() or WaitForState(). | ||
|
@@ -19,8 +21,8 @@ TFPROVIDERLINT_DEFAULT_FLAGS=-R001=false -R018=false -R019=false | |
# XAT001: missing resource.TestCase ErrorCheck. | ||
TFPROVIDERLINTX_DEFAULT_FLAGS=-XAT001=false | ||
|
||
GOHOSTOS ?= $(shell go env GOHOSTOS || echo unknown) | ||
GOHOSTARCH ?= $(shell go env GOHOSTARCH || echo unknown) | ||
GOHOSTOS ?= $(shell $(GO_BIN) env GOHOSTOS || echo unknown) | ||
GOHOSTARCH ?= $(shell $(GO_BIN) env GOHOSTARCH || echo unknown) | ||
|
||
# Use a parallelism of 4 by default for tests, overriding whatever GOMAXPROCS is | ||
# set to. For the acceptance tests especially, the main bottleneck affecting the | ||
|
@@ -32,7 +34,7 @@ TEST_PARALLELISM?=4 | |
default: build | ||
|
||
build: clean | ||
go build -o bin/terraform-provider-$(PKG_NAME)_$(VERSION) -ldflags="-X $(FULL_PKG_NAME)/$(VERSION_PLACEHOLDER)=$(VERSION)" | ||
$(GO_BIN) build -o bin/terraform-provider-$(PKG_NAME)_$(VERSION) -ldflags="-X $(FULL_PKG_NAME)/$(VERSION_PLACEHOLDER)=$(VERSION)" | ||
@sh -c "'$(CURDIR)/scripts/generate-dev-overrides.sh'" | ||
|
||
test: | ||
|
@@ -65,7 +67,7 @@ clean_test: | |
fi | ||
|
||
vet: | ||
@go vet $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \ | ||
@$(GO_BIN) vet $$($(GO_BIN) list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \ | ||
echo "\nVet found suspicious constructs. Please check the reported constructs"; \ | ||
echo "and fix them if necessary before submitting the code for review."; \ | ||
exit 1; \ | ||
|
@@ -82,7 +84,7 @@ errcheck: | |
|
||
goreleaser-bin: | ||
@# This is the last version of goreleaser that supports Go 1.20.14 (the version used to build the provider) | ||
go install github.com/goreleaser/[email protected] | ||
$(GO_BIN) install github.com/goreleaser/[email protected] | ||
|
||
nilaway: | ||
@nilaway ./... | ||
|
@@ -107,7 +109,7 @@ test-compile: | |
BIN=$(CURDIR)/bin | ||
$(BIN)/%: | ||
@echo "Installing tools from tools/tools.go" | ||
@cat tools/tools.go | grep _ | awk -F '"' '{print $$2}' | GOBIN=$(BIN) xargs -tI {} go install {} | ||
@cat tools/tools.go | grep _ | awk -F '"' '{print $$2}' | GOBIN=$(BIN) xargs -tI {} $(GO_BIN) install {} | ||
|
||
generate-docs: $(BIN)/tfplugindocs | ||
$(shell sed -e "s/__VERSION__/$(DOCS_PROVIDER_VERSION)/g" examples/index-fastly-provider.tf.tmpl > examples/index-fastly-provider.tf) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters