Skip to content

Commit

Permalink
merge from upstream
Browse files Browse the repository at this point in the history
Signed-off-by: xh4n3 <[email protected]>
  • Loading branch information
xh4n3 committed Jan 14, 2020
1 parent b79c0a5 commit dccbb7c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/golang:1.12
- image: circleci/golang:1.13
working_directory: /go/src/github.com/chartmuseum/helm-push
steps:
- checkout
Expand Down
1 change: 0 additions & 1 deletion cmd/helmpush/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ func newPushCmd(args []string) *cobra.Command {
f.BoolVarP(&p.forceUpload, "force", "f", false, "Force upload even if chart version exists")
f.BoolVarP(&p.dependencyUpdate, "dependency-update", "d", false, `update dependencies from "requirements.yaml" to dir "charts/" before packaging`)
f.BoolVarP(&p.checkHelmVersion, "check-helm-version", "", false, `outputs either "2" or "3" indicating the current Helm major version`)
f.BoolVarP(&p.debug, "debug", "d", false, "Debug mode")
f.Parse(args)

v2settings.AddFlags(f)
Expand Down
29 changes: 27 additions & 2 deletions pkg/helm/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,26 @@ func GetRepoByURL(url string) (*Repo, error) {
if !exists {
return nil, fmt.Errorf("no repo url %q found", url)
}
return &Repo{entry}, nil

// FIXME
// https://github.com/chartmuseum/helm-push/issues/54
if HelmMajorVersionCurrent() == HelmMajorVersion2 {
_ = os.Setenv("HELM_PLUGINS", os.Getenv("HELM_PLUGIN"))
}

settings := cli.New()
getters := getter.All(settings)
cr, err := repo.NewChartRepository(entry, getters)
if err != nil {
return nil, err
}

if HelmMajorVersionCurrent() == HelmMajorVersion2 {
home := v2helmHome()
cr.CachePath = filepath.Join(home.Repository(), "cache")
}

return &Repo{cr}, nil
}

// GetRepoByName returns repository by name
Expand All @@ -47,6 +66,12 @@ func GetRepoByName(name string) (*Repo, error) {
return nil, fmt.Errorf("no repo named %q found", name)
}

// FIXME
// https://github.com/chartmuseum/helm-push/issues/54
if HelmMajorVersionCurrent() == HelmMajorVersion2 {
_ = os.Setenv("HELM_PLUGINS", os.Getenv("HELM_PLUGIN"))
}

settings := cli.New()
getters := getter.All(settings)
cr, err := repo.NewChartRepository(entry, getters)
Expand Down Expand Up @@ -121,7 +146,7 @@ func findRepoEntry(name string, r *repo.File) (*repo.Entry, bool) {
return entry, exists
}

func findRepoEntryByURL(url string, r *repo.RepoFile) (*repo.Entry, bool) {
func findRepoEntryByURL(url string, r *repo.File) (*repo.Entry, bool) {
var entry *repo.Entry
exists := false
for _, re := range r.Repositories {
Expand Down
2 changes: 1 addition & 1 deletion plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "push"
version: "0.7.1"
version: "0.8.1"
usage: "Please see https://github.com/AliyunContainerService/helm-acr for usage"
description: "Push chart package to Alibaba Container Registry"
command: "$HELM_PLUGIN_DIR/bin/helmpush"
Expand Down

0 comments on commit dccbb7c

Please sign in to comment.