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

Fixes: mounts may contain string items #209

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hellodword
Copy link
Contributor

@hellodword hellodword commented Feb 14, 2024

https://github.com/devcontainers/cli/blob/2a6ab1ac82f4917654205e2a9b1ac928260d902e/.devcontainer/devcontainer.json#L15

I know this is devcontainer.json, but yes the devcontainer-feature.json also supports this.

@hellodword hellodword requested a review from a team as a code owner February 14, 2024 04:42
@@ -15,7 +15,7 @@ export interface Feature {
licenseURL?: string;
options?: Record<string, IOption>;
containerEnv?: Record<string, string>;
mounts?: Mount[];
mounts?: (Mount|string)[];
Copy link
Member

Choose a reason for hiding this comment

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

I understand that this is currently allowed by the CLI, however, this is an old syntax that shouldn't be used anymore. (This might be deprecated soon)

https://github.com/devcontainers/cli/blob/2a6ab1ac82f4917654205e2a9b1ac928260d902e/.devcontainer/devcontainer.json#L15 definitely needs to updated to use the new syntax 🤦‍♀️

We don't mention supporting string for mounts in https://containers.dev/implementors/features/ and https://containers.dev/implementors/json_schema/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems that https://containers.dev/implementors/json_schema/ does not synced with the schema.json https://github.com/devcontainers/spec/blob/87e7ce0a2e25264032e836a3c5379692491e9d4b/schemas/devContainer.base.schema.json#L236-L246

And you're right, the feature's schema is defined as Mount[] only.

So how about consider this as spec issues:

  1. No differences of mounts's type between template and feature
  2. I also believe mounts with strict type is a good thing, but currently it only support type, source and target, and docker bind mounts have more options, would it be better to define them all? For example, readonly is really useful: https://github.com/search?q=path%3Adevcontainer.json+%2F%22%5B%5E%22%5D*type%3D%28bind%7Cvolume%29%5B%5E%22%5D*readonly%5B%5E%22%5D*%22%2F&type=code

Copy link
Member

@samruddhikhandale samruddhikhandale Feb 16, 2024

Choose a reason for hiding this comment

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

Thanks for sharing your thoughts!

So how about consider this as spec issues:

Makes sense to me 👍

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.

2 participants