From a77e3365ac6b3512c3abd82ad50a2482982c5c3a Mon Sep 17 00:00:00 2001 From: "Luis (LT) Carbonell" Date: Wed, 25 Sep 2024 22:40:50 +0000 Subject: [PATCH] backport of commit b861d8b03f9d4cdad2cb4d3d8576f8d023b22a14 --- builtin/logical/database/path_creds_create.go | 4 ++++ changelog/28509.txt | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 changelog/28509.txt diff --git a/builtin/logical/database/path_creds_create.go b/builtin/logical/database/path_creds_create.go index d8696fc0a12a..53ca3b7bdb40 100644 --- a/builtin/logical/database/path_creds_create.go +++ b/builtin/logical/database/path_creds_create.go @@ -268,6 +268,10 @@ func (b *databaseBackend) pathStaticCredsRead() framework.OperationFunc { if role.StaticAccount.RotationWindow.Seconds() != 0 { respData["rotation_window"] = role.StaticAccount.RotationWindow.Seconds() } + + // The schedule is in UTC, but we want to convert it to the local time + role.StaticAccount.Schedule.Location = time.Local + respData["ttl"] = role.StaticAccount.CredentialTTL().Seconds() } switch role.CredentialType { diff --git a/changelog/28509.txt b/changelog/28509.txt new file mode 100644 index 000000000000..821f8411464f --- /dev/null +++ b/changelog/28509.txt @@ -0,0 +1,3 @@ +```release-note:bug +databases: fix issue where local timezone was getting lost when using a rotation schedule cron +```