Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions docs/data-sources/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Optional:
- `accounts` (Object) (see [below for nested schema](#nestedobjatt--configs--config--accounts))
- `annotations` (Map of String)
- `archs` (List of String)
- `certificates` (Object) (see [below for nested schema](#nestedobjatt--configs--config--certificates))
- `cmd` (String)
- `contents` (Object) (see [below for nested schema](#nestedobjatt--configs--config--contents))
- `entrypoint` (Object) (see [below for nested schema](#nestedobjatt--configs--config--entrypoint))
Expand Down Expand Up @@ -87,23 +86,6 @@ Optional:



<a id="nestedobjatt--configs--config--certificates"></a>
### Nested Schema for `configs.config.certificates`

Optional:

- `additional` (List of Object) (see [below for nested schema](#nestedobjatt--configs--config--certificates--additional))

<a id="nestedobjatt--configs--config--certificates--additional"></a>
### Nested Schema for `configs.config.certificates.additional`

Optional:

- `content` (String)
- `name` (String)



<a id="nestedobjatt--configs--config--contents"></a>
### Nested Schema for `configs.config.contents`

Expand Down Expand Up @@ -160,7 +142,6 @@ Read-Only:
- `accounts` (Object) (see [below for nested schema](#nestedobjatt--config--accounts))
- `annotations` (Map of String)
- `archs` (List of String)
- `certificates` (Object) (see [below for nested schema](#nestedobjatt--config--certificates))
- `cmd` (String)
- `contents` (Object) (see [below for nested schema](#nestedobjatt--config--contents))
- `entrypoint` (Object) (see [below for nested schema](#nestedobjatt--config--entrypoint))
Expand Down Expand Up @@ -205,23 +186,6 @@ Read-Only:



<a id="nestedobjatt--config--certificates"></a>
### Nested Schema for `config.certificates`

Read-Only:

- `additional` (List of Object) (see [below for nested schema](#nestedobjatt--config--certificates--additional))

<a id="nestedobjatt--config--certificates--additional"></a>
### Nested Schema for `config.certificates.additional`

Read-Only:

- `content` (String)
- `name` (String)



<a id="nestedobjatt--config--contents"></a>
### Nested Schema for `config.contents`

Expand Down
18 changes: 0 additions & 18 deletions docs/data-sources/tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Required:
- `accounts` (Object) (see [below for nested schema](#nestedobjatt--config--accounts))
- `annotations` (Map of String)
- `archs` (List of String)
- `certificates` (Object) (see [below for nested schema](#nestedobjatt--config--certificates))
- `cmd` (String)
- `contents` (Object) (see [below for nested schema](#nestedobjatt--config--contents))
- `entrypoint` (Object) (see [below for nested schema](#nestedobjatt--config--entrypoint))
Expand Down Expand Up @@ -78,23 +77,6 @@ Required:



<a id="nestedobjatt--config--certificates"></a>
### Nested Schema for `config.certificates`

Required:

- `additional` (List of Object) (see [below for nested schema](#nestedobjatt--config--certificates--additional))

<a id="nestedobjatt--config--certificates--additional"></a>
### Nested Schema for `config.certificates.additional`

Required:

- `content` (String)
- `name` (String)



<a id="nestedobjatt--config--contents"></a>
### Nested Schema for `config.contents`

Expand Down
36 changes: 0 additions & 36 deletions docs/resources/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ Required:
- `accounts` (Object) (see [below for nested schema](#nestedobjatt--config--accounts))
- `annotations` (Map of String)
- `archs` (List of String)
- `certificates` (Object) (see [below for nested schema](#nestedobjatt--config--certificates))
- `cmd` (String)
- `contents` (Object) (see [below for nested schema](#nestedobjatt--config--contents))
- `entrypoint` (Object) (see [below for nested schema](#nestedobjatt--config--entrypoint))
Expand Down Expand Up @@ -121,23 +120,6 @@ Required:



<a id="nestedobjatt--config--certificates"></a>
### Nested Schema for `config.certificates`

Required:

- `additional` (List of Object) (see [below for nested schema](#nestedobjatt--config--certificates--additional))

<a id="nestedobjatt--config--certificates--additional"></a>
### Nested Schema for `config.certificates.additional`

Required:

- `content` (String)
- `name` (String)



<a id="nestedobjatt--config--contents"></a>
### Nested Schema for `config.contents`

Expand Down Expand Up @@ -200,7 +182,6 @@ Optional:
- `accounts` (Object) (see [below for nested schema](#nestedobjatt--configs--config--accounts))
- `annotations` (Map of String)
- `archs` (List of String)
- `certificates` (Object) (see [below for nested schema](#nestedobjatt--configs--config--certificates))
- `cmd` (String)
- `contents` (Object) (see [below for nested schema](#nestedobjatt--configs--config--contents))
- `entrypoint` (Object) (see [below for nested schema](#nestedobjatt--configs--config--entrypoint))
Expand Down Expand Up @@ -245,23 +226,6 @@ Optional:



<a id="nestedobjatt--configs--config--certificates"></a>
### Nested Schema for `configs.config.certificates`

Optional:

- `additional` (List of Object) (see [below for nested schema](#nestedobjatt--configs--config--certificates--additional))

<a id="nestedobjatt--configs--config--certificates--additional"></a>
### Nested Schema for `configs.config.certificates.additional`

Optional:

- `content` (String)
- `name` (String)



<a id="nestedobjatt--configs--config--contents"></a>
### Nested Schema for `configs.config.contents`

Expand Down
16 changes: 16 additions & 0 deletions internal/provider/config_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ func init() {
panic("expected object type")
}

// TODO: Certificates are optional, but our schema generation using
// schema.ObjectAttribute with AttributeTypes doesn't support field-level
// optional/required controls. For now, remove certificates from the schema
// type definition. We also remove it from generated values in the Read method.
delete(imageConfigurationSchema.AttrTypes, "certificates")

imageConfigurationsSchema = basetypes.ObjectType{
AttrTypes: map[string]attr.Type{
"config": imageConfigurationSchema,
Expand Down Expand Up @@ -225,6 +231,16 @@ func (d *ConfigDataSource) Read(ctx context.Context, req datasource.ReadRequest,
return
}

// Remove certificates from the generated value to match the schema
// TODO: see above about optional types.
attrs := cfg.Attributes()
delete(attrs, "certificates")
cfg, diags = types.ObjectValue(imageConfigurationSchema.AttrTypes, attrs)
resp.Diagnostics = append(resp.Diagnostics, diags...)
if diags.HasError() {
return
}

// Keep original behavior for "apko_config.config" that only uses only the merged "index" arch.
if arch == "index" {
if out := os.Getenv("TF_APKO_OUT_DIR"); out != "" {
Expand Down
Loading