Skip to content

Commit 54ba6ee

Browse files
committed
Address code review comment and make build configurable
1 parent d102e90 commit 54ba6ee

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
ARG BUILD_SPEC="build.amd64"
12
FROM golang:1.22
23

34
WORKDIR /go/src/github.com/paypal/load-watcher
45
COPY . .
5-
RUN make build
6+
RUN make ${BUILD_SPEC}
67

78
FROM alpine:3.12
89

Makefile

+9-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
COMMONENVVAR=GOOS=$(uname -s | tr A-Z a-z)
16-
GOARCHVAR=GOARCH=$(uname -m | tr A-Z a-z)
1715
BUILDENVVAR=CGO_ENABLED=0
1816

1917
.PHONY: all
@@ -22,7 +20,15 @@ all: build
2220

2321
.PHONY: build
2422
build:
25-
$(COMMONENVVAR) $(BUILDENVVAR) $(GOARCHVAR) go build -o bin/load-watcher main.go
23+
GOOS=linux $(BUILDENVVAR) GOARCH=arm64 go build -o bin/load-watcher main.go
24+
25+
.PHONY: build.amd64
26+
build.amd64:
27+
GOOS=darwin $(BUILDENVVAR) GOARCH=amd64 go build -o bin/load-watcher main.go
28+
29+
.PHONY: build.arm64
30+
build.arm64:
31+
GOOS=linux $(BUILDENVVAR) GOARCH=arm64 go build -o bin/load-watcher main.go
2632

2733
.PHONY: clean
2834
clean:

pkg/watcher/internal/metricsprovider/datadog.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func NewDatadogClient(opts watcher.MetricsProviderOpts) (watcher.MetricsProvider
6161
return nil, fmt.Errorf("metric provider name should be %v, found %v", watcher.DatadogClientName, opts.Name)
6262
}
6363
tlsConfig := &http.Transport{
64-
TLSClientConfig: &tls.Config{InsecureSkipVerify: opts.InsecureSkipVerify}, // TODO(aqadeer): Figure out a secure way to let users add SSL certs
64+
TLSClientConfig: &tls.Config{InsecureSkipVerify: opts.InsecureSkipVerify}, // TODO(lawwong): Figure out a secure way to let users add SSL certs
6565
}
6666
hostNameSuffix, _ := os.LookupEnv(datadogHostNameSuffixKey)
6767
clusterName, _ := os.LookupEnv(datadogClusterName)

0 commit comments

Comments
 (0)