From afc511ccb9c2b747fb05a79aeceb7c66be74cf6f Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Wed, 17 May 2023 13:09:31 -0400 Subject: [PATCH] feat: Add support for `image_pull_secrets` on service account (#11) --- .pre-commit-config.yaml | 2 +- main.tf | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4d43cdf..aff2dbb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: detect-aws-credentials args: ['--allow-missing-credentials'] - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.77.1 + rev: v1.79.1 hooks: - id: terraform_fmt - id: terraform_docs diff --git a/main.tf b/main.tf index c02f222..ea7b6e3 100644 --- a/main.tf +++ b/main.tf @@ -200,6 +200,14 @@ resource "kubernetes_service_account_v1" "this" { labels = merge(var.labels, try(each.value.service_account.labels, {})) } + dynamic "image_pull_secret" { + for_each = try(each.value.service_account.image_pull_secrets, []) + + content { + name = secret.value.name + } + } + dynamic "secret" { for_each = try(each.value.service_account.secrets, [])