Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an issue with verify_client.sh #805

Merged
merged 1 commit into from
Mar 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ clientset: ## Generate a typed clientset
--listers-package sigs.k8s.io/cluster-api/pkg/client/listers_generated \
--output-package sigs.k8s.io/cluster-api/pkg/client/informers_generated \
--go-header-file=./hack/boilerplate.go.txt
$(MAKE) gazelle
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not keep this with generate? Bazel files might need to be updated after go generate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, we need it at both places to make Makefile target idempotent, the ci script verify_clientset.sh call make clientset, i will update the PR, thanks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was seeing issues with calling gazelle at the end of clientset where it was generating the wrong paths in the bazel build files, which was the reason for moving it to the generate target.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@detiber i replied in another code line thread, thanks


.PHONY: clean
clean: ## Remove all generated files
Expand Down
2 changes: 0 additions & 2 deletions hack/verify_clientset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ mkdir -p "${TMP_DIFFROOT}"
cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}"

make clientset
find "${TMP_DIFFROOT}" -name *.bazel -delete

echo "diffing ${DIFFROOT} against freshly generated codegen"
ret=0
diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" -x '*.bazel' -x 'BUILD' || ret=$?
cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@detiber i think this is line that causing issue you are seeing (correct me if not the same issue),
make gazelle will generate bazel under the _tmp, then it copy files from _tmp to main repo,
then main repo got the bazel files which point to _tmp which is wrong.

what i found is: we don't need to copy those clientset files from _tmp to main repo.
(i guess originally been done this way because: make gazelle is not called after clientset been generated, but thats only my guess)

if [[ $ret -eq 0 ]]
then
echo "${DIFFROOT} up to date."
Expand Down