From 4ac004e17868db2a7ff3e5bd7111eb1cf178b7a8 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Wed, 3 Nov 2021 14:43:57 +0100 Subject: [PATCH] stages/cloud-init: add support for configuring reporting handlers It's possible the keys "logging" and "telemetry" can be arbitrary names. If that's the case, we can change the schema without breaking backwards compatibility, so defining known keys is safer. --- stages/org.osbuild.cloud-init | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/stages/org.osbuild.cloud-init b/stages/org.osbuild.cloud-init index 1d5da2a7..adc39ac7 100755 --- a/stages/org.osbuild.cloud-init +++ b/stages/org.osbuild.cloud-init @@ -24,6 +24,12 @@ import osbuild.api SCHEMA = r""" +"definitions": { + "reporting_handlers": { + "type": "string", + "enum": ["log", "print", "webhook", "hyperv"] + } +}, "additionalProperties": false, "required": ["config", "filename"], "properties": { @@ -58,6 +64,32 @@ SCHEMA = r""" } } }, + "reporting": { + "type": "object", + "additionalProperties": false, + "description": "Define reporting endpoints.", + "minProperties": 1, + "properties": { + "logging": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "$ref": "#/definitions/reporting_handlers" + } + } + }, + "telemetry": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "$ref": "#/definitions/reporting_handlers" + } + } + } + } + }, "datasource_list": { "type": "array", "items": {