-
Notifications
You must be signed in to change notification settings - Fork 131
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
Removes JailerEnable and changes JailerCfg to be a pointer #110
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.
LGTM!
machine.go
Outdated
@@ -98,6 +98,33 @@ type Config struct { | |||
JailerCfg JailerConfig | |||
} | |||
|
|||
// WithJailerConfig will set the given JailerConfig to the JailerCfg field. In | |||
// addition this will also set EnableJailer to true |
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.
Do we strictly need to have the EnableJailer
field or can we enable the jailer when JailerCfg != nil
?
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.
Yea, that is an option, using nil as an indicator. I wanted to prevent doing that since whenever you want to grab values from the jailer config, you'd need to nil check. But I am okay with using nil as a check if we think that is a better experience.
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 agree it seems simpler to just have our code do nil checks internally and enable the jailer when JailerCfg is not nil. I think I'd be confused as a user if I saw there was EnableJailer
, JailerCfg
and WithJailerConfig
.
This fix allows for a more intuitive design in letting users enable the jailer. Signed-off-by: xibz <impactbchang@gmail.com>
This fix allows for a more intuitive design in letting users enable the
jailer.
Signed-off-by: xibz impactbchang@gmail.com
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.