diff --git a/internal/osbuild2/stage_test.go b/internal/osbuild2/stage_test.go index 4873b9d81..4800d0a0b 100644 --- a/internal/osbuild2/stage_test.go +++ b/internal/osbuild2/stage_test.go @@ -467,30 +467,19 @@ func TestStage_UnmarshalJSON(t *testing.T) { }, { name: "systemd-logind", - fields: fields{ - Type: "org.osbuild.systemd-logind", - Options: &SystemdLogindStageOptions{}, - }, - args: args{ - data: []byte(`{"type":"org.osbuild.systemd-logind","options":{}}`), - }, - }, - { - name: "systemd-logind-data", fields: fields{ Type: "org.osbuild.systemd-logind", Options: &SystemdLogindStageOptions{ - ConfigDropins: map[string]SystemdLogindConfigDropin{ - "10-ec2-getty-fix.conf": { - Login: SystemdLogindConfigLoginSection{ - NAutoVT: common.IntToPtr(0), - }, + Filename: "10-ec2-getty-fix.conf", + Config: SystemdLogindConfigDropin{ + Login: SystemdLogindConfigLoginSection{ + NAutoVT: common.IntToPtr(0), }, }, }, }, args: args{ - data: []byte(`{"type":"org.osbuild.systemd-logind","options":{"configuration_dropins":{"10-ec2-getty-fix.conf":{"Login":{"NAutoVT":0}}}}}`), + data: []byte(`{"type":"org.osbuild.systemd-logind","options":{"filename":"10-ec2-getty-fix.conf","config":{"Login":{"NAutoVT":0}}}}`), }, }, { diff --git a/internal/osbuild2/systemd_logind_stage.go b/internal/osbuild2/systemd_logind_stage.go index 6e13cdae3..a69759fa9 100644 --- a/internal/osbuild2/systemd_logind_stage.go +++ b/internal/osbuild2/systemd_logind_stage.go @@ -6,7 +6,8 @@ import ( ) type SystemdLogindStageOptions struct { - ConfigDropins map[string]SystemdLogindConfigDropin `json:"configuration_dropins,omitempty"` + Filename string `json:"filename"` + Config SystemdLogindConfigDropin `json:"config"` } func (SystemdLogindStageOptions) isStageOptions() {} diff --git a/internal/osbuild2/systemd_logind_stage_test.go b/internal/osbuild2/systemd_logind_stage_test.go index a3be6fb38..f64fbf1c0 100644 --- a/internal/osbuild2/systemd_logind_stage_test.go +++ b/internal/osbuild2/systemd_logind_stage_test.go @@ -21,13 +21,16 @@ func TestSystemdLogindStage_MarshalJSON_Invalid(t *testing.T) { name string options SystemdLogindStageOptions }{ + { + name: "empty-options", + options: SystemdLogindStageOptions{}, + }, { name: "no-section-options", options: SystemdLogindStageOptions{ - ConfigDropins: map[string]SystemdLogindConfigDropin{ - "10-ec2-getty-fix.conf": { - Login: SystemdLogindConfigLoginSection{}, - }, + Filename: "10-ec2-getty-fix.conf", + Config: SystemdLogindConfigDropin{ + Login: SystemdLogindConfigLoginSection{}, }, }, },