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
b671077d
Unverified
Commit
b671077d
authored
Jun 08, 2017
by
Adam Reese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ref(helm): mix bag of syntax cleanup in cmd/helm
parent
9f9b3e87
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
17 additions
and
18 deletions
+17
-18
dependency.go
cmd/helm/dependency.go
+2
-2
install.go
cmd/helm/install.go
+2
-2
package.go
cmd/helm/package.go
+3
-3
plugin.go
cmd/helm/plugin.go
+1
-2
plugin_install.go
cmd/helm/plugin_install.go
+1
-1
plugin_remove.go
cmd/helm/plugin_remove.go
+3
-3
plugin_update.go
cmd/helm/plugin_update.go
+1
-1
serve.go
cmd/helm/serve.go
+2
-2
status_test.go
cmd/helm/status_test.go
+1
-1
upgrade.go
cmd/helm/upgrade.go
+1
-1
No files found.
cmd/helm/dependency.go
View file @
b671077d
...
...
@@ -150,7 +150,7 @@ func (l *dependencyListCmd) run() error {
l
.
printRequirements
(
r
,
l
.
out
)
fmt
.
Fprintln
(
l
.
out
)
l
.
printMissing
(
r
,
l
.
out
)
l
.
printMissing
(
r
)
return
nil
}
...
...
@@ -240,7 +240,7 @@ func (l *dependencyListCmd) printRequirements(reqs *chartutil.Requirements, out
}
// printMissing prints warnings about charts that are present on disk, but are not in the requirements.
func
(
l
*
dependencyListCmd
)
printMissing
(
reqs
*
chartutil
.
Requirements
,
out
io
.
Writer
)
{
func
(
l
*
dependencyListCmd
)
printMissing
(
reqs
*
chartutil
.
Requirements
)
{
folder
:=
filepath
.
Join
(
l
.
chartpath
,
"charts/*"
)
files
,
err
:=
filepath
.
Glob
(
folder
)
if
err
!=
nil
{
...
...
cmd/helm/install.go
View file @
b671077d
...
...
@@ -229,7 +229,7 @@ func (i *installCmd) run() error {
// If checkDependencies returns an error, we have unfullfilled dependencies.
// As of Helm 2.4.0, this is treated as a stopping condition:
// https://github.com/kubernetes/helm/issues/2209
if
err
:=
checkDependencies
(
chartRequested
,
req
,
i
.
out
);
err
!=
nil
{
if
err
:=
checkDependencies
(
chartRequested
,
req
);
err
!=
nil
{
return
prettyError
(
err
)
}
}
else
if
err
!=
chartutil
.
ErrRequirementsNotFound
{
...
...
@@ -434,7 +434,7 @@ func defaultNamespace() string {
return
"default"
}
func
checkDependencies
(
ch
*
chart
.
Chart
,
reqs
*
chartutil
.
Requirements
,
out
io
.
Writer
)
error
{
func
checkDependencies
(
ch
*
chart
.
Chart
,
reqs
*
chartutil
.
Requirements
)
error
{
missing
:=
[]
string
{}
deps
:=
ch
.
GetDependencies
()
...
...
cmd/helm/package.go
View file @
b671077d
...
...
@@ -87,7 +87,7 @@ func newPackageCmd(out io.Writer) *cobra.Command {
}
for
i
:=
0
;
i
<
len
(
args
);
i
++
{
pkg
.
path
=
args
[
i
]
if
err
:=
pkg
.
run
(
cmd
,
args
);
err
!=
nil
{
if
err
:=
pkg
.
run
();
err
!=
nil
{
return
err
}
}
...
...
@@ -107,7 +107,7 @@ func newPackageCmd(out io.Writer) *cobra.Command {
return
cmd
}
func
(
p
*
packageCmd
)
run
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
func
(
p
*
packageCmd
)
run
()
error
{
path
,
err
:=
filepath
.
Abs
(
p
.
path
)
if
err
!=
nil
{
return
err
...
...
@@ -146,7 +146,7 @@ func (p *packageCmd) run(cmd *cobra.Command, args []string) error {
}
if
reqs
,
err
:=
chartutil
.
LoadRequirements
(
ch
);
err
==
nil
{
if
err
:=
checkDependencies
(
ch
,
reqs
,
p
.
out
);
err
!=
nil
{
if
err
:=
checkDependencies
(
ch
,
reqs
);
err
!=
nil
{
return
err
}
}
else
{
...
...
cmd/helm/plugin.go
View file @
b671077d
...
...
@@ -21,7 +21,6 @@ import (
"os"
"os/exec"
"k8s.io/helm/pkg/helm/helmpath"
"k8s.io/helm/pkg/plugin"
"github.com/spf13/cobra"
...
...
@@ -47,7 +46,7 @@ func newPluginCmd(out io.Writer) *cobra.Command {
}
// runHook will execute a plugin hook.
func
runHook
(
p
*
plugin
.
Plugin
,
event
string
,
home
helmpath
.
Home
)
error
{
func
runHook
(
p
*
plugin
.
Plugin
,
event
string
)
error
{
hook
:=
p
.
Metadata
.
Hooks
.
Get
(
event
)
if
hook
==
""
{
return
nil
...
...
cmd/helm/plugin_install.go
View file @
b671077d
...
...
@@ -75,7 +75,7 @@ func (pcmd *pluginInstallCmd) run() error {
return
err
}
if
err
:=
runHook
(
p
,
plugin
.
Install
,
pcmd
.
home
);
err
!=
nil
{
if
err
:=
runHook
(
p
,
plugin
.
Install
);
err
!=
nil
{
return
err
}
...
...
cmd/helm/plugin_remove.go
View file @
b671077d
...
...
@@ -67,7 +67,7 @@ func (pcmd *pluginRemoveCmd) run() error {
var
errorPlugins
[]
string
for
_
,
name
:=
range
pcmd
.
names
{
if
found
:=
findPlugin
(
plugins
,
name
);
found
!=
nil
{
if
err
:=
removePlugin
(
found
,
pcmd
.
home
);
err
!=
nil
{
if
err
:=
removePlugin
(
found
);
err
!=
nil
{
errorPlugins
=
append
(
errorPlugins
,
fmt
.
Sprintf
(
"Failed to remove plugin %s, got error (%v)"
,
name
,
err
))
}
else
{
fmt
.
Fprintf
(
pcmd
.
out
,
"Removed plugin: %s
\n
"
,
name
)
...
...
@@ -82,11 +82,11 @@ func (pcmd *pluginRemoveCmd) run() error {
return
nil
}
func
removePlugin
(
p
*
plugin
.
Plugin
,
home
helmpath
.
Home
)
error
{
func
removePlugin
(
p
*
plugin
.
Plugin
)
error
{
if
err
:=
os
.
Remove
(
p
.
Dir
);
err
!=
nil
{
return
err
}
return
runHook
(
p
,
plugin
.
Delete
,
home
)
return
runHook
(
p
,
plugin
.
Delete
)
}
func
findPlugin
(
plugins
[]
*
plugin
.
Plugin
,
name
string
)
*
plugin
.
Plugin
{
...
...
cmd/helm/plugin_update.go
View file @
b671077d
...
...
@@ -109,5 +109,5 @@ func updatePlugin(p *plugin.Plugin, home helmpath.Home) error {
return
err
}
return
runHook
(
updatedPlugin
,
plugin
.
Update
,
home
)
return
runHook
(
updatedPlugin
,
plugin
.
Update
)
}
cmd/helm/serve.go
View file @
b671077d
...
...
@@ -56,7 +56,7 @@ func newServeCmd(out io.Writer) *cobra.Command {
Short
:
"start a local http web server"
,
Long
:
serveDesc
,
PreRunE
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
return
srv
.
complete
(
args
)
return
srv
.
complete
()
},
RunE
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
return
srv
.
run
()
...
...
@@ -71,7 +71,7 @@ func newServeCmd(out io.Writer) *cobra.Command {
return
cmd
}
func
(
s
*
serveCmd
)
complete
(
args
[]
string
)
error
{
func
(
s
*
serveCmd
)
complete
()
error
{
if
s
.
repoPath
==
""
{
s
.
repoPath
=
settings
.
Home
.
LocalRepository
()
}
...
...
cmd/helm/status_test.go
View file @
b671077d
...
...
@@ -78,7 +78,7 @@ func TestStatusCmd(t *testing.T) {
args
:
[]
string
{
"flummoxed-chickadee"
},
expected
:
outputWithStatus
(
fmt
.
Sprintf
(
"DEPLOYED
\n\n
TEST SUITE:
\n
Last Started: %s
\n
Last Completed: %s
\n\n
"
,
dateString
,
dateString
)
+
fmt
.
Sprint
(
"TEST
\t
STATUS
\t
INFO
\t
STARTED
\t
COMPLETED
\n
"
)
+
"TEST
\t
STATUS
\t
INFO
\t
STARTED
\t
COMPLETED
\n
"
+
fmt
.
Sprintf
(
"test run 1
\t
SUCCESS
\t
extra info
\t
%s
\t
%s
\n
"
,
dateString
,
dateString
)
+
fmt
.
Sprintf
(
"test run 2
\t
FAILURE
\t
\t
%s
\t
%s
\n
"
,
dateString
,
dateString
)),
rel
:
releaseMockWithStatus
(
&
release
.
Status
{
...
...
cmd/helm/upgrade.go
View file @
b671077d
...
...
@@ -184,7 +184,7 @@ func (u *upgradeCmd) run() error {
// Check chart requirements to make sure all dependencies are present in /charts
if
ch
,
err
:=
chartutil
.
Load
(
chartPath
);
err
==
nil
{
if
req
,
err
:=
chartutil
.
LoadRequirements
(
ch
);
err
==
nil
{
if
err
:=
checkDependencies
(
ch
,
req
,
u
.
out
);
err
!=
nil
{
if
err
:=
checkDependencies
(
ch
,
req
);
err
!=
nil
{
return
err
}
}
else
if
err
!=
chartutil
.
ErrRequirementsNotFound
{
...
...
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