8000 Update after review · helm/helm@059aeed · GitHub
[go: up one dir, main page]

Skip to content

Commit 059aeed

Browse files
committed
Update after review
Review comment: - https://github.com/helm/helm/pull/8198/files#r435237511 Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
1 parent a90182e commit 059aeed

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/kube/client.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ import (
6868
// MissingGetHeader is added to Get's output when a resource is not found.
6969
const MissingGetHeader = "==> MISSING\nKIND\t\tNAME\n"
7070

71+
const KubsAPIErrorMsg = "unable to recognize \"\": no matches for kind"
72+
7173
// ErrNoObjectsVisited indicates that during a visit operation, no matching objects were found.
7274
var ErrNoObjectsVisited = goerrors.New("no objects visited")
7375

@@ -486,7 +488,7 @@ func (c *Client) UpdateWithOptions(namespace string, originalReader, targetReade
486488
if err != nil {
487489
// Checking for removed Kubernetes API error so can provide a more informative error message to the user
488490
// Ref: https://github.com/helm/helm/issues/7219
489-
if strings.Contains(err.Error(), "unable to recognize \"\": no matches for kind") {
491+
if strings.Contains(err.Error(), KubsAPIErrorMsg) {
490492
return fmt.Errorf("current release manifest contains removed kubernetes api(s) for this "+
491493
"kubernetes version and it is therefore unable to build the kubernetes "+
492494
"objects for performing the diff. error from kubernetes: %s", err)
@@ -500,7 +502,7 @@ func (c *Client) UpdateWithOptions(namespace string, originalReader, targetReade
500502
if err != nil {
501503
// Checking for removed Kubernetes API error so can provide a more informative error message to the user
502504
// Ref: https://github.com/helm/helm/issues/7219
503-
if strings.Contains(err.Error(), "unable to recognize \"\": no matches for kind") {
505+
if strings.Contains(err.Error(), KubsAPIErrorMsg) {
504506
return fmt.Errorf("new release manifest contains removed kubernetes api(s) for this "+
505507
"kubernetes version and it is therefore unable to build the kubernetes "+
506508
"objects for deployment. error from kubernetes: %s", err)

0 commit comments

Comments
 (0)
0