OLD | NEW |
1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
4 | 4 |
5 package main | 5 package main |
6 | 6 |
7 import ( | 7 import ( |
8 "fmt" | 8 "fmt" |
9 "sort" | 9 "sort" |
10 | 10 |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 x := t.exec("get", resource, "-o", "yaml") | 432 x := t.exec("get", resource, "-o", "yaml") |
433 switch rv, err := x.run(c); { | 433 switch rv, err := x.run(c); { |
434 case err != nil: | 434 case err != nil: |
435 return err | 435 return err |
436 | 436 |
437 case rv != 0: | 437 case rv != 0: |
438 return errKubeResourceNotFound | 438 return errKubeResourceNotFound |
439 | 439 |
440 default: | 440 default: |
441 if err := yaml.Unmarshal(x.stdout.Bytes(), obj); err != nil { | 441 if err := yaml.Unmarshal(x.stdout.Bytes(), obj); err != nil { |
442 » » » return errors.Annotate(err).Reason("failed to unmarshal
YAML %(type)T").D("type", obj).Err() | 442 » » » return errors.Annotate(err, "failed to unmarshal YAML %T
", obj).Err() |
443 } | 443 } |
444 return nil | 444 return nil |
445 } | 445 } |
446 } | 446 } |
OLD | NEW |