diff --git a/pkg/ubp/types.gen.go b/pkg/ubp/types.gen.go index 2b90a82..92055c8 100644 --- a/pkg/ubp/types.gen.go +++ b/pkg/ubp/types.gen.go @@ -334,6 +334,8 @@ type Container struct { // to freeze the blueprint. This is because the provides will expand into multiple // packages with their own names and versions. type DNF struct { + DNFConfig DNFConfig `json:"config,omitempty,omitzero"` + // Groups Groups to install, must match exactly. Groups describes groups // of packages to be installed into the image. Package groups are defined // in the repository metadata. Each group has a descriptive name used primarily @@ -368,6 +370,16 @@ type DNF struct { Repositories []DNFRepository `json:"repositories,omitempty,omitzero"` } +// DNFConfig defines model for dnf_config. +type DNFConfig struct { + // SetReleasever Set the $releasever DNF variable to the distribution's release. On RHEL + // systems, this ties a system to a specific release, preventing it from + // being updated to a later minor RHEL release through 'dnf upgrade', and is + // the mechanism for keeping systems on extended support releases (EUS and + // E4S). + SetReleasever bool `json:"set_releasever,omitempty,omitzero"` +} + // DNFRepository defines model for dnf_repository. type DNFRepository struct { // Filename Repository filename to use for the repository configuration file. diff --git a/schema/blueprint-oas3-ext.json b/schema/blueprint-oas3-ext.json index b75d26e..26bb96c 100644 --- a/schema/blueprint-oas3-ext.json +++ b/schema/blueprint-oas3-ext.json @@ -328,6 +328,9 @@ "additionalProperties": false, "description": "DNF package managers details. When using virtual provides as the\npackage name the version glob should be *. And be aware that you will be unable\nto freeze the blueprint. This is because the provides will expand into multiple\npackages with their own names and versions.\n", "properties": { + "config": { + "$ref": "#/components/schemas/dnf_config" + }, "groups": { "description": "Groups to install, must match exactly. Groups describes groups\nof packages to be installed into the image. Package groups are defined\nin the repository metadata. Each group has a descriptive name used primarily\nfor display in user interfaces and an ID more commonly used in kickstart\nfiles. Here, the ID is the expected way of listing a group. Groups have\nthree different ways of categorizing their packages: mandatory, default,\nand optional. For the purposes of blueprints, only mandatory and default\npackages will be installed. There is no mechanism for selecting optional\npackages.\n", "items": { @@ -373,6 +376,19 @@ "x-go-name": "DNF", "x-omitempty": true }, + "dnf_config": { + "additionalProperties": false, + "properties": { + "set_releasever": { + "description": "Set the $releasever DNF variable to the distribution's release. On RHEL\nsystems, this ties a system to a specific release, preventing it from\nbeing updated to a later minor RHEL release through 'dnf upgrade', and is\nthe mechanism for keeping systems on extended support releases (EUS and\nE4S).\n", + "type": "boolean", + "x-go-name": "SetReleasever" + } + }, + "type": "object", + "x-go-name": "DNFConfig", + "x-omitempty": true + }, "dnf_repository": { "additionalProperties": false, "properties": { diff --git a/schema/blueprint-oas3.json b/schema/blueprint-oas3.json index 4769e56..99ef151 100644 --- a/schema/blueprint-oas3.json +++ b/schema/blueprint-oas3.json @@ -328,6 +328,9 @@ "additionalProperties": false, "description": "DNF package managers details. When using virtual provides as the\npackage name the version glob should be *. And be aware that you will be unable\nto freeze the blueprint. This is because the provides will expand into multiple\npackages with their own names and versions.\n", "properties": { + "config": { + "$ref": "#/components/schemas/dnf_config" + }, "groups": { "description": "Groups to install, must match exactly. Groups describes groups\nof packages to be installed into the image. Package groups are defined\nin the repository metadata. Each group has a descriptive name used primarily\nfor display in user interfaces and an ID more commonly used in kickstart\nfiles. Here, the ID is the expected way of listing a group. Groups have\nthree different ways of categorizing their packages: mandatory, default,\nand optional. For the purposes of blueprints, only mandatory and default\npackages will be installed. There is no mechanism for selecting optional\npackages.\n", "items": { @@ -373,6 +376,19 @@ "x-go-name": "DNF", "x-omitempty": true }, + "dnf_config": { + "additionalProperties": false, + "properties": { + "set_releasever": { + "description": "Set the $releasever DNF variable to the distribution's release. On RHEL\nsystems, this ties a system to a specific release, preventing it from\nbeing updated to a later minor RHEL release through 'dnf upgrade', and is\nthe mechanism for keeping systems on extended support releases (EUS and\nE4S).\n", + "type": "boolean", + "x-go-name": "SetReleasever" + } + }, + "type": "object", + "x-go-name": "DNFConfig", + "x-omitempty": true + }, "dnf_repository": { "additionalProperties": false, "properties": { diff --git a/schema/blueprint-oas3.yaml b/schema/blueprint-oas3.yaml index 55ba966..d8ffe4b 100644 --- a/schema/blueprint-oas3.yaml +++ b/schema/blueprint-oas3.yaml @@ -339,6 +339,8 @@ components: to freeze the blueprint. This is because the provides will expand into multiple packages with their own names and versions. properties: + config: + $ref: '#/components/schemas/dnf_config' groups: description: | Groups to install, must match exactly. Groups describes groups @@ -395,6 +397,21 @@ components: type: object x-go-name: DNF x-omitempty: true + dnf_config: + additionalProperties: false + properties: + set_releasever: + description: | + Set the $releasever DNF variable to the distribution's release. On RHEL + systems, this ties a system to a specific release, preventing it from + being updated to a later minor RHEL release through 'dnf upgrade', and is + the mechanism for keeping systems on extended support releases (EUS and + E4S). + type: boolean + x-go-name: SetReleasever + type: object + x-go-name: DNFConfig + x-omitempty: true dnf_repository: additionalProperties: false properties: diff --git a/schema/oas/components/dnf.yaml b/schema/oas/components/dnf.yaml index beb56e5..a9cbe20 100644 --- a/schema/oas/components/dnf.yaml +++ b/schema/oas/components/dnf.yaml @@ -64,4 +64,6 @@ properties: items: "$ref": "dnf_repository.yaml" x-omitempty: true + config: + "$ref": "dnf_config.yaml" additionalProperties: false diff --git a/schema/oas/components/dnf_config.yaml b/schema/oas/components/dnf_config.yaml new file mode 100644 index 0000000..e34e8cd --- /dev/null +++ b/schema/oas/components/dnf_config.yaml @@ -0,0 +1,15 @@ +--- +type: object +x-go-name: DNFConfig +x-omitempty: true +properties: + set_releasever: + description: | + Set the $releasever DNF variable to the distribution's release. On RHEL + systems, this ties a system to a specific release, preventing it from + being updated to a later minor RHEL release through 'dnf upgrade', and is + the mechanism for keeping systems on extended support releases (EUS and + E4S). + type: boolean + x-go-name: SetReleasever +additionalProperties: false diff --git a/testdata/all-fields.in.yaml b/testdata/all-fields.in.yaml index c98f491..bc0caa5 100644 --- a/testdata/all-fields.in.yaml +++ b/testdata/all-fields.in.yaml @@ -35,6 +35,8 @@ dnf: usage: install: false configure: false + config: + set_releasever: true containers: - source: "quay.io/fedora/fedora:latest" name: "fedora" diff --git a/testdata/valid-dnf.in.yaml b/testdata/valid-dnf.in.yaml index 6d5ed4f..f885476 100644 --- a/testdata/valid-dnf.in.yaml +++ b/testdata/valid-dnf.in.yaml @@ -21,3 +21,5 @@ dnf: usage: install: true configure: true + config: + set_releasever: true