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
2c7aad5f
Commit
2c7aad5f
authored
Jan 27, 2016
by
vaikas-google
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wire [gs]etcredential to backend
parent
b2ebb24c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
dm.go
dm/dm.go
+17
-0
No files found.
dm/dm.go
View file @
2c7aad5f
...
@@ -65,6 +65,8 @@ var commands = []string{
...
@@ -65,6 +65,8 @@ var commands = []string{
"templates
\t\t
Lists the templates in a given template registry"
,
"templates
\t\t
Lists the templates in a given template registry"
,
"registries
\t\t
Lists the registries available"
,
"registries
\t\t
Lists the registries available"
,
"describe
\t\t
Describes the named template in a given template registry"
,
"describe
\t\t
Describes the named template in a given template registry"
,
"getcredential
\t\t
Gets the named credential used by a registry"
,
"setcredential
\t\t
Sets a credential used by a registry"
,
}
}
var
usage
=
func
()
{
var
usage
=
func
()
{
...
@@ -153,6 +155,21 @@ func execute() {
...
@@ -153,6 +155,21 @@ func execute() {
callService
(
"deployments"
,
"POST"
,
action
,
marshalTemplate
(
template
))
callService
(
"deployments"
,
"POST"
,
action
,
marshalTemplate
(
template
))
case
"list"
:
case
"list"
:
callService
(
"deployments"
,
"GET"
,
"list deployments"
,
nil
)
callService
(
"deployments"
,
"GET"
,
"list deployments"
,
nil
)
case
"getcredential"
:
path
:=
fmt
.
Sprintf
(
"credentials/%s"
,
args
[
1
])
callService
(
path
,
"GET"
,
"get credential"
,
nil
)
case
"setcredential"
:
c
:=
getGithubCredential
()
if
c
==
nil
{
panic
(
fmt
.
Errorf
(
"Failed to create a credential from flags/arguments"
))
}
y
,
err
:=
yaml
.
Marshal
(
c
)
if
err
!=
nil
{
panic
(
fmt
.
Errorf
(
"Failed to serialize credential: %#v : %s"
,
c
,
err
))
}
path
:=
fmt
.
Sprintf
(
"credentials/%s"
,
args
[
1
])
callService
(
path
,
"POST"
,
"get credential"
,
ioutil
.
NopCloser
(
bytes
.
NewReader
(
y
)))
case
"get"
:
case
"get"
:
if
len
(
args
)
<
2
{
if
len
(
args
)
<
2
{
fmt
.
Fprintln
(
os
.
Stderr
,
"No deployment name supplied"
)
fmt
.
Fprintln
(
os
.
Stderr
,
"No deployment name supplied"
)
...
...
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