Commit 1a55161a authored by adshmh's avatar adshmh Committed by Adam Reese

Fix several golint warnings (#3756)

* fix(helm): fix golint warning due to ApiVersionV1 constant name
Signed-off-by: 's avatarArash Deshmeh <adeshmeh@ca.ibm.com>

* fix(helm): fix golint warning due to ResolveChartVersionAndGetRepo comment
Signed-off-by: 's avatarArash Deshmeh <adeshmeh@ca.ibm.com>

* fix(helm): fix golint warnings on HttpGetter type and SetCredentials method missing a comment
Signed-off-by: 's avatarArash Deshmeh <adeshmeh@ca.ibm.com>

* fix(helm):fix golint warning due to comment on FindChartInAuthRepoURL function
Signed-off-by: 's avatarArash Deshmeh <adeshmeh@ca.ibm.com>

* fix(helm): fix golint warning due to RepoFile type name
Signed-off-by: 's avatarArash Deshmeh <adeshmeh@ca.ibm.com>

* fix(helm): fix golint warning due to ParseString comment
Signed-off-by: 's avatarArash Deshmeh <adeshmeh@ca.ibm.com>
parent 01e5c4f5
...@@ -31,7 +31,7 @@ import ( ...@@ -31,7 +31,7 @@ import (
// ApiVersionV1 is the API version number for version 1. // ApiVersionV1 is the API version number for version 1.
// //
// This is ApiVersionV1 instead of APIVersionV1 to match the protobuf-generated name. // This is ApiVersionV1 instead of APIVersionV1 to match the protobuf-generated name.
const ApiVersionV1 = "v1" const ApiVersionV1 = "v1" // nolint
// UnmarshalChartfile takes raw Chart.yaml data and unmarshals it. // UnmarshalChartfile takes raw Chart.yaml data and unmarshals it.
func UnmarshalChartfile(data []byte) (*chart.Metadata, error) { func UnmarshalChartfile(data []byte) (*chart.Metadata, error) {
......
...@@ -151,7 +151,7 @@ func (c *ChartDownloader) ResolveChartVersion(ref, version string) (*url.URL, ge ...@@ -151,7 +151,7 @@ func (c *ChartDownloader) ResolveChartVersion(ref, version string) (*url.URL, ge
return u, nil, err return u, nil, err
} }
// Same as the ResolveChartVersion method, but returns the chart repositoryy. // ResolveChartVersionAndGetRepo is the same as the ResolveChartVersion method, but returns the chart repositoryy.
func (c *ChartDownloader) ResolveChartVersionAndGetRepo(ref, version string) (*url.URL, *repo.ChartRepository, *getter.HttpGetter, error) { func (c *ChartDownloader) ResolveChartVersionAndGetRepo(ref, version string) (*url.URL, *repo.ChartRepository, *getter.HttpGetter, error) {
u, err := url.Parse(ref) u, err := url.Parse(ref)
if err != nil { if err != nil {
......
...@@ -27,13 +27,15 @@ import ( ...@@ -27,13 +27,15 @@ import (
"k8s.io/helm/pkg/version" "k8s.io/helm/pkg/version"
) )
//httpGetter is the efault HTTP(/S) backend handler //HttpGetter is the efault HTTP(/S) backend handler
type HttpGetter struct { // TODO: change the name to HTTPGetter in Helm 3
type HttpGetter struct { //nolint
client *http.Client client *http.Client
username string username string
password string password string
} }
//SetCredentials sets the credentials for the getter
func (g *HttpGetter) SetCredentials(username, password string) { func (g *HttpGetter) SetCredentials(username, password string) {
g.username = username g.username = username
g.password = password g.password = password
......
...@@ -196,9 +196,9 @@ func FindChartInRepoURL(repoURL, chartName, chartVersion, certFile, keyFile, caF ...@@ -196,9 +196,9 @@ func FindChartInRepoURL(repoURL, chartName, chartVersion, certFile, keyFile, caF
return FindChartInAuthRepoURL(repoURL, "", "", chartName, chartVersion, certFile, keyFile, caFile, getters) return FindChartInAuthRepoURL(repoURL, "", "", chartName, chartVersion, certFile, keyFile, caFile, getters)
} }
// FindChartInRepoURL finds chart in chart repository pointed by repoURL // FindChartInAuthRepoURL finds chart in chart repository pointed by repoURL
// without adding repo to repositories. // without adding repo to repositories, like FindChartInRepoURL,
// Unlike the FindChartInRepoURL function, this function also receives credentials for the chart repository. // but it also receives credentials for the chart repository.
func FindChartInAuthRepoURL(repoURL, username, password, chartName, chartVersion, certFile, keyFile, caFile string, getters getter.Providers) (string, error) { func FindChartInAuthRepoURL(repoURL, username, password, chartName, chartVersion, certFile, keyFile, caFile string, getters getter.Providers) (string, error) {
// Download and write the index file to a temporary location // Download and write the index file to a temporary location
......
...@@ -31,7 +31,8 @@ import ( ...@@ -31,7 +31,8 @@ import (
var ErrRepoOutOfDate = errors.New("repository file is out of date") var ErrRepoOutOfDate = errors.New("repository file is out of date")
// RepoFile represents the repositories.yaml file in $HELM_HOME // RepoFile represents the repositories.yaml file in $HELM_HOME
type RepoFile struct { // TODO: change type name to File in Helm 3 to resolve linter warning
type RepoFile struct { // nolint
APIVersion string `json:"apiVersion"` APIVersion string `json:"apiVersion"`
Generated time.Time `json:"generated"` Generated time.Time `json:"generated"`
Repositories []*Entry `json:"repositories"` Repositories []*Entry `json:"repositories"`
......
...@@ -50,7 +50,7 @@ func Parse(s string) (map[string]interface{}, error) { ...@@ -50,7 +50,7 @@ func Parse(s string) (map[string]interface{}, error) {
return vals, err return vals, err
} }
// Parse parses a set line and forces a string value. // ParseString parses a set line and forces a string value.
// //
// A set line is of the form name1=value1,name2=value2 // A set line is of the form name1=value1,name2=value2
func ParseString(s string) (map[string]interface{}, error) { func ParseString(s string) (map[string]interface{}, error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment