Skip to content

Commit abeb772

Browse files
Merge branch 'master' into shared-pd
2 parents 6af5e68 + 0bb37c1 commit abeb772

File tree

2,338 files changed

+1640319
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,338 files changed

+1640319
-113
lines changed

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414

1515

1616

17-
FROM golang:1.13.4-alpine3.10 as builder
17+
FROM golang:1.13.4 as builder
1818
WORKDIR /go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver
1919
ADD . .
20-
ARG TAG
21-
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-X main.vendorVersion='"${TAG:-latest}"' -extldflags "-static"' -o bin/gce-pd-csi-driver ./cmd/
20+
RUN make
2221

2322
# MAD HACKS: Build a version first so we can take the scsi_id bin and put it somewhere else in our real build
2423
FROM gcr.io/google-containers/debian-base-amd64:v2.0.0 as base

Dockerfile.Windows

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
ARG BASE_IMAGE
22
ARG BASE_IMAGE_TAG
3+
FROM --platform=$BUILDPLATFORM golang:1.13.3 AS builder
4+
5+
ARG TARGETPLATFORM
6+
ARG BUILDPLATFORM
7+
ARG STAGINGVERSION
8+
WORKDIR /code
9+
ADD . /code/
10+
RUN cd /code/ && GOARCH=$(echo $TARGETPLATFORM | cut -f2 -d '/') GCE_PD_CSI_STAGING_VERSION=${STAGINGVERSION} make gce-pd-driver-windows
311

412
FROM mcr.microsoft.com/windows/${BASE_IMAGE}:${BASE_IMAGE_TAG}
513
LABEL description="PD CSI driver"
6-
COPY bin/gce-pd-csi-driver.exe /gce-pd-csi-driver.exe
14+
COPY --from=builder /code/bin/gce-pd-csi-driver.exe /gce-pd-csi-driver.exe
715

816
USER ContainerAdministrator
917
ENTRYPOINT ["/gce-pd-csi-driver.exe"]

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ STAGINGIMAGE=${GCE_PD_CSI_STAGING_IMAGE}
2424
DRIVERBINARY=gce-pd-csi-driver
2525
DRIVERWINDOWSBINARY=${DRIVERBINARY}.exe
2626

27-
all: gce-pd-driver
27+
all: gce-pd-driver gce-pd-driver-windows
2828
gce-pd-driver:
2929
mkdir -p bin
30-
go build -ldflags "-X main.vendorVersion=${STAGINGVERSION}" -o bin/${DRIVERBINARY} ./cmd/
30+
go build -mod=vendor -ldflags "-X main.vendorVersion=${STAGINGVERSION}" -o bin/${DRIVERBINARY} ./cmd/
3131

3232
gce-pd-driver-windows:
3333
mkdir -p bin
34-
GOOS=windows go build -ldflags -X=main.vendorVersion=$(STAGINGVERSION) -o bin/${DRIVERWINDOWSBINARY} ./cmd/
34+
GOOS=windows go build -mod=vendor -ldflags -X=main.vendorVersion=$(STAGINGVERSION) -o bin/${DRIVERWINDOWSBINARY} ./cmd/
3535

3636
build-container:
3737
ifndef GCE_PD_CSI_STAGING_IMAGE
@@ -45,22 +45,22 @@ ifndef GCE_PD_CSI_STAGING_IMAGE
4545
endif
4646
@sh init-buildx.sh; \
4747
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --file=Dockerfile.Windows --platform=windows \
48-
-t $(STAGINGIMAGE):$(STAGINGVERSION) --build-arg BASE_IMAGE=servercore --build-arg BASE_IMAGE_TAG=ltsc2019 --push .
48+
-t $(STAGINGIMAGE):$(STAGINGVERSION) --build-arg BASE_IMAGE=servercore --build-arg BASE_IMAGE_TAG=ltsc2019 --build-arg STAGINGVERSION=$(STAGINGVERSION) --push .
4949

5050
build-and-push-windows-container-1909:
5151
ifndef GCE_PD_CSI_STAGING_IMAGE
5252
$(error "Must set environment variable GCE_PD_CSI_STAGING_IMAGE to staging image repository")
5353
endif
5454
@sh init-buildx.sh; \
5555
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --file=Dockerfile.Windows --platform=windows \
56-
-t $(STAGINGIMAGE):$(STAGINGVERSION) --build-arg BASE_IMAGE=servercore --build-arg BASE_IMAGE_TAG=1909 --push .
56+
-t $(STAGINGIMAGE):$(STAGINGVERSION) --build-arg BASE_IMAGE=servercore --build-arg BASE_IMAGE_TAG=1909 --build-arg STAGINGVERSION=$(STAGINGVERSION) --push .
5757

5858
push-container: build-container
5959
gcloud docker -- push $(STAGINGIMAGE):$(STAGINGVERSION)
6060

6161
test-sanity: gce-pd-driver
62-
go test -v -timeout 30s sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/test/sanity -run ^TestSanity$
62+
go test -mod=vendor --v -timeout 30s sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/test/sanity -run ^TestSanity$
6363

6464
test-k8s-integration:
65-
go build -o bin/k8s-integration-test ./test/k8s-integration
65+
go build -mod=vendor -o bin/k8s-integration-test ./test/k8s-integration
6666

OWNERS

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
reviewers:
2-
- msau42
32
- davidz627
3+
- jingxu97
4+
- mattcary
5+
- msau42
46
- saad-ali
7+
- saikat-royc
58
- verult
6-
- jingxu97
79
approvers:
810
- davidz627
9-
- saad-ali
11+
- mattcary
1012
- msau42
13+
- saad-ali
14+
- saikat-royc
1115
- verult

deploy/kubernetes/base/controller/cluster_setup.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,4 +272,3 @@ roleRef:
272272
kind: Role
273273
name: csi-gce-pd-leaderelection-role
274274
apiGroup: rbac.authorization.k8s.io
275-
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#### TODO: This need to be updated to v1 once we official support 1.18+
2+
apiVersion: storage.k8s.io/v1beta1
3+
kind: CSIDriver
4+
metadata:
5+
name: pd.csi.storage.gke.io
6+
spec:
7+
attachRequired: true
8+
podInfoOnMount: false

deploy/kubernetes/base/controller/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ namespace:
55
resources:
66
- cluster_setup.yaml
77
- controller.yaml
8+
- csidriver_info.yaml

deploy/kubernetes/images/alpha/image.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ metadata:
44
name: imagetag-gcepd-driver-alpha-win
55
imageTag:
66
name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver-win
7-
newName: gcr.io/jing-k8s-dev/gce-pd-windows-2019
8-
newTag: "0.2.0"
7+
newName: gcr.io/gke-release-staging/gcp-compute-persistent-disk-csi-driver-amd64-windows-1909
8+
newTag: "cca3c14"
99
---
1010

1111
apiVersion: builtin

deploy/kubernetes/overlays/alpha/kustomization.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
3-
namespace:
4-
gce-pd-csi-driver
3+
namespace: gce-pd-csi-driver
54
resources:
65
- ../../base/
76
transformers:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Enable extra-create-metadata flag for external-provisioner
2+
- op: add
3+
path: /spec/template/spec/containers/0/args/-
4+
value: "--extra-create-metadata"

0 commit comments

Comments
 (0)