Skip to content

Commit

Permalink
fix: Get version from the BuildInfo.Main.Version if not found in deps…
Browse files Browse the repository at this point in the history
… and build flag
  • Loading branch information
dmvolod committed Jan 16, 2025
1 parent 48686ac commit cd58781
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions api/provenance/provenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,24 @@ func GetProvenance() Provenance {

for _, dep := range info.Deps {
if dep != nil && dep.Path == "sigs.k8s.io/kustomize/kustomize/v5" {
if dep.Version != "devel" {
if dep.Version == developmentVersion {
continue
}
v, err := GetMostRecentTag(*dep)
if err != nil {
fmt.Printf("failed to get most recent tag for %s: %v\n", dep.Path, err)
continue
break
}
p.Version = v

return p
}
}

if info.Main.Version != "" && p.Version == developmentVersion {
p.Version = info.Main.Version
}

return p
}

Expand Down

0 comments on commit cd58781

Please sign in to comment.