Skip to content

Commit f0879a6

Browse files
Merge pull request kubernetes-sigs#31 from RomanBednar/rebase-v1.8.2
OCPBUGS-6411: Rebase to v1.8.2 for OCP 4.13
2 parents e32e3df + 897925d commit f0879a6

File tree

1,830 files changed

+549661
-243706
lines changed

Some content is hidden

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

1,830 files changed

+549661
-243706
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
See [CHANGELOG/README.md](./CHANGELOG/README.md).
1+
See the [1.8 changelog in the master branch](https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/blob/master/CHANGELOG/CHANGELOG-1.8.md).

CHANGELOG/README.md

-3
This file was deleted.

Dockerfile

+17-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
ARG BUILDPLATFORM
1616

17-
FROM --platform=$BUILDPLATFORM golang:1.18.4 as builder
17+
FROM --platform=$BUILDPLATFORM golang:1.19.4 as builder
1818

1919
ARG STAGINGVERSION
2020
ARG TARGETPLATFORM
@@ -40,7 +40,7 @@ ENV LIB_DIR_PREFIX x86_64
4040
FROM distroless-base AS distroless-arm64
4141
ENV LIB_DIR_PREFIX aarch64
4242

43-
FROM distroless-$TARGETARCH
43+
FROM distroless-$TARGETARCH as output-image
4444

4545
# Copy necessary dependencies into distroless base.
4646
COPY --from=builder /go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/bin/gce-pd-csi-driver /gce-pd-csi-driver
@@ -71,6 +71,7 @@ COPY --from=debian /bin/date /bin/date
7171
COPY --from=debian /bin/grep /bin/grep
7272
COPY --from=debian /bin/sed /bin/sed
7373
COPY --from=debian /bin/ln /bin/ln
74+
COPY --from=debian /bin/udevadm /bin/udevadm
7475

7576
# Copy shared libraries into distroless base.
7677
COPY --from=debian /lib/${LIB_DIR_PREFIX}-linux-gnu/libblkid.so.1 \
@@ -79,6 +80,7 @@ COPY --from=debian /lib/${LIB_DIR_PREFIX}-linux-gnu/libblkid.so.1 \
7980
/lib/${LIB_DIR_PREFIX}-linux-gnu/libe2p.so.2 \
8081
/lib/${LIB_DIR_PREFIX}-linux-gnu/libext2fs.so.2 \
8182
/lib/${LIB_DIR_PREFIX}-linux-gnu/libgcc_s.so.1 \
83+
/lib/${LIB_DIR_PREFIX}-linux-gnu/liblzma.so.5 \
8284
/lib/${LIB_DIR_PREFIX}-linux-gnu/libmount.so.1 \
8385
/lib/${LIB_DIR_PREFIX}-linux-gnu/libpcre.so.3 \
8486
/lib/${LIB_DIR_PREFIX}-linux-gnu/libreadline.so.5 \
@@ -93,9 +95,22 @@ COPY --from=debian /usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libacl.so.1 \
9395
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libicudata.so.63 \
9496
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libicui18n.so.63 \
9597
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libicuuc.so.63 \
98+
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libkmod.so.2 \
9699
/usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libstdc++.so.6 /usr/lib/${LIB_DIR_PREFIX}-linux-gnu/
97100

98101
# Copy NVME support required script and rules into distroless base.
99102
COPY deploy/kubernetes/udev/google_nvme_id /lib/udev_containerized/google_nvme_id
100103

104+
# Build stage used for validation of the output-image
105+
# See validate-container-linux-* targets in Makefile
106+
FROM output-image as validation-image
107+
108+
COPY --from=debian /usr/bin/ldd /usr/bin/find /usr/bin/xargs /usr/bin/
109+
COPY --from=builder /go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/hack/print-missing-deps.sh /print-missing-deps.sh
110+
SHELL ["/bin/bash", "-c"]
111+
RUN /print-missing-deps.sh
112+
113+
# Final build stage, create the real Docker image with ENTRYPOINT
114+
FROM output-image
115+
101116
ENTRYPOINT ["/gce-pd-csi-driver"]

Dockerfile.Windows

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
ARG BASE_IMAGE
16-
FROM --platform=$BUILDPLATFORM golang:1.17.8 AS builder
16+
FROM --platform=$BUILDPLATFORM golang:1.19.4 AS builder
1717

1818
ARG TARGETPLATFORM
1919
ARG BUILDPLATFORM

Dockerfile.debug

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

15-
FROM golang:1.13.15 as builder
15+
FROM golang:1.19.4 as builder
1616
WORKDIR /go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver
1717
ADD . .
1818

19-
RUN CGO_ENABLED=0 go get -ldflags "-s -w -extldflags '-static'" github.com/go-delve/delve/cmd/dlv
20-
RUN GCE_PD_CSI_DEBUG=1 make gce-pd-driver
19+
ARG STAGINGVERSION
20+
ARG TARGETPLATFORM
21+
22+
RUN CGO_ENABLED=0 go install -ldflags "-s -w -extldflags '-static'" github.com/go-delve/delve/cmd/dlv@latest
23+
24+
RUN GOARCH="$(echo $TARGETPLATFORM | cut -f2 -d '/')" GCE_PD_CSI_STAGING_VERSION=$STAGINGVERSION GCE_PD_CSI_DEBUG=1 make gce-pd-driver
2125

2226
# MAD HACKS: Build a version first so we can take the scsi_id bin and put it somewhere else in our real build
2327
FROM k8s.gcr.io/build-image/debian-base-amd64:buster-v1.5.0 as mad-hack

Makefile

+17-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ ifeq (${GOARCH}, amd64)
4545
mkdir -p bin
4646
GOOS=windows go build -mod=vendor -ldflags -X=main.version=$(STAGINGVERSION) -o bin/${DRIVERWINDOWSBINARY} ./cmd/gce-pd-csi-driver/
4747
else
48-
$(warning gcp-pd-driver-windows only supports amd64.)
48+
$(warning gcp-pd-driver-windows only supports amd64.)
4949
endif
5050

5151
build-container: require-GCE_PD_CSI_STAGING_IMAGE require-GCE_PD_CSI_STAGING_VERSION init-buildx
@@ -79,6 +79,22 @@ build-and-push-multi-arch-debug: build-and-push-container-linux-debug build-and-
7979

8080
push-container: build-container
8181

82+
# Used by hack/verify-docker-deps.sh, not used for building artifacts
83+
validate-container-linux-amd64: init-buildx
84+
$(DOCKER) buildx build --platform=linux/amd64 \
85+
-t validation_linux_amd64 \
86+
--target validation-image \
87+
--build-arg BUILDPLATFORM=linux \
88+
--build-arg STAGINGVERSION=$(STAGINGVERSION) .
89+
90+
# Used by hack/verify-docker-deps.sh, not used for building artifacts
91+
validate-container-linux-arm64: init-buildx
92+
$(DOCKER) buildx build --platform=linux/arm64 \
93+
-t validation_linux_arm64 \
94+
--target validation-image \
95+
--build-arg BUILDPLATFORM=linux \
96+
--build-arg STAGINGVERSION=$(STAGINGVERSION) .
97+
8298
build-and-push-container-linux-amd64: require-GCE_PD_CSI_STAGING_IMAGE init-buildx
8399
$(DOCKER) buildx build --platform=linux/amd64 \
84100
-t $(STAGINGIMAGE):$(STAGINGVERSION)_linux_amd64 \

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ lifecycle of Google Compute Engine Persistent Disks.
1212
## Project Status
1313

1414
Status: GA
15-
Latest stable image: `k8s.gcr.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver:v1.4.0`
15+
Latest stable image: `k8s.gcr.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver:v1.7.2`
1616

1717
### Test Status
1818

cmd/gce-pd-csi-driver/main.go

+14-9
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"runtime"
2424
"time"
2525

26-
"k8s.io/klog"
26+
"k8s.io/klog/v2"
2727

2828
"sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/common"
2929
gce "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/gce-cloud-provider/compute"
@@ -40,8 +40,11 @@ var (
4040
runNodeService = flag.Bool("run-node-service", true, "If set to false then the CSI driver does not activate its node service (default: true)")
4141
httpEndpoint = flag.String("http-endpoint", "", "The TCP network address where the prometheus metrics endpoint will listen (example: `:8080`). The default is empty string, which means metrics endpoint is disabled.")
4242
metricsPath = flag.String("metrics-path", "/metrics", "The HTTP path where prometheus metrics will be exposed. Default is `/metrics`.")
43+
grpcLogCharCap = flag.Int("grpc-log-char-cap", 10000, "The maximum amount of characters logged for every grpc responses")
4344

44-
extraVolumeLabelsStr = flag.String("extra-labels", "", "Extra labels to attach to each PD created. It is a comma separated list of key value pairs like '<key1>=<value1>,<key2>=<value2>'. See https://cloud.google.com/compute/docs/labeling-resources for details")
45+
errorBackoffInitialDurationMs = flag.Int("backoff-initial-duration-ms", 200, "The amount of ms for the initial duration of the backoff condition for controller publish/unpublish CSI operations. Default is 200.")
46+
errorBackoffMaxDurationMs = flag.Int("backoff-max-duration-ms", 300000, "The amount of ms for the max duration of the backoff condition for controller publish/unpublish CSI operations. Default is 300000 (5m).")
47+
extraVolumeLabelsStr = flag.String("extra-labels", "", "Extra labels to attach to each PD created. It is a comma separated list of key value pairs like '<key1>=<value1>,<key2>=<value2>'. See https://cloud.google.com/compute/docs/labeling-resources for details")
4548

4649
attachDiskBackoffDuration = flag.Duration("attach-disk-backoff-duration", 5*time.Second, "Duration for attachDisk backoff")
4750
attachDiskBackoffFactor = flag.Float64("attach-disk-backoff-factor", 0.0, "Factor for attachDisk backoff")
@@ -102,7 +105,7 @@ func handle() {
102105
}
103106
extraVolumeLabels, err := common.ConvertLabelsStringToMap(*extraVolumeLabelsStr)
104107
if err != nil {
105-
klog.Fatalf("Bad extra volume labels: %v", err)
108+
klog.Fatalf("Bad extra volume labels: %v", err.Error())
106109
}
107110

108111
gceDriver := driver.GetGCEDriver()
@@ -119,9 +122,11 @@ func handle() {
119122
if *runControllerService {
120123
cloudProvider, err := gce.CreateCloudProvider(ctx, version, *cloudConfigFilePath)
121124
if err != nil {
122-
klog.Fatalf("Failed to get cloud provider: %v", err)
125+
klog.Fatalf("Failed to get cloud provider: %v", err.Error())
123126
}
124-
controllerServer = driver.NewControllerServer(gceDriver, cloudProvider)
127+
initialBackoffDuration := time.Duration(*errorBackoffInitialDurationMs) * time.Millisecond
128+
maxBackoffDuration := time.Duration(*errorBackoffMaxDurationMs) * time.Microsecond
129+
controllerServer = driver.NewControllerServer(gceDriver, cloudProvider, initialBackoffDuration, maxBackoffDuration)
125130
} else if *cloudConfigFilePath != "" {
126131
klog.Warningf("controller service is disabled but cloud config given - it has no effect")
127132
}
@@ -131,20 +136,20 @@ func handle() {
131136
if *runNodeService {
132137
mounter, err := mountmanager.NewSafeMounter()
133138
if err != nil {
134-
klog.Fatalf("Failed to get safe mounter: %v", err)
139+
klog.Fatalf("Failed to get safe mounter: %v", err.Error())
135140
}
136141
deviceUtils := mountmanager.NewDeviceUtils()
137142
statter := mountmanager.NewStatter(mounter)
138143
meta, err := metadataservice.NewMetadataService()
139144
if err != nil {
140-
klog.Fatalf("Failed to set up metadata service: %v", err)
145+
klog.Fatalf("Failed to set up metadata service: %v", err.Error())
141146
}
142147
nodeServer = driver.NewNodeServer(gceDriver, mounter, deviceUtils, meta, statter)
143148
}
144149

145150
err = gceDriver.SetupGCEDriver(driverName, version, extraVolumeLabels, identityServer, controllerServer, nodeServer)
146151
if err != nil {
147-
klog.Fatalf("Failed to initialize GCE CSI Driver: %v", err)
152+
klog.Fatalf("Failed to initialize GCE CSI Driver: %v", err.Error())
148153
}
149154

150155
gce.AttachDiskBackoff.Duration = *attachDiskBackoffDuration
@@ -159,5 +164,5 @@ func handle() {
159164
gce.WaitForOpBackoff.Steps = *waitForOpBackoffSteps
160165
gce.WaitForOpBackoff.Cap = *waitForOpBackoffCap
161166

162-
gceDriver.Run(*endpoint)
167+
gceDriver.Run(*endpoint, *grpcLogCharCap)
163168
}

deploy/kubernetes/base/node_linux/node.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ spec:
3838
mountPath: /csi
3939
- name: registration-dir
4040
mountPath: /registration
41-
livenessProbe:
42-
initialDelaySeconds: 3
43-
exec:
44-
command:
45-
- /csi-node-driver-registrar
46-
- --kubelet-registration-path=/var/lib/kubelet/plugins/pd.csi.storage.gke.io/csi.sock
47-
- --mode=kubelet-registration-probe
4841
- name: gce-pd-driver
4942
# Don't change base image without changing pdImagePlaceholder in
5043
# test/k8s-integration/main.go

deploy/kubernetes/base/node_windows/node.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ spec:
3939
mountPath: /csi
4040
- name: registration-dir
4141
mountPath: /registration
42-
livenessProbe:
43-
initialDelaySeconds: 3
44-
exec:
45-
command:
46-
- /csi-node-driver-registrar.exe
47-
- --kubelet-registration-path=C:\\var\\lib\\kubelet\\plugins\\pd.csi.storage.gke.io\\csi.sock
48-
- --mode=kubelet-registration-probe
4942
- name: gce-pd-driver
5043
# Don't change base image without changing pdImagePlaceholder in
5144
# test/k8s-integration/main.go

deploy/kubernetes/images/prow-stable-sidecar-rc-master/image.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,47 @@ metadata:
77
name: imagetag-csi-provisioner-prow-rc
88
imageTag:
99
name: k8s.gcr.io/sig-storage/csi-provisioner
10-
newTag: "v3.1.0"
10+
newTag: "v3.1.1"
1111
---
1212
apiVersion: builtin
1313
kind: ImageTagTransformer
1414
metadata:
1515
name: imagetag-csi-attacher-prow-rc
1616
imageTag:
1717
name: k8s.gcr.io/sig-storage/csi-attacher
18-
newTag: "v3.4.0"
18+
newTag: "v3.5.0"
1919
---
2020
apiVersion: builtin
2121
kind: ImageTagTransformer
2222
metadata:
2323
name: imagetag-csi-resize-prow-rc
2424
imageTag:
2525
name: k8s.gcr.io/sig-storage/csi-resizer
26-
newTag: "v1.4.0"
26+
newTag: "v1.5.0"
2727
---
2828
apiVersion: builtin
2929
kind: ImageTagTransformer
3030
metadata:
3131
name: imagetag-csi-snapshotter-prow-head
3232
imageTag:
3333
name: k8s.gcr.io/sig-storage/csi-snapshotter
34-
newTag: "v4.1.1"
34+
newTag: "v6.0.1"
3535
---
3636
apiVersion: builtin
3737
kind: ImageTagTransformer
3838
metadata:
3939
name: imagetag-csi-node-registrar-prow-rc
4040
imageTag:
4141
name: k8s.gcr.io/sig-storage/csi-node-driver-registrar
42-
newTag: "v2.5.0"
42+
newTag: "v2.5.1"
4343
---
4444
apiVersion: builtin
4545
kind: ImageTagTransformer
4646
metadata:
4747
name: imagetag-csi-gce-driver-prow-rc
4848
imageTag:
4949
name: k8s.gcr.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
50-
newName: k8s.gcr.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
51-
newTag: "v1.4.0"
50+
newName: gcr.io/k8s-staging-cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
51+
newTag: "v1.7.2-rc1"
5252
---
5353

deploy/kubernetes/images/stable-1-22/image.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ metadata:
5050
imageTag:
5151
name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver
5252
newName: k8s.gcr.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
53-
newTag: "v1.4.0"
53+
newTag: "v1.7.1"
5454
---

deploy/kubernetes/images/stable-1-23/image.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ metadata:
5050
imageTag:
5151
name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver
5252
newName: k8s.gcr.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
53-
newTag: "v1.4.0"
53+
newTag: "v1.7.1"
5454
---

deploy/kubernetes/images/stable-1-24/image.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ imageTag:
5252
# Don't change stable image without changing pdImagePlaceholder in
5353
# test/k8s-integration/main.go
5454
newName: k8s.gcr.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
55-
newTag: "v1.4.0"
55+
newTag: "v1.7.1"
5656
---

deploy/kubernetes/images/stable-master/image.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ imageTag:
5252
# Don't change stable image without changing pdImagePlaceholder in
5353
# test/k8s-integration/main.go
5454
newName: k8s.gcr.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
55-
newTag: "v1.4.0"
55+
newTag: "v1.7.2"
5656
---

deploy/kubernetes/wait-for-driver.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ while [[ -n "${1-}" ]]; do
2424
esac
2525
done
2626

27-
kubectl wait -n gce-pd-csi-driver deployment csi-gce-pd-controller --for condition=available || exit -1
27+
kubectl wait \
28+
-n gce-pd-csi-driver deployment csi-gce-pd-controller \
29+
--for condition=available \
30+
--timeout=900s \
31+
|| exit -1
2832

2933
retries=90
3034
while [[ $retries -ge 0 ]]; do

0 commit comments

Comments
 (0)