Skip to content
This repository was archived by the owner on Oct 27, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions cmd/push/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -65,7 +65,7 @@ func newPushCmd(args []string) *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {

if len(args) != 2 {
return errors.New("This command needs 2 arguments: name of chart, repository URL")
return errors.New("this command needs 2 arguments: name of chart, repository URL")
}
p.chartName = args[0]
p.repository = args[1]
Expand Down Expand Up @@ -155,21 +155,21 @@ func (p *pushCmd) push() error {
}

if repo != nil {
p.repository = repo.URL
p.repository = repo.Config.URL
if p.username == "" {
p.username = repo.Username
p.username = repo.Config.Username
}
if p.password == "" {
p.password = repo.Password
p.password = repo.Config.Password
}
if p.caFile == "" {
p.caFile = repo.CAFile
p.caFile = repo.Config.CAFile
}
if p.certFile == "" {
p.certFile = repo.CertFile
p.certFile = repo.Config.CertFile
}
if p.keyFile == "" {
p.keyFile = repo.KeyFile
p.keyFile = repo.Config.KeyFile
}
}

Expand All @@ -190,7 +190,7 @@ func (p *pushCmd) push() error {
return err
}

tmp, err := ioutil.TempDir("", "helm-push-artifactory-")
tmp, err := os.MkdirTemp("", "helm-push-artifactory-")
if err != nil {
return err
}
Expand Down Expand Up @@ -222,7 +222,7 @@ func (p *pushCmd) push() error {
}

func handleReindexResponse(resp *http.Response) error {
b, err := ioutil.ReadAll(resp.Body)
b, err := io.ReadAll(resp.Body)
if err != nil {
return err
}
Expand All @@ -236,7 +236,7 @@ func handleReindexResponse(resp *http.Response) error {

func handlePushResponse(resp *http.Response) error {
if resp.StatusCode != 201 {
b, err := ioutil.ReadAll(resp.Body)
b, err := io.ReadAll(resp.Body)
if err != nil {
return err
}
Expand Down
59 changes: 50 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,56 @@ module github.com/belitre/helm-push-artifactory-plugin
go 1.14

require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/chartmuseum/helm-push v0.7.1
github.com/cyphar/filepath-securejoin v0.2.2 // indirect
github.com/Microsoft/hcsshim v0.11.1 // indirect
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 // indirect
github.com/chartmuseum/helm-push v0.10.4
github.com/docker/docker-credential-helpers v0.8.0 // indirect
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
github.com/go-errors/errors v1.5.1 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/jfrog/jfrog-client-go v0.8.1
github.com/spf13/cobra v0.0.6
github.com/stretchr/testify v1.5.1
gopkg.in/yaml.v2 v2.2.8
k8s.io/apimachinery v0.17.3 // indirect
k8s.io/client-go v11.0.0+incompatible // indirect
k8s.io/helm v2.16.3+incompatible
github.com/google/btree v1.1.2 // indirect
github.com/google/gnostic v0.7.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/jfrog/jfrog-client-go v1.32.3
github.com/klauspost/compress v1.17.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/mholt/archiver v2.1.0+incompatible // indirect
github.com/moby/term v0.5.0 // indirect
github.com/pelletier/go-buffruneio v0.2.0 // indirect
github.com/pierrec/lz4 v2.3.0+incompatible // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/spf13/cobra v1.7.0
github.com/src-d/gcfg v1.3.0 // indirect
github.com/stretchr/testify v1.8.4
go.opentelemetry.io/otel v1.18.0 // indirect
go.starlark.net v0.0.0-20230925163745-10651d5192ab // indirect
golang.org/x/oauth2 v0.12.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
google.golang.org/grpc v1.58.2 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.0 // indirect
gopkg.in/src-d/go-git-fixtures.v3 v3.1.1 // indirect
gopkg.in/src-d/go-git.v4 v4.7.0 // indirect
gopkg.in/yaml.v2 v2.4.0
helm.sh/helm/v3 v3.12.3 // indirect
k8s.io/apiextensions-apiserver v0.28.2 // indirect
k8s.io/cli-runtime v0.28.2 // indirect
k8s.io/client-go v0.28.2 // indirect
k8s.io/helm v2.17.0+incompatible
k8s.io/klog v1.0.0 // indirect
k8s.io/kube-openapi v0.0.0-20230918164632-68afd615200d // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
oras.land/oras-go v1.2.4 // indirect
sigs.k8s.io/kustomize/api v0.14.0 // indirect
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
)
Loading