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

Kustomize version is always devel, but should be v5.x.x #5339

Closed
denist-huma opened this issue Sep 22, 2023 · 4 comments · Fixed by #5463
Closed

Kustomize version is always devel, but should be v5.x.x #5339

denist-huma opened this issue Sep 22, 2023 · 4 comments · Fixed by #5463
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@denist-huma
Copy link

What happened?

$ /home/denis/huma/compose-operator/bin/kustomize version
(devel)

I have a part of Makefile to download kustomize and check that it is of recent v5, and I want a semver out of kustomize version call.

## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
KUSTOMIZE_VERSION ?= v5.1.0

KUSTOMIZE ?= $(LOCALBIN)/kustomize
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
$(KUSTOMIZE): $(LOCALBIN)
	@if test -x $(LOCALBIN)/kustomize && ! $(LOCALBIN)/kustomize version | grep -q $(KUSTOMIZE_VERSION); then \
		echo "$(LOCALBIN)/kustomize version is not expected $(KUSTOMIZE_VERSION). Removing it before installing."; \
		rm -rf $(LOCALBIN)/kustomize; \
	fi
	test -s $(LOCALBIN)/kustomize || GOBIN=$(LOCALBIN) GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/v5@$(KUSTOMIZE_VERSION)

What did you expect to happen?

$ /home/denis/huma/compose-operator/bin/kustomize version
v5.1.0

How can we reproduce it (as minimally and precisely as possible)?

$ kustomize version
(devel)

Expected output

No response

Actual output

No response

Kustomize version

v5.1.0

Operating system

Linux

@denist-huma denist-huma added the kind/bug Categorizes issue or PR as related to a bug. label Sep 22, 2023
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Sep 22, 2023
@sarab97
Copy link
Member

sarab97 commented Oct 3, 2023

Seems like the go build of kustomize isnt getting tagged with version. But brew installation does have proper tag of version

@sarab97
Copy link
Member

sarab97 commented Oct 4, 2023

Will need to look into how to pass version when building with go. Otherwise commit id will be added in place of version.
/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 4, 2023
@varshaprasad96
Copy link
Member

This is how we do in some of the operator-framework projects. Adding info here in case it helps in fixing the issue:

The buildinfo returns debug.Module (https://cs.opensource.google/go/go/+/refs/tags/go1.21.1:src/runtime/debug/mod.go;l=62), which contains all the dependencies of the build. We search for latest tag for our module (eg: https://github.com/operator-framework/helm-operator-plugins/blob/d00d0092fe5c2a7776a678b7dcee4085cbccfe01/internal/version/version.go#L67), it would be sigs.k8s.io/kustomize/kustomize in our case, and I assume it would give us the tag with which we add could +dirty (or any other better name +local). So no dependency on git, we just get the tag from go's build info.

@natasha41575 natasha41575 added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Oct 11, 2023
@chansuke
Copy link
Member

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Development

Successfully merging a pull request may close this issue.

6 participants