Unverified Commit 8cacb2c3 authored by Matthew Fisher's avatar Matthew Fisher Committed by GitHub

Merge pull request #6077 from tariq1890/fix_lint

fix golint issues reported by make test
parents 7ab62324 276bb9b1
...@@ -314,7 +314,14 @@ func (c *Client) Get(namespace string, reader io.Reader) (string, error) { ...@@ -314,7 +314,14 @@ func (c *Client) Get(namespace string, reader io.Reader) (string, error) {
return buf.String(), nil return buf.String(), nil
} }
// Deprecated; use UpdateWithOptions instead // Update reads the current configuration and a target configuration from io.reader
// and creates resources that don't already exist, updates resources that have been modified
// in the target configuration and deletes resources from the current configuration that are
// not present in the target configuration.
//
// Namespace will set the namespaces.
//
// Deprecated: use UpdateWithOptions instead.
func (c *Client) Update(namespace string, originalReader, targetReader io.Reader, force bool, recreate bool, timeout int64, shouldWait bool) error { func (c *Client) Update(namespace string, originalReader, targetReader io.Reader, force bool, recreate bool, timeout int64, shouldWait bool) error {
return c.UpdateWithOptions(namespace, originalReader, targetReader, UpdateOptions{ return c.UpdateWithOptions(namespace, originalReader, targetReader, UpdateOptions{
Force: force, Force: force,
...@@ -334,12 +341,13 @@ type UpdateOptions struct { ...@@ -334,12 +341,13 @@ type UpdateOptions struct {
CleanupOnFail bool CleanupOnFail bool
} }
// UpdateWithOptions reads in the current configuration and a target configuration from io.reader // UpdateWithOptions reads the current configuration and a target configuration from io.reader
// and creates resources that don't already exists, updates resources that have been modified // and creates resources that don't already exist, updates resources that have been modified
// in the target configuration and deletes resources from the current configuration that are // in the target configuration and deletes resources from the current configuration that are
// not present in the target configuration. // not present in the target configuration.
// //
// Namespace will set the namespaces. // Namespace will set the namespaces. UpdateOptions provides additional parameters to control
// update behavior.
func (c *Client) UpdateWithOptions(namespace string, originalReader, targetReader io.Reader, opts UpdateOptions) error { func (c *Client) UpdateWithOptions(namespace string, originalReader, targetReader io.Reader, opts UpdateOptions) error {
original, err := c.BuildUnstructured(namespace, originalReader) original, err := c.BuildUnstructured(namespace, originalReader)
if err != nil { if err != nil {
...@@ -552,7 +560,7 @@ func (c *Client) WatchUntilReady(namespace string, reader io.Reader, timeout int ...@@ -552,7 +560,7 @@ func (c *Client) WatchUntilReady(namespace string, reader io.Reader, timeout int
return perform(infos, c.watchTimeout(time.Duration(timeout)*time.Second)) return perform(infos, c.watchTimeout(time.Duration(timeout)*time.Second))
} }
// WatchUntilCRDEstablished polls the given CRD until it reaches the established // WaitUntilCRDEstablished polls the given CRD until it reaches the established
// state. A CRD needs to reach the established state before CRs can be created. // state. A CRD needs to reach the established state before CRs can be created.
// //
// If a naming conflict condition is found, this function will return an error. // If a naming conflict condition is found, this function will return an error.
......
...@@ -558,7 +558,7 @@ func TestWaitUntilCRDEstablished(t *testing.T) { ...@@ -558,7 +558,7 @@ func TestWaitUntilCRDEstablished(t *testing.T) {
} else { } else {
crd = crdWithConditions crd = crdWithConditions
} }
requestCount += 1 requestCount++
return newResponse(200, &crd) return newResponse(200, &crd)
}), }),
} }
......
...@@ -51,7 +51,7 @@ func Chartfile(linter *support.Linter) { ...@@ -51,7 +51,7 @@ func Chartfile(linter *support.Linter) {
linter.RunLinterRule(support.ErrorSev, chartFileName, validateChartNameDirMatch(linter.ChartDir, chartFile)) linter.RunLinterRule(support.ErrorSev, chartFileName, validateChartNameDirMatch(linter.ChartDir, chartFile))
// Chart metadata // Chart metadata
linter.RunLinterRule(support.ErrorSev, chartFileName, validateChartApiVersion(chartFile)) linter.RunLinterRule(support.ErrorSev, chartFileName, validateChartAPIVersion(chartFile))
linter.RunLinterRule(support.ErrorSev, chartFileName, validateChartVersion(chartFile)) linter.RunLinterRule(support.ErrorSev, chartFileName, validateChartVersion(chartFile))
linter.RunLinterRule(support.ErrorSev, chartFileName, validateChartEngine(chartFile)) linter.RunLinterRule(support.ErrorSev, chartFileName, validateChartEngine(chartFile))
linter.RunLinterRule(support.ErrorSev, chartFileName, validateChartMaintainer(chartFile)) linter.RunLinterRule(support.ErrorSev, chartFileName, validateChartMaintainer(chartFile))
...@@ -97,7 +97,7 @@ func validateChartNameDirMatch(chartDir string, cf *chart.Metadata) error { ...@@ -97,7 +97,7 @@ func validateChartNameDirMatch(chartDir string, cf *chart.Metadata) error {
return nil return nil
} }
func validateChartApiVersion(cf *chart.Metadata) error { func validateChartAPIVersion(cf *chart.Metadata) error {
if cf.ApiVersion == "" { if cf.ApiVersion == "" {
return errors.New("apiVersion is required") return errors.New("apiVersion is required")
} }
......
...@@ -255,6 +255,7 @@ func (p *PrintingKubeClient) WaitAndGetCompletedPodPhase(namespace string, reade ...@@ -255,6 +255,7 @@ func (p *PrintingKubeClient) WaitAndGetCompletedPodPhase(namespace string, reade
return v1.PodUnknown, err return v1.PodUnknown, err
} }
// WaitUntilCRDEstablished implements KubeClient WaitUntilCRDEstablished.
func (p *PrintingKubeClient) WaitUntilCRDEstablished(reader io.Reader, timeout time.Duration) error { func (p *PrintingKubeClient) WaitUntilCRDEstablished(reader io.Reader, timeout time.Duration) error {
_, err := io.Copy(p.Out, reader) _, err := io.Copy(p.Out, reader)
return err return err
......
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