Skip to content

Commit da2f00b

Browse files
set user agent with proper terraform provider information (#28)
2 parents d537052 + f972fe0 commit da2f00b

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ terraform.rc
2626
terraform
2727

2828
.vscode/
29-
.idea/
29+
.idea/
30+
31+
dev_test_state/

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
TEST?=$$(go list ./... | grep -v 'vendor')
22
HOSTNAME=github.com
3+
TF_HOSTNAME=registry.terraform.io
34
NAMESPACE=komodorio
45
NAME=komodor
56
BINARY=terraform-provider-${NAME}
6-
VERSION=2.3.0
7+
VERSION=2.3.1
78
OS_ARCH?=darwin_amd64
89

910
default: install
@@ -16,7 +17,10 @@ release:
1617

1718
install: build
1819
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
19-
mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
20+
mkdir -p ~/.terraform.d/plugins/${TF_HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
21+
cp ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
22+
cp ${BINARY} ~/.terraform.d/plugins/${TF_HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
23+
rm ${BINARY}
2024

2125
test:
2226
go test -i $(TEST) || exit 1

komodor/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func (c *Client) prepareRequest(method, url string, body *[]byte) (*http.Request
3838

3939
req.Header.Set("x-api-key", c.ApiKey)
4040
req.Header.Set("Content-Type", "application/json")
41+
req.Header.Set("User-Agent", "Terraform (terraform-provider-komodor); Go-http-client/1.1")
4142

4243
return req, nil
4344
}

0 commit comments

Comments
 (0)