Skip to content

Commit 6c3d394

Browse files
committed
feat: don't preserve extra container repository path from origin
Signed-off-by: Tomas Pizarro Moreno <tomas.pizarro@broadcom.com>
1 parent 24548df commit 6c3d394

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
github.com/spf13/cobra v1.10.2
1818
github.com/spf13/viper v1.20.1
1919
github.com/stretchr/testify v1.11.1
20-
github.com/vmware-labs/distribution-tooling-for-helm v0.6.1
20+
github.com/vmware-labs/distribution-tooling-for-helm v0.7.0
2121
google.golang.org/protobuf v1.36.11
2222
gopkg.in/yaml.v3 v3.0.1
2323
helm.sh/helm/v3 v3.19.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,8 @@ github.com/transparency-dev/merkle v0.0.2 h1:Q9nBoQcZcgPamMkGn7ghV8XiTZ/kRxn1yCG
689689
github.com/transparency-dev/merkle v0.0.2/go.mod h1:pqSy+OXefQ1EDUVmAJ8MUhHB9TXGuzVAT58PqBoHz1A=
690690
github.com/vbatts/tar-split v0.12.1 h1:CqKoORW7BUWBe7UL/iqTVvkTBOF8UvOMKOIZykxnnbo=
691691
github.com/vbatts/tar-split v0.12.1/go.mod h1:eF6B6i6ftWQcDqEn3/iGFRFRo8cBIMSJVOpnNdfTMFA=
692-
github.com/vmware-labs/distribution-tooling-for-helm v0.6.1 h1:dlhWvDevr3P86B7BipkREhMOtSZS9WxNoAwLtRUSewY=
693-
github.com/vmware-labs/distribution-tooling-for-helm v0.6.1/go.mod h1:Q6WupfRDDMi6qBcta2IK6UUAt14xe64ug8kLRfiuImY=
692+
github.com/vmware-labs/distribution-tooling-for-helm v0.7.0 h1:FJXG066yrovW8U/mEgQbhtQZe11DS0zpIot+GGVQzGA=
693+
github.com/vmware-labs/distribution-tooling-for-helm v0.7.0/go.mod h1:Q6WupfRDDMi6qBcta2IK6UUAt14xe64ug8kLRfiuImY=
694694
github.com/vmware-labs/yaml-jsonpath v0.3.2 h1:/5QKeCBGdsInyDCyVNLbXyilb61MXGi9NP674f9Hobk=
695695
github.com/vmware-labs/yaml-jsonpath v0.3.2/go.mod h1:U6whw1z03QyqgWdgXxvVnQ90zN1BWz5V+51Ewf8k+rQ=
696696
github.com/vmware-tanzu/carvel-imgpkg v0.38.3 h1:vVnqCPFEZ2NQcoTywg/va91qRyCuu46wBYAETqoyez4=

pkg/client/target/common/common.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ func NewContainer(target *apiv1.Target, containersReaderWriter client.Containers
6868
func (t *Target) getContainersUploadURL() string {
6969
containersURL := t.containersURL
7070
if containersURL == "" {
71-
containersURL = t.GetUploadURL()
71+
// When containers URL is not specified, append /containers to charts URL
72+
// to avoid collision between charts and containers at the same path
73+
containersURL = t.GetUploadURL() + "/containers"
7274
}
7375

7476
if schemeRE.MatchString(containersURL) {
@@ -97,6 +99,7 @@ func (t *Target) UnwrapChart(file string, _ *chart.Metadata, opts ...config.Opti
9799
unwrap.WithContainerRegistryAuth(t.containersUsername, t.containersPassword),
98100
unwrap.WithSkipImageRelocation(cfg.SkipImages),
99101
unwrap.WithSkipPullImages(cfg.SkipImages),
102+
unwrap.WithPreserveRepository(false),
100103
); err != nil {
101104
return errors.Trace(err)
102105
}
@@ -124,6 +127,7 @@ func (t *Target) UnwrapContainer(file string, opts ...config.Option) error {
124127
unwrap.WithSkipImageRelocation(cfg.SkipImages),
125128
unwrap.WithSkipPullImages(cfg.SkipImages),
126129
unwrap.WithFetchArtifacts(!cfg.SkipArtifacts),
130+
unwrap.WithPreserveRepository(false),
127131
); err != nil {
128132
return errors.Trace(err)
129133
}

0 commit comments

Comments
 (0)