Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes file loading more flexible #78

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pkg/patterns/declarative/pkg/manifest/objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
// Objects holds a collection of objects, so that we can filter / sequence them
type Objects struct {
Items []*Object
Blobs [][] byte
}

type Object struct {
Expand Down Expand Up @@ -331,8 +332,8 @@ func ParseObjects(ctx context.Context, manifest string) (*Objects, error) {
out := &unstructured.Unstructured{}
err := decoder.Decode(out)
if err != nil {
log.WithValues("yaml", yaml).Error(err, "error decoding object")
return nil, fmt.Errorf("error decoding object: %v", err)
log.WithValues("yaml", yaml).Info("Unable to parse into Unstructured, Storing as blob")
somtochiama marked this conversation as resolved.
Show resolved Hide resolved
objects.Blobs = append(objects.Blobs, []byte(yaml))
}

// We don't reuse the manifest because it's probably yaml, and we want to use json
Expand Down