-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: function to normalize the spec #30
Conversation
README.md
Outdated
|
||
var srcMap map[string]interface{} | ||
if err = loader.ParseYAML(&srcMap, src); err != nil { | ||
if err := loader.ParseYAML(&srcMap, src); err != nil { | ||
panic(err) | ||
} | ||
|
||
var spec score.WorkloadSpec |
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.
We should also recommend a call to score-go/schema Validate() before calling map spec.
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.
Added.
) | ||
|
||
// Normalize normalizes the target Workload by: | ||
// * embedding container file sources as content |
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.
nit pick: the only other normalisation I can think of so far is setting the protocol and target port in the services block if they aren't defined. Don't have to include them here, as most converters will be doing that by default anyway
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.
Yes, I wasn't really sure if we would add something in the future 🤔
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.
LGTM, couple of comments but nothing too important
be5b1e4
to
5609a02
Compare
Signed-off-by: Johannes Würbach <[email protected]>
5609a02
to
2f2e139
Compare
Description
Instead of implementing common concepts like embedding files in each implementation, add a
Normalize
function, which performs such operations.What does this PR do?
Move shared functionality (embedding files) into this library.
Types of changes
Checklist: