99 "path"
1010 "strings"
1111
12- igntypes "github.com/coreos/ignition/v2/config/v3_2/types"
13-
1412 "github.com/metal3-io/baremetal-operator/pkg/bmc"
1513 "github.com/metal3-io/baremetal-operator/pkg/hardware"
1614 "github.com/openshift/installer/pkg/tfvars/internal/cache"
@@ -28,10 +26,6 @@ type config struct {
2826 IronicUsername string `json:"ironic_username"`
2927 IronicPassword string `json:"ironic_password"`
3028
31- MasterIgnitionURL string `json:"master_ignition_url,omitempty"`
32- MasterIgnitionURLCACert string `json:"master_ignition_url_ca_cert,omitempty"`
33- MasterIgnitionURLHeaders map [string ]string `json:"master_ignition_url_headers,omitempty"`
34-
3529 // Data required for control plane deployment - several maps per host, because of terraform's limitations
3630 Hosts []map [string ]interface {} `json:"hosts"`
3731 RootDevices []map [string ]interface {} `json:"root_devices"`
@@ -174,44 +168,19 @@ func TFVars(libvirtURI, apiVIP, imageCacheIP, bootstrapOSImage, externalBridge,
174168 })
175169 }
176170
177- var masterIgn igntypes.Config
178- if err := json .Unmarshal ([]byte (ignition ), & masterIgn ); err != nil {
179- return nil , err
180- }
181- if len (masterIgn .Ignition .Config .Merge ) == 0 {
182- return nil , errors .Wrap (err , "Empty Merge section in master pointer ignition" )
183- }
184- ignitionURL := * masterIgn .Ignition .Config .Merge [0 ].Source
185- if len (masterIgn .Ignition .Security .TLS .CertificateAuthorities ) == 0 {
186- return nil , errors .Wrap (err , "Empty CertificateAuthorities section in master pointer ignition" )
187- }
188- ignitionURLCACert := strings .TrimPrefix (
189- * masterIgn .Ignition .Security .TLS .CertificateAuthorities [0 ].Source ,
190- "data:text/plain;charset=utf-8;base64," )
191- // To return the same version as the stub config, the MCS requires a
192- // header, otherwise we get 2.2.0, e.g:
193- // "Accept: application/vnd.coreos.ignition+json; version=3.1.0"
194- ignitionURLHeaders := map [string ]string {
195- "Accept" : fmt .Sprintf ("application/vnd.coreos.ignition+json;version=%s" ,
196- masterIgn .Ignition .Version ),
197- }
198-
199171 cfg := & config {
200- LibvirtURI : libvirtURI ,
201- IronicURI : fmt .Sprintf ("http://%s/v1" , net .JoinHostPort (apiVIP , "6385" )),
202- InspectorURI : fmt .Sprintf ("http://%s/v1" , net .JoinHostPort (apiVIP , "5050" )),
203- BootstrapOSImage : bootstrapOSImage ,
204- IronicUsername : ironicUsername ,
205- IronicPassword : ironicPassword ,
206- Hosts : hosts ,
207- Bridges : bridges ,
208- Properties : properties ,
209- DriverInfos : driverInfos ,
210- RootDevices : rootDevices ,
211- InstanceInfos : instanceInfos ,
212- MasterIgnitionURL : ignitionURL ,
213- MasterIgnitionURLCACert : ignitionURLCACert ,
214- MasterIgnitionURLHeaders : ignitionURLHeaders ,
172+ LibvirtURI : libvirtURI ,
173+ IronicURI : fmt .Sprintf ("http://%s/v1" , net .JoinHostPort (apiVIP , "6385" )),
174+ InspectorURI : fmt .Sprintf ("http://%s/v1" , net .JoinHostPort (apiVIP , "5050" )),
175+ BootstrapOSImage : bootstrapOSImage ,
176+ IronicUsername : ironicUsername ,
177+ IronicPassword : ironicPassword ,
178+ Hosts : hosts ,
179+ Bridges : bridges ,
180+ Properties : properties ,
181+ DriverInfos : driverInfos ,
182+ RootDevices : rootDevices ,
183+ InstanceInfos : instanceInfos ,
215184 }
216185
217186 return json .MarshalIndent (cfg , "" , " " )
0 commit comments