@@ -10,7 +10,7 @@ import (
10
10
"runtime"
11
11
"strings"
12
12
13
- "gopkg.in/ yaml.v2 "
13
+ "github.com/ghodss/ yaml"
14
14
15
15
igntypes "github.com/coreos/ignition/config/v2_2/types"
16
16
MachineConfig "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
@@ -135,27 +135,35 @@ func CheckParameters(rawdata *Parameters) {
135
135
nodetype = "worker"
136
136
}
137
137
r := strings .NewReplacer ("/" , "-" , "." , "-" )
138
- rawdata .Name = strings .TrimSpace (defaultMachineConfigPrefix + nodetype + r .Replace (rawdata .RemotePath ))
138
+ rawdata .Name = strings .ToLower ( strings . TrimSpace (defaultMachineConfigPrefix + nodetype + r .Replace (rawdata .RemotePath ) ))
139
139
log .Printf ("name not provided, using '%s' as name\n " , rawdata .Name )
140
140
}
141
+ } else {
142
+ rawdata .Name = strings .ToLower (rawdata .Name )
141
143
}
142
144
143
145
// Set label if not provided
144
146
if rawdata .Labels == "" {
145
147
log .Printf ("labels not provided, using '%s' by default" , defaultLabel )
146
- rawdata .Labels = defaultLabel
148
+ rawdata .Labels = strings .ToLower (defaultLabel )
149
+ } else {
150
+ rawdata .Labels = strings .ToLower (rawdata .Labels )
147
151
}
148
152
149
153
// Set filesystem if not provided
150
154
if rawdata .Filesystem == "" {
151
155
log .Printf ("filesystem not provided, using '%s' by default" , defaultFilesystem )
152
- rawdata .Filesystem = defaultFilesystem
156
+ rawdata .Filesystem = strings .ToLower (defaultFilesystem )
157
+ } else {
158
+ rawdata .Filesystem = strings .ToLower (rawdata .Filesystem )
153
159
}
154
160
155
161
// Set apiver if not provided
156
162
if rawdata .APIVer == "" {
157
163
log .Printf ("apiver not provided, using '%s' by default" , defaultApiversion )
158
- rawdata .APIVer = defaultApiversion
164
+ rawdata .APIVer = strings .ToLower (defaultApiversion )
165
+ } else {
166
+ rawdata .APIVer = strings .ToLower (rawdata .APIVer )
159
167
}
160
168
161
169
SetUserGroupMode (file , rawdata )
0 commit comments