Skip to content

Commit e78a040

Browse files
yasminvalimtravier
authored andcommitted
openshift/v4_19_exp: Add 4.19.0-experimental spec
1 parent f30c2c5 commit e78a040

File tree

11 files changed

+1502
-0
lines changed

11 files changed

+1502
-0
lines changed

config/config.go

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import (
4040
openshift4_16 "github.com/coreos/butane/config/openshift/v4_16"
4141
openshift4_17 "github.com/coreos/butane/config/openshift/v4_17"
4242
openshift4_18 "github.com/coreos/butane/config/openshift/v4_18"
43+
openshift4_19_exp "github.com/coreos/butane/config/openshift/v4_19_exp"
4344
openshift4_8 "github.com/coreos/butane/config/openshift/v4_8"
4445
openshift4_9 "github.com/coreos/butane/config/openshift/v4_9"
4546
r4e1_0 "github.com/coreos/butane/config/r4e/v1_0"
@@ -84,6 +85,7 @@ func init() {
8485
RegisterTranslator("openshift", "4.16.0", openshift4_16.ToConfigBytes)
8586
RegisterTranslator("openshift", "4.17.0", openshift4_17.ToConfigBytes)
8687
RegisterTranslator("openshift", "4.18.0", openshift4_18.ToConfigBytes)
88+
RegisterTranslator("openshift", "4.19.0-experimental", openshift4_19_exp.ToConfigBytes)
8789
RegisterTranslator("r4e", "1.0.0", r4e1_0.ToIgn3_3Bytes)
8890
RegisterTranslator("r4e", "1.1.0", r4e1_1.ToIgn3_4Bytes)
8991
RegisterTranslator("r4e", "1.2.0-experimental", r4e1_2_exp.ToIgn3_6Bytes)
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_6_experimental/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_19_exp/schema.go

+39
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_19_exp
16+
17+
import (
18+
fcos "github.com/coreos/butane/config/fcos/v1_7_exp"
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)