-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Support mlock and custom tmpdir for containerized plugins #23215
Support mlock and custom tmpdir for containerized plugins #23215
Conversation
Build Results: |
CI Results: |
@@ -139,7 +143,8 @@ func (rc runConfig) makeConfig(ctx context.Context) (*plugin.ClientConfig, error | |||
clientConfig.SkipHostEnv = true | |||
clientConfig.RunnerFunc = containerCfg.NewContainerRunner | |||
clientConfig.UnixSocketConfig = &plugin.UnixSocketConfig{ | |||
Group: strconv.Itoa(containerCfg.GroupAdd), | |||
Group: strconv.Itoa(containerCfg.GroupAdd), | |||
TempDir: os.Getenv("VAULT_PLUGIN_TMPDIR"), |
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.
Maybe this should be settable with both an env var and a config file option?
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.
It would be nice, but not strictly necessary I think.
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 think I'll aim to add a config option for 1.15.1 given where we are in the release cycle.
Note: I'm planning to merge the library PRs and tag them once all 3 have been reviewed, so once this PR is stable there will be a couple of go.mod changes to use tagged versions of the deps. |
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
@@ -139,7 +143,8 @@ func (rc runConfig) makeConfig(ctx context.Context) (*plugin.ClientConfig, error | |||
clientConfig.SkipHostEnv = true | |||
clientConfig.RunnerFunc = containerCfg.NewContainerRunner | |||
clientConfig.UnixSocketConfig = &plugin.UnixSocketConfig{ | |||
Group: strconv.Itoa(containerCfg.GroupAdd), | |||
Group: strconv.Itoa(containerCfg.GroupAdd), | |||
TempDir: os.Getenv("VAULT_PLUGIN_TMPDIR"), |
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.
It would be nice, but not strictly necessary I think.
…ock-and-custom-tmpdir
Thanks! |
When running containerised plugins within the context of our default systemd unit file (from the rpm repositories), I found a couple of issues I hadn't stumbled on previously:
/tmp
, so we need the ability to negotiate a separate directory that both sides can see. We could just use TMPDIR, but then that ruins the whole point of the setting. Instead, we introduce a new environment variable to use a different tmp dir in one very narrow use-case. Library PR: Add TempDir option to UnixSocketConfig go-plugin#282