From a2ecf46e04ec8a17874073a5c12a5b075fa9801d Mon Sep 17 00:00:00 2001 From: Tomas Hozza Date: Fri, 30 Jul 2021 14:48:48 +0200 Subject: [PATCH] osbuild2: extend chrony stage with `leapsectz` property Add support for specifying the `leapsectz` property of `org.osbuild.chrony` stage. Modify stage tests to test setting of the value. Signed-off-by: Tomas Hozza --- internal/osbuild2/chrony_stage.go | 1 + internal/osbuild2/stage_test.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/osbuild2/chrony_stage.go b/internal/osbuild2/chrony_stage.go index c2a2c765b..46873e698 100644 --- a/internal/osbuild2/chrony_stage.go +++ b/internal/osbuild2/chrony_stage.go @@ -9,6 +9,7 @@ import ( type ChronyStageOptions struct { Timeservers []string `json:"timeservers,omitempty"` Servers []ChronyConfigServer `json:"servers,omitempty"` + LeapsecTz *string `json:"leapsectz,omitempty"` } func (ChronyStageOptions) isStageOptions() {} diff --git a/internal/osbuild2/stage_test.go b/internal/osbuild2/stage_test.go index 63428d5f1..e2baac899 100644 --- a/internal/osbuild2/stage_test.go +++ b/internal/osbuild2/stage_test.go @@ -129,10 +129,11 @@ func TestStage_UnmarshalJSON(t *testing.T) { Hostname: "ntp.example.com", }, }, + LeapsecTz: common.StringToPtr(""), }, }, args: args{ - data: []byte(`{"type":"org.osbuild.chrony","options":{"servers":[{"hostname":"127.0.0.1","minpoll":0,"maxpoll":4,"iburst":true,"prefer":false},{"hostname":"ntp.example.com"}]}}`), + data: []byte(`{"type":"org.osbuild.chrony","options":{"servers":[{"hostname":"127.0.0.1","minpoll":0,"maxpoll":4,"iburst":true,"prefer":false},{"hostname":"ntp.example.com"}],"leapsectz":""}}`), }, }, {