github.com/openshift/installer@v1.4.17/pkg/types/powervs/machinepools.go (about)

     1  package powervs
     2  
     3  import (
     4  	"k8s.io/apimachinery/pkg/util/intstr"
     5  
     6  	machinev1 "github.com/openshift/api/machine/v1"
     7  )
     8  
     9  // MachinePool stores the configuration for a machine pool installed on IBM Power VS.
    10  type MachinePool struct {
    11  	// VolumeIDs is the list of volumes attached to the instance.
    12  	//
    13  	// +optional
    14  	VolumeIDs []string `json:"volumeIDs,omitempty"`
    15  
    16  	// memoryGiB is the size of a virtual machine's memory, in GiB.
    17  	//
    18  	// +optional
    19  	MemoryGiB int32 `json:"memoryGiB,omitempty"`
    20  
    21  	// Processors defines the processing units for the instance.
    22  	//
    23  	// +optional
    24  	Processors intstr.IntOrString `json:"processors,omitempty"`
    25  
    26  	// ProcType defines the processor sharing model for the instance.
    27  	// Must be one of {Capped, Dedicated, Shared}.
    28  	//
    29  	// +kubebuilder:validation:Enum:="Dedicated";"Shared";"Capped";""
    30  	// +optional
    31  	ProcType machinev1.PowerVSProcessorType `json:"procType,omitempty"`
    32  
    33  	// SMTLevel specifies the level of SMT to set the control plane and worker nodes to.
    34  	//
    35  	// +optional
    36  	SMTLevel string `json:"smtLevel,omitempty"`
    37  
    38  	// SysType defines the system type for instance.
    39  	//
    40  	// +optional
    41  	SysType string `json:"sysType,omitempty"`
    42  }
    43  
    44  // Set stores values from required into a
    45  func (a *MachinePool) Set(required *MachinePool) {
    46  	if required == nil || a == nil {
    47  		return
    48  	}
    49  	if len(required.VolumeIDs) != 0 {
    50  		a.VolumeIDs = required.VolumeIDs
    51  	}
    52  	if required.MemoryGiB != 0 {
    53  		a.MemoryGiB = required.MemoryGiB
    54  	}
    55  	if required.Processors.StrVal != "" || required.Processors.IntVal != 0 {
    56  		a.Processors = required.Processors
    57  	}
    58  	if required.ProcType != "" {
    59  		a.ProcType = required.ProcType
    60  	}
    61  	if required.SMTLevel != "" {
    62  		a.SMTLevel = required.SMTLevel
    63  	}
    64  	if required.SysType != "" {
    65  		a.SysType = required.SysType
    66  	}
    67  }