diff --git a/cmd/helm/home.go b/cmd/helm/home.go index 2f6e9f31a..c15cb163d 100644 --- a/cmd/helm/home.go +++ b/cmd/helm/home.go @@ -43,7 +43,6 @@ func newHomeCmd(out io.Writer) *cobra.Command { fmt.Fprintf(out, "Repository: %s\n", h.Repository()) fmt.Fprintf(out, "RepositoryFile: %s\n", h.RepositoryFile()) fmt.Fprintf(out, "Cache: %s\n", h.Cache()) - fmt.Fprintf(out, "Stable CacheIndex: %s\n", h.CacheIndex("stable")) fmt.Fprintf(out, "Starters: %s\n", h.Starters()) fmt.Fprintf(out, "Plugins: %s\n", h.Plugins()) } diff --git a/cmd/helm/init.go b/cmd/helm/init.go index bde922e3a..0faee1d11 100644 --- a/cmd/helm/init.go +++ b/cmd/helm/init.go @@ -28,7 +28,6 @@ import ( "sigs.k8s.io/yaml" "helm.sh/helm/cmd/helm/require" - "helm.sh/helm/pkg/getter" "helm.sh/helm/pkg/helmpath" "helm.sh/helm/pkg/plugin" "helm.sh/helm/pkg/plugin/installer" @@ -39,15 +38,9 @@ const initDesc = ` This command sets up local configuration in $HELM_HOME (default ~/.helm/). ` -const ( - stableRepository = "stable" - defaultStableRepositoryURL = "https://kubernetes-charts.storage.googleapis.com" -) - type initOptions struct { - skipRefresh bool // --skip-refresh - stableRepositoryURL string // --stable-repo-url - pluginsFilename string // --plugins + skipRefresh bool // --skip-refresh + pluginsFilename string // --plugins home helmpath.Home } @@ -77,7 +70,6 @@ func newInitCmd(out io.Writer) *cobra.Command { f := cmd.Flags() f.BoolVar(&o.skipRefresh, "skip-refresh", false, "do not refresh (download) the local repository cache") - f.StringVar(&o.stableRepositoryURL, "stable-repo-url", defaultStableRepositoryURL, "URL for stable repository") f.StringVar(&o.pluginsFilename, "plugins", "", "a YAML file specifying plugins to install") return cmd @@ -88,7 +80,7 @@ func (o *initOptions) run(out io.Writer) error { if err := ensureDirectories(o.home, out); err != nil { return err } - if err := ensureDefaultRepos(o.home, out, o.skipRefresh, o.stableRepositoryURL); err != nil { + if err := ensureReposFile(o.home, out, o.skipRefresh); err != nil { return err } if err := ensureRepoFileFormat(o.home.RepositoryFile(), out); err != nil { @@ -130,16 +122,11 @@ func ensureDirectories(home helmpath.Home, out io.Writer) error { return nil } -func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool, url string) error { +func ensureReposFile(home helmpath.Home, out io.Writer, skipRefresh bool) error { repoFile := home.RepositoryFile() if fi, err := os.Stat(repoFile); err != nil { fmt.Fprintf(out, "Creating %s \n", repoFile) f := repo.NewFile() - sr, err := initRepo(url, home.CacheIndex(stableRepository), out, skipRefresh, home) - if err != nil { - return err - } - f.Add(sr) if err := f.WriteFile(repoFile, 0644); err != nil { return err } @@ -149,31 +136,6 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool, url return nil } -func initRepo(url, cacheFile string, out io.Writer, skipRefresh bool, home helmpath.Home) (*repo.Entry, error) { - fmt.Fprintf(out, "Adding %s repo with URL: %s \n", stableRepository, url) - c := repo.Entry{ - Name: stableRepository, - URL: url, - Cache: cacheFile, - } - r, err := repo.NewChartRepository(&c, getter.All(settings)) - if err != nil { - return nil, err - } - - if skipRefresh { - return &c, nil - } - - // In this case, the cacheFile is always absolute. So passing empty string - // is safe. - if err := r.DownloadIndexFile(""); err != nil { - return nil, errors.Wrapf(err, "%s is not a valid chart repository or cannot be reached", url) - } - - return &c, nil -} - func ensureRepoFileFormat(file string, out io.Writer) error { r, err := repo.LoadFile(file) if err == repo.ErrRepoOutOfDate { diff --git a/cmd/helm/init_test.go b/cmd/helm/init_test.go index 270b12672..c0db7c184 100644 --- a/cmd/helm/init_test.go +++ b/cmd/helm/init_test.go @@ -34,10 +34,10 @@ func TestEnsureHome(t *testing.T) { if err := ensureDirectories(hh, b); err != nil { t.Error(err) } - if err := ensureDefaultRepos(hh, b, false, defaultStableRepositoryURL); err != nil { + if err := ensureReposFile(hh, b, false); err != nil { t.Error(err) } - if err := ensureDefaultRepos(hh, b, true, defaultStableRepositoryURL); err != nil { + if err := ensureReposFile(hh, b, true); err != nil { t.Error(err) } if err := ensureRepoFileFormat(hh.RepositoryFile(), b); err != nil { diff --git a/cmd/helm/install.go b/cmd/helm/install.go index ca2ef037f..bfbe329cf 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -75,7 +75,7 @@ file MUST pass all verification steps. There are five different ways you can express the chart you want to install: -1. By chart reference: helm install stable/mariadb +1. By chart reference: helm install example/mariadb 2. By path to a packaged chart: helm install ./nginx-1.2.3.tgz 3. By path to an unpacked chart directory: helm install ./nginx 4. By absolute URL: helm install https://example.com/charts/nginx-1.2.3.tgz @@ -85,8 +85,8 @@ CHART REFERENCES A chart reference is a convenient way of reference a chart in a chart repository. -When you use a chart reference with a repo prefix ('stable/mariadb'), Helm will look in the local -configuration for a chart repository named 'stable', and will then look for a +When you use a chart reference with a repo prefix ('example/mariadb'), Helm will look in the local +configuration for a chart repository named 'example', and will then look for a chart in that repository whose name is 'mariadb'. It will install the latest version of that chart unless you also supply a version number with the '--version' flag. diff --git a/cmd/helm/show.go b/cmd/helm/show.go index 4b23473af..68260eddd 100644 --- a/cmd/helm/show.go +++ b/cmd/helm/show.go @@ -28,7 +28,7 @@ import ( const showDesc = ` This command inspects a chart and displays information. It takes a chart reference -('stable/drupal'), a full path to a directory or packaged chart, or a URL. +('example/drupal'), a full path to a directory or packaged chart, or a URL. Inspect prints the contents of the Chart.yaml file and the values.yaml file. ` diff --git a/cmd/helm/upgrade.go b/cmd/helm/upgrade.go index 38c36485f..537660efd 100644 --- a/cmd/helm/upgrade.go +++ b/cmd/helm/upgrade.go @@ -34,7 +34,7 @@ const upgradeDesc = ` This command upgrades a release to a new version of a chart. The upgrade arguments must be a release and chart. The chart -argument can be either: a chart reference('stable/mariadb'), a path to a chart directory, +argument can be either: a chart reference('example/mariadb'), a path to a chart directory, a packaged chart, or a fully qualified URL. For chart references, the latest version will be specified unless the '--version' flag is set. diff --git a/pkg/downloader/manager.go b/pkg/downloader/manager.go index 08f1959f2..64f8cbbe8 100644 --- a/pkg/downloader/manager.go +++ b/pkg/downloader/manager.go @@ -404,9 +404,9 @@ func (m *Manager) getRepoNames(deps []*chart.Dependency) (map[string]string, err } if containsNonURL { errorMessage += ` -Note that repositories must be URLs or aliases. For example, to refer to the stable -repository, use "https://kubernetes-charts.storage.googleapis.com/" or "@stable" instead of -"stable". Don't forget to add the repo, too ('helm repo add').` +Note that repositories must be URLs or aliases. For example, to refer to the "example" +repository, use "https://charts.example.com/" or "@example" instead of +"example". Don't forget to add the repo, too ('helm repo add').` } return nil, errors.New(errorMessage) } diff --git a/scripts/completions.bash b/scripts/completions.bash index 6c05963b4..34eb02875 100644 --- a/scripts/completions.bash +++ b/scripts/completions.bash @@ -654,8 +654,6 @@ _helm_init() local_nonpersistent_flags+=("--service-account=") flags+=("--skip-refresh") local_nonpersistent_flags+=("--skip-refresh") - flags+=("--stable-repo-url=") - local_nonpersistent_flags+=("--stable-repo-url=") flags+=("--tiller-image=") two_word_flags+=("-i") local_nonpersistent_flags+=("--tiller-image=")