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
103145cc
Commit
103145cc
authored
Mar 28, 2016
by
jackgr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make all repo methods name based.
parent
acfc6054
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
12 deletions
+28
-12
manager.go
cmd/manager/manager/manager.go
+28
-12
No files found.
cmd/manager/manager/manager.go
View file @
103145cc
...
@@ -50,8 +50,8 @@ type Manager interface {
...
@@ -50,8 +50,8 @@ type Manager interface {
GetChart
(
chartName
string
)
(
*
chart
.
Chart
,
error
)
GetChart
(
chartName
string
)
(
*
chart
.
Chart
,
error
)
// Repo Charts
// Repo Charts
ListRepoCharts
(
repo
URL
string
,
regex
*
regexp
.
Regexp
)
([]
string
,
error
)
ListRepoCharts
(
repo
Name
string
,
regex
*
regexp
.
Regexp
)
([]
string
,
error
)
GetChartForRepo
(
repo
URL
,
chartName
string
)
(
*
chart
.
Chart
,
error
)
GetChartForRepo
(
repo
Name
,
chartName
string
)
(
*
chart
.
Chart
,
error
)
// Credentials
// Credentials
CreateCredential
(
name
string
,
c
*
repo
.
Credential
)
error
CreateCredential
(
name
string
,
c
*
repo
.
Credential
)
error
...
@@ -60,8 +60,8 @@ type Manager interface {
...
@@ -60,8 +60,8 @@ type Manager interface {
// Chart Repositories
// Chart Repositories
ListRepos
()
(
map
[
string
]
string
,
error
)
ListRepos
()
(
map
[
string
]
string
,
error
)
AddRepo
(
addition
repo
.
IRepo
)
error
AddRepo
(
addition
repo
.
IRepo
)
error
RemoveRepo
(
n
ame
string
)
error
RemoveRepo
(
repoN
ame
string
)
error
GetRepo
(
URL
string
)
(
repo
.
IRepo
,
error
)
GetRepo
(
repoName
string
)
(
repo
.
IRepo
,
error
)
}
}
type
manager
struct
{
type
manager
struct
{
...
@@ -377,17 +377,23 @@ func (m *manager) AddRepo(addition repo.IRepo) error {
...
@@ -377,17 +377,23 @@ func (m *manager) AddRepo(addition repo.IRepo) error {
}
}
// RemoveRepo removes a repository from the list by URL
// RemoveRepo removes a repository from the list by URL
func
(
m
*
manager
)
RemoveRepo
(
n
ame
string
)
error
{
func
(
m
*
manager
)
RemoveRepo
(
repoN
ame
string
)
error
{
url
,
err
:=
m
.
service
.
GetRepoURLByName
(
n
ame
)
repoURL
,
err
:=
m
.
service
.
GetRepoURLByName
(
repoN
ame
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
return
m
.
service
.
DeleteRepo
(
url
)
return
m
.
service
.
DeleteRepo
(
repoURL
)
}
}
// GetRepo returns the repository with the given URL
// GetRepo returns the repository with the given URL
func
(
m
*
manager
)
GetRepo
(
URL
string
)
(
repo
.
IRepo
,
error
)
{
func
(
m
*
manager
)
GetRepo
(
repoName
string
)
(
repo
.
IRepo
,
error
)
{
return
m
.
service
.
GetRepoByURL
(
URL
)
repoURL
,
err
:=
m
.
service
.
GetRepoURLByName
(
repoName
)
if
err
!=
nil
{
return
nil
,
err
}
return
m
.
service
.
GetRepoByURL
(
repoURL
)
}
}
func
generateManifestName
()
string
{
func
generateManifestName
()
string
{
...
@@ -412,10 +418,15 @@ func getResourceErrors(c *common.Configuration) []string {
...
@@ -412,10 +418,15 @@ func getResourceErrors(c *common.Configuration) []string {
return
errs
return
errs
}
}
// ListRepoCharts lists charts in a given repository whose
URL
s
// ListRepoCharts lists charts in a given repository whose
name
s
// conform to the supplied regular expression, or all charts, if the regular
// conform to the supplied regular expression, or all charts, if the regular
// expression is nil.
// expression is nil.
func
(
m
*
manager
)
ListRepoCharts
(
repoURL
string
,
regex
*
regexp
.
Regexp
)
([]
string
,
error
)
{
func
(
m
*
manager
)
ListRepoCharts
(
repoName
string
,
regex
*
regexp
.
Regexp
)
([]
string
,
error
)
{
repoURL
,
err
:=
m
.
service
.
GetRepoURLByName
(
repoName
)
if
err
!=
nil
{
return
nil
,
err
}
r
,
err
:=
m
.
repoProvider
.
GetRepoByURL
(
repoURL
)
r
,
err
:=
m
.
repoProvider
.
GetRepoByURL
(
repoURL
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -425,7 +436,12 @@ func (m *manager) ListRepoCharts(repoURL string, regex *regexp.Regexp) ([]string
...
@@ -425,7 +436,12 @@ func (m *manager) ListRepoCharts(repoURL string, regex *regexp.Regexp) ([]string
}
}
// GetChartForRepo returns a chart by name from a given repository.
// GetChartForRepo returns a chart by name from a given repository.
func
(
m
*
manager
)
GetChartForRepo
(
repoURL
,
chartName
string
)
(
*
chart
.
Chart
,
error
)
{
func
(
m
*
manager
)
GetChartForRepo
(
repoName
,
chartName
string
)
(
*
chart
.
Chart
,
error
)
{
repoURL
,
err
:=
m
.
service
.
GetRepoURLByName
(
repoName
)
if
err
!=
nil
{
return
nil
,
err
}
r
,
err
:=
m
.
repoProvider
.
GetRepoByURL
(
repoURL
)
r
,
err
:=
m
.
repoProvider
.
GetRepoByURL
(
repoURL
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
...
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