Skip to content

Commit 521bae0

Browse files
scripts: corrected regex for Dockerfile
1 parent 9569a9d commit 521bae0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/upgrade-operator-sdk.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,10 @@
105105

106106
# Dockerfile patterns
107107
_PAT_DOCKERFILE_FROM_GOLANG: Final = r"FROM golang:\d+\.\d+"
108-
_PAT_DOCKERFILE_LAST_SCAFFOLD_COPY: Final = (
109-
r"(COPY internal/controller/ internal/controller/\n)"
110-
)
108+
# Last COPY before the "# Build" section; used as insertion anchor for extra dirs.
109+
# Matches any COPY line whose target starts with "internal" (the scaffold's last
110+
# source COPY, regardless of whether it copies internal/ or internal/controller/).
111+
_PAT_DOCKERFILE_LAST_SCAFFOLD_COPY: Final = r"(COPY internal\S* internal\S*\n)"
111112

112113
# operator-sdk PROJECT file ((?m) embedded because used in file_regex_replace)
113114
_PAT_PROJECT_GROUP_LINE: Final = r"(?m)^ group: metalk8s\n"

0 commit comments

Comments
 (0)