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: update kind-load target to ensure that works aligned with controller-operator #462

Merged
Merged
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
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ kind-cluster-cleanup: $(KIND) ## Delete the kind cluster

.PHONY: kind-load
kind-load: check-cluster $(KIND) ## Load the built images onto the local cluster
$(KIND) export kubeconfig --name $(KIND_CLUSTER_NAME)
$(KIND) load docker-image $(IMAGE) --name $(KIND_CLUSTER_NAME)
docker save $(IMAGE) | $(KIND) load image-archive /dev/stdin --name $(KIND_CLUSTER_NAME)
Copy link
Member

Choose a reason for hiding this comment

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

I vaguely remember that we already tried something like this and there were issues with some setups. I think, was either macOS vs Linux setups or Docker vs Podman. Not sure.

  • This change ensures that the kind-load target works seamlessly with any local kind cluster created by the developer, without relying on a bingo-provided version of kind.

What did you mean here? Was the intention to use kind from PATH? This change still uses bingo-provided version of kind.

And I'm not sure that we want to do that do that: kind and other dependencies are intentionally managed by with so we have reproducibility across environments.

Copy link
Contributor Author

@camilamacedo86 camilamacedo86 Nov 18, 2024

Choose a reason for hiding this comment

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

I want to use my own local kind installation instead of relying on a version tied to bingo (e.g., /Users/camilam/go/bin/kind-v0.24.0). Contributors should have the flexibility to work with their local environments without unnecessary dependencies.

Forcing a specific kind of version is restrictive, and global dependencies are unnecessary and a pain. It messed up with my local env.

⚠️ I also don’t want to remember or use /Users/camilam/go/bin/kind-v0.24.0 to run any command for kind. It was frustrating to figure out why the image wasn’t loading.

This approach works perfectly on macOS (I use a Mac, and the CI uses Linux, so we are 100% safe here) and matches the implementation used in con-oper, where it’s not a problem.

Why treat it differently here? Standardizing this method simplifies workflows and makes the project more contributor-friendly. Let’s avoid unnecessary friction for contributors.

Copy link
Member

Choose a reason for hiding this comment

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

This approach works perfectly on macOS (I use a Mac, and the CI uses Linux, so we are 100% safe here) and matches the implementation used in con-oper, where it’s not a problem.

Why treat it differently here? Standardizing this method simplifies workflows and makes the project more contributor-friendly. Let’s avoid unnecessary friction for contributors.

As I said - I vaguely remember us having issues with kind load. But if it is the same approach as in operator-controller - then we should be good because I believe it was sorted in operator-controller. Here is the background I managed to dig out:

I want to use my own local kind installation instead of relying on a version tied to bingo (e.g., /Users/camilam/go/bin/kind-v0.24.0). Contributors should have the flexibility to work with their local environments without unnecessary dependencies.

This change does not achieve that: make still uses bingo versioned kind. Don't hesitate to submit a PR to further address this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right
I will do a follow up to fix the kind and do not use it from BINGO

Copy link
Member

Choose a reason for hiding this comment

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

I want to use my own local kind installation instead of relying on a version tied to bingo (e.g., /Users/camilam/go/bin/kind-v0.24.0). Contributors should have the flexibility to work with their local environments without unnecessary dependencies.

I really disagree with this actually. If the repository is setup to seamlessly ensure the necessary build/test dependencies are present on the local system, there is no good reason:

  • for a contributor to use alternate versions of the build tools that are specified by the repo
  • for maintainers to increase the complexity of the Makefile to support it.

The more options and overrides that are made available in the Makefile, the harder it is to trust the results of any particular CI task.

To the extent that we can use tooling like bingo to provide specific build tool versions, we should enforce those build tool versions for all contributors. It improves consistency and eliminates most of the "well it works on my system" problems.

Copy link
Member

Choose a reason for hiding this comment

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

I agree with what @joelanford said above and this is what I meant above when I said that we intentionally manage dependencies like this in the repo with bingo (but I now see that I typed some nonsense there).

I decided to leave these points unanswered here so we don't get distracted here from the consistency fix.

@camilamacedo86 could you please submit a PR or create an issue to address this further? Please describe the issues you are facing in as much detail as possible so we can discuss it there. If it is a time consuming PR - we should probably start with an issue describing a potential solution.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why replace common call to Kind with specific call to a particular container-runtime?

Copy link
Member

@m1kola m1kola Nov 18, 2024

Choose a reason for hiding this comment

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

@bentito there is currently no support for CONTAINER_RUNTIME variable in Makefile in catalogd. @camilamacedo86 addresses this in #464 which is currently waiting for this PR.


.PHONY: install
install: check-cluster build-container kind-load deploy wait ## Install local catalogd to an existing cluster
Expand Down