Skip to content

check for tool version in Makefile before installing #3068

@coriaedu

Description

@coriaedu

What do you want to happen?

Feature Request

Describe the problem you need a feature to resolve.

The Makefile that is scaffolded for golang has two targets that will download controller-gen and kustomize tools, with the versions corresponding to CONTROLLER_TOOLS_VERSION and KUSTOMIZE_VERSION vars.

The recipes there are currently checking for file existence before installing the tool, but they don't confirm the version.

In my scenario, where I am upgrading the OSDK, I found this issue with the current Makefile:

  • checkout clean branch with OSDK 1.24.0
  • Run make controller-gen -> This will download controller-gen v0.9.2 at $(LOCALBIN)
  • upgrade OSDK to 1.25.1
    • This includes updating the CONTROLLER_TOOLS_VERSION to v0.10.0
  • Run any command that uses controller-gen thinking that v0.10.0 will be used, but it is still running 0.9.2

The same thing applies when I switch branches that have different OSDK versions

This applies to kustomize also.

Describe the solution you'd like.

I'd like the controller-gen and kustomize targets to check for version so we ensure that it matches the corresponding VERSION var.

Extra Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions