Skip to content

Commit

Permalink
Add support for multiple custom labels in node templates (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiriloman authored Mar 24, 2023
1 parent 559f477 commit d998108
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ module "castai-aks-cluster" {
configuration_id = module.castai-aks-cluster.castai_node_configurations["default"]
should_taint = true
custom_label = {
key = "custom-key"
value = "label-value"
custom_labels = {
custom-label-key-1 = "custom-label-value-1"
custom-label-key-2 = "custom-label-value-2"
}
custom_taints = [
Expand Down Expand Up @@ -96,7 +97,7 @@ Usage examples are located in [terraform provider repo](https://github.com/casta
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
| <a name="requirement_azuread"></a> [azuread](#requirement\_azuread) | >= 2.22.0 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | >= 3.7.0 |
| <a name="requirement_castai"></a> [castai](#requirement\_castai) | >= 3.2.0 |
| <a name="requirement_castai"></a> [castai](#requirement\_castai) | >= 3.3.0 |
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 2.0.0 |

## Providers
Expand All @@ -105,7 +106,7 @@ Usage examples are located in [terraform provider repo](https://github.com/casta
|------|---------|
| <a name="provider_azuread"></a> [azuread](#provider\_azuread) | >= 2.22.0 |
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | >= 3.7.0 |
| <a name="provider_castai"></a> [castai](#provider\_castai) | >= 3.2.0 |
| <a name="provider_castai"></a> [castai](#provider\_castai) | >= 3.3.0 |
| <a name="provider_helm"></a> [helm](#provider\_helm) | >= 2.0.0 |

## Modules
Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ resource "castai_node_template" "this" {
value = try(custom_label.value.value, null)
}
}

custom_labels = try(each.value.custom_labels, {})

dynamic "custom_taints" {
for_each = flatten([lookup(each.value, "custom_taints", [])])
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
castai = {
source = "castai/castai"
version = ">= 3.2.0"
version = ">= 3.3.0"
}
helm = {
source = "hashicorp/helm"
Expand Down

0 comments on commit d998108

Please sign in to comment.