Skip to content

Commit

Permalink
Fix validate-manifest task (#1831)
Browse files Browse the repository at this point in the history
  • Loading branch information
helderjs authored Sep 20, 2024
1 parent 31bb653 commit bf83eaa
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -238,24 +238,23 @@ generate: ${GO_SOURCES} ## Generate code
controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./pkg/..."
$(MAKE) fmt

FILES = $(shell git ls-files -o -m --directory --exclude-standard --no-empty-directory)
TEMP := $(shell echo "$(FILES)" | awk 'NF')
LINES := $(shell echo "$(FILES)" | awk -F=' ' "{ print NF }")
check-missing-files: ## Check autogenerated runtime objects and manifest files are missing
@echo "Checking autogenerated runtime objects and manifests"
@echo "============================================"
ifneq ("$(LINES)","0")
@echo "Detected files that need to be committed:"
@echo "$(FILES)" | sed -e "s/^/ /"
@echo ""
@echo "Try running: make generate manifests"
@exit 1
.PHONY: check-missing-files
check-missing-files: ## Check autogenerated runtime objects and manifest files are missing
$(info Checking autogenerated runtime objects and manifests)
$(info ============================================)
ifneq ($(shell git ls-files -o -m --directory --exclude-standard --no-empty-directory),)
$(info Detected files that need to be committed:)
$(info $(shell git ls-files -o -m --directory --exclude-standard --no-empty-directory | sed -e "s/^/ /"))
$(info )
$(info Try running: make generate manifests)
$(error Check: FAILED)
else
$(info Check: PASS)
endif
@echo "--------------------"
@echo "Check: PASS"

.PHONY: validate-manifests
validate-manifests: generate manifests check-missing-files
validate-manifests: generate manifests
$(MAKE) check-missing-files


.PHONY: bundle
Expand Down

0 comments on commit bf83eaa

Please sign in to comment.