-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add yamltags #388
Add yamltags #388
Conversation
Got oneOf working and integrated into all our steps. |
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.
Nice! This would definitely be useful outside of skaffold, we should consider moving this code somewhere more central so we can reuse it in other projects.
val.SetInt(i) | ||
case reflect.String: | ||
val.SetString(dt.dv) | ||
} |
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.
Is it possible that another type could get passed here? Maybe put a default case here that returns an error so it's more clear that other types aren't supported?
@dlorenc Is this PR still active? |
cc @nkubala I rebased this and it should be ready to go if we still want it. |
Codecov Report
@@ Coverage Diff @@
## master #388 +/- ##
==========================================
+ Coverage 39.38% 41.17% +1.79%
==========================================
Files 61 62 +1
Lines 2613 2703 +90
==========================================
+ Hits 1029 1113 +84
- Misses 1471 1473 +2
- Partials 113 117 +4
Continue to review full report at Codecov.
|
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.
one small comment, otherwise LGTM
@@ -10,7 +10,7 @@ build: | |||
gitCommit: {} | |||
|
|||
# Tag the image with the checksum of the built image (image id). | |||
sha256: {} | |||
# sha256: {} |
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.
did you mean to comment this out?
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.
Yeah, this becomes invalid now. You can't define two tag policies with oneOf.
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.
Oh sorry, missed the gitCommit
tagger above it.
This PR adds some new tags we can place on YAML structs that will make management of our config easier.
It adds a 'oneOf' tag, that can be placed on a set of fields and will ensure that only one of them is provided by a user.
It adds a 'required' tag, that can ensure the field has been set by the user.
It adds a 'default' tag, that can be used for strings and ints right now.
Getting this out early for comment. I'll keep cleaning it up and try integrating it into our config parsing next.