@@ -2829,6 +2829,24 @@ func TestValidateTNF(t *testing.T) {
28292829 name : "invalid_number_of_credentials_for_dual_replica" ,
28302830 expected : "controlPlane.fencing.credentials: Forbidden: there should be exactly two fencing credentials to support the two node cluster, instead 3 credentials were found" ,
28312831 },
2832+ {
2833+ config : installConfig ().
2834+ MachinePoolArbiter (machinePool ()).
2835+ MachinePoolCP (machinePool ().Credential (c1 (), c2 ())).
2836+ ArbiterReplicas (1 ).
2837+ CpReplicas (2 ).build (),
2838+ name : "skip_number_of_credentials_validation_for_arbiter_deployment" ,
2839+ expected : "" ,
2840+ },
2841+ {
2842+ config : installConfig ().
2843+ MachinePoolArbiter (machinePool ()).
2844+ MachinePoolCP (machinePool ().Credential (c1 (), c2 (), c3 ())).
2845+ ArbiterReplicas (1 ).
2846+ CpReplicas (2 ).build (),
2847+ name : "skip_number_of_credentials_validation_for_arbiter_deployment_invalid_credentials_count" ,
2848+ expected : "" ,
2849+ },
28322850 {
28332851 config : installConfig ().
28342852 MachinePoolCP (machinePool ().
@@ -3040,6 +3058,19 @@ func (icb *installConfigBuilder) MachinePoolCP(builder *machinePoolBuilder) *ins
30403058 return icb
30413059}
30423060
3061+ func (icb * installConfigBuilder ) ArbiterReplicas (numOfCpReplicas int64 ) * installConfigBuilder {
3062+ if icb .InstallConfig .Arbiter == nil {
3063+ icb .InstallConfig .Arbiter = & types.MachinePool {}
3064+ }
3065+ icb .InstallConfig .Arbiter .Replicas = & numOfCpReplicas
3066+ return icb
3067+ }
3068+
3069+ func (icb * installConfigBuilder ) MachinePoolArbiter (builder * machinePoolBuilder ) * installConfigBuilder {
3070+ icb .InstallConfig .Arbiter = builder .build ()
3071+ return icb
3072+ }
3073+
30433074func (icb * installConfigBuilder ) MachinePoolCompute (builders ... * machinePoolBuilder ) * installConfigBuilder {
30443075 for _ , builder := range builders {
30453076 icb .InstallConfig .Compute = append (icb .InstallConfig .Compute , * builder .build ())
0 commit comments