// NewClusterScope creates a new Scope from the supplied parameters.
// This is meant to be called for each reconcile iteration.
NewClusterScope creates a new Scope from the supplied parameters.
This is meant to be called for each reconcile iteration.
// NewClusterScope creates a new Scope from the supplied parameters . // This is meant to be called for each reconcile iteration .
func NewClusterScope(params ClusterScopeParams) (*ClusterScope, error) {
	if params.Cluster == nil {
		return nil, errors.New("failed to generate new scope from nil Cluster")
	}
	if params.KVMCluster == nil {
		return nil, errors.New("failed to generate new scope from nil AWSCluster")
	}
	if params.Logger == nil {
		params.Logger = klogr.New()
	}
	helper, err := patch.NewHelper(params.KVMCluster, params.Client)
	if err != nil {
		return nil, errors.Wrap(err, "failed to init patch helper")
	}
	clusterScope := &ClusterScope{
		Logger:      params.Logger,
		client:      params.Client,
		patchHelper: helper,
		Cluster:        params.Cluster,
		KVMCluster:     params.KVMCluster,
		controllerName: params.ControllerName,
	}
	return clusterScope, nil
}
func NewClusterScope ( params ClusterScopeParams ) ( * ClusterScope , error ) { if params . Cluster == nil { return nil , errors . New ( " " ) } if params . KVMCluster == nil { return nil , errors . New ( " " ) } if params . Logger == nil { params . Logger = klogr . New ( ) } helper , err := patch . NewHelper ( params . KVMCluster , params . Client ) if err != nil { return nil , errors . Wrap ( err , " " ) } clusterScope := & ClusterScope { Logger : params . Logger , client : params . Client , patchHelper : helper , Cluster : params . Cluster , KVMCluster : params . KVMCluster , controllerName : params . ControllerName , } return clusterScope , nil }
NewClusterScope creates a new Scope from the supplied parameters.
NewClusterScope creates a new Scope from the supplied parameters .