ref(cmd): migrate to pkg/cli

This commit migrates all of the content over to pkg/cli, making it all consumable by third parties.

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
pull/5448/head
Matthew Fisher 7 years ago
parent e5094169d7
commit ceeb75eb67
No known key found for this signature in database
GPG Key ID: 92AA783CBAAE8E3B

@ -17,96 +17,19 @@ limitations under the License.
package main // import "k8s.io/helm/cmd/helm" package main // import "k8s.io/helm/cmd/helm"
import ( import (
"fmt"
"log" "log"
"os" "os"
"sync"
// Import to initialize client auth plugins.
"k8s.io/cli-runtime/pkg/genericclioptions"
_ "k8s.io/client-go/plugin/pkg/client/auth"
"k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli" "k8s.io/helm/pkg/cli"
"k8s.io/helm/pkg/kube"
"k8s.io/helm/pkg/storage"
"k8s.io/helm/pkg/storage/driver"
)
var (
settings cli.EnvSettings
config genericclioptions.RESTClientGetter
configOnce sync.Once
) )
func init() { func init() {
log.SetFlags(log.Lshortfile) log.SetFlags(log.Lshortfile)
} }
func logf(format string, v ...interface{}) {
if settings.Debug {
format = fmt.Sprintf("[debug] %s\n", format)
log.Output(2, fmt.Sprintf(format, v...))
}
}
func main() { func main() {
cmd := newRootCmd(newActionConfig(false), os.Stdout, os.Args[1:]) cmd := cli.New(cli.NewActionConfig(false), os.Stdout, os.Args[1:])
if err := cmd.Execute(); err != nil { if err := cmd.Execute(); err != nil {
logf("%+v", err)
os.Exit(1) os.Exit(1)
} }
} }
func newActionConfig(allNamespaces bool) *action.Configuration {
kc := kube.New(kubeConfig())
kc.Log = logf
clientset, err := kc.KubernetesClientSet()
if err != nil {
// TODO return error
log.Fatal(err)
}
var namespace string
if !allNamespaces {
namespace = getNamespace()
}
var store *storage.Storage
switch os.Getenv("HELM_DRIVER") {
case "secret", "secrets", "":
d := driver.NewSecrets(clientset.CoreV1().Secrets(namespace))
d.Log = logf
store = storage.Init(d)
case "configmap", "configmaps":
d := driver.NewConfigMaps(clientset.CoreV1().ConfigMaps(namespace))
d.Log = logf
store = storage.Init(d)
case "memory":
d := driver.NewMemory()
store = storage.Init(d)
default:
// Not sure what to do here.
panic("Unknown driver in HELM_DRIVER: " + os.Getenv("HELM_DRIVER"))
}
return &action.Configuration{
KubeClient: kc,
Releases: store,
Discovery: clientset.Discovery(),
}
}
func kubeConfig() genericclioptions.RESTClientGetter {
configOnce.Do(func() {
config = kube.GetConfig(settings.KubeConfig, settings.KubeContext, settings.Namespace)
})
return config
}
func getNamespace() string {
if ns, _, err := kubeConfig().ToRawKubeConfigLoader().Namespace(); err == nil {
return ns
}
return "default"
}

@ -1,118 +0,0 @@
/*
Copyright The Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main // import "k8s.io/helm/cmd/helm"
import (
"io"
"github.com/containerd/containerd/remotes/docker"
"github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/registry"
)
var globalUsage = `The Kubernetes package manager
To begin working with Helm, run the 'helm init' command:
$ helm init
This will set up any necessary local configuration.
Common actions from this point include:
- helm search: search for charts
- helm fetch: download a chart to your local directory to view
- helm install: upload the chart to Kubernetes
- helm list: list releases of charts
Environment:
$HELM_HOME set an alternative location for Helm files. By default, these are stored in ~/.helm
$HELM_DRIVER set the backend storage driver. Values are: configmap, secret, memory
$HELM_NO_PLUGINS disable plugins. Set HELM_NO_PLUGINS=1 to disable plugins.
$KUBECONFIG set an alternative Kubernetes configuration file (default "~/.kube/config")
`
func newRootCmd(actionConfig *action.Configuration, out io.Writer, args []string) *cobra.Command {
cmd := &cobra.Command{
Use: "helm",
Short: "The Helm package manager for Kubernetes.",
Long: globalUsage,
SilenceUsage: true,
Args: require.NoArgs,
}
flags := cmd.PersistentFlags()
settings.AddFlags(flags)
flags.Parse(args)
// set defaults from environment
settings.Init(flags)
// Add the registry client based on settings
// TODO: Move this elsewhere (first, settings.Init() must move)
actionConfig.RegistryClient = registry.NewClient(&registry.ClientOptions{
Out: out,
Resolver: registry.Resolver{
Resolver: docker.NewResolver(docker.ResolverOptions{}),
},
CacheRootDir: settings.Home.Registry(),
})
cmd.AddCommand(
// chart commands
newCreateCmd(out),
newDependencyCmd(out),
newPullCmd(out),
newShowCmd(out),
newLintCmd(out),
newPackageCmd(out),
newRepoCmd(out),
newSearchCmd(out),
newVerifyCmd(out),
newChartCmd(actionConfig, out),
// release commands
newGetCmd(actionConfig, out),
newHistoryCmd(actionConfig, out),
newInstallCmd(actionConfig, out),
newListCmd(actionConfig, out),
newReleaseTestCmd(actionConfig, out),
newRollbackCmd(actionConfig, out),
newStatusCmd(actionConfig, out),
newUninstallCmd(actionConfig, out),
newUpgradeCmd(actionConfig, out),
newCompletionCmd(out),
newHomeCmd(out),
newInitCmd(out),
newPluginCmd(out),
newTemplateCmd(out),
newVersionCmd(out),
// Hidden documentation generator command: 'helm docs'
newDocsCmd(out),
)
// Find and add plugins
loadPlugins(cmd, out)
return cmd
}

@ -1 +0,0 @@
WARNING: no dependencies at testdata/testcharts/alpine/charts

123
go.mod

@ -0,0 +1,123 @@
module k8s.io/helm
go 1.12
require (
cloud.google.com/go v0.34.0
contrib.go.opencensus.io/exporter/ocagent v0.2.0
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78
github.com/Azure/go-autorest v11.2.8+incompatible
github.com/BurntSushi/toml v0.3.1
github.com/MakeNowJust/heredoc v0.0.0-20171113091838-e9091a26100e
github.com/Masterminds/semver v1.4.2
github.com/Masterminds/sprig v2.16.0+incompatible
github.com/Masterminds/vcs v1.13.0
github.com/PuerkitoBio/purell v1.1.0
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d
github.com/aokoli/goutils v1.0.1
github.com/asaskevich/govalidator v0.0.0-20180315120708-ccb8e960c48f
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973
github.com/bshuster-repo/logrus-logstash-hook v0.4.1
github.com/bugsnag/bugsnag-go v1.3.2
github.com/bugsnag/panicwrap v1.2.0
github.com/census-instrumentation/opencensus-proto v0.1.0
github.com/chai2010/gettext-go v0.0.0-20170215093142-bf70f2a70fb1
github.com/containerd/containerd v1.2.1
github.com/cpuguy83/go-md2man v1.0.8
github.com/davecgh/go-spew v1.1.1
github.com/deislabs/oras v0.3.3
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/docker/distribution v2.7.0+incompatible
github.com/docker/docker v0.0.0-20181221150755-2cb26cfe9cbf
github.com/docker/go-metrics v0.0.0-20181218153428-b84716841b82
github.com/docker/go-units v0.3.3
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c
github.com/emicklei/go-restful v2.8.0+incompatible
github.com/evanphx/json-patch v3.0.0+incompatible
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d
github.com/fatih/camelcase v1.0.0
github.com/garyburd/redigo v1.6.0
github.com/ghodss/yaml v1.0.0
github.com/go-openapi/jsonpointer v0.17.2
github.com/go-openapi/jsonreference v0.17.2
github.com/go-openapi/spec v0.17.2
github.com/go-openapi/swag v0.17.2
github.com/gobwas/glob v0.2.3
github.com/gogo/protobuf v1.2.0
github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff
github.com/golang/protobuf v1.2.0
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf
github.com/google/uuid v1.1.0
github.com/googleapis/gnostic v0.2.0
github.com/gophercloud/gophercloud v0.0.0-20181221023737-94924357ebf6
github.com/gorilla/handlers v1.4.0
github.com/gorilla/mux v1.7.0
github.com/gosuri/uitable v0.0.0-20160404203958-36ee7e946282
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f
github.com/hashicorp/golang-lru v0.5.0
github.com/huandu/xstrings v1.2.0
github.com/imdario/mergo v0.3.6
github.com/inconshreveable/mousetrap v1.0.0
github.com/json-iterator/go v1.1.5
github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1
github.com/konsorten/go-windows-terminal-sequences v1.0.1
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329
github.com/mattn/go-runewidth v0.0.4
github.com/mattn/go-shellwords v1.0.3
github.com/matttproud/golang_protobuf_extensions v1.0.1
github.com/miekg/dns v0.0.0-20181005163659-0d29b283ac0f
github.com/mitchellh/go-wordwrap v1.0.0
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
github.com/opencontainers/go-digest v1.0.0-rc1
github.com/opencontainers/image-spec v1.0.1
github.com/petar/GoLLRB v0.0.0-20130427215148-53be0d36a84c
github.com/peterbourgon/diskv v2.0.1+incompatible
github.com/pkg/errors v0.8.0
github.com/pmezard/go-difflib v1.0.0
github.com/prometheus/client_golang v0.9.2
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
github.com/prometheus/common v0.2.0
github.com/prometheus/procfs v0.0.0-20190129233650-316cf8ccfec5
github.com/russross/blackfriday v1.5.2
github.com/sirupsen/logrus v1.2.0
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.3
github.com/stretchr/testify v1.3.0
github.com/xenolf/lego v0.0.0-20160613233155-a9d8cec0e656
github.com/yvasiyarov/go-metrics v0.0.0-20150112132944-c25f46c4b940
github.com/yvasiyarov/gorelic v0.0.6
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f
go.opencensus.io v0.18.0
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9
golang.org/x/net v0.0.0-20181220203305-927f97764cc3
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6
golang.org/x/text v0.3.0
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c
google.golang.org/api v0.0.0-20181221000618-65a46cafb132
google.golang.org/appengine v1.4.0
google.golang.org/genproto v0.0.0-20181221175505-bd9b4fb69e2f
google.golang.org/grpc v1.17.0
gopkg.in/inf.v0 v0.9.1
gopkg.in/square/go-jose.v1 v1.1.2
gopkg.in/square/go-jose.v2 v2.3.0
gopkg.in/yaml.v2 v2.2.2
k8s.io/api v0.0.0-20190222213804-5cb15d344471
k8s.io/apiextensions-apiserver v0.0.0-20190221221350-bfb440be4b87
k8s.io/apimachinery v0.0.0-20190221213512-86fb29eff628
k8s.io/apiserver v0.0.0-20190221215341-5838f549963b
k8s.io/cli-runtime v0.0.0-20181221202950-8abb1aeb8307
k8s.io/client-go v0.0.0-20190228174230-b40b2a5939e4
k8s.io/klog v0.1.0
k8s.io/kube-openapi v0.0.0-20181114233023-0317810137be
k8s.io/kubernetes v0.0.0-20190305150815-6c1e64b94a3e
k8s.io/utils v0.0.0-20181221173059-8a16e7dd8fb6
sigs.k8s.io/kustomize v1.0.11
sigs.k8s.io/yaml v1.1.0
vbom.ml/util v0.0.0-20180919145318-efcd4e0f9787
)

271
go.sum

@ -0,0 +1,271 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
contrib.go.opencensus.io/exporter/ocagent v0.2.0 h1:Q/jXnVbliDYozuWJni9452xsSUuo+y8yrioxRgofBhE=
contrib.go.opencensus.io/exporter/ocagent v0.2.0/go.mod h1:0fnkYHF+ORKj7HWzOExKkUHeFX79gXSKUQbpnAM+wzo=
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
github.com/Azure/go-autorest v11.2.8+incompatible h1:Q2feRPMlcfVcqz3pF87PJzkm5lZrL+x6BDtzhODzNJM=
github.com/Azure/go-autorest v11.2.8+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/MakeNowJust/heredoc v0.0.0-20171113091838-e9091a26100e h1:eb0Pzkt15Bm7f2FFYv7sjY7NPFi3cPkS3tv1CcrFBWA=
github.com/MakeNowJust/heredoc v0.0.0-20171113091838-e9091a26100e/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E=
github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc=
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/sprig v2.16.0+incompatible h1:QZbMUPxRQ50EKAq3LFMnxddMu88/EUUG3qmxwtDmPsY=
github.com/Masterminds/sprig v2.16.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
github.com/Masterminds/vcs v1.13.0 h1:USF5TvZGYgIpcbNAEMLfFhHqP08tFZVlUVrmTSpqnyA=
github.com/Masterminds/vcs v1.13.0/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA=
github.com/PuerkitoBio/purell v1.1.0 h1:rmGxhojJlM0tuKtfdvliR84CFHljx9ag64t2xmVkjK4=
github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/aokoli/goutils v1.0.1 h1:7fpzNGoJ3VA8qcrm++XEE1QUe0mIwNeLa02Nwq7RDkg=
github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ=
github.com/asaskevich/govalidator v0.0.0-20180315120708-ccb8e960c48f h1:y2hSFdXeA1y5z5f0vfNO0Dg5qVY036qzlz3Pds0B92o=
github.com/asaskevich/govalidator v0.0.0-20180315120708-ccb8e960c48f/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk=
github.com/bugsnag/bugsnag-go v1.3.2/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8=
github.com/bugsnag/panicwrap v1.2.0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
github.com/census-instrumentation/opencensus-proto v0.0.2-0.20180913191712-f303ae3f8d6a/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.1.0 h1:VwZ9smxzX8u14/125wHIX7ARV+YhR+L4JADswwxWK0Y=
github.com/census-instrumentation/opencensus-proto v0.1.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/chai2010/gettext-go v0.0.0-20170215093142-bf70f2a70fb1 h1:HD4PLRzjuCVW79mQ0/pdsalOLHJ+FaEoqJLxfltpb2U=
github.com/chai2010/gettext-go v0.0.0-20170215093142-bf70f2a70fb1/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/containerd/containerd v1.2.1 h1:rG4/dK9V2qa5a9ly/E3CtG6/FBXfmSkDo8An3ea2Yt8=
github.com/containerd/containerd v1.2.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/cpuguy83/go-md2man v1.0.8 h1:DwoNytLphI8hzS2Af4D0dfaEaiSq2bN05mEm4R6vf8M=
github.com/cpuguy83/go-md2man v1.0.8/go.mod h1:N6JayAiVKtlHSnuTCeuLSQVs75hb8q+dYQLjr7cDsKY=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/deislabs/oras v0.3.3 h1:vZdf6n0eDBHsVoP8Ha/CZN2U2KjaF/eQJ3AEtU7H+vs=
github.com/deislabs/oras v0.3.3/go.mod h1:SXwPnImOu69FofPWaqgB+cPKKQRBmao5i+9xQRdcOiM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/docker/distribution v2.7.0+incompatible h1:neUDAlf3wX6Ml4HdqTrbcOHXtfRN0TFIwt6YFL7N9RU=
github.com/docker/distribution v2.7.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v0.0.0-20181221150755-2cb26cfe9cbf h1:UUNoLGt3UNi06Zuad3kyUStUnaW5OJ4VHmQ5QlTOKxo=
github.com/docker/docker v0.0.0-20181221150755-2cb26cfe9cbf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-metrics v0.0.0-20181218153428-b84716841b82/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI=
github.com/docker/go-units v0.3.3 h1:Xk8S3Xj5sLGlG5g67hJmYMmUgXv5N4PhkjJHHqrwnTk=
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE=
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c h1:ZfSZ3P3BedhKGUhzj7BQlPSU4OvT6tfOKe3DVHzOA7s=
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/emicklei/go-restful v2.8.0+incompatible h1:wN8GCRDPGHguIynsnBartv5GUgGUg1LAU7+xnSn1j7Q=
github.com/emicklei/go-restful v2.8.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/evanphx/json-patch v3.0.0+incompatible h1:l91aby7TzBXBdmF8heZqjskeH9f3g7ZOL8/sSe+vTlU=
github.com/evanphx/json-patch v3.0.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM=
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4=
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
github.com/go-openapi/jsonpointer v0.17.2 h1:3ekBy41gar/iJi2KSh/au/PrC2vpLr85upF/UZmm3W0=
github.com/go-openapi/jsonpointer v0.17.2/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
github.com/go-openapi/jsonreference v0.17.2 h1:lF3z7AH8dd0IKXc1zEBi1dj0B4XgVb5cVjn39dCK3Ls=
github.com/go-openapi/jsonreference v0.17.2/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
github.com/go-openapi/spec v0.17.2 h1:eb2NbuCnoe8cWAxhtK6CfMWUYmiFEZJ9Hx3Z2WRwJ5M=
github.com/go-openapi/spec v0.17.2/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
github.com/go-openapi/swag v0.17.2 h1:K/ycE/XTUDFltNHSO32cGRUhrVGJD64o8WgAIZNyc3k=
github.com/go-openapi/swag v0.17.2/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff h1:kOkM9whyQYodu09SJ6W3NCsHG7crFaJILQ22Gozp3lg=
github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c h1:964Od4U6p2jUkFxvCydnIczKteheJEzHRToSGK3Bnlw=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/uuid v1.1.0 h1:Jf4mxPC/ziBnoPIdpQdPJ9OeiomAUHLvxmPRSPH9m4s=
github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g=
github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/gophercloud/gophercloud v0.0.0-20181221023737-94924357ebf6 h1:4/heZnxONZh0s2O5wg6R0nPBs2ikXQ8nHKGuSBNWqx8=
github.com/gophercloud/gophercloud v0.0.0-20181221023737-94924357ebf6/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4=
github.com/gorilla/handlers v1.4.0/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gosuri/uitable v0.0.0-20160404203958-36ee7e946282 h1:KFqmdzEPbU7Uck2tn50t+HQXZNVkxe8M9qRb/ZoSHaE=
github.com/gosuri/uitable v0.0.0-20160404203958-36ee7e946282/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo=
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f h1:ShTPMJQes6tubcjzGMODIVG5hlrCeImaBnZzKF2N8SM=
github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0=
github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE=
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-shellwords v1.0.3 h1:K/VxK7SZ+cvuPgFSLKi5QPI9Vr/ipOf4C1gN+ntueUk=
github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/miekg/dns v0.0.0-20181005163659-0d29b283ac0f/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4=
github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/petar/GoLLRB v0.0.0-20130427215148-53be0d36a84c/go.mod h1:HUpKUBZnpzkdx0kD/+Yfuft+uD3zHGtXF/XJB14TUr4=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190129233650-316cf8ccfec5/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/xenolf/lego v0.0.0-20160613233155-a9d8cec0e656/go.mod h1:fwiGnfsIjG7OHPfOvgK7Y/Qo6+2Ox0iozjNTkZICKbY=
github.com/yvasiyarov/go-metrics v0.0.0-20150112132944-c25f46c4b940/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs=
github.com/yvasiyarov/gorelic v0.0.6/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA=
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg=
go.opencensus.io v0.17.0/go.mod h1:mp1VrMQxhlqqDpKvH4UcQUa4YwlzNmymAjPrDdfxNpI=
go.opencensus.io v0.18.0 h1:Mk5rgZcggtbvtAun5aJzAtjKKN/t0R3jJPlWILlv938=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3 h1:eH6Eip3UpmR+yM/qI9Ijluzb1bNv/cAU/n+6l8tRSis=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890 h1:uESlIz09WIHT2I+pasSXcpLYqYK8wHcdCetU3VuMBJE=
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6 h1:IcgEB62HYgAhX0Nd/QrVgZlxlcyxbGQHElLUhW2X4Fo=
golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c h1:fqgJT0MGcGpPgpWU7VRdRjuArfcOvC4AoJmILihzhDg=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/api v0.0.0-20181221000618-65a46cafb132 h1:SLcC5l+3o5vwvXAbdm936WwLkHteUZpo1RULZD7YvQ4=
google.golang.org/api v0.0.0-20181221000618-65a46cafb132/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20181221175505-bd9b4fb69e2f h1:eT3B0O2ghdSPzjAOznr3oOLyN1HFeYUncYl7FRwg4VI=
google.golang.org/genproto v0.0.0-20181221175505-bd9b4fb69e2f/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.15.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
google.golang.org/grpc v1.17.0 h1:TRJYBgMclJvGYn2rIMjj+h9KtMt5r1Ij7ODVRIZkwhk=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/square/go-jose.v1 v1.1.2/go.mod h1:QpYS+a4WhS+DTlyQIi6Ka7MS3SuR9a055rgXNEe6EiA=
gopkg.in/square/go-jose.v2 v2.3.0 h1:nLzhkFyl5bkblqYBoiWJUt5JkWOzmiaBtCxdJAqJd3U=
gopkg.in/square/go-jose.v2 v2.3.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/api v0.0.0-20190222213804-5cb15d344471 h1:MzQGt8qWQCR+39kbYRd0uQqsvSidpYqJLFeWiJ9l4OE=
k8s.io/api v0.0.0-20190222213804-5cb15d344471/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
k8s.io/apiextensions-apiserver v0.0.0-20190221221350-bfb440be4b87 h1:BMfPZfi3CkPd9e9Qbm+/AFgE6qXWQcbzUvC91LR3m7w=
k8s.io/apiextensions-apiserver v0.0.0-20190221221350-bfb440be4b87/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE=
k8s.io/apimachinery v0.0.0-20190221213512-86fb29eff628 h1:UYfHH+KEF88OTg+GojQUwFTNxbxwmoktLwutUzR0GPg=
k8s.io/apimachinery v0.0.0-20190221213512-86fb29eff628/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0=
k8s.io/apiserver v0.0.0-20190221215341-5838f549963b h1:yFFYCR/UVj6hsYX6yRbY3CJ3917NF7tn0hwcdUil1aI=
k8s.io/apiserver v0.0.0-20190221215341-5838f549963b/go.mod h1:6bqaTSOSJavUIXUtfaR9Os9JtTCm8ZqH2SUl2S60C4w=
k8s.io/cli-runtime v0.0.0-20181221202950-8abb1aeb8307 h1:x8ssI66Rojl2Q5vd9CvgZkwJBWiauDioKu8F3V9nBas=
k8s.io/cli-runtime v0.0.0-20181221202950-8abb1aeb8307/go.mod h1:qWnH3/b8sp/l7EvlDh7ulDU3UWA4P4N1NFbEEP791tM=
k8s.io/client-go v0.0.0-20190228174230-b40b2a5939e4 h1:aE8wOCKuoRs2aU0OP/Rz8SXiAB0FTTku3VtGhhrkSmc=
k8s.io/client-go v0.0.0-20190228174230-b40b2a5939e4/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s=
k8s.io/klog v0.1.0 h1:I5HMfc/DtuVaGR1KPwUrTc476K8NCqNBldC7H4dYEzk=
k8s.io/klog v0.1.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/kube-openapi v0.0.0-20181114233023-0317810137be h1:aWEq4nbj7HRJ0mtKYjNSk/7X28Tl6TI6FeG8gKF+r7Q=
k8s.io/kube-openapi v0.0.0-20181114233023-0317810137be/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc=
k8s.io/kubernetes v0.0.0-20190305150815-6c1e64b94a3e h1:lAr5aJET0QryOW5/uvVyF7uMkjob+/2b82PaPK4K7Hs=
k8s.io/kubernetes v0.0.0-20190305150815-6c1e64b94a3e/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
k8s.io/utils v0.0.0-20181221173059-8a16e7dd8fb6 h1:+jRzzMyx+I9J18BvwHYmZ5hpPwoZfh6g39WfNlsMCkY=
k8s.io/utils v0.0.0-20181221173059-8a16e7dd8fb6/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0=
sigs.k8s.io/kustomize v1.0.11 h1:Yb+6DDt9+aR2AvQApvUaKS/ugteeG4MPyoFeUHiPOjk=
sigs.k8s.io/kustomize v1.0.11/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU=
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
vbom.ml/util v0.0.0-20180919145318-efcd4e0f9787 h1:O69FD9pJA4WUZlEwYatBEEkRWKQ5cKodWpdKTrCS/iQ=
vbom.ml/util v0.0.0-20180919145318-efcd4e0f9787/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj6uzU2+8OWDFv/HxUSs7kI=

@ -62,7 +62,7 @@ func path(filename string) string {
if filepath.IsAbs(filename) { if filepath.IsAbs(filename) {
return filename return filename
} }
return filepath.Join("testdata", filename) return filepath.Join("..", "..", "testdata", filename)
} }
func compare(actual []byte, filename string) error { func compare(actual []byte, filename string) error {

@ -36,7 +36,7 @@ import (
"k8s.io/helm/pkg/chart" "k8s.io/helm/pkg/chart"
"k8s.io/helm/pkg/chartutil" "k8s.io/helm/pkg/chartutil"
"k8s.io/helm/pkg/cli" "k8s.io/helm/pkg/cli/environment"
"k8s.io/helm/pkg/downloader" "k8s.io/helm/pkg/downloader"
"k8s.io/helm/pkg/engine" "k8s.io/helm/pkg/engine"
"k8s.io/helm/pkg/getter" "k8s.io/helm/pkg/getter"
@ -532,7 +532,7 @@ OUTER:
// - URL // - URL
// //
// If 'verify' is true, this will attempt to also verify the chart. // If 'verify' is true, this will attempt to also verify the chart.
func (c *ChartPathOptions) LocateChart(name string, settings cli.EnvSettings) (string, error) { func (c *ChartPathOptions) LocateChart(name string, settings environment.Settings) (string, error) {
name = strings.TrimSpace(name) name = strings.TrimSpace(name)
version := strings.TrimSpace(c.Version) version := strings.TrimSpace(c.Version)
@ -597,7 +597,7 @@ func (c *ChartPathOptions) LocateChart(name string, settings cli.EnvSettings) (s
// MergeValues merges values from files specified via -f/--values and // MergeValues merges values from files specified via -f/--values and
// directly via --set or --set-string, marshaling them to YAML // directly via --set or --set-string, marshaling them to YAML
func (v *ValueOptions) MergeValues(settings cli.EnvSettings) error { func (v *ValueOptions) MergeValues(settings environment.Settings) error {
base := map[string]interface{}{} base := map[string]interface{}{}
// User specified a values files via -f/--values // User specified a values files via -f/--values
@ -662,7 +662,7 @@ func MergeValues(dest, src map[string]interface{}) map[string]interface{} {
} }
// readFile load a file from stdin, the local directory, or a remote file with a url. // readFile load a file from stdin, the local directory, or a remote file with a url.
func readFile(filePath string, settings cli.EnvSettings) ([]byte, error) { func readFile(filePath string, settings environment.Settings) ([]byte, error) {
if strings.TrimSpace(filePath) == "-" { if strings.TrimSpace(filePath) == "-" {
return ioutil.ReadAll(os.Stdin) return ioutil.ReadAll(os.Stdin)
} }

@ -24,11 +24,11 @@ var (
values = make(map[string]interface{}) values = make(map[string]interface{})
namespace = "testNamespace" namespace = "testNamespace"
strict = false strict = false
archivedChartPath = "../../cmd/helm/testdata/testcharts/compressedchart-0.1.0.tgz" archivedChartPath = "../../testdata/testcharts/compressedchart-0.1.0.tgz"
archivedChartPathWithHyphens = "../../cmd/helm/testdata/testcharts/compressedchart-with-hyphens-0.1.0.tgz" archivedChartPathWithHyphens = "../../testdata/testcharts/compressedchart-with-hyphens-0.1.0.tgz"
invalidArchivedChartPath = "../../cmd/helm/testdata/testcharts/invalidcompressedchart0.1.0.tgz" invalidArchivedChartPath = "../../testdata/testcharts/invalidcompressedchart0.1.0.tgz"
chartDirPath = "../../cmd/helm/testdata/testcharts/decompressedchart/" chartDirPath = "../../testdata/testcharts/decompressedchart/"
chartMissingManifest = "../../cmd/helm/testdata/testcharts/chart-missing-manifest" chartMissingManifest = "../../testdata/testcharts/chart-missing-manifest"
) )
func TestLintChart(t *testing.T) { func TestLintChart(t *testing.T) {

@ -26,7 +26,7 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"k8s.io/helm/pkg/chartutil" "k8s.io/helm/pkg/chartutil"
"k8s.io/helm/pkg/cli" "k8s.io/helm/pkg/cli/environment"
"k8s.io/helm/pkg/downloader" "k8s.io/helm/pkg/downloader"
"k8s.io/helm/pkg/getter" "k8s.io/helm/pkg/getter"
"k8s.io/helm/pkg/repo" "k8s.io/helm/pkg/repo"
@ -38,7 +38,7 @@ import (
type Pull struct { type Pull struct {
ChartPathOptions ChartPathOptions
Settings cli.EnvSettings // TODO: refactor this out of pkg/action Settings environment.Settings // TODO: refactor this out of pkg/action
Devel bool Devel bool
Untar bool Untar bool

@ -25,21 +25,21 @@ import (
func TestShow(t *testing.T) { func TestShow(t *testing.T) {
client := NewShow(ShowAll) client := NewShow(ShowAll)
output, err := client.Run("../../cmd/helm/testdata/testcharts/alpine") output, err := client.Run("../../testdata/testcharts/alpine")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
// Load the data from the textfixture directly. // Load the data from the textfixture directly.
cdata, err := ioutil.ReadFile("../../cmd/helm/testdata/testcharts/alpine/Chart.yaml") cdata, err := ioutil.ReadFile("../../testdata/testcharts/alpine/Chart.yaml")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
data, err := ioutil.ReadFile("../../cmd/helm/testdata/testcharts/alpine/values.yaml") data, err := ioutil.ReadFile("../../testdata/testcharts/alpine/values.yaml")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
readmeData, err := ioutil.ReadFile("../../cmd/helm/testdata/testcharts/alpine/README.md") readmeData, err := ioutil.ReadFile("../../testdata/testcharts/alpine/README.md")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@ -65,7 +65,7 @@ func TestShow(t *testing.T) {
// Regression tests for missing values. See issue #1024. // Regression tests for missing values. See issue #1024.
client.OutputFormat = ShowValues client.OutputFormat = ShowValues
output, err = client.Run("../../cmd/helm/testdata/testcharts/novals") output, err = client.Run("../../testdata/testcharts/novals")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
@ -32,19 +32,19 @@ Example usage:
$ helm chart pull [URL] $ helm chart pull [URL]
` `
func newChartCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewChartCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "chart", Use: "chart",
Short: "push, pull, tag, or remove Helm charts", Short: "push, pull, tag, or remove Helm charts",
Long: chartHelp, Long: chartHelp,
} }
cmd.AddCommand( cmd.AddCommand(
newChartListCmd(cfg, out), NewChartListCmd(cfg, out),
newChartExportCmd(cfg, out), NewChartExportCmd(cfg, out),
newChartPullCmd(cfg, out), NewChartPullCmd(cfg, out),
newChartPushCmd(cfg, out), NewChartPushCmd(cfg, out),
newChartRemoveCmd(cfg, out), NewChartRemoveCmd(cfg, out),
newChartSaveCmd(cfg, out), NewChartSaveCmd(cfg, out),
) )
return cmd return cmd
} }

@ -14,15 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
const chartExportDesc = ` const chartExportDesc = `
@ -33,7 +33,7 @@ the chart, in a format that developers can modify
and check into source control if desired. and check into source control if desired.
` `
func newChartExportCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewChartExportCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
return &cobra.Command{ return &cobra.Command{
Use: "export [ref]", Use: "export [ref]",
Short: "export a chart to directory", Short: "export a chart to directory",

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
@ -30,7 +30,7 @@ List all charts in the local registry cache.
Charts are sorted by ref name, alphabetically. Charts are sorted by ref name, alphabetically.
` `
func newChartListCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewChartListCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
return &cobra.Command{ return &cobra.Command{
Use: "list", Use: "list",
Aliases: []string{"ls"}, Aliases: []string{"ls"},

@ -14,15 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
const chartPullDesc = ` const chartPullDesc = `
@ -31,7 +31,7 @@ Download a chart from a remote registry.
This will store the chart in the local registry cache to be used later. This will store the chart in the local registry cache to be used later.
` `
func newChartPullCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewChartPullCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
return &cobra.Command{ return &cobra.Command{
Use: "pull [ref]", Use: "pull [ref]",
Short: "pull a chart from remote", Short: "pull a chart from remote",

@ -14,15 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
const chartPushDesc = ` const chartPushDesc = `
@ -33,7 +33,7 @@ Note: the ref must already exist in the local registry cache.
Must first run "helm chart save" or "helm chart pull". Must first run "helm chart save" or "helm chart pull".
` `
func newChartPushCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewChartPushCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
return &cobra.Command{ return &cobra.Command{
Use: "push [ref]", Use: "push [ref]",
Short: "push a chart to remote", Short: "push a chart to remote",

@ -14,15 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
const chartRemoveDesc = ` const chartRemoveDesc = `
@ -34,7 +34,7 @@ but it will no longer appear in "helm chart list".
To remove all unlinked content, please run "helm chart prune". (TODO) To remove all unlinked content, please run "helm chart prune". (TODO)
` `
func newChartRemoveCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewChartRemoveCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
return &cobra.Command{ return &cobra.Command{
Use: "remove [ref]", Use: "remove [ref]",
Aliases: []string{"rm"}, Aliases: []string{"rm"},

@ -14,15 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
const chartSaveDesc = ` const chartSaveDesc = `
@ -32,7 +32,7 @@ Note: modifying the chart after this operation will
not change the item as it exists in the cache. not change the item as it exists in the cache.
` `
func newChartSaveCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewChartSaveCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
return &cobra.Command{ return &cobra.Command{
Use: "save [path] [ref]", Use: "save [path] [ref]",
Short: "save a chart directory", Short: "save a chart directory",

@ -0,0 +1,193 @@
/*
Copyright The Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cli
import (
"fmt"
"io"
"log"
"os"
"sync"
"github.com/containerd/containerd/remotes/docker"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
_ "k8s.io/client-go/plugin/pkg/client/auth" // initialize kubernetes client auth plugins
"k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/environment"
"k8s.io/helm/pkg/cli/require"
"k8s.io/helm/pkg/kube"
"k8s.io/helm/pkg/registry"
"k8s.io/helm/pkg/storage"
"k8s.io/helm/pkg/storage/driver"
)
const globalUsage = `The Kubernetes package manager
To begin working with Helm, run the 'helm init' command:
$ helm init
This will set up any necessary local configuration.
Common actions from this point include:
- helm search: search for charts
- helm fetch: download a chart to your local directory to view
- helm install: upload the chart to Kubernetes
- helm list: list releases of charts
Environment:
$HELM_HOME set an alternative location for Helm files. By default, these are stored in ~/.helm
$HELM_DRIVER set the backend storage driver. Values are: configmap, secret, memory
$HELM_NO_PLUGINS disable plugins. Set HELM_NO_PLUGINS=1 to disable plugins.
$KUBECONFIG set an alternative Kubernetes configuration file (default "~/.kube/config")
`
var (
settings environment.Settings
config genericclioptions.RESTClientGetter
configOnce sync.Once
)
func New(actionConfig *action.Configuration, out io.Writer, args []string) *cobra.Command {
cmd := &cobra.Command{
Use: "helm",
Short: "The Helm package manager for Kubernetes.",
Long: globalUsage,
SilenceUsage: true,
Args: require.NoArgs,
}
flags := cmd.PersistentFlags()
settings.AddFlags(flags)
flags.Parse(args)
// set defaults from environment
settings.Init(flags)
// Add the registry client based on settings
// TODO: Move this elsewhere (first, settings.Init() must move)
actionConfig.RegistryClient = registry.NewClient(&registry.ClientOptions{
Out: out,
Resolver: registry.Resolver{
Resolver: docker.NewResolver(docker.ResolverOptions{}),
},
CacheRootDir: settings.Home.Registry(),
})
cmd.AddCommand(
// chart commands
NewCreateCmd(out),
NewDependencyCmd(out),
NewPullCmd(out),
NewShowCmd(out),
NewLintCmd(out),
NewPackageCmd(out),
NewRepoCmd(out),
NewSearchCmd(out),
NewVerifyCmd(out),
NewChartCmd(actionConfig, out),
// release commands
NewGetCmd(actionConfig, out),
NewHistoryCmd(actionConfig, out),
NewInstallCmd(actionConfig, out),
NewListCmd(actionConfig, out),
NewReleaseTestCmd(actionConfig, out),
NewRollbackCmd(actionConfig, out),
NewStatusCmd(actionConfig, out),
NewUninstallCmd(actionConfig, out),
NewUpgradeCmd(actionConfig, out),
NewCompletionCmd(out),
NewHomeCmd(out),
NewInitCmd(out),
NewPluginCmd(out),
NewTemplateCmd(out),
NewVersionCmd(out),
// Hidden documentation generator command: 'helm docs'
NewDocsCmd(out),
)
// Find and add plugins
loadPlugins(cmd, out)
return cmd
}
func logf(format string, v ...interface{}) {
if settings.Debug {
format = fmt.Sprintf("[debug] %s\n", format)
log.Output(2, fmt.Sprintf(format, v...))
}
}
func NewActionConfig(allNamespaces bool) *action.Configuration {
kc := kube.New(kubeConfig())
kc.Log = logf
clientset, err := kc.KubernetesClientSet()
if err != nil {
// TODO return error
log.Fatal(err)
}
var namespace string
if !allNamespaces {
namespace = getNamespace()
}
var store *storage.Storage
switch os.Getenv("HELM_DRIVER") {
case "secret", "secrets", "":
d := driver.NewSecrets(clientset.CoreV1().Secrets(namespace))
d.Log = logf
store = storage.Init(d)
case "configmap", "configmaps":
d := driver.NewConfigMaps(clientset.CoreV1().ConfigMaps(namespace))
d.Log = logf
store = storage.Init(d)
case "memory":
d := driver.NewMemory()
store = storage.Init(d)
default:
// Not sure what to do here.
panic("Unknown driver in HELM_DRIVER: " + os.Getenv("HELM_DRIVER"))
}
return &action.Configuration{
KubeClient: kc,
Releases: store,
Discovery: clientset.Discovery(),
}
}
func kubeConfig() genericclioptions.RESTClientGetter {
configOnce.Do(func() {
config = kube.GetConfig(settings.KubeConfig, settings.KubeContext, settings.Namespace)
})
return config
}
func getNamespace() string {
if ns, _, err := kubeConfig().ToRawKubeConfigLoader().Namespace(); err == nil {
return ns
}
return "default"
}

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"bytes" "bytes"
@ -42,7 +42,7 @@ var (
} }
) )
func newCompletionCmd(out io.Writer) *cobra.Command { func NewCompletionCmd(out io.Writer) *cobra.Command {
shells := []string{} shells := []string{}
for s := range completionShells { for s := range completionShells {
shells = append(shells, s) shells = append(shells, s)

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -23,9 +23,9 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/chart" "k8s.io/helm/pkg/chart"
"k8s.io/helm/pkg/chartutil" "k8s.io/helm/pkg/chartutil"
"k8s.io/helm/pkg/cli/require"
) )
const createDesc = ` const createDesc = `
@ -53,7 +53,7 @@ type createOptions struct {
name string name string
} }
func newCreateCmd(out io.Writer) *cobra.Command { func NewCreateCmd(out io.Writer) *cobra.Command {
o := &createOptions{} o := &createOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
@ -21,8 +21,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
const dependencyDesc = ` const dependencyDesc = `
@ -82,7 +82,7 @@ the contents of a chart.
This will produce an error if the chart cannot be loaded. This will produce an error if the chart cannot be loaded.
` `
func newDependencyCmd(out io.Writer) *cobra.Command { func NewDependencyCmd(out io.Writer) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "dependency update|build|list", Use: "dependency update|build|list",
Aliases: []string{"dep", "dependencies"}, Aliases: []string{"dep", "dependencies"},
@ -91,14 +91,14 @@ func newDependencyCmd(out io.Writer) *cobra.Command {
Args: require.NoArgs, Args: require.NoArgs,
} }
cmd.AddCommand(newDependencyListCmd(out)) cmd.AddCommand(NewDependencyListCmd(out))
cmd.AddCommand(newDependencyUpdateCmd(out)) cmd.AddCommand(NewDependencyUpdateCmd(out))
cmd.AddCommand(newDependencyBuildCmd(out)) cmd.AddCommand(NewDependencyBuildCmd(out))
return cmd return cmd
} }
func newDependencyListCmd(out io.Writer) *cobra.Command { func NewDependencyListCmd(out io.Writer) *cobra.Command {
client := action.NewDependency() client := action.NewDependency()
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
@ -23,8 +23,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/client-go/util/homedir" "k8s.io/client-go/util/homedir"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
"k8s.io/helm/pkg/downloader" "k8s.io/helm/pkg/downloader"
"k8s.io/helm/pkg/getter" "k8s.io/helm/pkg/getter"
) )
@ -40,7 +40,7 @@ If no lock file is found, 'helm dependency build' will mirror the behavior
of 'helm dependency update'. of 'helm dependency update'.
` `
func newDependencyBuildCmd(out io.Writer) *cobra.Command { func NewDependencyBuildCmd(out io.Writer) *cobra.Command {
client := action.NewDependency() client := action.NewDependency()
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -34,7 +34,7 @@ func TestDependencyBuildCmd(t *testing.T) {
srv := repotest.NewServer(hh.String()) srv := repotest.NewServer(hh.String())
defer srv.Stop() defer srv.Stop()
if _, err := srv.CopyCharts("testdata/testcharts/*.tgz"); err != nil { if _, err := srv.CopyCharts("../../testdata/testcharts/*.tgz"); err != nil {
t.Fatal(err) t.Fatal(err)
} }

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"runtime" "runtime"
@ -30,7 +30,7 @@ func TestDependencyListCmd(t *testing.T) {
noDependencies := cmdTestCase{ noDependencies := cmdTestCase{
name: "No dependencies", name: "No dependencies",
cmd: "dependency list testdata/testcharts/alpine", cmd: "dependency list ../../testdata/testcharts/alpine",
golden: "output/dependency-list-no-requirements-linux.txt", golden: "output/dependency-list-no-requirements-linux.txt",
} }
@ -42,11 +42,11 @@ func TestDependencyListCmd(t *testing.T) {
tests := []cmdTestCase{noSuchChart, tests := []cmdTestCase{noSuchChart,
noDependencies, { noDependencies, {
name: "Dependencies in chart dir", name: "Dependencies in chart dir",
cmd: "dependency list testdata/testcharts/reqtest", cmd: "dependency list ../../testdata/testcharts/reqtest",
golden: "output/dependency-list.txt", golden: "output/dependency-list.txt",
}, { }, {
name: "Dependencies in chart archive", name: "Dependencies in chart archive",
cmd: "dependency list testdata/testcharts/reqtest-0.1.0.tgz", cmd: "dependency list ../../testdata/testcharts/reqtest-0.1.0.tgz",
golden: "output/dependency-list-archive.txt", golden: "output/dependency-list-archive.txt",
}} }}
runTestCmd(t, tests) runTestCmd(t, tests)

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
@ -21,8 +21,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
"k8s.io/helm/pkg/downloader" "k8s.io/helm/pkg/downloader"
"k8s.io/helm/pkg/getter" "k8s.io/helm/pkg/getter"
) )
@ -43,7 +43,7 @@ in the Chart.yaml file, but (b) at the wrong version.
` `
// newDependencyUpdateCmd creates a new dependency update command. // newDependencyUpdateCmd creates a new dependency update command.
func newDependencyUpdateCmd(out io.Writer) *cobra.Command { func NewDependencyUpdateCmd(out io.Writer) *cobra.Command {
client := action.NewDependency() client := action.NewDependency()
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -38,7 +38,7 @@ func TestDependencyUpdateCmd(t *testing.T) {
srv := repotest.NewServer(hh.String()) srv := repotest.NewServer(hh.String())
defer srv.Stop() defer srv.Stop()
copied, err := srv.CopyCharts("testdata/testcharts/*.tgz") copied, err := srv.CopyCharts("../../testdata/testcharts/*.tgz")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@ -120,7 +120,7 @@ func TestDependencyUpdateCmd_SkipRefresh(t *testing.T) {
srv := repotest.NewServer(hh.String()) srv := repotest.NewServer(hh.String())
defer srv.Stop() defer srv.Stop()
copied, err := srv.CopyCharts("testdata/testcharts/*.tgz") copied, err := srv.CopyCharts("../../testdata/testcharts/*.tgz")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@ -151,7 +151,7 @@ func TestDependencyUpdateCmd_DontDeleteOldChartsOnError(t *testing.T) {
srv := repotest.NewServer(hh.String()) srv := repotest.NewServer(hh.String())
defer srv.Stop() defer srv.Stop()
copied, err := srv.CopyCharts("testdata/testcharts/*.tgz") copied, err := srv.CopyCharts("../../testdata/testcharts/*.tgz")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
@ -23,7 +23,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/cobra/doc" "github.com/spf13/cobra/doc"
"k8s.io/helm/cmd/helm/require" "k8s.io/helm/pkg/cli/require"
) )
const docsDesc = ` const docsDesc = `
@ -45,7 +45,7 @@ type docsOptions struct {
topCmd *cobra.Command topCmd *cobra.Command
} }
func newDocsCmd(out io.Writer) *cobra.Command { func NewDocsCmd(out io.Writer) *cobra.Command {
o := &docsOptions{} o := &docsOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -20,7 +20,7 @@ Helm's environment encapsulates all of the service dependencies Helm has.
These dependencies are expressed as interfaces so that alternate implementations These dependencies are expressed as interfaces so that alternate implementations
(mocks, etc.) can be easily generated. (mocks, etc.) can be easily generated.
*/ */
package cli package environment
import ( import (
"os" "os"
@ -35,8 +35,8 @@ import (
// defaultHelmHome is the default HELM_HOME. // defaultHelmHome is the default HELM_HOME.
var defaultHelmHome = filepath.Join(homedir.HomeDir(), ".helm") var defaultHelmHome = filepath.Join(homedir.HomeDir(), ".helm")
// EnvSettings describes all of the environment settings. // Settings describes all of the environment settings.
type EnvSettings struct { type Settings struct {
// Home is the local path to the Helm home directory. // Home is the local path to the Helm home directory.
Home helmpath.Home Home helmpath.Home
// Namespace is the namespace scope. // Namespace is the namespace scope.
@ -50,7 +50,7 @@ type EnvSettings struct {
} }
// AddFlags binds flags to the given flagset. // AddFlags binds flags to the given flagset.
func (s *EnvSettings) AddFlags(fs *pflag.FlagSet) { func (s *Settings) AddFlags(fs *pflag.FlagSet) {
fs.StringVar((*string)(&s.Home), "home", defaultHelmHome, "location of your Helm config. Overrides $HELM_HOME") fs.StringVar((*string)(&s.Home), "home", defaultHelmHome, "location of your Helm config. Overrides $HELM_HOME")
fs.StringVarP(&s.Namespace, "namespace", "n", "", "namespace scope for this request") fs.StringVarP(&s.Namespace, "namespace", "n", "", "namespace scope for this request")
fs.StringVar(&s.KubeConfig, "kubeconfig", "", "path to the kubeconfig file") fs.StringVar(&s.KubeConfig, "kubeconfig", "", "path to the kubeconfig file")
@ -59,14 +59,14 @@ func (s *EnvSettings) AddFlags(fs *pflag.FlagSet) {
} }
// Init sets values from the environment. // Init sets values from the environment.
func (s *EnvSettings) Init(fs *pflag.FlagSet) { func (s *Settings) Init(fs *pflag.FlagSet) {
for name, envar := range envMap { for name, envar := range envMap {
setFlagFromEnv(name, envar, fs) setFlagFromEnv(name, envar, fs)
} }
} }
// PluginDirs is the path to the plugin directories. // PluginDirs is the path to the plugin directories.
func (s EnvSettings) PluginDirs() string { func (s Settings) PluginDirs() string {
if d, ok := os.LookupEnv("HELM_PLUGIN"); ok { if d, ok := os.LookupEnv("HELM_PLUGIN"); ok {
return d return d
} }

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package cli package environment
import ( import (
"os" "os"
@ -26,7 +26,7 @@ import (
"k8s.io/helm/pkg/helmpath" "k8s.io/helm/pkg/helmpath"
) )
func TestEnvSettings(t *testing.T) { func TestSettings(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
@ -81,7 +81,7 @@ func TestEnvSettings(t *testing.T) {
flags := pflag.NewFlagSet("testing", pflag.ContinueOnError) flags := pflag.NewFlagSet("testing", pflag.ContinueOnError)
settings := &EnvSettings{} settings := &Settings{}
settings.AddFlags(flags) settings.AddFlags(flags)
flags.Parse(strings.Split(tt.args, " ")) flags.Parse(strings.Split(tt.args, " "))

@ -14,15 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
var getHelp = ` var getHelp = `
@ -38,7 +38,7 @@ By default, this prints a human readable collection of information about the
chart, the supplied values, and the generated manifest file. chart, the supplied values, and the generated manifest file.
` `
func newGetCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewGetCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewGet(cfg) client := action.NewGet(cfg)
cmd := &cobra.Command{ cmd := &cobra.Command{
@ -57,9 +57,9 @@ func newGetCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
cmd.Flags().IntVar(&client.Version, "revision", 0, "get the named release with revision") cmd.Flags().IntVar(&client.Version, "revision", 0, "get the named release with revision")
cmd.AddCommand(newGetValuesCmd(cfg, out)) cmd.AddCommand(NewGetValuesCmd(cfg, out))
cmd.AddCommand(newGetManifestCmd(cfg, out)) cmd.AddCommand(NewGetManifestCmd(cfg, out))
cmd.AddCommand(newGetHooksCmd(cfg, out)) cmd.AddCommand(NewGetHooksCmd(cfg, out))
return cmd return cmd
} }

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -22,8 +22,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
const getHooksHelp = ` const getHooksHelp = `
@ -32,7 +32,7 @@ This command downloads hooks for a given release.
Hooks are formatted in YAML and separated by the YAML '---\n' separator. Hooks are formatted in YAML and separated by the YAML '---\n' separator.
` `
func newGetHooksCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewGetHooksCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewGet(cfg) client := action.NewGet(cfg)
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"testing" "testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -22,8 +22,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
var getManifestHelp = ` var getManifestHelp = `
@ -34,7 +34,7 @@ were generated from this release's chart(s). If a chart is dependent on other
charts, those resources will also be included in the manifest. charts, those resources will also be included in the manifest.
` `
func newGetManifestCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewGetManifestCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewGet(cfg) client := action.NewGet(cfg)
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"testing" "testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"testing" "testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -22,15 +22,15 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
var getValuesHelp = ` var getValuesHelp = `
This command downloads a values file for a given release. This command downloads a values file for a given release.
` `
func newGetValuesCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewGetValuesCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewGetValues(cfg) client := action.NewGetValues(cfg)
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"testing" "testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"bytes" "bytes"
@ -121,7 +121,7 @@ func executeActionCommandC(store *storage.Storage, cmd string) (*cobra.Command,
Log: func(format string, v ...interface{}) {}, Log: func(format string, v ...interface{}) {},
} }
root := newRootCmd(actionConfig, buf, args) root := New(actionConfig, buf, args)
root.SetOutput(buf) root.SetOutput(buf)
root.SetArgs(args) root.SetArgs(args)

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -22,8 +22,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
var historyHelp = ` var historyHelp = `
@ -42,7 +42,7 @@ The historical release set is printed as a formatted table, e.g:
4 Mon Oct 3 10:15:13 2016 deployed alpine-0.1.0 Upgraded successfully 4 Mon Oct 3 10:15:13 2016 deployed alpine-0.1.0 Upgraded successfully
` `
func newHistoryCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewHistoryCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewHistory(cfg) client := action.NewHistory(cfg)
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"testing" "testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -22,7 +22,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require" "k8s.io/helm/pkg/cli/require"
) )
var longHomeHelp = ` var longHomeHelp = `
@ -30,7 +30,7 @@ This command displays the location of HELM_HOME. This is where
any helm configuration files live. any helm configuration files live.
` `
func newHomeCmd(out io.Writer) *cobra.Command { func NewHomeCmd(out io.Writer) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "home", Use: "home",
Short: "displays the location of HELM_HOME", Short: "displays the location of HELM_HOME",

@ -14,20 +14,21 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath"
"github.com/Masterminds/semver" "github.com/Masterminds/semver"
"github.com/ghodss/yaml" "github.com/ghodss/yaml"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require" "k8s.io/helm/pkg/cli/require"
"k8s.io/helm/pkg/getter" "k8s.io/helm/pkg/getter"
"k8s.io/helm/pkg/helmpath" "k8s.io/helm/pkg/helmpath"
"k8s.io/helm/pkg/plugin" "k8s.io/helm/pkg/plugin"
@ -61,7 +62,7 @@ type pluginsFile struct {
Plugins []*pluginsFileEntry `json:"plugins"` Plugins []*pluginsFileEntry `json:"plugins"`
} }
func newInitCmd(out io.Writer) *cobra.Command { func NewInitCmd(out io.Writer) *cobra.Command {
o := &initOptions{} o := &initOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{
@ -206,7 +207,8 @@ func ensurePluginsInstalled(pluginsFilename string, out io.Writer) error {
} }
func ensurePluginInstalled(requiredPlugin *pluginsFileEntry, pluginsFilename string, out io.Writer) error { func ensurePluginInstalled(requiredPlugin *pluginsFileEntry, pluginsFilename string, out io.Writer) error {
i, err := installer.NewForSource(requiredPlugin.URL, requiredPlugin.Version, settings.Home) fmt.Println(filepath.Join(filepath.Dir(pluginsFilename), requiredPlugin.URL))
i, err := installer.NewForSource(filepath.Join(filepath.Dir(pluginsFilename), requiredPlugin.URL), requiredPlugin.Version, settings.Home)
if err != nil { if err != nil {
return err return err
} }

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"bytes" "bytes"
@ -24,7 +24,7 @@ import (
"k8s.io/helm/pkg/helmpath" "k8s.io/helm/pkg/helmpath"
) )
const testPluginsFile = "testdata/plugins.yaml" const testPluginsFile = "../../testdata/plugins.yaml"
func TestEnsureHome(t *testing.T) { func TestEnsureHome(t *testing.T) {
hh := helmpath.Home(testTempDir(t)) hh := helmpath.Home(testTempDir(t))

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
@ -24,10 +24,10 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag" "github.com/spf13/pflag"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/chart/loader" "k8s.io/helm/pkg/chart/loader"
"k8s.io/helm/pkg/chartutil" "k8s.io/helm/pkg/chartutil"
"k8s.io/helm/pkg/cli/require"
"k8s.io/helm/pkg/downloader" "k8s.io/helm/pkg/downloader"
"k8s.io/helm/pkg/getter" "k8s.io/helm/pkg/getter"
) )
@ -94,7 +94,7 @@ To see the list of chart repositories, use 'helm repo list'. To search for
charts in a repository, use 'helm search'. charts in a repository, use 'helm search'.
` `
func newInstallCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewInstallCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewInstall(cfg) client := action.NewInstall(cfg)
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"testing" "testing"
@ -25,38 +25,38 @@ func TestInstall(t *testing.T) {
// Install, base case // Install, base case
{ {
name: "basic install", name: "basic install",
cmd: "install aeneas testdata/testcharts/empty", cmd: "install aeneas ../../testdata/testcharts/empty",
golden: "output/install.txt", golden: "output/install.txt",
}, },
// Install, values from cli // Install, values from cli
{ {
name: "install with values", name: "install with values",
cmd: "install virgil testdata/testcharts/alpine --set test.Name=bar", cmd: "install virgil ../../testdata/testcharts/alpine --set test.Name=bar",
golden: "output/install-with-values.txt", golden: "output/install-with-values.txt",
}, },
// Install, values from cli via multiple --set // Install, values from cli via multiple --set
{ {
name: "install with multiple values", name: "install with multiple values",
cmd: "install virgil testdata/testcharts/alpine --set test.Color=yellow --set test.Name=banana", cmd: "install virgil ../../testdata/testcharts/alpine --set test.Color=yellow --set test.Name=banana",
golden: "output/install-with-multiple-values.txt", golden: "output/install-with-multiple-values.txt",
}, },
// Install, values from yaml // Install, values from yaml
{ {
name: "install with values file", name: "install with values file",
cmd: "install virgil testdata/testcharts/alpine -f testdata/testcharts/alpine/extra_values.yaml", cmd: "install virgil ../../testdata/testcharts/alpine -f ../../testdata/testcharts/alpine/extra_values.yaml",
golden: "output/install-with-values-file.txt", golden: "output/install-with-values-file.txt",
}, },
// Install, no hooks // Install, no hooks
{ {
name: "install without hooks", name: "install without hooks",
cmd: "install aeneas testdata/testcharts/alpine --no-hooks --set test.Name=hello", cmd: "install aeneas ../../testdata/testcharts/alpine --no-hooks --set test.Name=hello",
golden: "output/install-no-hooks.txt", golden: "output/install-no-hooks.txt",
}, },
// Install, values from multiple yaml // Install, values from multiple yaml
{ {
name: "install with values", name: "install with values",
cmd: "install virgil testdata/testcharts/alpine -f testdata/testcharts/alpine/extra_values.yaml -f testdata/testcharts/alpine/more_values.yaml", cmd: "install virgil ../../testdata/testcharts/alpine -f ../../testdata/testcharts/alpine/extra_values.yaml -f ../../testdata/testcharts/alpine/more_values.yaml",
golden: "output/install-with-multiple-values-files.txt", golden: "output/install-with-multiple-values-files.txt",
}, },
// Install, no charts // Install, no charts
@ -69,70 +69,70 @@ func TestInstall(t *testing.T) {
// Install, re-use name // Install, re-use name
{ {
name: "install and replace release", name: "install and replace release",
cmd: "install aeneas testdata/testcharts/empty --replace", cmd: "install aeneas ../../testdata/testcharts/empty --replace",
golden: "output/install-and-replace.txt", golden: "output/install-and-replace.txt",
}, },
// Install, with timeout // Install, with timeout
{ {
name: "install with a timeout", name: "install with a timeout",
cmd: "install foobar testdata/testcharts/empty --timeout 120", cmd: "install foobar ../../testdata/testcharts/empty --timeout 120",
golden: "output/install-with-timeout.txt", golden: "output/install-with-timeout.txt",
}, },
// Install, with wait // Install, with wait
{ {
name: "install with a wait", name: "install with a wait",
cmd: "install apollo testdata/testcharts/empty --wait", cmd: "install apollo ../../testdata/testcharts/empty --wait",
golden: "output/install-with-wait.txt", golden: "output/install-with-wait.txt",
}, },
// Install, using the name-template // Install, using the name-template
{ {
name: "install with name-template", name: "install with name-template",
cmd: "install testdata/testcharts/empty --name-template '{{upper \"foobar\"}}'", cmd: "install ../../testdata/testcharts/empty --name-template '{{upper \"foobar\"}}'",
golden: "output/install-name-template.txt", golden: "output/install-name-template.txt",
}, },
// Install, perform chart verification along the way. // Install, perform chart verification along the way.
{ {
name: "install with verification, missing provenance", name: "install with verification, missing provenance",
cmd: "install bogus testdata/testcharts/compressedchart-0.1.0.tgz --verify --keyring testdata/helm-test-key.pub", cmd: "install bogus ../../testdata/testcharts/compressedchart-0.1.0.tgz --verify --keyring ../../testdata/helm-test-key.pub",
wantError: true, wantError: true,
}, },
{ {
name: "install with verification, directory instead of file", name: "install with verification, directory instead of file",
cmd: "install bogus testdata/testcharts/signtest --verify --keyring testdata/helm-test-key.pub", cmd: "install bogus ../../testdata/testcharts/signtest --verify --keyring ../../testdata/helm-test-key.pub",
wantError: true, wantError: true,
}, },
{ {
name: "install with verification, valid", name: "install with verification, valid",
cmd: "install signtest testdata/testcharts/signtest-0.1.0.tgz --verify --keyring testdata/helm-test-key.pub", cmd: "install signtest ../../testdata/testcharts/signtest-0.1.0.tgz --verify --keyring ../../testdata/helm-test-key.pub",
}, },
// Install, chart with missing dependencies in /charts // Install, chart with missing dependencies in /charts
{ {
name: "install chart with missing dependencies", name: "install chart with missing dependencies",
cmd: "install nodeps testdata/testcharts/chart-missing-deps", cmd: "install nodeps ../../testdata/testcharts/chart-missing-deps",
wantError: true, wantError: true,
}, },
// Install, chart with bad dependencies in Chart.yaml in /charts // Install, chart with bad dependencies in Chart.yaml in /charts
{ {
name: "install chart with bad dependencies in Chart.yaml", name: "install chart with bad dependencies in Chart.yaml",
cmd: "install badreq testdata/testcharts/chart-bad-requirements", cmd: "install badreq ../../testdata/testcharts/chart-bad-requirements",
wantError: true, wantError: true,
}, },
// Install, chart with library chart dependency // Install, chart with library chart dependency
{ {
name: "install chart with library chart dependency", name: "install chart with library chart dependency",
cmd: "install withlibchartp testdata/testcharts/chart-with-lib-dep", cmd: "install withlibchartp ../../testdata/testcharts/chart-with-lib-dep",
}, },
// Install, library chart // Install, library chart
{ {
name: "install library chart", name: "install library chart",
cmd: "install libchart testdata/testcharts/lib-chart", cmd: "install libchart ../../testdata/testcharts/lib-chart",
wantError: true, wantError: true,
golden: "output/template-lib-chart.txt", golden: "output/template-lib-chart.txt",
}, },
// Install, chart with bad type // Install, chart with bad type
{ {
name: "install chart with bad type", name: "install chart with bad type",
cmd: "install badtype testdata/testcharts/chart-bad-type", cmd: "install badtype ../../testdata/testcharts/chart-bad-type",
wantError: true, wantError: true,
golden: "output/install-chart-bad-type.txt", golden: "output/install-chart-bad-type.txt",
}, },

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -36,7 +36,7 @@ it will emit [ERROR] messages. If it encounters issues that break with conventio
or recommendation, it will emit [WARNING] messages. or recommendation, it will emit [WARNING] messages.
` `
func newLintCmd(out io.Writer) *cobra.Command { func NewLintCmd(out io.Writer) *cobra.Command {
client := action.NewLint() client := action.NewLint()
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -22,8 +22,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
var listHelp = ` var listHelp = `
@ -53,7 +53,7 @@ server's default, which may be much higher than 256. Pairing the '--max'
flag with the '--offset' flag allows you to page through results. flag with the '--offset' flag allows you to page through results.
` `
func newListCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewListCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewList(cfg) client := action.NewList(cfg)
cmd := &cobra.Command{ cmd := &cobra.Command{
@ -64,7 +64,7 @@ func newListCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
Args: require.NoArgs, Args: require.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
if client.AllNamespaces { if client.AllNamespaces {
client.SetConfiguration(newActionConfig(true)) client.SetConfiguration(NewActionConfig(true))
} }
client.All = client.Limit == -1 client.All = client.Limit == -1
client.SetStateMask() client.SetStateMask()

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -42,7 +42,7 @@ Chart.yaml file, and (if found) build the current directory into a chart.
Versioned chart archives are used by Helm package repositories. Versioned chart archives are used by Helm package repositories.
` `
func newPackageCmd(out io.Writer) *cobra.Command { func NewPackageCmd(out io.Writer) *cobra.Command {
client := action.NewPackage() client := action.NewPackage()
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"bytes" "bytes"
@ -61,74 +61,74 @@ func TestPackage(t *testing.T) {
}, },
{ {
name: "package --sign, no --key", name: "package --sign, no --key",
args: []string{"testdata/testcharts/alpine"}, args: []string{"../../testdata/testcharts/alpine"},
flags: map[string]string{"sign": "1"}, flags: map[string]string{"sign": "1"},
expect: "key is required for signing a package", expect: "key is required for signing a package",
err: true, err: true,
}, },
{ {
name: "package --sign, no --keyring", name: "package --sign, no --keyring",
args: []string{"testdata/testcharts/alpine"}, args: []string{"../../testdata/testcharts/alpine"},
flags: map[string]string{"sign": "1", "key": "nosuchkey", "keyring": ""}, flags: map[string]string{"sign": "1", "key": "nosuchkey", "keyring": ""},
expect: "keyring is required for signing a package", expect: "keyring is required for signing a package",
err: true, err: true,
}, },
{ {
name: "package testdata/testcharts/alpine, no save", name: "package ../../testdata/testcharts/alpine, no save",
args: []string{"testdata/testcharts/alpine"}, args: []string{"../../testdata/testcharts/alpine"},
flags: map[string]string{"save": "0"}, flags: map[string]string{"save": "0"},
expect: "", expect: "",
hasfile: "alpine-0.1.0.tgz", hasfile: "alpine-0.1.0.tgz",
}, },
{ {
name: "package testdata/testcharts/alpine", name: "package ../../testdata/testcharts/alpine",
args: []string{"testdata/testcharts/alpine"}, args: []string{"../../testdata/testcharts/alpine"},
expect: "", expect: "",
hasfile: "alpine-0.1.0.tgz", hasfile: "alpine-0.1.0.tgz",
}, },
{ {
name: "package testdata/testcharts/issue1979", name: "package ../../testdata/testcharts/issue1979",
args: []string{"testdata/testcharts/issue1979"}, args: []string{"../../testdata/testcharts/issue1979"},
expect: "", expect: "",
hasfile: "alpine-0.1.0.tgz", hasfile: "alpine-0.1.0.tgz",
}, },
{ {
name: "package --destination toot", name: "package --destination toot",
args: []string{"testdata/testcharts/alpine"}, args: []string{"../../testdata/testcharts/alpine"},
flags: map[string]string{"destination": "toot"}, flags: map[string]string{"destination": "toot"},
expect: "", expect: "",
hasfile: "toot/alpine-0.1.0.tgz", hasfile: "toot/alpine-0.1.0.tgz",
}, },
{ {
name: "package --destination does-not-exist", name: "package --destination does-not-exist",
args: []string{"testdata/testcharts/alpine"}, args: []string{"../../testdata/testcharts/alpine"},
flags: map[string]string{"destination": "does-not-exist"}, flags: map[string]string{"destination": "does-not-exist"},
expect: fmt.Sprintf("failed to save: %s does-not-exist: %s", statExe, statFileMsg), expect: fmt.Sprintf("failed to save: %s does-not-exist: %s", statExe, statFileMsg),
err: true, err: true,
}, },
{ {
name: "package --sign --key=KEY --keyring=KEYRING testdata/testcharts/alpine", name: "package --sign --key=KEY --keyring=KEYRING ../../testdata/testcharts/alpine",
args: []string{"testdata/testcharts/alpine"}, args: []string{"../../testdata/testcharts/alpine"},
flags: map[string]string{"sign": "1", "keyring": "testdata/helm-test-key.secret", "key": "helm-test"}, flags: map[string]string{"sign": "1", "keyring": "../../testdata/helm-test-key.secret", "key": "helm-test"},
expect: "", expect: "",
hasfile: "alpine-0.1.0.tgz", hasfile: "alpine-0.1.0.tgz",
}, },
{ {
name: "package testdata/testcharts/chart-missing-deps", name: "package ../../testdata/testcharts/chart-missing-deps",
args: []string{"testdata/testcharts/chart-missing-deps"}, args: []string{"../../testdata/testcharts/chart-missing-deps"},
hasfile: "chart-missing-deps-0.1.0.tgz", hasfile: "chart-missing-deps-0.1.0.tgz",
err: true, err: true,
}, },
{ {
name: "package --values does-not-exist", name: "package --values does-not-exist",
args: []string{"testdata/testcharts/alpine"}, args: []string{"../../testdata/testcharts/alpine"},
flags: map[string]string{"values": "does-not-exist"}, flags: map[string]string{"values": "does-not-exist"},
expect: fmt.Sprintf("does-not-exist: %s", statFileMsg), expect: fmt.Sprintf("does-not-exist: %s", statFileMsg),
err: true, err: true,
}, },
{ {
name: "package testdata/testcharts/chart-bad-type", name: "package ../../testdata/testcharts/chart-bad-type",
args: []string{"testdata/testcharts/chart-bad-type"}, args: []string{"../../testdata/testcharts/chart-bad-type"},
err: true, err: true,
}, },
} }
@ -152,7 +152,7 @@ func TestPackage(t *testing.T) {
for _, tt := range tests { for _, tt := range tests {
buf := bytes.NewBuffer(nil) buf := bytes.NewBuffer(nil)
c := newPackageCmd(buf) c := NewPackageCmd(buf)
// This is an unfortunate byproduct of the tmpdir // This is an unfortunate byproduct of the tmpdir
if v, ok := tt.flags["keyring"]; ok && len(v) > 0 { if v, ok := tt.flags["keyring"]; ok && len(v) > 0 {
@ -208,13 +208,13 @@ func TestSetAppVersion(t *testing.T) {
hh := testHelmHome(t) hh := testHelmHome(t)
settings.Home = hh settings.Home = hh
c := newPackageCmd(&bytes.Buffer{}) c := NewPackageCmd(&bytes.Buffer{})
flags := map[string]string{ flags := map[string]string{
"destination": tmp, "destination": tmp,
"app-version": expectedAppVersion, "app-version": expectedAppVersion,
} }
setFlags(c, flags) setFlags(c, flags)
if err := c.RunE(c, []string{"testdata/testcharts/alpine"}); err != nil { if err := c.RunE(c, []string{"../../testdata/testcharts/alpine"}); err != nil {
t.Errorf("unexpected error %q", err) t.Errorf("unexpected error %q", err)
} }
@ -245,25 +245,25 @@ func TestPackageValues(t *testing.T) {
}{ }{
{ {
desc: "helm package, single values file", desc: "helm package, single values file",
args: []string{"testdata/testcharts/alpine"}, args: []string{"../../testdata/testcharts/alpine"},
valuefilesContents: []string{"Name: chart-name-foo"}, valuefilesContents: []string{"Name: chart-name-foo"},
expected: []string{"Name: chart-name-foo"}, expected: []string{"Name: chart-name-foo"},
}, },
{ {
desc: "helm package, multiple values files", desc: "helm package, multiple values files",
args: []string{"testdata/testcharts/alpine"}, args: []string{"../../testdata/testcharts/alpine"},
valuefilesContents: []string{"Name: chart-name-foo", "foo: bar"}, valuefilesContents: []string{"Name: chart-name-foo", "foo: bar"},
expected: []string{"Name: chart-name-foo", "foo: bar"}, expected: []string{"Name: chart-name-foo", "foo: bar"},
}, },
{ {
desc: "helm package, with set option", desc: "helm package, with set option",
args: []string{"testdata/testcharts/alpine"}, args: []string{"../../testdata/testcharts/alpine"},
flags: map[string]string{"set": "Name=chart-name-foo"}, flags: map[string]string{"set": "Name=chart-name-foo"},
expected: []string{"Name: chart-name-foo"}, expected: []string{"Name: chart-name-foo"},
}, },
{ {
desc: "helm package, set takes precedence over value file", desc: "helm package, set takes precedence over value file",
args: []string{"testdata/testcharts/alpine"}, args: []string{"../../testdata/testcharts/alpine"},
valuefilesContents: []string{"Name: chart-name-foo"}, valuefilesContents: []string{"Name: chart-name-foo"},
flags: map[string]string{"set": "Name=chart-name-bar"}, flags: map[string]string{"set": "Name=chart-name-bar"},
expected: []string{"Name: chart-name-bar"}, expected: []string{"Name: chart-name-bar"},
@ -303,7 +303,7 @@ func runAndVerifyPackageCommandValues(t *testing.T, args []string, flags map[str
flags["values"] = valueFiles flags["values"] = valueFiles
} }
cmd := newPackageCmd(&bytes.Buffer{}) cmd := NewPackageCmd(&bytes.Buffer{})
setFlags(cmd, flags) setFlags(cmd, flags)
if err := cmd.RunE(cmd, args); err != nil { if err := cmd.RunE(cmd, args); err != nil {
t.Errorf("unexpected error: %q", err) t.Errorf("unexpected error: %q", err)

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
@ -30,17 +30,17 @@ const pluginHelp = `
Manage client-side Helm plugins. Manage client-side Helm plugins.
` `
func newPluginCmd(out io.Writer) *cobra.Command { func NewPluginCmd(out io.Writer) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "plugin", Use: "plugin",
Short: "add, list, or remove Helm plugins", Short: "add, list, or remove Helm plugins",
Long: pluginHelp, Long: pluginHelp,
} }
cmd.AddCommand( cmd.AddCommand(
newPluginInstallCmd(out), NewPluginInstallCmd(out),
newPluginListCmd(out), NewPluginListCmd(out),
newPluginRemoveCmd(out), NewPluginRemoveCmd(out),
newPluginUpdateCmd(out), NewPluginUpdateCmd(out),
) )
return cmd return cmd
} }

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -21,7 +21,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require" "k8s.io/helm/pkg/cli/require"
"k8s.io/helm/pkg/helmpath" "k8s.io/helm/pkg/helmpath"
"k8s.io/helm/pkg/plugin" "k8s.io/helm/pkg/plugin"
"k8s.io/helm/pkg/plugin/installer" "k8s.io/helm/pkg/plugin/installer"
@ -40,7 +40,7 @@ Example usage:
$ helm plugin install https://github.com/technosophos/helm-template $ helm plugin install https://github.com/technosophos/helm-template
` `
func newPluginInstallCmd(out io.Writer) *cobra.Command { func NewPluginInstallCmd(out io.Writer) *cobra.Command {
o := &pluginInstallOptions{} o := &pluginInstallOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "install [options] <path|url>...", Use: "install [options] <path|url>...",

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -29,7 +29,7 @@ type pluginListOptions struct {
home helmpath.Home home helmpath.Home
} }
func newPluginListCmd(out io.Writer) *cobra.Command { func NewPluginListCmd(out io.Writer) *cobra.Command {
o := &pluginListOptions{} o := &pluginListOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "list", Use: "list",

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -33,7 +33,7 @@ type pluginRemoveOptions struct {
home helmpath.Home home helmpath.Home
} }
func newPluginRemoveCmd(out io.Writer) *cobra.Command { func NewPluginRemoveCmd(out io.Writer) *cobra.Command {
o := &pluginRemoveOptions{} o := &pluginRemoveOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "remove <plugin>...", Use: "remove <plugin>...",

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"bytes" "bytes"
@ -64,7 +64,7 @@ func TestManuallyProcessArgs(t *testing.T) {
func TestLoadPlugins(t *testing.T) { func TestLoadPlugins(t *testing.T) {
defer resetEnv()() defer resetEnv()()
settings.Home = "testdata/helmhome" settings.Home = "../../testdata/helmhome"
os.Setenv("HELM_HOME", settings.Home.String()) os.Setenv("HELM_HOME", settings.Home.String())
hh := settings.Home hh := settings.Home
@ -134,7 +134,7 @@ func TestLoadPlugins(t *testing.T) {
func TestLoadPlugins_HelmNoPlugins(t *testing.T) { func TestLoadPlugins_HelmNoPlugins(t *testing.T) {
defer resetEnv()() defer resetEnv()()
settings.Home = "testdata/helmhome" settings.Home = "../../testdata/helmhome"
os.Setenv("HELM_NO_PLUGINS", "1") os.Setenv("HELM_NO_PLUGINS", "1")
@ -151,7 +151,7 @@ func TestLoadPlugins_HelmNoPlugins(t *testing.T) {
func TestSetupEnv(t *testing.T) { func TestSetupEnv(t *testing.T) {
defer resetEnv()() defer resetEnv()()
name := "pequod" name := "pequod"
settings.Home = helmpath.Home("testdata/helmhome") settings.Home = helmpath.Home("../../testdata/helmhome")
base := filepath.Join(settings.Home.Plugins(), name) base := filepath.Join(settings.Home.Plugins(), name)
settings.Debug = true settings.Debug = true
defer func() { defer func() {

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -34,7 +34,7 @@ type pluginUpdateOptions struct {
home helmpath.Home home helmpath.Home
} }
func newPluginUpdateCmd(out io.Writer) *cobra.Command { func NewPluginUpdateCmd(out io.Writer) *cobra.Command {
o := &pluginUpdateOptions{} o := &pluginUpdateOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "update <plugin>...", Use: "update <plugin>...",

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -22,8 +22,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
const pullDesc = ` const pullDesc = `
@ -41,7 +41,7 @@ file, and MUST pass the verification process. Failure in any part of this will
result in an error, and the chart will not be saved locally. result in an error, and the chart will not be saved locally.
` `
func newPullCmd(out io.Writer) *cobra.Command { func NewPullCmd(out io.Writer) *cobra.Command {
client := action.NewPull() client := action.NewPull()
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -70,13 +70,13 @@ func TestPullCmd(t *testing.T) {
}, },
{ {
name: "Fetch and verify", name: "Fetch and verify",
args: []string{"test/signtest --verify --keyring testdata/helm-test-key.pub"}, args: []string{"test/signtest --verify --keyring ../../testdata/helm-test-key.pub"},
expectFile: "./signtest-0.1.0.tgz", expectFile: "./signtest-0.1.0.tgz",
expectVerify: true, expectVerify: true,
}, },
{ {
name: "Fetch and fail verify", name: "Fetch and fail verify",
args: []string{"test/reqtest --verify --keyring testdata/helm-test-key.pub"}, args: []string{"test/reqtest --verify --keyring ../../testdata/helm-test-key.pub"},
failExpect: "Failed to fetch provenance", failExpect: "Failed to fetch provenance",
wantError: true, wantError: true,
}, },
@ -88,7 +88,7 @@ func TestPullCmd(t *testing.T) {
}, },
{ {
name: "Fetch, verify, untar", name: "Fetch, verify, untar",
args: []string{"test/signtest --verify --keyring=testdata/helm-test-key.pub --untar --untardir signtest"}, args: []string{"test/signtest --verify --keyring=../../testdata/helm-test-key.pub --untar --untardir signtest"},
expectFile: "./signtest", expectFile: "./signtest",
expectDir: true, expectDir: true,
expectVerify: true, expectVerify: true,
@ -117,7 +117,7 @@ func TestPullCmd(t *testing.T) {
}, },
} }
if _, err := srv.CopyCharts("testdata/testcharts/*.tgz*"); err != nil { if _, err := srv.CopyCharts("../../testdata/testcharts/*.tgz*"); err != nil {
t.Fatal(err) t.Fatal(err)
} }
if err := srv.LinkIndices(); err != nil { if err := srv.LinkIndices(); err != nil {

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -23,8 +23,8 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
"k8s.io/helm/pkg/release" "k8s.io/helm/pkg/release"
) )
@ -35,7 +35,7 @@ The argument this command takes is the name of a deployed release.
The tests to be run are defined in the chart that was installed. The tests to be run are defined in the chart that was installed.
` `
func newReleaseTestCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewReleaseTestCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewReleaseTesting(cfg) client := action.NewReleaseTesting(cfg)
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"testing" "testing"

@ -14,14 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require" "k8s.io/helm/pkg/cli/require"
) )
var repoHelm = ` var repoHelm = `
@ -32,7 +32,7 @@ Example usage:
$ helm repo add [NAME] [REPO_URL] $ helm repo add [NAME] [REPO_URL]
` `
func newRepoCmd(out io.Writer) *cobra.Command { func NewRepoCmd(out io.Writer) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "repo add|remove|list|index|update [ARGS]", Use: "repo add|remove|list|index|update [ARGS]",
Short: "add, list, remove, update, and index chart repositories", Short: "add, list, remove, update, and index chart repositories",
@ -40,11 +40,11 @@ func newRepoCmd(out io.Writer) *cobra.Command {
Args: require.NoArgs, Args: require.NoArgs,
} }
cmd.AddCommand(newRepoAddCmd(out)) cmd.AddCommand(NewRepoAddCmd(out))
cmd.AddCommand(newRepoListCmd(out)) cmd.AddCommand(NewRepoListCmd(out))
cmd.AddCommand(newRepoRemoveCmd(out)) cmd.AddCommand(NewRepoRemoveCmd(out))
cmd.AddCommand(newRepoIndexCmd(out)) cmd.AddCommand(NewRepoIndexCmd(out))
cmd.AddCommand(newRepoUpdateCmd(out)) cmd.AddCommand(NewRepoUpdateCmd(out))
return cmd return cmd
} }

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -23,7 +23,7 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require" "k8s.io/helm/pkg/cli/require"
"k8s.io/helm/pkg/getter" "k8s.io/helm/pkg/getter"
"k8s.io/helm/pkg/helmpath" "k8s.io/helm/pkg/helmpath"
"k8s.io/helm/pkg/repo" "k8s.io/helm/pkg/repo"
@ -42,7 +42,7 @@ type repoAddOptions struct {
caFile string caFile string
} }
func newRepoAddCmd(out io.Writer) *cobra.Command { func NewRepoAddCmd(out io.Writer) *cobra.Command {
o := &repoAddOptions{} o := &repoAddOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -28,7 +28,7 @@ import (
func TestRepoAddCmd(t *testing.T) { func TestRepoAddCmd(t *testing.T) {
defer resetEnv()() defer resetEnv()()
srv, hh, err := repotest.NewTempServer("testdata/testserver/*.*") srv, hh, err := repotest.NewTempServer("../../testdata/testserver/*.*")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
@ -52,7 +52,7 @@ func TestRepoAddCmd(t *testing.T) {
func TestRepoAdd(t *testing.T) { func TestRepoAdd(t *testing.T) {
defer resetEnv()() defer resetEnv()()
ts, hh, err := repotest.NewTempServer("testdata/testserver/*.*") ts, hh, err := repotest.NewTempServer("../../testdata/testserver/*.*")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
@ -24,7 +24,7 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require" "k8s.io/helm/pkg/cli/require"
"k8s.io/helm/pkg/repo" "k8s.io/helm/pkg/repo"
) )
@ -45,7 +45,7 @@ type repoIndexOptions struct {
merge string merge string
} }
func newRepoIndexCmd(out io.Writer) *cobra.Command { func NewRepoIndexCmd(out io.Writer) *cobra.Command {
o := &repoIndexOptions{} o := &repoIndexOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"bytes" "bytes"
@ -31,16 +31,16 @@ func TestRepoIndexCmd(t *testing.T) {
dir := testTempDir(t) dir := testTempDir(t)
comp := filepath.Join(dir, "compressedchart-0.1.0.tgz") comp := filepath.Join(dir, "compressedchart-0.1.0.tgz")
if err := linkOrCopy("testdata/testcharts/compressedchart-0.1.0.tgz", comp); err != nil { if err := linkOrCopy("../../testdata/testcharts/compressedchart-0.1.0.tgz", comp); err != nil {
t.Fatal(err) t.Fatal(err)
} }
comp2 := filepath.Join(dir, "compressedchart-0.2.0.tgz") comp2 := filepath.Join(dir, "compressedchart-0.2.0.tgz")
if err := linkOrCopy("testdata/testcharts/compressedchart-0.2.0.tgz", comp2); err != nil { if err := linkOrCopy("../../testdata/testcharts/compressedchart-0.2.0.tgz", comp2); err != nil {
t.Fatal(err) t.Fatal(err)
} }
buf := bytes.NewBuffer(nil) buf := bytes.NewBuffer(nil)
c := newRepoIndexCmd(buf) c := NewRepoIndexCmd(buf)
if err := c.RunE(c, []string{dir}); err != nil { if err := c.RunE(c, []string{dir}); err != nil {
t.Error(err) t.Error(err)
@ -77,10 +77,10 @@ func TestRepoIndexCmd(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
// Add a new chart and a new version of an existing chart // Add a new chart and a new version of an existing chart
if err := linkOrCopy("testdata/testcharts/reqtest-0.1.0.tgz", filepath.Join(dir, "reqtest-0.1.0.tgz")); err != nil { if err := linkOrCopy("../../testdata/testcharts/reqtest-0.1.0.tgz", filepath.Join(dir, "reqtest-0.1.0.tgz")); err != nil {
t.Fatal(err) t.Fatal(err)
} }
if err := linkOrCopy("testdata/testcharts/compressedchart-0.3.0.tgz", filepath.Join(dir, "compressedchart-0.3.0.tgz")); err != nil { if err := linkOrCopy("../../testdata/testcharts/compressedchart-0.3.0.tgz", filepath.Join(dir, "compressedchart-0.3.0.tgz")); err != nil {
t.Fatal(err) t.Fatal(err)
} }

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -24,7 +24,7 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require" "k8s.io/helm/pkg/cli/require"
"k8s.io/helm/pkg/helmpath" "k8s.io/helm/pkg/helmpath"
"k8s.io/helm/pkg/repo" "k8s.io/helm/pkg/repo"
) )
@ -33,7 +33,7 @@ type repoListOptions struct {
home helmpath.Home home helmpath.Home
} }
func newRepoListCmd(out io.Writer) *cobra.Command { func NewRepoListCmd(out io.Writer) *cobra.Command {
o := &repoListOptions{} o := &repoListOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -24,7 +24,7 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require" "k8s.io/helm/pkg/cli/require"
"k8s.io/helm/pkg/helmpath" "k8s.io/helm/pkg/helmpath"
"k8s.io/helm/pkg/repo" "k8s.io/helm/pkg/repo"
) )
@ -34,7 +34,7 @@ type repoRemoveOptions struct {
home helmpath.Home home helmpath.Home
} }
func newRepoRemoveCmd(out io.Writer) *cobra.Command { func NewRepoRemoveCmd(out io.Writer) *cobra.Command {
o := &repoRemoveOptions{} o := &repoRemoveOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"bytes" "bytes"
@ -29,7 +29,7 @@ import (
func TestRepoRemove(t *testing.T) { func TestRepoRemove(t *testing.T) {
defer resetEnv()() defer resetEnv()()
ts, hh, err := repotest.NewTempServer("testdata/testserver/*.*") ts, hh, err := repotest.NewTempServer("../../testdata/testserver/*.*")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -24,7 +24,7 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require" "k8s.io/helm/pkg/cli/require"
"k8s.io/helm/pkg/getter" "k8s.io/helm/pkg/getter"
"k8s.io/helm/pkg/helmpath" "k8s.io/helm/pkg/helmpath"
"k8s.io/helm/pkg/repo" "k8s.io/helm/pkg/repo"
@ -45,7 +45,7 @@ type repoUpdateOptions struct {
home helmpath.Home home helmpath.Home
} }
func newRepoUpdateCmd(out io.Writer) *cobra.Command { func NewRepoUpdateCmd(out io.Writer) *cobra.Command {
o := &repoUpdateOptions{update: updateCharts} o := &repoUpdateOptions{update: updateCharts}
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"bytes" "bytes"
@ -59,7 +59,7 @@ func TestUpdateCmd(t *testing.T) {
func TestUpdateCharts(t *testing.T) { func TestUpdateCharts(t *testing.T) {
defer resetEnv()() defer resetEnv()()
ts, hh, err := repotest.NewTempServer("testdata/testserver/*.*") ts, hh, err := repotest.NewTempServer("../../testdata/testserver/*.*")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -22,8 +22,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
const rollbackDesc = ` const rollbackDesc = `
@ -34,7 +34,7 @@ second is a revision (version) number. To see revision numbers, run
'helm history RELEASE'. 'helm history RELEASE'.
` `
func newRollbackCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewRollbackCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewRollback(cfg) client := action.NewRollback(cfg)
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"testing" "testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"os" "os"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -26,7 +26,7 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/search" "k8s.io/helm/pkg/cli/search"
"k8s.io/helm/pkg/helmpath" "k8s.io/helm/pkg/helmpath"
"k8s.io/helm/pkg/repo" "k8s.io/helm/pkg/repo"
) )
@ -49,7 +49,7 @@ type searchOptions struct {
version string version string
} }
func newSearchCmd(out io.Writer) *cobra.Command { func NewSearchCmd(out io.Writer) *cobra.Command {
o := &searchOptions{} o := &searchOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"testing" "testing"
@ -24,7 +24,7 @@ func TestSearchCmd(t *testing.T) {
defer resetEnv()() defer resetEnv()()
setHome := func(cmd string) string { setHome := func(cmd string) string {
return cmd + " --home=testdata/helmhome" return cmd + " --home=../../testdata/helmhome"
} }
tests := []cmdTestCase{{ tests := []cmdTestCase{{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -22,8 +22,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
const showDesc = ` const showDesc = `
@ -48,7 +48,7 @@ This command inspects a chart (directory, file, or URL) and displays the content
of the README file of the README file
` `
func newShowCmd(out io.Writer) *cobra.Command { func NewShowCmd(out io.Writer) *cobra.Command {
client := action.NewShow(action.ShowAll) client := action.NewShow(action.ShowAll)
showCommand := &cobra.Command{ showCommand := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"encoding/json" "encoding/json"
@ -24,8 +24,8 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
var statusHelp = ` var statusHelp = `
@ -39,7 +39,7 @@ The status consists of:
- additional notes provided by the chart - additional notes provided by the chart
` `
func newStatusCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewStatusCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewStatus(cfg) client := action.NewStatus(cfg)
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"testing" "testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -25,8 +25,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/kubernetes/fake"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
"k8s.io/helm/pkg/kube" "k8s.io/helm/pkg/kube"
"k8s.io/helm/pkg/storage" "k8s.io/helm/pkg/storage"
"k8s.io/helm/pkg/storage/driver" "k8s.io/helm/pkg/storage/driver"
@ -45,7 +45,7 @@ To render just one template in a chart, use '-x':
$ helm template mychart -x templates/deployment.yaml $ helm template mychart -x templates/deployment.yaml
` `
func newTemplateCmd(out io.Writer) *cobra.Command { func NewTemplateCmd(out io.Writer) *cobra.Command {
customConfig := &action.Configuration{ customConfig := &action.Configuration{
// Add mock objects in here so it doesn't use Kube API server // Add mock objects in here so it doesn't use Kube API server
Releases: storage.Init(driver.NewMemory()), Releases: storage.Init(driver.NewMemory()),

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -22,7 +22,7 @@ import (
"testing" "testing"
) )
var chartPath = "./../../pkg/chartutil/testdata/subpop/charts/subchart1" var chartPath = "./../chartutil/testdata/subpop/charts/subchart1"
func TestTemplateCmd(t *testing.T) { func TestTemplateCmd(t *testing.T) {
tests := []cmdTestCase{ tests := []cmdTestCase{
@ -54,13 +54,13 @@ func TestTemplateCmd(t *testing.T) {
}, },
{ {
name: "check library chart", name: "check library chart",
cmd: fmt.Sprintf("template '%s'", "testdata/testcharts/lib-chart"), cmd: fmt.Sprintf("template '%s'", "../../testdata/testcharts/lib-chart"),
wantError: true, wantError: true,
golden: "output/template-lib-chart.txt", golden: "output/template-lib-chart.txt",
}, },
{ {
name: "check chart bad type", name: "check chart bad type",
cmd: fmt.Sprintf("template '%s'", "testdata/testcharts/chart-bad-type"), cmd: fmt.Sprintf("template '%s'", "../../testdata/testcharts/chart-bad-type"),
wantError: true, wantError: true,
golden: "output/install-chart-bad-type.txt", golden: "output/install-chart-bad-type.txt",
}, },

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -22,8 +22,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
const uninstallDesc = ` const uninstallDesc = `
@ -34,7 +34,7 @@ Use the '--dry-run' flag to see which releases will be uninstalled without actua
uninstalling them. uninstalling them.
` `
func newUninstallCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewUninstallCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewUninstall(cfg) client := action.NewUninstall(cfg)
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"testing" "testing"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -23,9 +23,9 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/chart/loader" "k8s.io/helm/pkg/chart/loader"
"k8s.io/helm/pkg/cli/require"
"k8s.io/helm/pkg/storage/driver" "k8s.io/helm/pkg/storage/driver"
) )
@ -54,7 +54,7 @@ set for a key called 'foo', the 'newbar' value would take precedence:
$ helm upgrade --set foo=bar --set foo=newbar redis ./redis $ helm upgrade --set foo=bar --set foo=newbar redis ./redis
` `
func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { func NewUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewUpgrade(cfg) client := action.NewUpgrade(cfg)
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -79,8 +79,8 @@ func TestUpgradeCmd(t *testing.T) {
t.Fatalf("Error loading updated chart: %v", err) t.Fatalf("Error loading updated chart: %v", err)
} }
missingDepsPath := "testdata/testcharts/chart-missing-deps" missingDepsPath := "../../testdata/testcharts/chart-missing-deps"
badDepsPath := "testdata/testcharts/chart-bad-requirements" badDepsPath := "../../testdata/testcharts/chart-bad-requirements"
relMock := func(n string, v int, ch *chart.Chart) *release.Release { relMock := func(n string, v int, ch *chart.Chart) *release.Release {
return release.Mock(&release.MockReleaseOptions{Name: n, Version: v, Chart: ch}) return release.Mock(&release.MockReleaseOptions{Name: n, Version: v, Chart: ch})

@ -13,15 +13,15 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"io" "io"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/pkg/action" "k8s.io/helm/pkg/action"
"k8s.io/helm/pkg/cli/require"
) )
const verifyDesc = ` const verifyDesc = `
@ -35,7 +35,7 @@ This command can be used to verify a local chart. Several other commands provide
the 'helm package --sign' command. the 'helm package --sign' command.
` `
func newVerifyCmd(out io.Writer) *cobra.Command { func NewVerifyCmd(out io.Writer) *cobra.Command {
client := action.NewVerify() client := action.NewVerify()
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -52,19 +52,19 @@ func TestVerifyCmd(t *testing.T) {
}, },
{ {
name: "verify requires that chart is not a directory", name: "verify requires that chart is not a directory",
cmd: "verify testdata/testcharts/signtest", cmd: "verify ../../testdata/testcharts/signtest",
expect: "unpacked charts cannot be verified", expect: "unpacked charts cannot be verified",
wantError: true, wantError: true,
}, },
{ {
name: "verify requires that chart has prov file", name: "verify requires that chart has prov file",
cmd: "verify testdata/testcharts/compressedchart-0.1.0.tgz", cmd: "verify ../../testdata/testcharts/compressedchart-0.1.0.tgz",
expect: fmt.Sprintf("could not load provenance file testdata/testcharts/compressedchart-0.1.0.tgz.prov: %s testdata/testcharts/compressedchart-0.1.0.tgz.prov: %s", statExe, statFileMsg), expect: fmt.Sprintf("could not load provenance file ../../testdata/testcharts/compressedchart-0.1.0.tgz.prov: %s ../../testdata/testcharts/compressedchart-0.1.0.tgz.prov: %s", statExe, statFileMsg),
wantError: true, wantError: true,
}, },
{ {
name: "verify validates a properly signed chart", name: "verify validates a properly signed chart",
cmd: "verify testdata/testcharts/signtest-0.1.0.tgz --keyring testdata/helm-test-key.pub", cmd: "verify ../../testdata/testcharts/signtest-0.1.0.tgz --keyring ../../testdata/helm-test-key.pub",
expect: "", expect: "",
wantError: false, wantError: false,
}, },

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"fmt" "fmt"
@ -23,8 +23,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/helm/cmd/helm/require"
"k8s.io/helm/internal/version" "k8s.io/helm/internal/version"
"k8s.io/helm/pkg/cli/require"
) )
const versionDesc = ` const versionDesc = `
@ -46,7 +46,7 @@ type versionOptions struct {
template string template string
} }
func newVersionCmd(out io.Writer) *cobra.Command { func NewVersionCmd(out io.Writer) *cobra.Command {
o := &versionOptions{} o := &versionOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package main package cli
import ( import (
"testing" "testing"

@ -25,7 +25,7 @@ import (
"path/filepath" "path/filepath"
"testing" "testing"
"k8s.io/helm/pkg/cli" "k8s.io/helm/pkg/cli/environment"
"k8s.io/helm/pkg/getter" "k8s.io/helm/pkg/getter"
"k8s.io/helm/pkg/helmpath" "k8s.io/helm/pkg/helmpath"
"k8s.io/helm/pkg/repo" "k8s.io/helm/pkg/repo"
@ -57,7 +57,7 @@ func TestResolveChartRef(t *testing.T) {
c := ChartDownloader{ c := ChartDownloader{
HelmHome: helmpath.Home("testdata/helmhome"), HelmHome: helmpath.Home("testdata/helmhome"),
Out: os.Stderr, Out: os.Stderr,
Getters: getter.All(cli.EnvSettings{}), Getters: getter.All(environment.Settings{}),
} }
for _, tt := range tests { for _, tt := range tests {
@ -94,7 +94,7 @@ func TestDownload(t *testing.T) {
})) }))
defer srv.Close() defer srv.Close()
provider, err := getter.ByScheme("http", cli.EnvSettings{}) provider, err := getter.ByScheme("http", environment.Settings{})
if err != nil { if err != nil {
t.Fatal("No http provider found") t.Fatal("No http provider found")
} }
@ -197,7 +197,7 @@ func TestDownloadTo(t *testing.T) {
Out: os.Stderr, Out: os.Stderr,
Verify: VerifyAlways, Verify: VerifyAlways,
Keyring: "testdata/helm-test-key.pub", Keyring: "testdata/helm-test-key.pub",
Getters: getter.All(cli.EnvSettings{}), Getters: getter.All(environment.Settings{}),
} }
cname := "/signtest-0.1.0.tgz" cname := "/signtest-0.1.0.tgz"
where, v, err := c.DownloadTo(srv.URL()+cname, "", dest) where, v, err := c.DownloadTo(srv.URL()+cname, "", dest)
@ -260,7 +260,7 @@ func TestDownloadTo_VerifyLater(t *testing.T) {
HelmHome: hh, HelmHome: hh,
Out: os.Stderr, Out: os.Stderr,
Verify: VerifyLater, Verify: VerifyLater,
Getters: getter.All(cli.EnvSettings{}), Getters: getter.All(environment.Settings{}),
} }
cname := "/signtest-0.1.0.tgz" cname := "/signtest-0.1.0.tgz"
where, _, err := c.DownloadTo(srv.URL()+cname, "", dest) where, _, err := c.DownloadTo(srv.URL()+cname, "", dest)
@ -289,7 +289,7 @@ func TestScanReposForURL(t *testing.T) {
HelmHome: hh, HelmHome: hh,
Out: os.Stderr, Out: os.Stderr,
Verify: VerifyLater, Verify: VerifyLater,
Getters: getter.All(cli.EnvSettings{}), Getters: getter.All(environment.Settings{}),
} }
u := "http://example.com/alpine-0.2.0.tgz" u := "http://example.com/alpine-0.2.0.tgz"

@ -21,7 +21,7 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"k8s.io/helm/pkg/cli" "k8s.io/helm/pkg/cli/environment"
) )
// Getter is an interface to support GET to the specified URL. // Getter is an interface to support GET to the specified URL.
@ -71,7 +71,7 @@ func (p Providers) ByScheme(scheme string) (Constructor, error) {
// All finds all of the registered getters as a list of Provider instances. // All finds all of the registered getters as a list of Provider instances.
// Currently the build-in http/https getter and the discovered // Currently the build-in http/https getter and the discovered
// plugins with downloader notations are collected. // plugins with downloader notations are collected.
func All(settings cli.EnvSettings) Providers { func All(settings environment.Settings) Providers {
result := Providers{ result := Providers{
{ {
Schemes: []string{"http", "https"}, Schemes: []string{"http", "https"},
@ -86,7 +86,7 @@ func All(settings cli.EnvSettings) Providers {
// ByScheme returns a getter for the given scheme. // ByScheme returns a getter for the given scheme.
// //
// If the scheme is not supported, this will return an error. // If the scheme is not supported, this will return an error.
func ByScheme(scheme string, settings cli.EnvSettings) (Provider, error) { func ByScheme(scheme string, settings environment.Settings) (Provider, error) {
// Q: What do you call a scheme string who's the boss? // Q: What do you call a scheme string who's the boss?
// A: Bruce Schemestring, of course. // A: Bruce Schemestring, of course.
a := All(settings) a := All(settings)

@ -23,13 +23,13 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"k8s.io/helm/pkg/cli" "k8s.io/helm/pkg/cli/environment"
"k8s.io/helm/pkg/plugin" "k8s.io/helm/pkg/plugin"
) )
// collectPlugins scans for getter plugins. // collectPlugins scans for getter plugins.
// This will load plugins according to the cli. // This will load plugins according to the cli.
func collectPlugins(settings cli.EnvSettings) (Providers, error) { func collectPlugins(settings environment.Settings) (Providers, error) {
plugins, err := plugin.FindPlugins(settings.PluginDirs()) plugins, err := plugin.FindPlugins(settings.PluginDirs())
if err != nil { if err != nil {
return nil, err return nil, err
@ -56,7 +56,7 @@ func collectPlugins(settings cli.EnvSettings) (Providers, error) {
type pluginGetter struct { type pluginGetter struct {
command string command string
certFile, keyFile, cAFile string certFile, keyFile, cAFile string
settings cli.EnvSettings settings environment.Settings
name string name string
base string base string
} }
@ -81,7 +81,7 @@ func (p *pluginGetter) Get(href string) (*bytes.Buffer, error) {
} }
// newPluginGetter constructs a valid plugin getter // newPluginGetter constructs a valid plugin getter
func newPluginGetter(command string, settings cli.EnvSettings, name, base string) Constructor { func newPluginGetter(command string, settings environment.Settings, name, base string) Constructor {
return func(URL, CertFile, KeyFile, CAFile string) (Getter, error) { return func(URL, CertFile, KeyFile, CAFile string) (Getter, error) {
result := &pluginGetter{ result := &pluginGetter{
command: command, command: command,

@ -22,17 +22,17 @@ import (
"strings" "strings"
"testing" "testing"
"k8s.io/helm/pkg/cli" "k8s.io/helm/pkg/cli/environment"
"k8s.io/helm/pkg/helmpath" "k8s.io/helm/pkg/helmpath"
) )
func hh(debug bool) cli.EnvSettings { func hh(debug bool) environment.Settings {
apath, err := filepath.Abs("./testdata") apath, err := filepath.Abs("./testdata")
if err != nil { if err != nil {
panic(err) panic(err)
} }
hp := helmpath.Home(apath) hp := helmpath.Home(apath)
return cli.EnvSettings{ return environment.Settings{
Home: hp, Home: hp,
Debug: debug, Debug: debug,
} }

@ -27,7 +27,7 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"k8s.io/helm/pkg/cli" "k8s.io/helm/pkg/cli/environment"
"k8s.io/helm/pkg/getter" "k8s.io/helm/pkg/getter"
"k8s.io/helm/pkg/helmpath" "k8s.io/helm/pkg/helmpath"
"k8s.io/helm/pkg/plugin/cache" "k8s.io/helm/pkg/plugin/cache"
@ -79,7 +79,7 @@ func NewHTTPInstaller(source string, home helmpath.Home) (*HTTPInstaller, error)
return nil, err return nil, err
} }
getConstructor, err := getter.ByScheme("http", cli.EnvSettings{}) getConstructor, err := getter.ByScheme("http", environment.Settings{})
if err != nil { if err != nil {
return nil, err return nil, err
} }

@ -25,7 +25,7 @@ import (
"github.com/ghodss/yaml" "github.com/ghodss/yaml"
helm_env "k8s.io/helm/pkg/cli" "k8s.io/helm/pkg/cli/environment"
) )
const pluginFileName = "plugin.yaml" const pluginFileName = "plugin.yaml"
@ -214,7 +214,7 @@ func FindPlugins(plugdirs string) ([]*Plugin, error) {
// SetupPluginEnv prepares os.Env for plugins. It operates on os.Env because // SetupPluginEnv prepares os.Env for plugins. It operates on os.Env because
// the plugin subsystem itself needs access to the environment variables // the plugin subsystem itself needs access to the environment variables
// created here. // created here.
func SetupPluginEnv(settings helm_env.EnvSettings, func SetupPluginEnv(settings environment.Settings,
shortName, base string) { shortName, base string) {
for key, val := range map[string]string{ for key, val := range map[string]string{
"HELM_PLUGIN_NAME": shortName, "HELM_PLUGIN_NAME": shortName,

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save