chore: update references to zz_filesystem_generated.go (#1580)

* chore: update references to zz_filesystem_generated.go

Some places were missed in the repo restructuring. This should fix
test_infra build failures.

Signed-off-by: Lance Ball <lball@redhat.com>

* fix: do not put "." into template zip array (#24)

Signed-off-by: Matej Vasek <mvasek@redhat.com>

---------

Signed-off-by: Lance Ball <lball@redhat.com>
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Co-authored-by: Matej Vasek <matejvasek@gmail.com>
This commit is contained in:
Lance Ball 2023-02-23 14:12:29 -05:00 committed by GitHub
parent 3624ccb58d
commit 0b1d537309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 18 deletions

View File

@ -27,7 +27,7 @@ VERS ?= $(shell [ -z $(VTAG) ] && echo 'tip' || echo $(VTAG) )
LDFLAGS := "-X main.date=$(DATE) -X main.vers=$(VERS) -X main.hash=$(HASH)" LDFLAGS := "-X main.date=$(DATE) -X main.vers=$(VERS) -X main.hash=$(HASH)"
# All Code prerequisites, including generated files, etc. # All Code prerequisites, including generated files, etc.
CODE := $(shell find . -name '*.go') zz_filesystem_generated.go go.mod schema/func_yaml-schema.json CODE := $(shell find . -name '*.go') generate/zz_filesystem_generated.go go.mod schema/func_yaml-schema.json
TEMPLATES := $(shell find templates -name '*' -type f) TEMPLATES := $(shell find templates -name '*' -type f)
.PHONY: test docs .PHONY: test docs
@ -86,7 +86,7 @@ clean_templates:
@rm -rf templates/springboot/http/target @rm -rf templates/springboot/http/target
@rm -f templates/**/.DS_Store @rm -f templates/**/.DS_Store
.PHONY: zz_filesystem_generated.go .PHONY: generate/zz_filesystem_generated.go
generate/zz_filesystem_generated.go: clean_templates generate/zz_filesystem_generated.go: clean_templates
go generate pkg/functions/templates_embedded.go go generate pkg/functions/templates_embedded.go
@ -162,37 +162,37 @@ cross-platform: darwin-arm64 darwin-amd64 linux-amd64 linux-arm64 linux-ppc64le
darwin-arm64: $(BIN_DARWIN_ARM64) ## Build for mac M1 darwin-arm64: $(BIN_DARWIN_ARM64) ## Build for mac M1
$(BIN_DARWIN_ARM64): zz_filesystem_generated.go $(BIN_DARWIN_ARM64): generate/zz_filesystem_generated.go
env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o $(BIN_DARWIN_ARM64) -ldflags $(LDFLAGS) ./cmd/$(BIN) env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o $(BIN_DARWIN_ARM64) -ldflags $(LDFLAGS) ./cmd/$(BIN)
darwin-amd64: $(BIN_DARWIN_AMD64) ## Build for Darwin (macOS) darwin-amd64: $(BIN_DARWIN_AMD64) ## Build for Darwin (macOS)
$(BIN_DARWIN_AMD64): zz_filesystem_generated.go $(BIN_DARWIN_AMD64): generate/zz_filesystem_generated.go
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o $(BIN_DARWIN_AMD64) -ldflags $(LDFLAGS) ./cmd/$(BIN) env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o $(BIN_DARWIN_AMD64) -ldflags $(LDFLAGS) ./cmd/$(BIN)
linux-amd64: $(BIN_LINUX_AMD64) ## Build for Linux amd64 linux-amd64: $(BIN_LINUX_AMD64) ## Build for Linux amd64
$(BIN_LINUX_AMD64): zz_filesystem_generated.go $(BIN_LINUX_AMD64): generate/zz_filesystem_generated.go
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(BIN_LINUX_AMD64) -ldflags $(LDFLAGS) ./cmd/$(BIN) env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(BIN_LINUX_AMD64) -ldflags $(LDFLAGS) ./cmd/$(BIN)
linux-arm64: $(BIN_LINUX_ARM64) ## Build for Linux arm64 linux-arm64: $(BIN_LINUX_ARM64) ## Build for Linux arm64
$(BIN_LINUX_ARM64): zz_filesystem_generated.go $(BIN_LINUX_ARM64): generate/zz_filesystem_generated.go
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o $(BIN_LINUX_ARM64) -ldflags $(LDFLAGS) ./cmd/$(BIN) env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o $(BIN_LINUX_ARM64) -ldflags $(LDFLAGS) ./cmd/$(BIN)
linux-ppc64le: $(BIN_LINUX_PPC64LE) ## Build for Linux ppc64le linux-ppc64le: $(BIN_LINUX_PPC64LE) ## Build for Linux ppc64le
$(BIN_LINUX_PPC64LE): zz_filesystem_generated.go $(BIN_LINUX_PPC64LE): generate/zz_filesystem_generated.go
env CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -o $(BIN_LINUX_PPC64LE) -ldflags $(LDFLAGS) ./cmd/$(BIN) env CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -o $(BIN_LINUX_PPC64LE) -ldflags $(LDFLAGS) ./cmd/$(BIN)
linux-s390x: $(BIN_LINUX_S390X) ## Build for Linux s390x linux-s390x: $(BIN_LINUX_S390X) ## Build for Linux s390x
$(BIN_LINUX_S390X): zz_filesystem_generated.go $(BIN_LINUX_S390X): generate/zz_filesystem_generated.go
env CGO_ENABLED=0 GOOS=linux GOARCH=s390x go build -o $(BIN_LINUX_S390X) -ldflags $(LDFLAGS) ./cmd/$(BIN) env CGO_ENABLED=0 GOOS=linux GOARCH=s390x go build -o $(BIN_LINUX_S390X) -ldflags $(LDFLAGS) ./cmd/$(BIN)
windows: $(BIN_WINDOWS) ## Build for Windows windows: $(BIN_WINDOWS) ## Build for Windows
$(BIN_WINDOWS): zz_filesystem_generated.go $(BIN_WINDOWS): generate/zz_filesystem_generated.go
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o $(BIN_WINDOWS) -ldflags $(LDFLAGS) ./cmd/$(BIN) env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o $(BIN_WINDOWS) -ldflags $(LDFLAGS) ./cmd/$(BIN)
###################### ######################

View File

@ -37,14 +37,13 @@ func main() {
return err return err
} }
if filepath.Clean(path) == templatesPath {
return nil
}
name, err := filepath.Rel(templatesPath, path) name, err := filepath.Rel(templatesPath, path)
if err != nil { if err != nil {
return err return err
} }
if name == "." {
return nil
}
name = filepath.ToSlash(name) name = filepath.ToSlash(name)
if info.IsDir() { if info.IsDir() {
name = name + "/" name = name + "/"

View File

@ -59,8 +59,8 @@ const prepareBranch = async (branchName, prTitle) => {
const script = `git config user.email "automation@knative.team" && \\ const script = `git config user.email "automation@knative.team" && \\
git config user.name "Knative Automation" && \\ git config user.name "Knative Automation" && \\
git checkout -b "${branchName}" && \\ git checkout -b "${branchName}" && \\
make zz_filesystem_generated.go && \\ make generate/zz_filesystem_generated.go && \\
git add "${cePomPath}" "${httpPomPath}" zz_filesystem_generated.go && \\ git add "${cePomPath}" "${httpPomPath}" generate/zz_filesystem_generated.go && \\
git commit -m "${prTitle}" && \\ git commit -m "${prTitle}" && \\
git push --set-upstream origin "${branchName}" git push --set-upstream origin "${branchName}"
` `

View File

@ -29,17 +29,17 @@ cleanup() {
trap "cleanup" EXIT SIGINT trap "cleanup" EXIT SIGINT
# Save working tree state # Save working tree state
cp -aR "${REPO_ROOT_DIR}/go.sum" "${REPO_ROOT_DIR}/zz_filesystem_generated.go" "${REPO_ROOT_DIR}/vendor" "${TMP_DIFFROOT}" cp -aR "${REPO_ROOT_DIR}/go.sum" "${REPO_ROOT_DIR}/generate/zz_filesystem_generated.go" "${REPO_ROOT_DIR}/vendor" "${TMP_DIFFROOT}"
"${REPO_ROOT_DIR}/hack/update-codegen.sh" "${REPO_ROOT_DIR}/hack/update-codegen.sh"
echo "Diffing ${REPO_ROOT_DIR} against freshly generated codegen" echo "Diffing ${REPO_ROOT_DIR} against freshly generated codegen"
ret=0 ret=0
diff -Nupr --no-dereference "${REPO_ROOT_DIR}/go.sum" "${TMP_DIFFROOT}/go.sum" || ret=1 diff -Nupr --no-dereference "${REPO_ROOT_DIR}/go.sum" "${TMP_DIFFROOT}/go.sum" || ret=1
diff -Nupr --no-dereference "${REPO_ROOT_DIR}/zz_filesystem_generated.go" "${TMP_DIFFROOT}/zz_filesystem_generated.go" || ret=1 diff -Nupr --no-dereference "${REPO_ROOT_DIR}/generate/zz_filesystem_generated.go" "${TMP_DIFFROOT}/zz_filesystem_generated.go" || ret=1
diff -Nupr --no-dereference "${REPO_ROOT_DIR}/vendor" "${TMP_DIFFROOT}/vendor" || ret=1 diff -Nupr --no-dereference "${REPO_ROOT_DIR}/vendor" "${TMP_DIFFROOT}/vendor" || ret=1
# Restore working tree state # Restore working tree state
rm -fr "${REPO_ROOT_DIR}/go.sum" "${REPO_ROOT_DIR}/zz_filesystem_generated.go" "${REPO_ROOT_DIR}/vendor" rm -fr "${REPO_ROOT_DIR}/go.sum" "${REPO_ROOT_DIR}/generate/zz_filesystem_generated.go" "${REPO_ROOT_DIR}/vendor"
cp -aR "${TMP_DIFFROOT}"/* "${REPO_ROOT_DIR}" cp -aR "${TMP_DIFFROOT}"/* "${REPO_ROOT_DIR}"
if [[ $ret -eq 0 ]] if [[ $ret -eq 0 ]]