From 59ca71270bc67fa02b51685c7256f984c102026d Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 14 Feb 2024 10:41:48 +0900 Subject: [PATCH 01/11] fix: use go build binary to add license Signed-off-by: hlts2 --- .github/workflows/format.yml | 4 +++- Makefile.d/functions.mk | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index fdd5afb2d7..4c3d7af937 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -90,7 +90,9 @@ jobs: runs-on: ubuntu-latest needs: [detect-ci-container] container: - image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }} + # TODO: revert it later. + # image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }} + image: ghcr.io/vdaas/vald/vald-ci-container:pr-2334 steps: - uses: actions/checkout@v4 with: diff --git a/Makefile.d/functions.mk b/Makefile.d/functions.mk index 52158f9a68..5a1b0f6ca9 100644 --- a/Makefile.d/functions.mk +++ b/Makefile.d/functions.mk @@ -279,11 +279,15 @@ define gen-go-option-test-sources endef define gen-license + BIN_PATH="$(TEMP_DIR)/vald-license-gen" + rm -rf $$BIN_PATH MAINTAINER=$2 \ GOPRIVATE=$(GOPRIVATE) \ GOARCH=$(GOARCH) \ GOOS=$(GOOS) \ - go run -mod=readonly $(ROOTDIR)/hack/license/gen/main.go $1 + go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/license/gen/main.go + $$BIN_PATH $1 + rm -rf $$BIN_PATH endef define gen-vald-helm-schema From 82e3b31d70f93c094754528f4b00a747b64213ad Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 14 Feb 2024 10:50:11 +0900 Subject: [PATCH 02/11] fix: add debug log Signed-off-by: hlts2 --- Makefile.d/functions.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.d/functions.mk b/Makefile.d/functions.mk index 5a1b0f6ca9..45e6d21bbe 100644 --- a/Makefile.d/functions.mk +++ b/Makefile.d/functions.mk @@ -286,6 +286,7 @@ define gen-license GOARCH=$(GOARCH) \ GOOS=$(GOOS) \ go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/license/gen/main.go + ls $(ROOTDIR) $$BIN_PATH $1 rm -rf $$BIN_PATH endef From 7e10e4f2da4421c8611a75da1adb1e25d6856a23 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 14 Feb 2024 10:55:23 +0900 Subject: [PATCH 03/11] fix: tweak Signed-off-by: hlts2 --- Makefile.d/functions.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.d/functions.mk b/Makefile.d/functions.mk index 45e6d21bbe..e0484a2c39 100644 --- a/Makefile.d/functions.mk +++ b/Makefile.d/functions.mk @@ -285,8 +285,8 @@ define gen-license GOPRIVATE=$(GOPRIVATE) \ GOARCH=$(GOARCH) \ GOOS=$(GOOS) \ - go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/license/gen/main.go ls $(ROOTDIR) + go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/license/gen/main.go $$BIN_PATH $1 rm -rf $$BIN_PATH endef From dcf156dc191180b0bf30f652de748c158087fc7a Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 14 Feb 2024 11:08:45 +0900 Subject: [PATCH 04/11] fix: debug log Signed-off-by: hlts2 --- Makefile.d/functions.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.d/functions.mk b/Makefile.d/functions.mk index e0484a2c39..eb232ed186 100644 --- a/Makefile.d/functions.mk +++ b/Makefile.d/functions.mk @@ -286,6 +286,7 @@ define gen-license GOARCH=$(GOARCH) \ GOOS=$(GOOS) \ ls $(ROOTDIR) + echo "$$BIN_PATH" go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/license/gen/main.go $$BIN_PATH $1 rm -rf $$BIN_PATH From b5c31375a86aa64ee6222c5ba4b6c7cfda543364 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 14 Feb 2024 11:17:38 +0900 Subject: [PATCH 05/11] fix: tweak Signed-off-by: hlts2 --- Makefile.d/functions.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.d/functions.mk b/Makefile.d/functions.mk index eb232ed186..b6e8936e7c 100644 --- a/Makefile.d/functions.mk +++ b/Makefile.d/functions.mk @@ -286,7 +286,7 @@ define gen-license GOARCH=$(GOARCH) \ GOOS=$(GOOS) \ ls $(ROOTDIR) - echo "$$BIN_PATH" + ls $(ROOTDIR)/hack/license/gen/main.go go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/license/gen/main.go $$BIN_PATH $1 rm -rf $$BIN_PATH From 5b1a2e92628a79bca324146ec5deaa3aab92872d Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 14 Feb 2024 11:34:44 +0900 Subject: [PATCH 06/11] fix: use local variable Signed-off-by: hlts2 --- Makefile.d/functions.mk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile.d/functions.mk b/Makefile.d/functions.mk index b6e8936e7c..7fcc2709e3 100644 --- a/Makefile.d/functions.mk +++ b/Makefile.d/functions.mk @@ -280,16 +280,17 @@ endef define gen-license BIN_PATH="$(TEMP_DIR)/vald-license-gen" - rm -rf $$BIN_PATH + rm -rf $(BIN_PATH) MAINTAINER=$2 \ GOPRIVATE=$(GOPRIVATE) \ GOARCH=$(GOARCH) \ GOOS=$(GOOS) \ ls $(ROOTDIR) ls $(ROOTDIR)/hack/license/gen/main.go - go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/license/gen/main.go - $$BIN_PATH $1 - rm -rf $$BIN_PATH + ls $(BIN_PATH) + go build -mod=readonly -a -o $(BIN_PATH) $(ROOTDIR)/hack/license/gen/main.go + $(BIN_PATH) $1 + rm -rf $(BIN_PATH) endef define gen-vald-helm-schema From bbd11640b0b7956c3970c1a8e8d249ef1d985009 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 14 Feb 2024 11:42:46 +0900 Subject: [PATCH 07/11] Revert "fix: use local variable" This reverts commit 5b1a2e92628a79bca324146ec5deaa3aab92872d. --- Makefile.d/functions.mk | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile.d/functions.mk b/Makefile.d/functions.mk index 7fcc2709e3..b6e8936e7c 100644 --- a/Makefile.d/functions.mk +++ b/Makefile.d/functions.mk @@ -280,17 +280,16 @@ endef define gen-license BIN_PATH="$(TEMP_DIR)/vald-license-gen" - rm -rf $(BIN_PATH) + rm -rf $$BIN_PATH MAINTAINER=$2 \ GOPRIVATE=$(GOPRIVATE) \ GOARCH=$(GOARCH) \ GOOS=$(GOOS) \ ls $(ROOTDIR) ls $(ROOTDIR)/hack/license/gen/main.go - ls $(BIN_PATH) - go build -mod=readonly -a -o $(BIN_PATH) $(ROOTDIR)/hack/license/gen/main.go - $(BIN_PATH) $1 - rm -rf $(BIN_PATH) + go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/license/gen/main.go + $$BIN_PATH $1 + rm -rf $$BIN_PATH endef define gen-vald-helm-schema From cf64888312c35b8cf39950a256c3360e5e3bbcd5 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 14 Feb 2024 12:16:33 +0900 Subject: [PATCH 08/11] fix: tweak Signed-off-by: hlts2 --- Makefile.d/functions.mk | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile.d/functions.mk b/Makefile.d/functions.mk index b6e8936e7c..86465cd207 100644 --- a/Makefile.d/functions.mk +++ b/Makefile.d/functions.mk @@ -279,16 +279,14 @@ define gen-go-option-test-sources endef define gen-license - BIN_PATH="$(TEMP_DIR)/vald-license-gen" - rm -rf $$BIN_PATH + BIN_PATH="$(TEMP_DIR)/vald-license-gen"; \ + rm -rf $$BIN_PATH; \ MAINTAINER=$2 \ GOPRIVATE=$(GOPRIVATE) \ GOARCH=$(GOARCH) \ GOOS=$(GOOS) \ - ls $(ROOTDIR) - ls $(ROOTDIR)/hack/license/gen/main.go - go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/license/gen/main.go - $$BIN_PATH $1 + go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/license/gen/main.go; \ + $$BIN_PATH $1; \ rm -rf $$BIN_PATH endef From dbd949853ea90ef9e4cb934325eb708696c161df Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 14 Feb 2024 12:24:53 +0900 Subject: [PATCH 09/11] fix: bugfix local variable Signed-off-by: hlts2 --- Makefile.d/functions.mk | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile.d/functions.mk b/Makefile.d/functions.mk index 86465cd207..bfa81d228d 100644 --- a/Makefile.d/functions.mk +++ b/Makefile.d/functions.mk @@ -291,13 +291,13 @@ define gen-license endef define gen-vald-helm-schema - BIN_PATH="$(TEMP_DIR)/vald-helm-schema-gen" - rm -rf $$BIN_PATH + BIN_PATH="$(TEMP_DIR)/vald-helm-schema-gen"; \ + rm -rf $$BIN_PATH; \ GOPRIVATE=$(GOPRIVATE) \ GOARCH=$(GOARCH) \ GOOS=$(GOOS) \ - go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/helm/schema/gen/main.go - $$BIN_PATH charts/$1.yaml > charts/$1.schema.json + go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/helm/schema/gen/main.go; \ + $$BIN_PATH charts/$1.yaml > charts/$1.schema.json; \ rm -rf $$BIN_PATH endef @@ -305,14 +305,14 @@ define gen-vald-crd if [[ -f $(ROOTDIR)/charts/$1/crds/$2.yaml ]]; then \ mv $(ROOTDIR)/charts/$1/crds/$2.yaml $(TEMP_DIR)/$2.yaml; \ fi; - BIN_PATH="$(TEMP_DIR)/vald-helm-crd-schema-gen" - rm -rf $$BIN_PATH + BIN_PATH="$(TEMP_DIR)/vald-helm-crd-schema-gen"; \ + rm -rf $$BIN_PATH; \ GOPRIVATE=$(GOPRIVATE) \ GOARCH=$(GOARCH) \ GOOS=$(GOOS) \ - go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/helm/schema/crd/main.go - $$BIN_PATH $(ROOTDIR)/charts/$3.yaml > $(TEMP_DIR)/$2-spec.yaml - rm -rf $$BIN_PATH + go build -mod=readonly -a -o $$BIN_PATH $(ROOTDIR)/hack/helm/schema/crd/main.go; \ + $$BIN_PATH $(ROOTDIR)/charts/$3.yaml > $(TEMP_DIR)/$2-spec.yaml; \ + rm -rf $$BIN_PATH; \ $(BINDIR)/yq eval-all 'select(fileIndex==0).spec.versions[0].schema.openAPIV3Schema.properties.spec = select(fileIndex==1).spec | select(fileIndex==0)' \ $(TEMP_DIR)/$2.yaml $(TEMP_DIR)/$2-spec.yaml > $(ROOTDIR)/charts/$1/crds/$2.yaml endef From 16c9fa3d40f4619be218e92974f4344f602517c2 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 14 Feb 2024 13:28:17 +0900 Subject: [PATCH 10/11] fix: make helm/schema/all format Signed-off-by: hlts2 --- .../vald-benchmark-operator/{ => schemas}/job-values.schema.json | 0 .../{ => schemas}/scenario-values.schema.json | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename charts/vald-benchmark-operator/{ => schemas}/job-values.schema.json (100%) rename charts/vald-benchmark-operator/{ => schemas}/scenario-values.schema.json (100%) diff --git a/charts/vald-benchmark-operator/job-values.schema.json b/charts/vald-benchmark-operator/schemas/job-values.schema.json similarity index 100% rename from charts/vald-benchmark-operator/job-values.schema.json rename to charts/vald-benchmark-operator/schemas/job-values.schema.json diff --git a/charts/vald-benchmark-operator/scenario-values.schema.json b/charts/vald-benchmark-operator/schemas/scenario-values.schema.json similarity index 100% rename from charts/vald-benchmark-operator/scenario-values.schema.json rename to charts/vald-benchmark-operator/schemas/scenario-values.schema.json From 8e786d99e0a84be7882566e7221f62f3795cca0f Mon Sep 17 00:00:00 2001 From: hlts2 Date: Wed, 14 Feb 2024 13:52:04 +0900 Subject: [PATCH 11/11] fix: revert ci container image tag Signed-off-by: hlts2 --- .github/workflows/format.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 4c3d7af937..fdd5afb2d7 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -90,9 +90,7 @@ jobs: runs-on: ubuntu-latest needs: [detect-ci-container] container: - # TODO: revert it later. - # image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }} - image: ghcr.io/vdaas/vald/vald-ci-container:pr-2334 + image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG_NAME }} steps: - uses: actions/checkout@v4 with: