-
Notifications
You must be signed in to change notification settings - Fork 770
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
Fix: Make the out flag print to one file using seperator #1541
Fix: Make the out flag print to one file using seperator #1541
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return r | ||
} | ||
// return r | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented out section
return fmt.Errorf("error in marshalling the List: %v", err) | ||
} | ||
data = []byte(fmt.Sprintf("---\n%s", data)) | ||
printVal, err := transformer.Print("", dirName, "", data, opt.ToStdout, opt.GenerateJSON, f, opt.Provider) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good, but you need to add comments "this part add ---
which unifies the file", etc.
data = []byte(fmt.Sprintf("---\n%s", data)) | ||
printVal, err := transformer.Print("", dirName, "", data, opt.ToStdout, opt.GenerateJSON, f, opt.Provider) | ||
if err != nil { | ||
return errors.Wrap(err, "transformer.Print failed") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is outside the scope of the PR, but perhaps change this error output while you're at it :) "transformer to print to one single file failed" or something like that.
LGTM |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AhmedGrati, cdrage, hangyan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
This pull request solves #1539.
Implementation
Basically, it has the exact implementation of the
helm template
command. It will output all the k8s resources in one YAML file using the---
separator. If the user specifies a JSON output, it will return an error since we cannot have multiple JSON resources in one file.