Skip to content

Commit 244f8bf

Browse files
authored
Merge branch 'main' into dependabot/go_modules/github.com/aws/aws-sdk-go-v2/service/s3-1.97.3
2 parents 60ce15e + a75775e commit 244f8bf

95 files changed

Lines changed: 3084 additions & 2326 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Pull Request File Path Check
2+
on: [pull_request]
3+
jobs:
4+
5+
filepath-check:
6+
name: Check for invalid characters in file paths
7+
runs-on: ubuntu-latest
8+
steps:
9+
10+
- name: Check out the code
11+
uses: actions/checkout@v6
12+
13+
- name: Validate file paths for Go module compatibility
14+
run: |
15+
# Go's module zip rejects filenames containing certain characters.
16+
# See golang.org/x/mod/module fileNameOK() for the full specification.
17+
#
18+
# Allowed ASCII: letters, digits, and: !#$%&()+,-.=@[]^_{}~ and space
19+
# Allowed non-ASCII: unicode letters only
20+
# Rejected: " ' * < > ? ` | / \ : and any non-letter unicode (control
21+
# chars, format chars like U+200E LEFT-TO-RIGHT MARK, etc.)
22+
#
23+
# This check catches issues like the U+200E incident in PR #9552.
24+
25+
EXIT_STATUS=0
26+
27+
git ls-files -z | python3 -c "
28+
import sys, unicodedata
29+
30+
data = sys.stdin.buffer.read()
31+
files = data.split(b'\x00')
32+
33+
# Characters explicitly rejected by Go's fileNameOK
34+
# (path separators / and \ are inherent to paths so we check per-element)
35+
bad_ascii = set('\"' + \"'\" + '*<>?\`|:')
36+
37+
allowed_ascii = set('!#$%&()+,-.=@[]^_{}~ ')
38+
39+
def is_ok(ch):
40+
if ch.isascii():
41+
return ch.isalnum() or ch in allowed_ascii
42+
return ch.isalpha()
43+
44+
bad_files = [] # list of (original_path, clean_path, char_desc)
45+
for f in files:
46+
if not f:
47+
continue
48+
try:
49+
name = f.decode('utf-8')
50+
except UnicodeDecodeError:
51+
print(f'::error::Non-UTF-8 bytes in filename: {f!r}')
52+
bad_files.append((repr(f), None, 'non-UTF-8 bytes'))
53+
continue
54+
55+
# Check each path element (split on /)
56+
for element in name.split('/'):
57+
for ch in element:
58+
if not is_ok(ch):
59+
cp = ord(ch)
60+
char_name = unicodedata.name(ch, f'U+{cp:04X}')
61+
char_desc = f'U+{cp:04X} ({char_name})'
62+
# Build cleaned path by stripping invalid chars
63+
clean = '/'.join(
64+
''.join(c for c in elem if is_ok(c))
65+
for elem in name.split('/')
66+
)
67+
print(f'::error file={name}::File \"{name}\" contains invalid char {char_desc}')
68+
bad_files.append((name, clean, char_desc))
69+
break
70+
71+
if bad_files:
72+
print()
73+
print('The following files have characters that are invalid in Go module zip archives:')
74+
print()
75+
for original, clean, desc in bad_files:
76+
print(f' {original} — {desc}')
77+
print()
78+
print('To fix, rename the files to remove the problematic characters:')
79+
print()
80+
for original, clean, desc in bad_files:
81+
if clean:
82+
print(f' mv \"{original}\" \"{clean}\" && git add \"{clean}\"')
83+
print(f' # or: git mv \"{original}\" \"{clean}\"')
84+
else:
85+
print(f' # {original} — cannot auto-suggest rename (non-UTF-8)')
86+
print()
87+
print('See https://github.com/vmware-tanzu/velero/pull/9552 for context.')
88+
sys.exit(1)
89+
else:
90+
print('All file paths are valid for Go module zip.')
91+
" || EXIT_STATUS=1
92+
93+
exit $EXIT_STATUS

Dockerfile

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
# Velero binary build section
16-
FROM --platform=$BUILDPLATFORM golang:1.25-bookworm AS velero-builder
16+
FROM --platform=$BUILDPLATFORM golang:1.25-trixie AS velero-builder
1717

1818
ARG GOPROXY
1919
ARG BIN
@@ -48,38 +48,11 @@ RUN mkdir -p /output/usr/bin && \
4848
-ldflags "${LDFLAGS}" ${PKG}/cmd/velero-helper && \
4949
go clean -modcache -cache
5050

51-
# Restic binary build section
52-
FROM --platform=$BUILDPLATFORM golang:1.25-bookworm AS restic-builder
53-
54-
ARG GOPROXY
55-
ARG BIN
56-
ARG TARGETOS
57-
ARG TARGETARCH
58-
ARG TARGETVARIANT
59-
ARG RESTIC_VERSION
60-
61-
ENV CGO_ENABLED=0 \
62-
GO111MODULE=on \
63-
GOPROXY=${GOPROXY} \
64-
GOOS=${TARGETOS} \
65-
GOARCH=${TARGETARCH} \
66-
GOARM=${TARGETVARIANT}
67-
68-
COPY . /go/src/github.com/vmware-tanzu/velero
69-
70-
RUN mkdir -p /output/usr/bin && \
71-
export GOARM=$(echo "${GOARM}" | cut -c2-) && \
72-
/go/src/github.com/vmware-tanzu/velero/hack/build-restic.sh && \
73-
go clean -modcache -cache
74-
7551
# Velero image packing section
7652
FROM paketobuildpacks/run-jammy-tiny:latest
7753

7854
LABEL maintainer="Xun Jiang <jxun@vmware.com>"
7955

8056
COPY --from=velero-builder /output /
8157

82-
COPY --from=restic-builder /output /
83-
8458
USER cnb:cnb
85-

Dockerfile-Windows

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
ARG OS_VERSION=1809
1616

1717
# Velero binary build section
18-
FROM --platform=$BUILDPLATFORM golang:1.25-bookworm AS velero-builder
18+
FROM --platform=$BUILDPLATFORM golang:1.25-trixie AS velero-builder
1919

2020
ARG GOPROXY
2121
ARG BIN

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ see: https://velero.io/docs/main/build-from-source/#making-images-and-updating-v
105105
endef
106106
# comma cannot be escaped and can only be used in Make function arguments by putting into variable
107107
comma=,
108-
# The version of restic binary to be downloaded
109-
RESTIC_VERSION ?= 0.15.0
110108

111109
CLI_PLATFORMS ?= linux-amd64 linux-arm linux-arm64 darwin-amd64 darwin-arm64 windows-amd64 linux-ppc64le linux-s390x
112110
BUILD_OUTPUT_TYPE ?= docker
@@ -260,7 +258,6 @@ container-linux:
260258
--build-arg=GIT_SHA=$(GIT_SHA) \
261259
--build-arg=GIT_TREE_STATE=$(GIT_TREE_STATE) \
262260
--build-arg=REGISTRY=$(REGISTRY) \
263-
--build-arg=RESTIC_VERSION=$(RESTIC_VERSION) \
264261
--provenance=false \
265262
--sbom=false \
266263
-f $(VELERO_DOCKERFILE) .

Tiltfile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ local_resource(
103103
deps = ["internal", "pkg/cmd"],
104104
)
105105

106-
local_resource(
107-
"restic_binary",
108-
cmd = 'cd ' + '.' + ';mkdir -p _tiltbuild/restic; BIN=velero GOOS=linux GOARCH=amd64 GOARM="" RESTIC_VERSION=0.13.1 OUTPUT_DIR=_tiltbuild/restic ./hack/build-restic.sh',
109-
)
110-
111106
# Note: we need a distro with a bash shell to exec into the Velero container
112107
tilt_dockerfile_header = """
113108
FROM ubuntu:22.04 as tilt
@@ -118,7 +113,6 @@ WORKDIR /
118113
COPY --from=tilt-helper /start.sh .
119114
COPY --from=tilt-helper /restart.sh .
120115
COPY velero .
121-
COPY restic/restic /usr/bin/restic
122116
"""
123117

124118
dockerfile_contents = "\n".join([
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix VolumeGroupSnapshot restore failure with Ceph RBD CSI driver by creating stub VolumeGroupSnapshotContent during restore and looking up VolumeSnapshotClass by driver for credential support
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add block data mover design for block level incremental backup by integrating with Kubernetes CBT

0 commit comments

Comments
 (0)