Skip to content

Add --masked-path and --read-only-path to container machine create - #2081

Closed
adityabagchi24 wants to merge 1 commit into
apple:mainfrom
adityabagchi24:addfeature
Closed

Add --masked-path and --read-only-path to container machine create#2081
adityabagchi24 wants to merge 1 commit into
apple:mainfrom
adityabagchi24:addfeature

Conversation

@adityabagchi24

Copy link
Copy Markdown
Contributor

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Fixes: #2077

container run/container create already support --masked-path and --read-only-path (PR #2069) to hide or protect sensitive paths inside a container. Container machines did not expose the same controls, so users had no way to mask or protect paths inside a machine's backing container.

This PR adds --masked-path and --read-only-path to container machine create. The paths are persisted in the machine's MachineConfiguration (create-time only, matching how the machine's platform is fixed) and applied to the backing container at boot. When not specified, the runtime OCI defaults apply; the NONE sentinel clears the defaults as it does for container run/create. The effective paths are surfaced in container machine inspect under maskedPaths and readonlyPaths.

MachineConfiguration uses decodeIfPresent/encodeIfPresent with explicit CodingKeys so existing machines from earlier revisions still decode, and new machines are readable by older revisions.

@jglogan

jglogan commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@adityabagchi24 Thank you for the contribution. #2069 was merged prior to the creation of the issue, so we're going to close this one. Apologies for the confusion!

@jglogan jglogan closed this Aug 6, 2026
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.

Add a way to specify read-only-path and masked-pat when creating a container machine

2 participants