From 27453ec2d648f91f7f7662b165546655f7f339cd Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Wed, 25 Sep 2024 07:47:53 -0400 Subject: [PATCH] Add a Z suffix to indicate UTC --- task/generate-labels/0.1/generate-labels.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/task/generate-labels/0.1/generate-labels.yaml b/task/generate-labels/0.1/generate-labels.yaml index c7fe9e7d52..9179837c0e 100644 --- a/task/generate-labels/0.1/generate-labels.yaml +++ b/task/generate-labels/0.1/generate-labels.yaml @@ -20,9 +20,9 @@ spec: The following environment variables are defined for use in LABEL_TEMPLATES - * ACTUAL_DATE - a date time string containing the time this task runs, formatted +'%Y-%m-%dT%H:%M:%S' + * ACTUAL_DATE - a date time string containing the time this task runs, formatted +'%Y-%m-%dT%H:%M:%SZ' * ACTUAL_DATE_EPOCH - the timestamp at the time this task runs - * SOURCE_DATE - a date time string containing the provided source timestamp, formatted +'%Y-%m-%dT%H:%M:%S' + * SOURCE_DATE - a date time string containing the provided source timestamp, formatted +'%Y-%m-%dT%H:%M:%SZ' * SOURCE_DATE_EPOCH - the timestamp provided as a param meant to represent the timestamp at which the source was last modified params: @@ -47,12 +47,12 @@ spec: #!/bin/bash ACTUAL_DATE_EPOCH=$(date -u +'%s') - ACTUAL_DATE=$(date -u --date=@"$ACTUAL_DATE_EPOCH" +'%Y-%m-%dT%H:%M:%S') + ACTUAL_DATE=$(date -u --date=@"$ACTUAL_DATE_EPOCH" +'%Y-%m-%dT%H:%M:%SZ') if [ "$SOURCE_DATE_EPOCH" == "" ]; then SOURCE_DATE_EPOCH="$ACTUAL_DATE_EPOCH" fi - SOURCE_DATE=$(date -u --date=@"$SOURCE_DATE_EPOCH" +'%Y-%m-%dT%H:%M:%S') + SOURCE_DATE=$(date -u --date=@"$SOURCE_DATE_EPOCH" +'%Y-%m-%dT%H:%M:%SZ') # Export, so that these are available to the subshell below export ACTUAL_DATE