// Generate generates the ignition config for the Master asset.
Generate generates the ignition config for the Master asset.
// Generate generates the ignition config for the Master asset .
func (a *Master) Generate(dependencies asset.Parents) error {
	installConfig := &installconfig.InstallConfig{}
	rootCA := &tls.RootCA{}
	dependencies.Get(installConfig, rootCA)
	a.configs = make([]*igntypes.Config, installConfig.Config.MasterCount())
	for i := range a.configs {
		a.configs[i] = pointerIgnitionConfig(installConfig.Config, rootCA.Cert(), "master", fmt.Sprintf("etcd_index=%d", i))
	}
	a.files = make([]*asset.File, len(a.configs))
	for i, c := range a.configs {
		data, err := json.Marshal(c)
		if err != nil {
			return errors.Wrap(err, "failed to marshal ignition config")
		}
		a.files[i] = &asset.File{
			Filename: fmt.Sprintf("master-%d.ign", i),
			Data:     data,
		}
	}
	return nil
}
func ( a * Master ) Generate ( dependencies asset . Parents ) error { installConfig := & installconfig . InstallConfig { } rootCA := & tls . RootCA { } dependencies . Get ( installConfig , rootCA ) a . configs = make ( [ ] * igntypes . Config , installConfig . Config . MasterCount ( ) ) for i := range a . configs { a . configs [ i ] = pointerIgnitionConfig ( installConfig . Config , rootCA . Cert ( ) , " " , fmt . Sprintf ( " " , i ) ) } a . files = make ( [ ] * asset . File , len ( a . configs ) ) for i , c := range a . configs { data , err := json . Marshal ( c ) if err != nil { return errors . Wrap ( err , " " ) } a . files [ i ] = & asset . File { Filename : fmt . Sprintf ( " " , i ) , Data : data , } } return nil }
Generate generates the ignition config for the Master asset.
Generate generates the ignition config for the Master asset .