Skip to content

Commit 6aab650

Browse files
authored
Merge pull request #514 from travier/main-openshift-4.15-stable
Stabilise openshift 4.15 spec & add openshift 4.16-experimental spec
2 parents ec330b4 + 9be0a58 commit 6aab650

20 files changed

+1426
-33
lines changed

config/config.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ import (
3535
openshift4_12 "github.com/coreos/butane/config/openshift/v4_12"
3636
openshift4_13 "github.com/coreos/butane/config/openshift/v4_13"
3737
openshift4_14 "github.com/coreos/butane/config/openshift/v4_14"
38-
openshift4_15_exp "github.com/coreos/butane/config/openshift/v4_15_exp"
38+
openshift4_15 "github.com/coreos/butane/config/openshift/v4_15"
39+
openshift4_16_exp "github.com/coreos/butane/config/openshift/v4_16_exp"
3940
openshift4_8 "github.com/coreos/butane/config/openshift/v4_8"
4041
openshift4_9 "github.com/coreos/butane/config/openshift/v4_9"
4142
r4e1_0 "github.com/coreos/butane/config/r4e/v1_0"
@@ -75,7 +76,8 @@ func init() {
7576
RegisterTranslator("openshift", "4.12.0", openshift4_12.ToConfigBytes)
7677
RegisterTranslator("openshift", "4.13.0", openshift4_13.ToConfigBytes)
7778
RegisterTranslator("openshift", "4.14.0", openshift4_14.ToConfigBytes)
78-
RegisterTranslator("openshift", "4.15.0-experimental", openshift4_15_exp.ToConfigBytes)
79+
RegisterTranslator("openshift", "4.15.0", openshift4_15.ToConfigBytes)
80+
RegisterTranslator("openshift", "4.16.0-experimental", openshift4_16_exp.ToConfigBytes)
7981
RegisterTranslator("r4e", "1.0.0", r4e1_0.ToIgn3_3Bytes)
8082
RegisterTranslator("r4e", "1.1.0", r4e1_1.ToIgn3_4Bytes)
8183
RegisterTranslator("r4e", "1.2.0-experimental", r4e1_2_exp.ToIgn3_5Bytes)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright 2021 Red Hat, Inc
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.)
14+
15+
package result
16+
17+
import (
18+
"github.com/coreos/ignition/v2/config/v3_4/types"
19+
)
20+
21+
const (
22+
MC_API_VERSION = "machineconfiguration.openshift.io/v1"
23+
MC_KIND = "MachineConfig"
24+
)
25+
26+
// We round-trip through JSON because Ignition uses `json` struct tags,
27+
// so all struct tags need to be `json` even though we're ultimately
28+
// writing YAML.
29+
30+
type MachineConfig struct {
31+
ApiVersion string `json:"apiVersion"`
32+
Kind string `json:"kind"`
33+
Metadata Metadata `json:"metadata"`
34+
Spec Spec `json:"spec"`
35+
}
36+
37+
type Metadata struct {
38+
Name string `json:"name"`
39+
Labels map[string]string `json:"labels,omitempty"`
40+
}
41+
42+
type Spec struct {
43+
Config types.Config `json:"config"`
44+
KernelArguments []string `json:"kernelArguments,omitempty"`
45+
Extensions []string `json:"extensions,omitempty"`
46+
FIPS *bool `json:"fips,omitempty"`
47+
KernelType *string `json:"kernelType,omitempty"`
48+
}

config/openshift/v4_15/schema.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright 2020 Red Hat, Inc
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.)
14+
15+
package v4_15
16+
17+
import (
18+
fcos "github.com/coreos/butane/config/fcos/v1_5"
19+
)
20+
21+
const ROLE_LABEL_KEY = "machineconfiguration.openshift.io/role"
22+
23+
type Config struct {
24+
fcos.Config `yaml:",inline"`
25+
Metadata Metadata `yaml:"metadata"`
26+
OpenShift OpenShift `yaml:"openshift"`
27+
}
28+
29+
type Metadata struct {
30+
Name string `yaml:"name"`
31+
Labels map[string]string `yaml:"labels,omitempty"`
32+
}
33+
34+
type OpenShift struct {
35+
KernelArguments []string `yaml:"kernel_arguments"`
36+
Extensions []string `yaml:"extensions"`
37+
FIPS *bool `yaml:"fips"`
38+
KernelType *string `yaml:"kernel_type"`
39+
}

0 commit comments

Comments
 (0)