Skip to content
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

Merged
merged 1 commit into from
Aug 6, 2019

Conversation

xibz
Copy link
Contributor

@xibz xibz commented Jul 31, 2019

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.

@xibz xibz requested review from kzys, samuelkarp, mxpv and sipsma July 31, 2019 23:19
Copy link
Contributor

@kzys kzys left a 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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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>
@xibz xibz changed the title Adding helper jailer enable method Removes JailerEnable and changes JailerCfg to be a pointer Aug 6, 2019
@xibz xibz merged commit b320837 into firecracker-microvm:master Aug 6, 2019
@xibz xibz deleted the jail-util branch August 6, 2019 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants