// Generate generates the network-operator-config.yml and network-operator-manifest.yml files
Generate generates the network-operator-config.yml and network-operator-manifest.yml files
// Generate generates the network - operator - config . yml and network - operator - manifest . yml files
func (no *networkOperator) Generate(dependencies asset.Parents) error {
	installConfig := &installconfig.InstallConfig{}
	dependencies.Get(installConfig)
	no.config = &tectonicnetwork.OperatorConfig{
		TypeMeta: metav1.TypeMeta{
			APIVersion: tectonicnetwork.APIVersion,
			Kind:       tectonicnetwork.Kind,
		},
		PodCIDR: installConfig.Config.Networking.PodCIDR.String(),
		CalicoConfig: tectonicnetwork.CalicoConfig{
			MTU: defaultMTU,
		},
		NetworkProfile: tectonicnetwork.NetworkType(installConfig.Config.Networking.Type),
	}
	configData, err := yaml.Marshal(no.config)
	if err != nil {
		return errors.Wrapf(err, "failed to create %s manifests from InstallConfig", no.Name())
	}
	no.files = []*asset.File{
		{
			Filename: "network-operator-config.yml",
			Data:     configData,
		},
		{
			Filename: "network-operator-manifests.yml",
			Data:     []byte{},
		},
	}
	return nil
}
func ( no * networkOperator ) Generate ( dependencies asset . Parents ) error { installConfig := & installconfig . InstallConfig { } dependencies . Get ( installConfig ) no . config = & tectonicnetwork . OperatorConfig { TypeMeta : metav1 . TypeMeta { APIVersion : tectonicnetwork . APIVersion , Kind : tectonicnetwork . Kind , } , PodCIDR : installConfig . Config . Networking . PodCIDR . String ( ) , CalicoConfig : tectonicnetwork . CalicoConfig { MTU : defaultMTU , } , NetworkProfile : tectonicnetwork . NetworkType ( installConfig . Config . Networking . Type ) , } configData , err := yaml . Marshal ( no . config ) if err != nil { return errors . Wrapf ( err , " " , no . Name ( ) ) } no . files = [ ] * asset . File { { Filename : " " , Data : configData , } , { Filename : " " , Data : [ ] byte { } , } , } return nil }
Generate generates the network-operator-config.yml and network-operator-manifest.yml files
Generate generates the network - operator - config . yml and network - operator - manifest . yml files