Skip to content

Commit 5c2696b

Browse files
committed
use GCFLAGS with envvar
1 parent 977a57b commit 5c2696b

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

Diff for: Dockerfile.debug

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 The Kubernetes Authors.
1+
# Copyright 2021 The Kubernetes Authors.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -25,7 +25,8 @@ RUN clean-install udev
2525

2626
# Start from Kubernetes Debian base
2727
FROM k8s.gcr.io/build-image/debian-base-amd64:v2.1.3
28-
# Copy source code too?
28+
29+
# Copy source code too to correlate the binary and the breakpoints
2930
WORKDIR /go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver
3031
ADD . .
3132

@@ -35,4 +36,7 @@ COPY --from=builder /go/bin/dlv /go/bin/dlv
3536
RUN clean-install util-linux e2fsprogs mount ca-certificates udev xfsprogs
3637
COPY --from=base /lib/udev/scsi_id /lib/udev_containerized/scsi_id
3738

39+
# PDCSI driver isn't copied to / because of delve not being able to correlate
40+
# the binary and the source code, instead just run the binary where it was
41+
# compiled, the overlay noauth-dev calls this binary
3842
ENTRYPOINT ["/go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/bin/gce-pd-csi-driver"]

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ WINDOWS_BASE_IMAGES=$(BASE_IMAGE_LTSC2019) $(BASE_IMAGE_1909) $(BASE_IMAGE_2004)
4444
all: gce-pd-driver gce-pd-driver-windows
4545
gce-pd-driver:
4646
mkdir -p bin
47-
go build -mod=vendor -gcflags="all=-N -l" -ldflags "-X main.version=$(STAGINGVERSION)" -o bin/${DRIVERBINARY} ./cmd/gce-pd-csi-driver/
47+
go build -mod=vendor $(GCFLAGS) -ldflags "-X main.version=$(STAGINGVERSION)" -o bin/${DRIVERBINARY} ./cmd/gce-pd-csi-driver/
4848

4949
gce-pd-driver-windows:
5050
mkdir -p bin

Diff for: deploy/kubernetes/overlays/noauth-dev/kustomization.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ patchesStrategicMerge:
1010
- controller-overlay.yaml
1111
namespace: gce-pd-csi-driver
1212
# To change the dev image, add something like the following.
13-
images:
14-
- name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver
15-
newName: gcr.io/mauriciopoppe-gke-dev/gcp-compute-persistent-disk-csi-driver
16-
newTag: latest
13+
# images:
14+
# - name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver
15+
# newName: gcr.io/mauriciopoppe-gke-dev/gcp-compute-persistent-disk-csi-driver
16+
# newTag: latest

0 commit comments

Comments
 (0)