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
c4b2926c
Commit
c4b2926c
authored
Apr 20, 2016
by
Matt Butcher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(*): fix misc style issues
parent
33a85a3a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
20 deletions
+25
-20
home.go
cmd/helm/home.go
+2
-2
init.go
cmd/helm/init.go
+12
-12
tiller.go
cmd/tiller/tiller.go
+1
-1
values.go
pkg/chart/values.go
+2
-0
memory.go
pkg/storage/memory.go
+8
-5
No files found.
cmd/helm/home.go
View file @
c4b2926c
...
...
@@ -15,13 +15,13 @@ var homeCommand = &cobra.Command{
Use
:
"home"
,
Short
:
"Displays the location of HELM_HOME"
,
Long
:
longHomeHelp
,
Run
:
H
ome
,
Run
:
h
ome
,
}
func
init
()
{
RootCommand
.
AddCommand
(
homeCommand
)
}
func
H
ome
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
func
h
ome
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
cmd
.
Printf
(
os
.
ExpandEnv
(
helmHome
)
+
"
\n
"
)
}
cmd/helm/init.go
View file @
c4b2926c
...
...
@@ -32,16 +32,16 @@ var initCmd = &cobra.Command{
Use
:
"init"
,
Short
:
"Initialize Helm on both client and server."
,
Long
:
installDesc
,
RunE
:
R
unInit
,
RunE
:
r
unInit
,
}
//
R
unInit initializes local config and installs tiller to Kubernetes Cluster
func
R
unInit
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
//
r
unInit initializes local config and installs tiller to Kubernetes Cluster
func
r
unInit
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
if
len
(
args
)
!=
0
{
return
errors
.
New
(
"This command does not accept arguments.
\n
"
)
}
if
err
:=
E
nsureHome
(
os
.
ExpandEnv
(
helmHome
));
err
!=
nil
{
if
err
:=
e
nsureHome
(
os
.
ExpandEnv
(
helmHome
));
err
!=
nil
{
return
err
}
...
...
@@ -75,11 +75,11 @@ func buildKubectlRunner(kubectlPath string) kubectl.Runner {
return
&
kubectl
.
RealRunner
{}
}
//
E
nsureHome checks to see if $HELM_HOME exists
//
e
nsureHome checks to see if $HELM_HOME exists
//
// If $HELM_HOME does not exist, this function will create it.
func
E
nsureHome
(
home
string
)
error
{
configDirectories
:=
[]
string
{
home
,
C
acheDirectory
(
home
)}
func
e
nsureHome
(
home
string
)
error
{
configDirectories
:=
[]
string
{
home
,
c
acheDirectory
(
home
)}
for
_
,
p
:=
range
configDirectories
{
if
fi
,
err
:=
os
.
Stat
(
p
);
err
!=
nil
{
...
...
@@ -88,26 +88,26 @@ func EnsureHome(home string) error {
return
fmt
.
Errorf
(
"Could not create %s: %s"
,
p
,
err
)
}
}
else
if
!
fi
.
IsDir
()
{
return
fmt
.
Errorf
(
"%s must be a directory
.
"
,
p
)
return
fmt
.
Errorf
(
"%s must be a directory"
,
p
)
}
}
repoPath
:=
R
epositoriesFile
(
home
)
repoPath
:=
r
epositoriesFile
(
home
)
if
fi
,
err
:=
os
.
Stat
(
repoPath
);
err
!=
nil
{
fmt
.
Printf
(
"Creating %s
\n
"
,
repoPath
)
if
err
:=
ioutil
.
WriteFile
(
repoPath
,
[]
byte
(
"test-charts: https://www.googleapis.com/storage/v1/b/test-charts/o
\n
"
),
0644
);
err
!=
nil
{
return
err
}
}
else
if
fi
.
IsDir
()
{
return
fmt
.
Errorf
(
"%s must be a file, not a directory
.
"
,
repoPath
)
return
fmt
.
Errorf
(
"%s must be a file, not a directory"
,
repoPath
)
}
return
nil
}
func
C
acheDirectory
(
home
string
)
string
{
func
c
acheDirectory
(
home
string
)
string
{
return
filepath
.
Join
(
home
,
cachePath
)
}
func
R
epositoriesFile
(
home
string
)
string
{
func
r
epositoriesFile
(
home
string
)
string
{
return
filepath
.
Join
(
home
,
repositoriesPath
)
}
cmd/tiller/tiller.go
View file @
c4b2926c
...
...
@@ -13,7 +13,7 @@ import (
// rootServer is the root gRPC server.
//
// Each gRPC service registers itself to this server during init().
var
rootServer
*
grpc
.
Server
=
grpc
.
NewServer
()
var
rootServer
=
grpc
.
NewServer
()
var
env
=
environment
.
New
()
const
globalUsage
=
`The Kubernetes Helm server.
...
...
pkg/chart/values.go
View file @
c4b2926c
...
...
@@ -8,8 +8,10 @@ import (
"github.com/BurntSushi/toml"
)
// ErrNoTable indicates that a chart does not have a matching table.
var
ErrNoTable
=
errors
.
New
(
"no table"
)
// Values represents a collection of chart values.
type
Values
map
[
string
]
interface
{}
// Table gets a table (TOML subsection) from a Values object.
...
...
pkg/storage/memory.go
View file @
c4b2926c
...
...
@@ -11,12 +11,14 @@ type Memory struct {
releases
map
[
string
]
*
release
.
Release
}
// NewMemory creates a new in-memory storage.
func
NewMemory
()
*
Memory
{
return
&
Memory
{
releases
:
map
[
string
]
*
release
.
Release
{},
}
}
// ErrNotFound indicates that a release is not found.
var
ErrNotFound
=
errors
.
New
(
"release not found"
)
// Read returns the named Release.
...
...
@@ -36,12 +38,10 @@ func (m *Memory) Create(rel *release.Release) error {
return
nil
}
var
ErrNoRelease
=
errors
.
New
(
"no release found"
)
// Update sets a release.
func
(
m
*
Memory
)
Update
(
rel
*
release
.
Release
)
error
{
if
_
,
ok
:=
m
.
releases
[
rel
.
Name
];
!
ok
{
return
ErrNo
Release
return
ErrNo
tFound
}
// FIXME: When Release is done, we need to do this right by marking the old
...
...
@@ -50,16 +50,17 @@ func (m *Memory) Update(rel *release.Release) error {
return
nil
}
// Delete removes a release.
func
(
m
*
Memory
)
Delete
(
name
string
)
(
*
release
.
Release
,
error
)
{
rel
,
ok
:=
m
.
releases
[
name
]
if
!
ok
{
return
nil
,
ErrNo
Release
return
nil
,
ErrNo
tFound
}
delete
(
m
.
releases
,
name
)
return
rel
,
nil
}
// List returns all releases
// List returns all releases
.
func
(
m
*
Memory
)
List
()
([]
*
release
.
Release
,
error
)
{
buf
:=
make
([]
*
release
.
Release
,
len
(
m
.
releases
))
i
:=
0
...
...
@@ -69,6 +70,8 @@ func (m *Memory) List() ([]*release.Release, error) {
}
return
buf
,
nil
}
// Query searches all releases for matches.
func
(
m
*
Memory
)
Query
(
labels
map
[
string
]
string
)
([]
*
release
.
Release
,
error
)
{
return
[]
*
release
.
Release
{},
errors
.
New
(
"Cannot implement until release.Release is defined."
)
}
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