Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
50eee836
Unverified
Commit
50eee836
authored
Apr 20, 2017
by
Adam Reese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ref(helm): use new debug method to standardize debug output
parent
5af676cd
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
28 additions
and
43 deletions
+28
-43
dependency_update.go
cmd/helm/dependency_update.go
+1
-1
helm.go
cmd/helm/helm.go
+4
-7
home.go
cmd/helm/home.go
+1
-1
init.go
cmd/helm/init.go
+1
-1
init_test.go
cmd/helm/init_test.go
+3
-3
install.go
cmd/helm/install.go
+5
-9
package.go
cmd/helm/package.go
+5
-10
plugin_install.go
cmd/helm/plugin_install.go
+1
-1
plugin_test.go
cmd/helm/plugin_test.go
+2
-2
printer.go
cmd/helm/printer.go
+1
-1
upgrade.go
cmd/helm/upgrade.go
+1
-1
version.go
cmd/helm/version.go
+1
-4
environment.go
pkg/helm/environment/environment.go
+1
-1
plugin.go
pkg/plugin/plugin.go
+1
-1
No files found.
cmd/helm/dependency_update.go
View file @
50eee836
...
...
@@ -100,7 +100,7 @@ func (d *dependencyUpdateCmd) run() error {
if
d
.
verify
{
man
.
Verify
=
downloader
.
VerifyIfPossible
}
if
settings
.
Flag
Debug
{
if
settings
.
Debug
{
man
.
Debug
=
true
}
return
man
.
Update
()
...
...
cmd/helm/helm.go
View file @
50eee836
...
...
@@ -105,7 +105,7 @@ func newRootCmd(out io.Writer) *cobra.Command {
settings
.
Home
=
helmpath
.
Home
(
helmHomeTemp
)
p
.
StringVar
(
&
settings
.
TillerHost
,
"host"
,
helm_env
.
DefaultHelmHost
(),
"address of tiller. Overrides $HELM_HOST"
)
p
.
StringVar
(
&
kubeContext
,
"kube-context"
,
""
,
"name of the kubeconfig context to use"
)
p
.
BoolVar
(
&
settings
.
Flag
Debug
,
"debug"
,
false
,
"enable verbose output"
)
p
.
BoolVar
(
&
settings
.
Debug
,
"debug"
,
false
,
"enable verbose output"
)
p
.
StringVar
(
&
settings
.
TillerNamespace
,
"tiller-namespace"
,
tiller_env
.
GetTillerNamespace
(),
"namespace of tiller"
)
if
os
.
Getenv
(
helm_env
.
PluginDisableEnvVar
)
!=
"1"
{
...
...
@@ -190,15 +190,12 @@ func setupConnection(c *cobra.Command, args []string) error {
}
settings
.
TillerHost
=
fmt
.
Sprintf
(
"localhost:%d"
,
tunnel
.
Local
)
if
settings
.
FlagDebug
{
fmt
.
Printf
(
"Created tunnel using local port: '%d'
\n
"
,
tunnel
.
Local
)
}
debug
(
"Created tunnel using local port: '%d'
\n
"
,
tunnel
.
Local
)
}
// Set up the gRPC config.
if
settings
.
FlagDebug
{
fmt
.
Printf
(
"SERVER: %q
\n
"
,
settings
.
TillerHost
)
}
debug
(
"SERVER: %q
\n
"
,
settings
.
TillerHost
)
// Plugin support.
return
nil
}
...
...
cmd/helm/home.go
View file @
50eee836
...
...
@@ -36,7 +36,7 @@ func newHomeCmd(out io.Writer) *cobra.Command {
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
h
:=
settings
.
Home
fmt
.
Fprintf
(
out
,
"%s
\n
"
,
h
)
if
settings
.
Flag
Debug
{
if
settings
.
Debug
{
fmt
.
Fprintf
(
out
,
"Repository: %s
\n
"
,
h
.
Repository
())
fmt
.
Fprintf
(
out
,
"RepositoryFile: %s
\n
"
,
h
.
RepositoryFile
())
fmt
.
Fprintf
(
out
,
"Cache: %s
\n
"
,
h
.
Cache
())
...
...
cmd/helm/init.go
View file @
50eee836
...
...
@@ -155,7 +155,7 @@ func (i *initCmd) run() error {
i
.
opts
.
UseCanary
=
i
.
canary
i
.
opts
.
ImageSpec
=
i
.
image
if
settings
.
Flag
Debug
{
if
settings
.
Debug
{
writeYAMLManifest
:=
func
(
apiVersion
,
kind
,
body
string
,
first
,
last
bool
)
error
{
w
:=
i
.
out
if
!
first
{
...
...
cmd/helm/init_test.go
View file @
50eee836
...
...
@@ -140,11 +140,11 @@ func TestInitCmd_dryRun(t *testing.T) {
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
dbg
:=
settings
.
Flag
Debug
settings
.
Flag
Debug
=
true
dbg
:=
settings
.
Debug
settings
.
Debug
=
true
defer
func
()
{
os
.
Remove
(
home
)
settings
.
Flag
Debug
=
dbg
settings
.
Debug
=
dbg
}()
var
buf
bytes
.
Buffer
...
...
cmd/helm/install.go
View file @
50eee836
...
...
@@ -178,9 +178,7 @@ func newInstallCmd(c helm.Interface, out io.Writer) *cobra.Command {
}
func
(
i
*
installCmd
)
run
()
error
{
if
settings
.
FlagDebug
{
fmt
.
Fprintf
(
i
.
out
,
"CHART PATH: %s
\n
"
,
i
.
chartPath
)
}
debug
(
"CHART PATH: %s
\n
"
,
i
.
chartPath
)
if
i
.
namespace
==
""
{
i
.
namespace
=
defaultNamespace
()
...
...
@@ -305,14 +303,14 @@ func (i *installCmd) vals() ([]byte, error) {
return
yaml
.
Marshal
(
base
)
}
// printRelease prints info about a release if the
flag
Debug is true.
// printRelease prints info about a release if the Debug is true.
func
(
i
*
installCmd
)
printRelease
(
rel
*
release
.
Release
)
{
if
rel
==
nil
{
return
}
// TODO: Switch to text/template like everything else.
fmt
.
Fprintf
(
i
.
out
,
"NAME: %s
\n
"
,
rel
.
Name
)
if
settings
.
Flag
Debug
{
if
settings
.
Debug
{
printRelease
(
i
.
out
,
rel
)
}
}
...
...
@@ -371,11 +369,9 @@ func locateChartPath(name, version string, verify bool, keyring string) (string,
if
err
!=
nil
{
return
filename
,
err
}
if
settings
.
FlagDebug
{
fmt
.
Printf
(
"Fetched %s to %s
\n
"
,
name
,
filename
)
}
debug
(
"Fetched %s to %s
\n
"
,
name
,
filename
)
return
lname
,
nil
}
else
if
settings
.
Flag
Debug
{
}
else
if
settings
.
Debug
{
return
filename
,
err
}
...
...
cmd/helm/package.go
View file @
50eee836
...
...
@@ -119,9 +119,7 @@ func (p *packageCmd) run(cmd *cobra.Command, args []string) error {
if
err
:=
setVersion
(
ch
,
p
.
version
);
err
!=
nil
{
return
err
}
if
settings
.
FlagDebug
{
fmt
.
Fprintf
(
p
.
out
,
"Setting version to %s"
,
p
.
version
)
}
debug
(
"Setting version to %s"
,
p
.
version
)
}
if
filepath
.
Base
(
path
)
!=
ch
.
Metadata
.
Name
{
...
...
@@ -145,8 +143,8 @@ func (p *packageCmd) run(cmd *cobra.Command, args []string) error {
}
name
,
err
:=
chartutil
.
Save
(
ch
,
dest
)
if
err
==
nil
&&
settings
.
FlagDebug
{
fmt
.
Fprintf
(
p
.
out
,
"Saved %s to current directory
\n
"
,
name
)
if
err
==
nil
{
debug
(
"Saved %s to current directory
\n
"
,
name
)
}
// Save to $HELM_HOME/local directory. This is second, because we don't want
...
...
@@ -155,9 +153,8 @@ func (p *packageCmd) run(cmd *cobra.Command, args []string) error {
lr
:=
p
.
home
.
LocalRepository
()
if
err
:=
repo
.
AddChartToLocalRepo
(
ch
,
lr
);
err
!=
nil
{
return
err
}
else
if
settings
.
FlagDebug
{
fmt
.
Fprintf
(
p
.
out
,
"Saved %s to %s
\n
"
,
name
,
lr
)
}
debug
(
"Saved %s to %s
\n
"
,
name
,
lr
)
}
if
p
.
sign
{
...
...
@@ -194,9 +191,7 @@ func (p *packageCmd) clearsign(filename string) error {
return
err
}
if
settings
.
FlagDebug
{
fmt
.
Fprintln
(
p
.
out
,
sig
)
}
debug
(
sig
)
return
ioutil
.
WriteFile
(
filename
+
".prov"
,
[]
byte
(
sig
),
0755
)
}
...
...
cmd/helm/plugin_install.go
View file @
50eee836
...
...
@@ -59,7 +59,7 @@ func (pcmd *pluginInstallCmd) complete(args []string) error {
}
func
(
pcmd
*
pluginInstallCmd
)
run
()
error
{
installer
.
Debug
=
settings
.
Flag
Debug
installer
.
Debug
=
settings
.
Debug
i
,
err
:=
installer
.
NewForSource
(
pcmd
.
source
,
pcmd
.
version
,
pcmd
.
home
)
if
err
!=
nil
{
...
...
cmd/helm/plugin_test.go
View file @
50eee836
...
...
@@ -162,9 +162,9 @@ func TestSetupEnv(t *testing.T) {
settings
.
Home
=
helmpath
.
Home
(
"testdata/helmhome"
)
base
:=
filepath
.
Join
(
settings
.
Home
.
Plugins
(),
name
)
settings
.
PlugDirs
=
settings
.
Home
.
Plugins
()
settings
.
Flag
Debug
=
true
settings
.
Debug
=
true
defer
func
()
{
settings
.
Flag
Debug
=
false
settings
.
Debug
=
false
}()
plugin
.
SetupPluginEnv
(
settings
,
name
,
base
)
...
...
cmd/helm/printer.go
View file @
50eee836
...
...
@@ -75,7 +75,7 @@ func tpl(t string, vals map[string]interface{}, out io.Writer) error {
}
func
debug
(
format
string
,
args
...
interface
{})
{
if
settings
.
Flag
Debug
{
if
settings
.
Debug
{
format
=
fmt
.
Sprintf
(
"[debug] %s
\n
"
,
format
)
fmt
.
Printf
(
format
,
args
...
)
}
...
...
cmd/helm/upgrade.go
View file @
50eee836
...
...
@@ -185,7 +185,7 @@ func (u *upgradeCmd) run() error {
return
fmt
.
Errorf
(
"UPGRADE FAILED: %v"
,
prettyError
(
err
))
}
if
settings
.
Flag
Debug
{
if
settings
.
Debug
{
printRelease
(
u
.
out
,
resp
.
Release
)
}
...
...
cmd/helm/version.go
View file @
50eee836
...
...
@@ -20,7 +20,6 @@ import (
"errors"
"fmt"
"io"
"os"
"github.com/spf13/cobra"
"google.golang.org/grpc"
...
...
@@ -105,9 +104,7 @@ func (v *versionCmd) run() error {
if
grpc
.
Code
(
err
)
==
codes
.
Unimplemented
{
return
errors
.
New
(
"server is too old to know its version"
)
}
if
settings
.
FlagDebug
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
}
debug
(
"%s"
,
err
)
return
errors
.
New
(
"cannot connect to Tiller"
)
}
fmt
.
Fprintf
(
v
.
out
,
"Server: %s
\n
"
,
formatVersion
(
resp
.
Version
,
v
.
short
))
...
...
pkg/helm/environment/environment.go
View file @
50eee836
...
...
@@ -52,5 +52,5 @@ type EnvSettings struct {
TillerNamespace
string
Home
helmpath
.
Home
PlugDirs
string
FlagDebug
bool
Debug
bool
}
pkg/plugin/plugin.go
View file @
50eee836
...
...
@@ -195,7 +195,7 @@ func SetupPluginEnv(settings helm_env.EnvSettings,
os
.
Setenv
(
key
,
val
)
}
if
settings
.
Flag
Debug
{
if
settings
.
Debug
{
os
.
Setenv
(
"HELM_DEBUG"
,
"1"
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment