Skip to content

Commit

Permalink
Remove base_image defaults for static bases.
Browse files Browse the repository at this point in the history
Instead of configuring this per-image/module, recommendation should be to
configure this at the ko-module level unless a specific base image is
needed for a particular module.

Including defaults throws off provider-level behavior, so remove these
so they only apply if they are explicitly set.
  • Loading branch information
wlynch committed Apr 10, 2024
1 parent 36cc93c commit 2c4a58d
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 9 deletions.
2 changes: 1 addition & 1 deletion modules/cron/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ No requirements.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_base_image"></a> [base\_image](#input\_base\_image) | The base image that will be used to build the container image. | `string` | `"cgr.dev/chainguard/static:latest-glibc"` | no |
| <a name="input_base_image"></a> [base\_image](#input\_base\_image) | The base image that will be used to build the container image. | `string` | `null` | no |
| <a name="input_cpu"></a> [cpu](#input\_cpu) | The CPU limit for the job. | `string` | `"1000m"` | no |
| <a name="input_env"></a> [env](#input\_env) | A map of custom environment variables (e.g. key=value) | `map` | `{}` | no |
| <a name="input_exec"></a> [exec](#input\_exec) | Execute job on modify. | `bool` | `false` | no |
Expand Down
33 changes: 33 additions & 0 deletions modules/cron/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_google"></a> [google](#provider\_google) | n/a |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_cron"></a> [cron](#module\_cron) | ../ | n/a |

## Resources

| Name | Type |
|------|------|
| [google_service_account.this](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/service_account) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | The project that will host the cron job. | `string` | n/a | yes |

## Outputs

No outputs.
<!-- END_TF_DOCS -->

Check failure on line 33 in modules/cron/example/README.md

View workflow job for this annotation

GitHub Actions / Lint

[EOF Newline] reported by reviewdog 🐶 Missing newline Raw Output: modules/cron/example/README.md:33: Missing newline
2 changes: 1 addition & 1 deletion modules/cron/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ variable "schedule" {

variable "base_image" {
type = string
default = "cgr.dev/chainguard/static:latest-glibc"
default = null
description = "The base image that will be used to build the container image."
}

Expand Down
5 changes: 2 additions & 3 deletions modules/dashboard/sections/github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ No providers.
|------|--------|---------|
| <a name="module_collapsible"></a> [collapsible](#module\_collapsible) | ../collapsible | n/a |
| <a name="module_limit"></a> [limit](#module\_limit) | ../../widgets/xy | n/a |
| <a name="module_remaining"></a> [remaining](#module\_remaining) | ../../widgets/xy | n/a |
| <a name="module_reset"></a> [reset](#module\_reset) | ../../widgets/xy | n/a |
| <a name="module_time_to_reset"></a> [time\_to\_reset](#module\_time\_to\_reset) | ../../widgets/xy | n/a |
| <a name="module_used"></a> [used](#module\_used) | ../../widgets/xy | n/a |
| <a name="module_width"></a> [width](#module\_width) | ../width | n/a |

## Resources
Expand All @@ -25,7 +25,6 @@ No resources.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_cloudrun_name"></a> [cloudrun\_name](#input\_cloudrun\_name) | n/a | `string` | n/a | yes |
| <a name="input_collapsed"></a> [collapsed](#input\_collapsed) | n/a | `bool` | `false` | no |
| <a name="input_filter"></a> [filter](#input\_filter) | n/a | `list(string)` | n/a | yes |
| <a name="input_title"></a> [title](#input\_title) | n/a | `string` | n/a | yes |
Expand Down
2 changes: 1 addition & 1 deletion modules/dashboard/sections/resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ No requirements.
| <a name="input_cloudrun_name"></a> [cloudrun\_name](#input\_cloudrun\_name) | n/a | `string` | n/a | yes |
| <a name="input_collapsed"></a> [collapsed](#input\_collapsed) | n/a | `bool` | `false` | no |
| <a name="input_filter"></a> [filter](#input\_filter) | n/a | `list(string)` | n/a | yes |
| <a name="input_notification_channels"></a> [notification\_channels](#input\_notification\_channels) | n/a | `list(string)` | `[]` | no |
| <a name="input_notification_channels"></a> [notification\_channels](#input\_notification\_channels) | n/a | `list(string)` | n/a | yes |
| <a name="input_title"></a> [title](#input\_title) | n/a | `string` | n/a | yes |

## Outputs
Expand Down
2 changes: 1 addition & 1 deletion modules/dashboard/sections/subscription/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ No requirements.
|------|-------------|------|---------|:--------:|
| <a name="input_alert_threshold"></a> [alert\_threshold](#input\_alert\_threshold) | n/a | `number` | `50000` | no |
| <a name="input_collapsed"></a> [collapsed](#input\_collapsed) | n/a | `bool` | `false` | no |
| <a name="input_notification_channels"></a> [notification\_channels](#input\_notification\_channels) | n/a | `list(string)` | `[]` | no |
| <a name="input_notification_channels"></a> [notification\_channels](#input\_notification\_channels) | n/a | `list(string)` | n/a | yes |
| <a name="input_subscription_prefix"></a> [subscription\_prefix](#input\_subscription\_prefix) | n/a | `string` | n/a | yes |
| <a name="input_title"></a> [title](#input\_title) | n/a | `string` | n/a | yes |

Expand Down
2 changes: 1 addition & 1 deletion modules/regional-go-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ No requirements.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_containers"></a> [containers](#input\_containers) | The containers to run in the service. Each container will be run in each region. | <pre>map(object({<br> source = object({<br> base_image = optional(string, "cgr.dev/chainguard/static:latest-glibc")<br> working_dir = string<br> importpath = string<br> })<br> args = optional(list(string), [])<br> ports = optional(list(object({<br> name = optional(string, "http1")<br> container_port = number<br> })), [])<br> resources = optional(<br> object(<br> {<br> limits = optional(object(<br> {<br> cpu = string<br> memory = string<br> }<br> ), null)<br> cpu_idle = optional(bool, true)<br> startup_cpu_boost = optional(bool, false)<br> }<br> ),<br> {<br> cpu_idle = true<br> }<br> )<br> env = optional(list(object({<br> name = string<br> value = optional(string)<br> value_source = optional(object({<br> secret_key_ref = object({<br> secret = string<br> version = string<br> })<br> }), null)<br> })), [])<br> regional-env = optional(list(object({<br> name = string<br> value = map(string)<br> })), [])<br> volume_mounts = optional(list(object({<br> name = string<br> mount_path = string<br> })), [])<br> }))</pre> | n/a | yes |
| <a name="input_containers"></a> [containers](#input\_containers) | The containers to run in the service. Each container will be run in each region. | <pre>map(object({<br> source = object({<br> base_image = optional(string)<br> working_dir = string<br> importpath = string<br> })<br> args = optional(list(string), [])<br> ports = optional(list(object({<br> name = optional(string, "http1")<br> container_port = number<br> })), [])<br> resources = optional(<br> object(<br> {<br> limits = optional(object(<br> {<br> cpu = string<br> memory = string<br> }<br> ), null)<br> cpu_idle = optional(bool, true)<br> startup_cpu_boost = optional(bool, false)<br> }<br> ),<br> {<br> cpu_idle = true<br> }<br> )<br> env = optional(list(object({<br> name = string<br> value = optional(string)<br> value_source = optional(object({<br> secret_key_ref = object({<br> secret = string<br> version = string<br> })<br> }), null)<br> })), [])<br> regional-env = optional(list(object({<br> name = string<br> value = map(string)<br> })), [])<br> volume_mounts = optional(list(object({<br> name = string<br> mount_path = string<br> })), [])<br> }))</pre> | n/a | yes |
| <a name="input_egress"></a> [egress](#input\_egress) | Which type of egress traffic to send through the VPC.<br><br>- ALL\_TRAFFIC sends all traffic through regional VPC network<br>- PRIVATE\_RANGES\_ONLY sends only traffic to private IP addresses through regional VPC network | `string` | `"ALL_TRAFFIC"` | no |
| <a name="input_execution_environment"></a> [execution\_environment](#input\_execution\_environment) | The execution environment for the service | `string` | `"EXECUTION_ENVIRONMENT_GEN1"` | no |
| <a name="input_ingress"></a> [ingress](#input\_ingress) | Which type of ingress traffic to accept for the service.<br><br>- INGRESS\_TRAFFIC\_ALL accepts all traffic, enabling the public .run.app URL for the service<br>- INGRESS\_TRAFFIC\_INTERNAL\_LOAD\_BALANCER accepts traffic only from a load balancer<br>- INGRESS\_TRAFFIC\_INTERNAL\_ONLY accepts internal traffic only | `string` | `"INGRESS_TRAFFIC_INTERNAL_ONLY"` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/regional-go-service/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ variable "containers" {
description = "The containers to run in the service. Each container will be run in each region."
type = map(object({
source = object({
base_image = optional(string, "cgr.dev/chainguard/static:latest-glibc")
base_image = optional(string)
working_dir = string
importpath = string
})
Expand Down

0 comments on commit 2c4a58d

Please sign in to comment.