4
vendor/sigs.k8s.io/controller-tools/pkg/schemapatcher/internal/yaml/convert.go
generated
vendored
4
vendor/sigs.k8s.io/controller-tools/pkg/schemapatcher/internal/yaml/convert.go
generated
vendored
@@ -33,12 +33,12 @@ func ToYAML(rawObj interface{}) (*yaml.Node, error) {
|
||||
|
||||
rawJSON, err := json.Marshal(rawObj)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to marshal object: %v", err)
|
||||
return nil, fmt.Errorf("failed to marshal object: %w", err)
|
||||
}
|
||||
|
||||
var out yaml.Node
|
||||
if err := yaml.Unmarshal(rawJSON, &out); err != nil {
|
||||
return nil, fmt.Errorf("unable to unmarshal marshalled object: %v", err)
|
||||
return nil, fmt.Errorf("unable to unmarshal marshalled object: %w", err)
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
2
vendor/sigs.k8s.io/controller-tools/pkg/schemapatcher/internal/yaml/nested.go
generated
vendored
2
vendor/sigs.k8s.io/controller-tools/pkg/schemapatcher/internal/yaml/nested.go
generated
vendored
@@ -58,7 +58,7 @@ func asCloseAsPossible(root *yaml.Node, path ...string) (*yaml.Node, []string, e
|
||||
|
||||
nextNode, err := ValueInMapping(currNode, path[0])
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("unable to get next node in path %v: %v", path, err)
|
||||
return nil, nil, fmt.Errorf("unable to get next node in path %v: %w", path, err)
|
||||
}
|
||||
|
||||
if nextNode == nil {
|
||||
|
||||
Reference in New Issue
Block a user