Skip to content

Commit

Permalink
openshift/v4.15: Use fcos 1.5 & ignition 3.4 specs
Browse files Browse the repository at this point in the history
Stabilise openshift 4.14.0 spec on fcos 1.5 and ignition 3.4 stable
specs. fcos 1.6 & ignition 3.5 are still experimental.
  • Loading branch information
travier committed Feb 16, 2024
1 parent 178182c commit 778b95e
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 24 deletions.
2 changes: 1 addition & 1 deletion config/openshift/v4_15/result/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package result

import (
"github.com/coreos/ignition/v2/config/v3_5_experimental/types"
"github.com/coreos/ignition/v2/config/v3_4/types"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion config/openshift/v4_15/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package v4_15

import (
fcos "github.com/coreos/butane/config/fcos/v1_6_exp"
fcos "github.com/coreos/butane/config/fcos/v1_5"
)

const ROLE_LABEL_KEY = "machineconfiguration.openshift.io/role"
Expand Down
16 changes: 8 additions & 8 deletions config/openshift/v4_15/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/coreos/butane/translate"

"github.com/coreos/ignition/v2/config/util"
"github.com/coreos/ignition/v2/config/v3_5_experimental/types"
"github.com/coreos/ignition/v2/config/v3_4/types"
"github.com/coreos/vcontext/path"
"github.com/coreos/vcontext/report"
)
Expand Down Expand Up @@ -113,7 +113,7 @@ func (c Config) FieldFilters() *cutil.FieldFilters {
// can be tracked back to their source in the source config. No config
// validation is performed on input or output.
func (c Config) ToMachineConfig4_15Unvalidated(options common.TranslateOptions) (result.MachineConfig, translate.TranslationSet, report.Report) {
cfg, ts, r := c.Config.ToIgn3_5Unvalidated(options)
cfg, ts, r := c.Config.ToIgn3_4Unvalidated(options)
if r.IsFatal() {
return result.MachineConfig{}, ts, r
}
Expand Down Expand Up @@ -174,11 +174,11 @@ func (c Config) ToMachineConfig4_15(options common.TranslateOptions) (result.Mac
return cfg.(result.MachineConfig), r, err
}

// ToIgn3_5Unvalidated translates the config to an Ignition config. It also
// ToIgn3_4Unvalidated translates the config to an Ignition config. It also
// returns the set of translations it did so paths in the resultant config
// can be tracked back to their source in the source config. No config
// validation is performed on input or output.
func (c Config) ToIgn3_5Unvalidated(options common.TranslateOptions) (types.Config, translate.TranslationSet, report.Report) {
func (c Config) ToIgn3_4Unvalidated(options common.TranslateOptions) (types.Config, translate.TranslationSet, report.Report) {
mc, ts, r := c.ToMachineConfig4_15Unvalidated(options)
cfg := mc.Spec.Config

Expand All @@ -194,12 +194,12 @@ func (c Config) ToIgn3_5Unvalidated(options common.TranslateOptions) (types.Conf
return cfg, ts, r
}

// ToIgn3_5 translates the config to an Ignition config. It returns a
// ToIgn3_4 translates the config to an Ignition config. It returns a
// report of any errors or warnings in the source and resultant config. If
// the report has fatal errors or it encounters other problems translating,
// an error is returned.
func (c Config) ToIgn3_5(options common.TranslateOptions) (types.Config, report.Report, error) {
cfg, r, err := cutil.Translate(c, "ToIgn3_5Unvalidated", options)
func (c Config) ToIgn3_4(options common.TranslateOptions) (types.Config, report.Report, error) {
cfg, r, err := cutil.Translate(c, "ToIgn3_4Unvalidated", options)
return cfg.(types.Config), r, err
}

Expand All @@ -208,7 +208,7 @@ func (c Config) ToIgn3_5(options common.TranslateOptions) (types.Config, report.
// translating, an error is returned.
func ToConfigBytes(input []byte, options common.TranslateBytesOptions) ([]byte, report.Report, error) {
if options.Raw {
return cutil.TranslateBytes(input, &Config{}, "ToIgn3_5", options)
return cutil.TranslateBytes(input, &Config{}, "ToIgn3_4", options)
} else {
return cutil.TranslateBytesYAML(input, &Config{}, "ToMachineConfig4_15", options)
}
Expand Down
14 changes: 7 additions & 7 deletions config/openshift/v4_15/translate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import (
"testing"

baseutil "github.com/coreos/butane/base/util"
base "github.com/coreos/butane/base/v0_6_exp"
base "github.com/coreos/butane/base/v0_5"
"github.com/coreos/butane/config/common"
fcos "github.com/coreos/butane/config/fcos/v1_6_exp"
fcos "github.com/coreos/butane/config/fcos/v1_5"
"github.com/coreos/butane/config/openshift/v4_15/result"
confutil "github.com/coreos/butane/config/util"
"github.com/coreos/butane/translate"

"github.com/coreos/ignition/v2/config/util"
"github.com/coreos/ignition/v2/config/v3_5_experimental/types"
"github.com/coreos/ignition/v2/config/v3_4/types"
"github.com/coreos/vcontext/path"
"github.com/coreos/vcontext/report"
"github.com/stretchr/testify/assert"
Expand All @@ -52,7 +52,7 @@ func TestElidedFieldWarning(t *testing.T) {
expected.AddOnWarn(path.New("yaml", "openshift", "fips"), common.ErrFieldElided)
expected.AddOnWarn(path.New("yaml", "openshift", "kernel_type"), common.ErrFieldElided)

_, _, r := in.ToIgn3_5Unvalidated(common.TranslateOptions{})
_, _, r := in.ToIgn3_4Unvalidated(common.TranslateOptions{})
assert.Equal(t, expected, r, "report mismatch")
}

Expand Down Expand Up @@ -84,7 +84,7 @@ func TestTranslateConfig(t *testing.T) {
Spec: result.Spec{
Config: types.Config{
Ignition: types.Ignition{
Version: "3.5.0-experimental",
Version: "3.4.0",
},
},
},
Expand Down Expand Up @@ -159,7 +159,7 @@ func TestTranslateConfig(t *testing.T) {
Spec: result.Spec{
Config: types.Config{
Ignition: types.Ignition{
Version: "3.5.0-experimental",
Version: "3.4.0",
},
Storage: types.Storage{
Filesystems: []types.Filesystem{
Expand Down Expand Up @@ -304,7 +304,7 @@ func TestTranslateConfig(t *testing.T) {
Spec: result.Spec{
Config: types.Config{
Ignition: types.Ignition{
Version: "3.5.0-experimental",
Version: "3.4.0",
},
Storage: types.Storage{
Filesystems: []types.Filesystem{
Expand Down
3 changes: 1 addition & 2 deletions docs/config-openshift-v4_15.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The OpenShift configuration is a YAML document conforming to the following speci
<div id="spec-docs"></div>

* **variant** (string): used to differentiate configs for different operating systems. Must be `openshift` for this specification.
* **version** (string): the semantic version of the spec for this document. This document is for version `4.15.0` and generates Ignition configs with version `3.5.0-experimental`.
* **version** (string): the semantic version of the spec for this document. This document is for version `4.15.0` and generates Ignition configs with version `3.4.0`.
* **metadata** (object): metadata about the generated MachineConfig resource. Respected when rendering to a MachineConfig, ignored when rendering directly to an Ignition config.
* **name** (string): a unique [name](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names) for this MachineConfig resource.
* **labels** (object): string key/value pairs to apply as [Kubernetes labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) to this MachineConfig resource. `machineconfiguration.openshift.io/role` is required.
Expand Down Expand Up @@ -158,7 +158,6 @@ The OpenShift configuration is a YAML document conforming to the following speci
* **_boot_device_** (object): describes the desired boot device configuration. At least one of `luks` or `mirror` must be specified.
* **_layout_** (string): the disk layout of the target OS image. Supported values are `aarch64`, `ppc64le`, `s390x-eckd`, `s390x-virt`, `s390x-zfcp`, and `x86_64`. Defaults to `x86_64`.
* **_luks_** (object): describes the clevis configuration for encrypting the root filesystem.
* **_device_** (string): the whole-disk device (not partitions), referenced by their absolute path. Must start with `/dev/dasd` for `s390x-eckd` layout or `/dev/sd` for `s390x-zfcp` layouts.
* **_tang_** (list of objects): describes a tang server. Every server must have a unique `url`.
* **url** (string): url of the tang server.
* **thumbprint** (string): thumbprint of a trusted signing key.
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ key](https://getfedora.org/security/).
### Features

- Support s390x layouts in `boot_device` section (fcos 1.6.0-exp, openshift 4.15.0-exp)
- Stabilize OpenShift spec 4.15.0, targeting Ignition spec 3.4.0

### Bug fixes

Expand Down
6 changes: 3 additions & 3 deletions docs/specs.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ We recommend that you always use the latest **stable** specification for your op
- [v1.1.0](config-flatcar-v1_1.md)
- [v1.0.0](config-flatcar-v1_0.md)
- OpenShift (`openshift`)
- [v4.15.0](config-openshift-v4_15.md)
- [v4.14.0](config-openshift-v4_14.md)
- [v4.13.0](config-openshift-v4_13.md)
- [v4.12.0](config-openshift-v4_12.md)
Expand All @@ -47,7 +48,6 @@ Do not use **experimental** specifications for anything beyond **development and
- Flatcar (`flatcar`)
- [v1.2.0-experimental](config-flatcar-v1_2-exp.md)
- OpenShift (`openshift`)
- [v4.15.0-experimental](config-openshift-v4_15-exp.md)
- RHEL for Edge (`r4e`)
- [v1.2.0-experimental](config-r4e-v1_2-exp.md)
- Fedora IoT (`fiot`)
Expand Down Expand Up @@ -76,9 +76,9 @@ Each version of the Butane specification corresponds to a version of the Ignitio
| `openshift` | 4.12.0 | 3.2.0 |
| `openshift` | 4.13.0 | 3.2.0 |
| `openshift` | 4.14.0 | 3.4.0 |
| `openshift` | 4.15.0-experimental | 3.5.0-experimental |
| `openshift` | 4.15.0 | 3.4.0 |
| `r4e` | 1.0.0 | 3.3.0 |
| `r4e` | 1.1.0 | 3.4.0 |
| `r4e` | 1.2.0-experimental | 3.5.0-experimental |
| `fiot` | 1.0.0 | 3.4.0 |
| `fiot` | 1.1.0-experimental | 3.5.0-experimental |
| `fiot` | 1.1.0-experimental | 3.5.0-experimental |
8 changes: 6 additions & 2 deletions docs/upgrading-openshift.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ Occasionally, changes are made to OpenShift Butane configs (those that specify `

{% comment %}

## From Version 4.14.0 to 4.15.0
## From Version 4.15.0 to 4.16.0

There are no breaking changes between versions 4.14.0 and 4.15.0 of the `openshift` configuration specification. Any valid 4.14.0 configuration can be updated to a 4.15.0 configuration by changing the version string in the config.
There are no breaking changes between versions 4.15.0 and 4.16.0 of the `openshift` configuration specification. Any valid 4.15.0 configuration can be updated to a 4.16.0 configuration by changing the version string in the config.

{% endcomment %}

## From Version 4.14.0 to 4.15.0

There are no breaking changes between versions 4.14.0 and 4.15.0 of the `openshift` configuration specification. Any valid 4.14.0 configuration can be updated to a 4.15.0 configuration by changing the version string in the config.

## From Version 4.13.0 to 4.14.0

There are no breaking changes between versions 4.13.0 and 4.14.0 of the `openshift` configuration specification. Any valid 4.13.0 configuration can be updated to a 4.14.0 configuration by changing the version string in the config.
Expand Down

0 comments on commit 778b95e

Please sign in to comment.