feat: kubesphere 4.0 (#6115)
* feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> * feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> --------- Signed-off-by: ci-bot <ci-bot@kubesphere.io> Co-authored-by: ks-ci-bot <ks-ci-bot@example.com> Co-authored-by: joyceliu <joyceliu@yunify.com>
This commit is contained in:
committed by
GitHub
parent
b5015ec7b9
commit
447a51f08b
@@ -184,11 +184,11 @@ func (c *ChartDownloader) getOciURI(ref, version string, u *url.URL) (*url.URL,
|
||||
//
|
||||
// A version is a SemVer string (1.2.3-beta.1+f334a6789).
|
||||
//
|
||||
// - For fully qualified URLs, the version will be ignored (since URLs aren't versioned)
|
||||
// - For a chart reference
|
||||
// * If version is non-empty, this will return the URL for that version
|
||||
// * If version is empty, this will return the URL for the latest version
|
||||
// * If no version can be found, an error is returned
|
||||
// - For fully qualified URLs, the version will be ignored (since URLs aren't versioned)
|
||||
// - For a chart reference
|
||||
// - If version is non-empty, this will return the URL for that version
|
||||
// - If version is empty, this will return the URL for the latest version
|
||||
// - If no version can be found, an error is returned
|
||||
func (c *ChartDownloader) ResolveChartVersion(ref, version string) (*url.URL, error) {
|
||||
u, err := url.Parse(ref)
|
||||
if err != nil {
|
||||
|
||||
3
vendor/helm.sh/helm/v3/pkg/downloader/doc.go
vendored
3
vendor/helm.sh/helm/v3/pkg/downloader/doc.go
vendored
@@ -13,7 +13,8 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*Package downloader provides a library for downloading charts.
|
||||
/*
|
||||
Package downloader provides a library for downloading charts.
|
||||
|
||||
This package contains various tools for downloading charts from repository
|
||||
servers, and then storing them in Helm-specific directory structures. This
|
||||
|
||||
13
vendor/helm.sh/helm/v3/pkg/downloader/manager.go
vendored
13
vendor/helm.sh/helm/v3/pkg/downloader/manager.go
vendored
@@ -20,7 +20,6 @@ import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/url"
|
||||
"os"
|
||||
@@ -249,7 +248,7 @@ func (m *Manager) downloadAll(deps []*chart.Dependency) error {
|
||||
destPath := filepath.Join(m.ChartPath, "charts")
|
||||
tmpPath := filepath.Join(m.ChartPath, "tmpcharts")
|
||||
|
||||
// Check if 'charts' directory is not actally a directory. If it does not exist, create it.
|
||||
// Check if 'charts' directory is not actually a directory. If it does not exist, create it.
|
||||
if fi, err := os.Stat(destPath); err == nil {
|
||||
if !fi.IsDir() {
|
||||
return errors.Errorf("%q is not a directory", destPath)
|
||||
@@ -668,6 +667,7 @@ func (m *Manager) parallelRepoUpdate(repos []*repo.Entry) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
r.CachePath = m.RepositoryCache
|
||||
wg.Add(1)
|
||||
go func(r *repo.ChartRepository) {
|
||||
if _, err := r.DownloadIndexFile(); err != nil {
|
||||
@@ -714,15 +714,21 @@ func (m *Manager) findChartURL(name, version, repoURL string, repos map[string]*
|
||||
var entry repo.ChartVersions
|
||||
entry, err = findEntryByName(name, cr)
|
||||
if err != nil {
|
||||
// TODO: Where linting is skipped in this function we should
|
||||
// refactor to remove naked returns while ensuring the same
|
||||
// behavior
|
||||
//nolint:nakedret
|
||||
return
|
||||
}
|
||||
var ve *repo.ChartVersion
|
||||
ve, err = findVersionedEntry(version, entry)
|
||||
if err != nil {
|
||||
//nolint:nakedret
|
||||
return
|
||||
}
|
||||
url, err = normalizeURL(repoURL, ve.URLs[0])
|
||||
if err != nil {
|
||||
//nolint:nakedret
|
||||
return
|
||||
}
|
||||
username = cr.Config.Username
|
||||
@@ -732,6 +738,7 @@ func (m *Manager) findChartURL(name, version, repoURL string, repos map[string]*
|
||||
caFile = cr.Config.CAFile
|
||||
certFile = cr.Config.CertFile
|
||||
keyFile = cr.Config.KeyFile
|
||||
//nolint:nakedret
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -845,7 +852,7 @@ func writeLock(chartpath string, lock *chart.Lock, legacyLockfile bool) error {
|
||||
lockfileName = "requirements.lock"
|
||||
}
|
||||
dest := filepath.Join(chartpath, lockfileName)
|
||||
return ioutil.WriteFile(dest, data, 0644)
|
||||
return os.WriteFile(dest, data, 0644)
|
||||
}
|
||||
|
||||
// archive a dep chart from local directory and save it into destPath
|
||||
|
||||
Reference in New Issue
Block a user