@@ -68,6 +68,8 @@ import (
68
68
// MissingGetHeader is added to Get's output when a resource is not found.
69
69
const MissingGetHeader = "==> MISSING\n KIND\t \t NAME\n "
70
70
71
+ const KubsAPIErrorMsg = "unable to recognize \" \" : no matches for kind"
72
+
71
73
// ErrNoObjectsVisited indicates that during a visit operation, no matching objects were found.
72
74
var ErrNoObjectsVisited = goerrors .New ("no objects visited" )
73
75
@@ -486,7 +488,7 @@ func (c *Client) UpdateWithOptions(namespace string, originalReader, targetReade
486
488
if err != nil {
487
489
// Checking for removed Kubernetes API error so can provide a more informative error message to the user
488
490
// 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 ) {
490
492
return fmt .Errorf ("current release manifest contains removed kubernetes api(s) for this " +
491
493
"kubernetes version and it is therefore unable to build the kubernetes " +
492
494
"objects for performing the diff. error from kubernetes: %s" , err )
@@ -500,7 +502,7 @@ func (c *Client) UpdateWithOptions(namespace string, originalReader, targetReade
500
502
if err != nil {
501
503
// Checking for removed Kubernetes API error so can provide a more informative error message to the user
502
504
// 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 ) {
504
506
return fmt .Errorf ("new release manifest contains removed kubernetes api(s) for this " +
505
507
"kubernetes version and it is therefore unable to build the kubernetes " +
506
508
"objects for deployment. error from kubernetes: %s" , err )
0 commit comments