debian-forge-composer/internal/osbuild2
Tomas Hozza f06e66b94b osbuild2: support for servers option in org.osbuild.chrony
Add support for the newly added `servers` option in the
`org.osbuild.chrony` osbuild stage [1]. The option allows one to
specify timeservers to be used by chrony, including a subset of
lower-level configuration options per each server.

Implement a custom JSON marshaller method for `ChronyStageOptions` to
ensure that exactly one of 'timeservers' or 'servers' is specified, as
mandated by the stage schema.

Optional values in `ChronyConfigServer` are declared as pointers to
distinguish the case when the value was explicitly set by the user from
the default value when the structure instance is created. All of these
options should be omitted from the JSON, but only when not explicitly
set, not when their value us "0" for int or "false" for bool. Downside
of this approach is that one can not easily use pointer to a basic
type literal in the struct literal. Passing the basic type literal has
to be workarounded using an intermediate variable, which address is
used in the struct literal.

Add unit test cases for the added functionality.

[1] https://github.com/osbuild/osbuild/pull/692

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-07-08 19:37:09 +02:00
..
anaconda_stage.go osbuild2: add support for new osbuild stages 2021-03-17 18:12:17 +00:00
bootiso_stage.go osbuild2/bootiso: arch-based xz compression option 2021-05-11 12:10:09 +02:00
buildstamp_stage.go osbuild2: add support for new osbuild stages 2021-03-17 18:12:17 +00:00
chrony_stage.go osbuild2: support for servers option in org.osbuild.chrony 2021-07-08 19:37:09 +02:00
chrony_stage_test.go osbuild2: support for servers option in org.osbuild.chrony 2021-07-08 19:37:09 +02:00
cloud_init_stage.go osbuild2: add support for org.osbuild.cloud-init stage 2021-07-08 19:37:09 +02:00
cloud_init_stage_test.go osbuild2: add support for org.osbuild.cloud-init stage 2021-07-08 19:37:09 +02:00
curl_source.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
discinfo_stage.go osbuild2: add support for new osbuild stages 2021-03-17 18:12:17 +00:00
dracut_conf_stage.go osbuild2: add support for org.osbuild.dracut.conf stage 2021-07-08 19:37:09 +02:00
dracut_conf_stage_test.go osbuild2: add support for org.osbuild.dracut.conf stage 2021-07-08 19:37:09 +02:00
dracut_stage.go osbuild2: new dracut stage to re-create initrd 2021-03-17 18:12:17 +00:00
dracut_stage_test.go osbuild2: new dracut stage to re-create initrd 2021-03-17 18:12:17 +00:00
files_input.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
firewall_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
firewall_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
first_boot_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
first_boot_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
fix_bls_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
fix_bls_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
fstab_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
fstab_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
groups_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
groups_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
grub2_stage.go osbuild2: add SavedEntry to Grub2StageOptions 2021-03-17 18:12:17 +00:00
grub2_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
hostname_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
hostname_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
implantisomd5_stage.go osbuild2: add support for new osbuild stages 2021-03-17 18:12:17 +00:00
kernel_cmdline_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
kernel_cmdline_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
keymap_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
keymap_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
kickstart_stage.go rhel85: tar installer main pipeline 2021-07-01 12:48:32 +02:00
locale_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
locale_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
lorax_script_stage.go osbuild2: add support for new osbuild stages 2021-03-17 18:12:17 +00:00
modprobe_stage.go osbuild2: add support for org.osbuild.modprobe stage 2021-07-08 19:37:09 +02:00
modprobe_stage_test.go osbuild2: add support for org.osbuild.modprobe stage 2021-07-08 19:37:09 +02:00
oci_archive_stage.go obsuild2: support additional layers in oci-archive 2021-03-17 18:12:17 +00:00
oci_archive_stage_test.go obsuild2: support additional layers in oci-archive 2021-03-17 18:12:17 +00:00
osbuild.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
osbuild_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
ostree_commit_stage.go osbuild2: add support for reading stage metadata 2021-06-29 09:33:05 +01:00
ostree_init_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
ostree_input.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
ostree_preptree_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
ostree_pull_stage.go osbuild2: add support for new osbuild stages 2021-03-17 18:12:17 +00:00
ostree_source.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
result.go osbuild2: add support for reading stage metadata 2021-06-29 09:33:05 +01:00
result_test.go osbuild1/result: fix conversion of success field from v2 2021-03-19 18:50:31 +01:00
rhsm_stage.go osbuild2: support for subscription-manager option in org.osbuild.rhsm 2021-07-08 19:37:09 +02:00
rhsm_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
rpm_stage.go osbuild2: add support for reading stage metadata 2021-06-29 09:33:05 +01:00
rpm_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
script_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
script_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
selinux_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
selinux_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
source.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
source_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
stage.go osbuild2: add support for org.osbuild.cloud-init stage 2021-07-08 19:37:09 +02:00
stage_test.go osbuild2: support for servers option in org.osbuild.chrony 2021-07-08 19:37:09 +02:00
sysconfig_stage.go osbuild2: support for network-scripts option in org.osbuild.sysconfig 2021-07-08 19:37:09 +02:00
sysconfig_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
systemd_logind_stage.go osbuild2: add support for org.osbuild.systemd-logind stage 2021-07-08 19:37:09 +02:00
systemd_logind_stage_test.go osbuild2: add support for org.osbuild.systemd-logind stage 2021-07-08 19:37:09 +02:00
systemd_stage.go osbuild2: support for unit-dropins option in org.osbuild.systemd 2021-07-08 19:37:09 +02:00
systemd_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
tar_stage.go osbuild2: tar stage 2021-05-11 12:10:09 +02:00
timezone_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
timezone_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
tree_input.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
users_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
users_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
xorrisofs_stage.go rhel84,osbuild2: add system ID to ISO 2021-03-17 18:12:17 +00:00
zipl_stage.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00
zipl_stage_test.go osbuild2: new schema types: stages, inputs, sources 2021-03-17 18:12:17 +00:00