github.com/openshift/installer@v1.4.17/pkg/asset/ignition/bootstrap/bootstrap.go (about)

     1  package bootstrap
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/openshift/installer/pkg/asset"
     7  )
     8  
     9  const (
    10  	bootstrapIgnFilename = "bootstrap.ign"
    11  )
    12  
    13  // Bootstrap is an asset that generates the ignition config for bootstrap nodes.
    14  type Bootstrap struct {
    15  	Common
    16  }
    17  
    18  var _ asset.WritableAsset = (*Bootstrap)(nil)
    19  
    20  // Generate generates the ignition config for the Bootstrap asset.
    21  func (a *Bootstrap) Generate(_ context.Context, dependencies asset.Parents) error {
    22  	templateData := a.getTemplateData(dependencies, false)
    23  	if err := a.generateConfig(dependencies, templateData); err != nil {
    24  		return err
    25  	}
    26  
    27  	if err := a.generateFile(bootstrapIgnFilename); err != nil {
    28  		return err
    29  	}
    30  	return nil
    31  }
    32  
    33  // Name returns the human-friendly name of the asset.
    34  func (a *Bootstrap) Name() string {
    35  	return "Bootstrap Ignition Config"
    36  }
    37  
    38  // Load returns the bootstrap ignition from disk.
    39  func (a *Bootstrap) Load(f asset.FileFetcher) (found bool, err error) {
    40  	return a.load(f, bootstrapIgnFilename)
    41  }