<p>I need to download chart which is located external OCI repository, when I download it using click on the link of the chart and version and provide user and password it works but not with the following code, this is what I tried and get an error</p>
<p><strong>failed to download &quot;https://fdr.cdn.repositories.amp/artifactory/control-1.0.0.tgz&quot; at version &quot;1.0.0&quot; (hint: running <code>helm repo update</code> may help)</strong> , if I click on the above link it asks for user and pass (in the browser) and when I provide it (the same in the code) the chart is <strong>downloaded</strong>, any idea why with the code its not working?</p>
<p>This is what I tried</p>
<pre><code>    package main

import (
    &quot;fmt&quot;
    &quot;os&quot;

    &quot;helm.sh/helm/v3/pkg/action&quot;
    &quot;helm.sh/helm/v3/pkg/cli&quot;
    &quot;helm.sh/helm/v3/pkg/repo&quot;
)

var config *cli.EnvSettings

func main() {
    config = cli.New()
    re := repo.Entry{
        Name:     &quot;control&quot;,
        URL:      &quot;https://fdr.cdn.repositories.amp/artifactory/control&quot;,
        Username:              &quot;myuser&quot;,
        Password:              &quot;mypass&quot;,
    }
    file, err := repo.LoadFile(config.RepositoryConfig)
    if err != nil {
        fmt.Println(err.Error())
    }
    file.Update(&amp;re)
    file.WriteFile(config.RepositoryConfig, os.ModeAppend)

    co := action.ChartPathOptions{
        InsecureSkipTLSverify: false,
        RepoURL:               &quot;https://fdr.cdn.repositories.amp/artifactory/control&quot;,
        Username:              &quot;myuser&quot;,
        Password:              &quot;mypass&quot;,
        Version:               &quot;1.0.0&quot;,
    }

    fp, err := co.LocateChart(&quot;control&quot;, config)
    if err != nil {
        fmt.Println(err.Error())
    }
    fmt.Println(fp)
}
</code></pre>
<p>While <strong>debug</strong> the code I found <strong>where the error is coming from</strong>  <a href="https://github.com/helm/helm/blob/release-3.6/pkg/downloader/chart_downloader.go#L352" rel="nofollow noreferrer">https://github.com/helm/helm/blob/release-3.6/pkg/downloader/chart_downloader.go#L352</a>
it trying to find some cache which doesn't exist in my laptop, how could I disable it or some other solution to make it work?</p>

Jenney
<p>I think you need to update your repository before locating the chart.</p>
<p><a href="https://github.com/helm/helm/blob/main/cmd/helm/repo_update.go#L64-L89" rel="nofollow noreferrer">This</a> is the code the CLI uses to update the repositories.</p>
<p>And <a href="https://github.com/helm/helm/blob/main/cmd/helm/repo_update.go#L64-L89" rel="nofollow noreferrer">this</a> is the function that performs the update on the repositories.</p>
