TIL plantimestamp > timestamp because timestamp is evaluated at apply.

This commit is contained in:
Greyscale 2024-12-12 22:35:12 +01:00
parent b3950b394e
commit c99d837055
Signed by: grey
GPG key ID: DDB392AE64B32D89
3 changed files with 5 additions and 5 deletions
docker
config
volume
products/docker_registry

View file

@ -14,7 +14,7 @@ locals {
labels = merge(var.labels, {
"com.docker.stack.namespace" = var.stack_name
"ooo.grey.config.stack" = var.stack_name
#"ooo.grey.config.created" = timestamp()
#"ooo.grey.config.created" = plantimestamp()
"ooo.grey.config.bytes" = length(var.value)
"ooo.grey.config.name" = local.config_name
"ooo.grey.config.hash" = sha1(var.value)

View file

@ -2,14 +2,14 @@ locals {
volume_name = substr(join("-", [
substr(var.stack_name, 0, 20),
substr(var.volume_name, 0, 64 - 1 - 3 - 20 - 6 - 6),
formatdate("YYMMDD", timestamp()),
formatdate("hhmmss", timestamp()),
formatdate("YYMMDD", plantimestamp()),
formatdate("hhmmss", plantimestamp()),
]), 0, 63)
labels = merge(var.labels, {
"com.docker.stack.namespace" = var.stack_name
"ooo.grey.volume.stack" = var.stack_name
"ooo.grey.volume.name" = var.volume_name
#"ooo.grey.volume.created" = timestamp()
#"ooo.grey.volume.created" = plantimestamp()
})
}

View file

@ -25,7 +25,7 @@ resource "htpasswd_password" "registry_users" {
salt = random_password.salt[each.key].result
}
resource "docker_config" "docker_registry_htpasswd" {
name = "docker-registry-htpasswd-${replace(timestamp(), ":", ".")}"
name = "docker-registry-htpasswd-${replace(plantimestamp(), ":", ".")}"
data = base64encode(local.registry_htpasswd)
lifecycle {
ignore_changes = [name]