Skip to content

Commit 1cfe12d

Browse files
committed
update schema docs
1 parent 7dcad7b commit 1cfe12d

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

docs/data-sources/cached_image.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -33,36 +33,36 @@ resource "docker_container" "container" {
3333

3434
### Required
3535

36-
- `builder_image` (String) The builder image URL to use if the cache does not exist.
36+
- `builder_image` (String) The builder image to use if the cache does not exist.
3737
- `cache_repo` (String) The name of the container registry to fetch the cache image from.
3838
- `git_url` (String) The URL of a Git repository containing a Devcontainer or Docker image to clone.
3939

4040
### Optional
4141

42-
- `base_image_cache_dir` (String) TODO
43-
- `build_context_path` (String) TODO
42+
- `base_image_cache_dir` (String) The path to a directory where the base image can be found. This should be a read-only directory solely mounted for the purpose of caching the base image.
43+
- `build_context_path` (String) Can be specified when a DockerfilePath is specified outside the base WorkspaceFolder. This path MUST be relative to the WorkspaceFolder path into which the repo is cloned.
4444
- `cache_ttl_days` (Number) The number of days to use cached layers before expiring them. Defaults to 7 days.
45-
- `devcontainer_dir` (String) TODO
46-
- `devcontainer_json_path` (String) TODO
47-
- `docker_config_base64` (String) TODO
48-
- `dockerfile_path` (String) TODO
49-
- `exit_on_build_failure` (Boolean) TODO
45+
- `devcontainer_dir` (String) The path to the folder containing the devcontainer.json file that will be used to build the workspace and can either be an absolute path or a path relative to the workspace folder. If not provided, defaults to `.devcontainer`.
46+
- `devcontainer_json_path` (String) The path to a devcontainer.json file that is either an absolute path or a path relative to DevcontainerDir. This can be used in cases where one wants to substitute an edited devcontainer.json file for the one that exists in the repo.
47+
- `docker_config_base64` (String) The base64 encoded Docker config file that will be used to pull images from private container registries.
48+
- `dockerfile_path` (String) The relative path to the Dockerfile that will be used to build the workspace. This is an alternative to using a devcontainer that some might find simpler.
49+
- `exit_on_build_failure` (Boolean) Terminates upon a build failure. This is handy when preferring the FALLBACK_IMAGE in cases where no devcontainer.json or image is provided. However, it ensures that the container stops if the build process encounters an error.
5050
- `extra_env` (Map of String) Extra environment variables to set for the container. This may include evbuilder options.
51-
- `fallback_image` (String) TODO
52-
- `git_clone_depth` (Number) TODO
53-
- `git_clone_single_branch` (Boolean) TODO
54-
- `git_http_proxy_url` (String) TODO
51+
- `fallback_image` (String) Specifies an alternative image to use when neither an image is declared in the devcontainer.json file nor a Dockerfile is present. If there's a build failure (from a faulty Dockerfile) or a misconfiguration, this image will be the substitute. Set ExitOnBuildFailure to true to halt the container if the build faces an issue.
52+
- `git_clone_depth` (Number) The depth to use when cloning the Git repository.
53+
- `git_clone_single_branch` (Boolean) Clone only a single branch of the Git repository.
54+
- `git_http_proxy_url` (String) The URL for the HTTP proxy. This is optional.
5555
- `git_password` (String, Sensitive) The password to use for Git authentication. This is optional.
56-
- `git_ssh_private_key_path` (String) TODO
56+
- `git_ssh_private_key_path` (String) Path to an SSH private key to be used for Git authentication.
5757
- `git_username` (String) The username to use for Git authentication. This is optional.
58-
- `ignore_paths` (List of String) TODO
59-
- `insecure` (Boolean) TODO
60-
- `ssl_cert_base64` (String) TODO
58+
- `ignore_paths` (List of String) The comma separated list of paths to ignore when building the workspace.
59+
- `insecure` (Boolean) Bypass TLS verification when cloning and pulling from container registries.
60+
- `ssl_cert_base64` (String) The content of an SSL cert file. This is useful for self-signed certificates.
6161
- `verbose` (Boolean) Enable verbose output.
6262

6363
### Read-Only
6464

6565
- `env` (List of String) Computed envbuilder configuration to be set for the container.
6666
- `exists` (Boolean) Whether the cached image was exists or not for the given config.
67-
- `id` (String) Cached image identifier
67+
- `id` (String) Cached image identifier. This will generally be the image's SHA256 digest.
6868
- `image` (String) Outputs the cached image URL if it exists, otherwise the builder image URL is output instead.

internal/provider/cached_image_data_source.go

+17-17
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ func (d *CachedImageDataSource) Schema(ctx context.Context, req datasource.Schem
7676

7777
Attributes: map[string]schema.Attribute{
7878
"base_image_cache_dir": schema.StringAttribute{
79-
MarkdownDescription: "TODO",
79+
MarkdownDescription: "The path to a directory where the base image can be found. This should be a read-only directory solely mounted for the purpose of caching the base image.",
8080
Optional: true,
8181
},
8282
"build_context_path": schema.StringAttribute{
83-
MarkdownDescription: "TODO",
83+
MarkdownDescription: "Can be specified when a DockerfilePath is specified outside the base WorkspaceFolder. This path MUST be relative to the WorkspaceFolder path into which the repo is cloned.",
8484
Optional: true,
8585
},
8686
"builder_image": schema.StringAttribute{
87-
MarkdownDescription: "The builder image URL to use if the cache does not exist.",
87+
MarkdownDescription: "The builder image to use if the cache does not exist.",
8888
Required: true,
8989
},
9090
"cache_repo": schema.StringAttribute{
@@ -96,19 +96,19 @@ func (d *CachedImageDataSource) Schema(ctx context.Context, req datasource.Schem
9696
Optional: true,
9797
},
9898
"devcontainer_dir": schema.StringAttribute{
99-
MarkdownDescription: "TODO",
99+
MarkdownDescription: "The path to the folder containing the devcontainer.json file that will be used to build the workspace and can either be an absolute path or a path relative to the workspace folder. If not provided, defaults to `.devcontainer`.",
100100
Optional: true,
101101
},
102102
"devcontainer_json_path": schema.StringAttribute{
103-
MarkdownDescription: "TODO",
103+
MarkdownDescription: "The path to a devcontainer.json file that is either an absolute path or a path relative to DevcontainerDir. This can be used in cases where one wants to substitute an edited devcontainer.json file for the one that exists in the repo.",
104104
Optional: true,
105105
},
106106
"dockerfile_path": schema.StringAttribute{
107-
MarkdownDescription: "TODO",
107+
MarkdownDescription: "The relative path to the Dockerfile that will be used to build the workspace. This is an alternative to using a devcontainer that some might find simpler.",
108108
Optional: true,
109109
},
110110
"docker_config_base64": schema.StringAttribute{
111-
MarkdownDescription: "TODO",
111+
MarkdownDescription: "The base64 encoded Docker config file that will be used to pull images from private container registries.",
112112
Optional: true,
113113
},
114114
// TODO(mafredri): Map vs List? Support both?
@@ -122,7 +122,7 @@ func (d *CachedImageDataSource) Schema(ctx context.Context, req datasource.Schem
122122
Computed: true,
123123
},
124124
"exit_on_build_failure": schema.BoolAttribute{
125-
MarkdownDescription: "TODO",
125+
MarkdownDescription: "Terminates upon a build failure. This is handy when preferring the FALLBACK_IMAGE in cases where no devcontainer.json or image is provided. However, it ensures that the container stops if the build process encounters an error.",
126126
Optional: true,
127127
},
128128
// TODO(mafredri): Map vs List? Support both?
@@ -132,19 +132,19 @@ func (d *CachedImageDataSource) Schema(ctx context.Context, req datasource.Schem
132132
Optional: true,
133133
},
134134
"fallback_image": schema.StringAttribute{
135-
MarkdownDescription: "TODO",
135+
MarkdownDescription: "Specifies an alternative image to use when neither an image is declared in the devcontainer.json file nor a Dockerfile is present. If there's a build failure (from a faulty Dockerfile) or a misconfiguration, this image will be the substitute. Set ExitOnBuildFailure to true to halt the container if the build faces an issue.",
136136
Optional: true,
137137
},
138138
"git_clone_depth": schema.Int64Attribute{
139-
MarkdownDescription: "TODO",
139+
MarkdownDescription: "The depth to use when cloning the Git repository.",
140140
Optional: true,
141141
},
142142
"git_clone_single_branch": schema.BoolAttribute{
143-
MarkdownDescription: "TODO",
143+
MarkdownDescription: "Clone only a single branch of the Git repository.",
144144
Optional: true,
145145
},
146146
"git_http_proxy_url": schema.StringAttribute{
147-
MarkdownDescription: "TODO",
147+
MarkdownDescription: "The URL for the HTTP proxy. This is optional.",
148148
Optional: true,
149149
},
150150
"git_password": schema.StringAttribute{
@@ -153,7 +153,7 @@ func (d *CachedImageDataSource) Schema(ctx context.Context, req datasource.Schem
153153
Optional: true,
154154
},
155155
"git_ssh_private_key_path": schema.StringAttribute{
156-
MarkdownDescription: "TODO",
156+
MarkdownDescription: "Path to an SSH private key to be used for Git authentication.",
157157
Optional: true,
158158
},
159159
"git_username": schema.StringAttribute{
@@ -165,11 +165,11 @@ func (d *CachedImageDataSource) Schema(ctx context.Context, req datasource.Schem
165165
Required: true,
166166
},
167167
"id": schema.StringAttribute{
168-
MarkdownDescription: "Cached image identifier",
168+
MarkdownDescription: "Cached image identifier. This will generally be the image's SHA256 digest.",
169169
Computed: true,
170170
},
171171
"ignore_paths": schema.ListAttribute{
172-
MarkdownDescription: "TODO",
172+
MarkdownDescription: "The comma separated list of paths to ignore when building the workspace.",
173173
ElementType: types.StringType,
174174
Optional: true,
175175
},
@@ -178,11 +178,11 @@ func (d *CachedImageDataSource) Schema(ctx context.Context, req datasource.Schem
178178
Computed: true,
179179
},
180180
"insecure": schema.BoolAttribute{
181-
MarkdownDescription: "TODO",
181+
MarkdownDescription: "Bypass TLS verification when cloning and pulling from container registries.",
182182
Optional: true,
183183
},
184184
"ssl_cert_base64": schema.StringAttribute{
185-
MarkdownDescription: "TODO",
185+
MarkdownDescription: "The content of an SSL cert file. This is useful for self-signed certificates.",
186186
Optional: true,
187187
},
188188
"verbose": schema.BoolAttribute{

0 commit comments

Comments
 (0)