Skip to content

Commit

Permalink
fix: clone Chart struct when handling semver ranges (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
sboschman authored Feb 14, 2025
1 parent ffaa806 commit f75f6be
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ require (
github.com/enescakir/emoji v1.0.0
github.com/hashicorp/go-retryablehttp v0.7.7
github.com/jedib0t/go-pretty/v6 v6.6.0
github.com/jinzhu/copier v0.4.0
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213
github.com/moby/buildkit v0.15.1
github.com/project-copacetic/copacetic v0.7.1-0.20240723231147-beb8c86673a8
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,8 @@ github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 h1:TMtDYDHKYY
github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267/go.mod h1:h1nSAbGFqGVzn6Jyl1R/iCcBUHN4g+gW1u9CoBTrb9E=
github.com/jellydator/ttlcache/v3 v3.3.0 h1:BdoC9cE81qXfrxeb9eoJi9dWrdhSuwXMAnHTbnBm4Wc=
github.com/jellydator/ttlcache/v3 v3.3.0/go.mod h1:bj2/e0l4jRnQdrnSTaGTsh4GSXvMjQcy41i7th0GVGw=
github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8=
github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
github.com/jinzhu/gorm v0.0.0-20170222002820-5409931a1bb8 h1:CZkYfurY6KGhVtlalI4QwQ6T0Cu6iuY3e0x5RLu96WE=
github.com/jinzhu/gorm v0.0.0-20170222002820-5409931a1bb8/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCdxqo=
github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d h1:jRQLvyVGL+iVtDElaEIDdKwpPqUIZJfzkNLV34htpEc=
Expand Down
11 changes: 8 additions & 3 deletions pkg/helm/chartCollection.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/ChristofferNissen/helmper/pkg/util/terminal"
"github.com/jinzhu/copier"
"helm.sh/helm/v3/pkg/cli"
)

Expand Down Expand Up @@ -83,9 +84,13 @@ func (collection ChartCollection) SetupHelm(settings *cli.EnvSettings, setters .
}

for _, v := range vs {
c := c
c.Version = v
res = append(res, c)
cv := &Chart{}
err := copier.Copy(&cv, &c)
if err != nil {
return nil, err
}
cv.Version = v
res = append(res, cv)
}
}
collection.Charts = res
Expand Down

0 comments on commit f75f6be

Please sign in to comment.