Skip to content

Conversation

@dtfranz
Copy link
Contributor

@dtfranz dtfranz commented Apr 21, 2023

Separates the tools binaries out to their own folder so we can stop doing funky stuff to ignore them when building the operator-controller image.

@dtfranz
Copy link
Contributor Author

dtfranz commented Apr 21, 2023

I'd like to try caching the tools directory as well for a little extra speed boost on the builds.
I'll take care of this ^ in a separate issue.

/hold
Until actions are good.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 21, 2023
@dtfranz
Copy link
Contributor Author

dtfranz commented Apr 21, 2023

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 21, 2023

## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
LOCALBIN ?= $(shell pwd)/hack/tools/bin
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if this is a bit too long; in k8s repos, the scripts are located directly in the hack directory, and then we add the tools and bin directory, all of which end up as synonyms of each other? Perhaps something shorter?
(Not a fan of the name of the directory, but it's what k8s does... shrug)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's setup this way to give us an option in the future of declaring our go tools via go.mod file in hack/tools/, then when those are pulled down they'll go in hack/tools/bin/. Makes it a bit easier to manage with our .gitignore files IMO.

.goreleaser.yml Outdated
Comment on lines 12 to 14
hooks:
pre:
- mkdir -p bin
Copy link
Member

Choose a reason for hiding this comment

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

Is bin only a concern for goreleaser because of the make build task? If so, WDYT about calling mkdir -p bin in the make build recipe prior to calling goreleaser?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's needed for everything that runs goreleaser, including the release target, so I figured I'd build it into the yaml so it would always be there regardless of how/which make was called.

Copy link
Member

@joelanford joelanford Apr 27, 2023

Choose a reason for hiding this comment

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

including the release target

Ah, I didn't know this. How does it come into play with make release? (I thought that target used <projectRoot>/dist exclusively.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I stand corrected, you were right on this one; I've updated it to just call mkdir -p bin when running the build target.

.gitignore Outdated
*.dylib
bin/*
testbin/*
hack/tools/bin/*
Copy link
Member

Choose a reason for hiding this comment

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

IMO, we should be more explicit in some of these cases. IIRC, leaving the leading slash out means that we will ignore any path under the current dir that ends with hack/tools/bin/*. Whereas including the leading slash means just this specific directory from the root (based on the location of the gitignore file). IMO explicitness is almost always better.

There's a reasonable argument one could make about doing this more ubiquitously for all relevant .gitignore paths in a single PR, so this is non-blocking, regardless.

Suggested change
hack/tools/bin/*
/hack/tools/bin/*

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fully in agreement here, I'll add your suggestion. Thanks!

Comment on lines 29 to 31
use: buildx
build_flag_templates:
- "--platform=linux/amd64"
Copy link
Member

Choose a reason for hiding this comment

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

Need to rebase to pick this fix back up?

Separates the tools binaries out to their own folder so we can stop doing funky stuff to ignore them when building the operator-controller image.

Signed-off-by: dtfranz <dfranz@redhat.com>
@dtfranz dtfranz merged commit cc4b09a into operator-framework:main Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants