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

dynamic host volumes: client-side tests, comments, tidying #24747

Merged
merged 5 commits into from
Jan 6, 2025

Conversation

gulducat
Copy link
Member

Sprucing things up after the initial push to get it working.

I added test coverage before moving funcs around to ensure no functional changes.

Lots of lines, but hopefully an easy read!

tgross
tgross previously approved these changes Jan 6, 2025
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

Comment on lines 146 to 149
// HostVolumePluginExternal calls an executable on disk. All operations should
// be idempotent, and safe to be called concurrently per volume ID.
// For each call, the executable's stdout and stderr may be logged, so plugin
// authors should not include any sensitive information in their plugin outputs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These docstrings are likely to make their way into a spec for plugin authors. We should probably use the term "must" rather than "should" here in that RFC 2119 sense of the terms.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MUST This word, or the terms "REQUIRED" or "SHALL", mean that the definition is an absolute requirement of the specification.

I don't think this matches, because including secret strings doesn't break anything, and we have no way of enforcing it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just because it's not enforceable doesn't mean it's compliant with the spec. But "should be idempotent" is probably a better candidate for the stronger "must" wording, because that definitely will break things.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh! I totally missed the "should" on this "be idempotent" -- I totally agree on that one!

HostVolumePluginMkdirID: &HostVolumePluginMkdir{
ID: HostVolumePluginMkdirID,
TargetPath: config.SharedMountDir,
log: logger.With("plugin_id", HostVolumePluginMkdirID),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: this logger won't be named host_volume_manager but the loggers we instantiate for the external plugins will, because they get cloned from hvm.log.With. Maybe we should hoist the logger.Named to the top of this method and then have the mkdir plugin call .With on that?

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@gulducat gulducat added this to the 1.10.0 milestone Jan 6, 2025
@gulducat gulducat merged commit 4594539 into main Jan 6, 2025
37 checks passed
@gulducat gulducat deleted the dhv-misc-daniel-tidying branch January 6, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants