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

🌱 Minor CAPD Makefile cleanup #4418

Merged
merged 1 commit into from
Mar 31, 2021

Conversation

sedefsavas
Copy link

What this PR does / why we need it:
A minor cleanup to use the main Makefile targets for CAPD controller-gen and conversion-gen.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Related to #4407

/kind cleanup

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 31, 2021
@sedefsavas
Copy link
Author

cc @vincepri

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 31, 2021
@@ -94,11 +94,11 @@ test-verbose: ## Run tests with verbose settings.
manager: ## Build manager binary
go build -o $(BIN_DIR)/manager sigs.k8s.io/cluster-api/test/infrastructure/docker

$(CONTROLLER_GEN): $(TOOLS_DIR)/go.mod # Build controller-gen from tools folder.
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/controller-gen sigs.k8s.io/controller-tools/cmd/controller-gen
$(CONTROLLER_GEN):
Copy link
Member

@sbueringer sbueringer Mar 31, 2021

Choose a reason for hiding this comment

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

I'm getting more and more confused about Makefiles work :), but do you need those targets at all?

Can you rebase onto the current master? I'm also using gotestsum here and I didn't have to specify a target like those.

Copy link
Author

Choose a reason for hiding this comment

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

In a scenario where a user wants to run make generate inside CAPD, we need to build them if I am not missing anything.

Copy link
Member

@sbueringer sbueringer Mar 31, 2021

Choose a reason for hiding this comment

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

I dropped those targets locally and it still seems to work:

-> cd ./test/infrastructure/docker
-> make generate-go
~/code/src/sigs.k8s.io/cluster-api/hack/tools/bin/controller-gen \
...

Same for make test-junit:

...
{"Time":"2021-03-31T20:22:24.872626044+02:00","Action":"skip","Package":"sigs.k8s.io/cluster-api/test/infrastructure/docker/third_party/forked/loadbalancer","Elapsed":0}
~/code/src/sigs.k8s.io/cluster-api/hack/tools/bin/gotestsum --junitfile ../../../_artifacts/junit.infra_docker.xml --raw-command cat ../../../_artifacts/junit.infra_docker.stdout
✓  cloudinit (cached)
✓  api/v1alpha4 (cached)
...

I suspect it just resolves the path and builds the targets already defined in the top-level file.

But it's very possible that I'm missing something

(I think the same would apply to $(KUSTOMIZE))

Copy link
Author

Choose a reason for hiding this comment

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

If those binaries are not already in hack/tools/bin before, not working for me.

Copy link
Member

Choose a reason for hiding this comment

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

I didn't think of that. Same for me, I just already had the binaries before I tested it.

Copy link
Member

Choose a reason for hiding this comment

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

Can you maybe also add a target for GOTESTSUM? I missed that use case with my PR

@sbueringer
Copy link
Member

Thank you!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 31, 2021
@detiber
Copy link
Member

detiber commented Mar 31, 2021

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: detiber

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 31, 2021
@k8s-ci-robot k8s-ci-robot merged commit c770422 into kubernetes-sigs:master Mar 31, 2021
@k8s-ci-robot k8s-ci-robot added this to the v0.4 milestone Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants