// Generates manifestworks to deploy the required roles of submariner-addon agent.
Generates manifestworks to deploy the required roles of submariner-addon agent.
// Generates manifestworks to deploy the required roles of submariner - addon agent .
func (a *addOnAgent) permissionConfig(cluster *clusterv1.ManagedCluster, addon *addonapiv1alpha1.ManagedClusterAddOn) error {
	config := struct {
		ClusterName string
		Group       string
	}{
		ClusterName: cluster.Name,
		Group:       fmt.Sprintf(clusterAddOnGroup, cluster.Name),
	}
	results := resourceapply.ApplyDirectly(
		context.TODO(),
		resourceapply.NewKubeClientHolder(a.kubeClient),
		a.recorder,
		func(name string) ([]byte, error) {
			template, err := manifestFiles.ReadFile(name)
			if err != nil {
				return nil, err
			}
			return assets.MustCreateAssetFromTemplate(name, template, config).Data, nil
		},
		agentHubPermissionFiles...,
	)
	errs := []error{}
	for _, result := range results {
		if result.Error != nil {
			errs = append(errs, result.Error)
		}
	}
	return operatorhelpers.NewMultiLineAggregate(errs)
}
func ( a * addOnAgent ) permissionConfig ( cluster * clusterv1 . ManagedCluster , addon * addonapiv1alpha1 . ManagedClusterAddOn ) error { config := struct { ClusterName string Group string } { ClusterName : cluster . Name , Group : fmt . Sprintf ( clusterAddOnGroup , cluster . Name ) , } results := resourceapply . ApplyDirectly ( context . TODO ( ) , resourceapply . NewKubeClientHolder ( a . kubeClient ) , a . recorder , func ( name string ) ( [ ] byte , error ) { template , err := manifestFiles . ReadFile ( name ) if err != nil { return nil , err } return assets . MustCreateAssetFromTemplate ( name , template , config ) . Data , nil } , agentHubPermissionFiles ... , ) errs := [ ] error { } for _ , result := range results { if result . Error != nil { errs = append ( errs , result . Error ) } } return operatorhelpers . NewMultiLineAggregate ( errs ) }
Generates manifestworks to deploy the required roles of submariner-addon agent.
Generates manifestworks to deploy the required roles of submariner - addon agent .