A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/helm/helm/commit/a90182e3b2dba2172a7ee0a2680de0c7b09ec4ed below:

Add more informative error message for removed k8s APIs · helm/helm@a90182e · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+19

-2

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+19

-2

lines changed Original file line number Diff line number Diff line change

@@ -484,13 +484,30 @@ type UpdateOptions struct {

484 484

func (c *Client) UpdateWithOptions(namespace string, originalReader, targetReader io.Reader, opts UpdateOptions) error {

485 485

original, err := c.BuildUnstructured(namespace, originalReader)

486 486

if err != nil {

487 -

return fmt.Errorf("failed decoding reader into objects: %s", err)

487 +

// Checking for removed Kubernetes API error so can provide a more informative error message to the user

488 +

// Ref: https://github.com/helm/helm/issues/7219

489 +

if strings.Contains(err.Error(), "unable to recognize \"\": no matches for kind") {

490 +

return fmt.Errorf("current release manifest contains removed kubernetes api(s) for this "+

491 +

"kubernetes version and it is therefore unable to build the kubernetes "+

492 +

"objects for performing the diff. error from kubernetes: %s", err)

493 +

} else {

494 +

return fmt.Errorf("failed decoding reader into objects: %s", err)

495 +

}

488 496

}

489 497 490 498

c.Log("building resources from updated manifest")

491 499

target, err := c.BuildUnstructured(namespace, targetReader)

492 500

if err != nil {

493 -

return fmt.Errorf("failed decoding reader into objects: %s", err)

501 +

// Checking for removed Kubernetes API error so can provide a more informative error message to the user

502 +

// Ref: https://github.com/helm/helm/issues/7219

503 +

if strings.Contains(err.Error(), "unable to recognize \"\": no matches for kind") {

504 +

return fmt.Errorf("new release manifest contains removed kubernetes api(s) for this "+

505 +

"kubernetes version and it is therefore unable to build the kubernetes "+

506 +

"objects for deployment. error from kubernetes: %s", err)

507 + 508 +

} else {

509 +

return fmt.Errorf("failed decoding reader into objects: %s", err)

510 +

}

494 511

}

495 512 496 513

newlyCreatedResources := []*resource.Info{}

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4