Skip to content

Commit 532abf7

Browse files
committed
refactor: fix generate-kustimize-builtin-plugins, add diff checker on generate-kustomize-builtin-plugins, add go work sync on presubmit check, add generate-kustomize-builtin-plugins on presubmit check
1 parent 59696d1 commit 532abf7

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

0

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1607

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ prow-presubmit-check: \
112112
test-go-mod \
113113
build-non-plugin-all \
114114
test-examples-kustomize-against-HEAD \
115-
test-examples-kustomize-against-latest-release
115+
test-examples-kustomize-against-latest-release \
116+
workspace-sync \
117+
generate-kustomize-builtin-plugins
116118

117119
.PHONY: license
118120
license: $(MYGOBIN)/addlicense
@@ -181,7 +183,15 @@ test-examples-kustomize-against-HEAD: $(MYGOBIN)/kustomize $(MYGOBIN)/mdrip
181183
test-examples-kustomize-against-latest-release: $(MYGOBIN)/mdrip
182184
./hack/testExamplesAgainstKustomize.sh v5@$(LATEST_RELEASE)
183185

186+
.PHONY: generate-kustomize-builtin-plugins
187+
generate-kustomize-builtin-plugins:
188+
$(MAKE) -f Makefile-plugin.mk
184189

190+
# Pushes dependencies in the go.work file back to go.mod files of each workspace module.
191+
.PHONY: workspace-sync
192+
workspace sync:
193+
go work sync
194+
185195
# --- Cleanup targets ---
186196
.PHONY: clean
187197
clean: clean-kustomize-external-go-plugin uninstall-tools

Makefile-plugins.mk

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,25 @@ $(pGen)/%.go: $(MYGOBIN)/pluginator $(MYGOBIN)/goimports
9191

9292
# Target is for debugging.
9393
.PHONY: generate-kustomize-builtin-plugins
94-
generate-kustomize-builtin-plugins: $(builtinplugins)
94+
generate-kustomize-builtin-plugins: $(builtplugins)
95+
for plugin in $(abspath $(wildcard $(pSrc)/*)); do \
96+
echo "generating $${plugin} ..."; \
97+
set -e; \
98+
cd $${plugin}; \
99+
go generate pluginator .; \
100+
done; \
101+
cd ../../../; \
102+
make no-diff \
103+
104+
.PHONY: no-diff
105+
no-diff: $(builtplugins)
106+
for file in $(abspath $(builtinplugins)); do \
107+
echo "Checking for diff... $${file}" ; \
108+
set -e ; \
109+
if [ "`git diff $${file} | wc -c`" -gt 0 ]; then\
110+
echo "Error(1): diff found on $${file}"; exit 1; \
111+
fi \
112+
done
95113

96114
.PHONY: build-kustomize-external-go-plugin
97115
build-kustomize-external-go-plugin:

0 commit comments

Comments
 (0)