-
Notifications
You must be signed in to change notification settings - Fork 49
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 typos and minor mistakes #196
Conversation
Codecov Report
@@ Coverage Diff @@
## master #196 +/- ##
=======================================
Coverage 46.82% 46.82%
=======================================
Files 59 59
Lines 2819 2819
=======================================
Hits 1320 1320
Misses 1255 1255
Partials 244 244
Flags with carried forward coverage won't be shown. Click here to find out more.
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.
Thank you! LGTM
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.
once the error is added, LGTM
func (d *Driver) RemoveTemplate(ctx context.Context, templ *templates.ConstraintTemplate) error { | ||
if err := validateTargets(templ); err != nil { | ||
func (d *Driver) RemoveTemplate(templ *templates.ConstraintTemplate) error { | ||
if len(templ.Spec.Targets) != 1 { |
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 probably want to return an error here to avoid failing silently if we forget to update this code when multi-target templates become a thing.
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.
If we return an error here, it's possible to get into a bad state where a template can't be deleted.
- Add valid Template
- Update Template to have multiple targets and wait for reconcile error
- Delete Template
As-is, this code is probably broken if someone does a similar change. I'd rather investigate and resolve in a dedicated PR than add the test/logic necessary to deal with this case here. Thus, I'd rather not modify the code and possibly introduce a bug (or modify the behavior of an existing one) and feel it safer to leave as-is.
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.
Also - this will be made moot by compiler sharding since we'll fix this 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.
Filed #197 in the compiler sharding milestone.
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.
Also added TODO.
I ran inspect code to find typos and various unintentional bits of code. All of these changes are minor and don't result in any behavioral changes. Generally they show up as I'm editing code, and this makes them go away. Signed-off-by: Will Beason <willbeason@google.com>
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
I ran inspect code to find typos and various unintentional bits of code.
All of these changes are minor and don't result in any behavioral
changes. Generally they show up as I'm editing code, and this makes them
go away.
Signed-off-by: Will Beason willbeason@google.com