Skip to content

Commit

Permalink
Address code review comment and make build configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
lawwong committed Dec 3, 2024
1 parent d102e90 commit 54ba6ee
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
ARG BUILD_SPEC="build.amd64"
FROM golang:1.22

WORKDIR /go/src/github.com/paypal/load-watcher
COPY . .
RUN make build
RUN make ${BUILD_SPEC}

FROM alpine:3.12

Expand Down
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

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

.PHONY: all
Expand All @@ -22,7 +20,15 @@ all: build

.PHONY: build
build:
$(COMMONENVVAR) $(BUILDENVVAR) $(GOARCHVAR) go build -o bin/load-watcher main.go
GOOS=linux $(BUILDENVVAR) GOARCH=arm64 go build -o bin/load-watcher main.go

.PHONY: build.amd64
build.amd64:
GOOS=darwin $(BUILDENVVAR) GOARCH=amd64 go build -o bin/load-watcher main.go

.PHONY: build.arm64
build.arm64:
GOOS=linux $(BUILDENVVAR) GOARCH=arm64 go build -o bin/load-watcher main.go

.PHONY: clean
clean:
Expand Down
2 changes: 1 addition & 1 deletion pkg/watcher/internal/metricsprovider/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func NewDatadogClient(opts watcher.MetricsProviderOpts) (watcher.MetricsProvider
return nil, fmt.Errorf("metric provider name should be %v, found %v", watcher.DatadogClientName, opts.Name)
}
tlsConfig := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: opts.InsecureSkipVerify}, // TODO(aqadeer): Figure out a secure way to let users add SSL certs
TLSClientConfig: &tls.Config{InsecureSkipVerify: opts.InsecureSkipVerify}, // TODO(lawwong): Figure out a secure way to let users add SSL certs
}
hostNameSuffix, _ := os.LookupEnv(datadogHostNameSuffixKey)
clusterName, _ := os.LookupEnv(datadogClusterName)
Expand Down

0 comments on commit 54ba6ee

Please sign in to comment.