Skip to content

Commit

Permalink
Fix version tag management
Browse files Browse the repository at this point in the history
  • Loading branch information
chansuke committed Nov 29, 2023
1 parent bfb00ec commit 0d4e7e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Expand Up @@ -75,7 +75,9 @@ $(MYGOBIN)/pluginator:
# Build from local source.
$(MYGOBIN)/kustomize: build-kustomize-api
cd kustomize; \
go install -ldflags "-X sigs.k8s.io/kustomize/api/provenance.buildDate=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')" \
go install -ldflags \
"-X sigs.k8s.io/kustomize/api/provenance.buildDate=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') \
-X sigs.k8s.io/kustomize/api/provenance.version=$(shell git describe --tags --always --dirty)" \
.

kustomize: $(MYGOBIN)/kustomize
Expand Down
7 changes: 7 additions & 0 deletions api/provenance/provenance.go
Expand Up @@ -62,6 +62,13 @@ func GetProvenance() Provenance {
p.GitCommit = setting.Value
}
}

for _, dep := range info.Deps {
if dep.Path == "sigs.k8s.io/kustomize/kustomize/v5" {
p.Version = dep.Version
}
}

return p
}

Expand Down

0 comments on commit 0d4e7e4

Please sign in to comment.