@@ -2137,7 +2137,8 @@ func TestValidateAWSProviderSpec(t *testing.T) {
2137
2137
testCase : "fail if placementGroupPartition is set, but placementGroupName is empty" ,
2138
2138
modifySpec : func (p * machinev1beta1.AWSMachineProviderConfig ) {
2139
2139
p .PlacementGroupName = ""
2140
- p .PlacementGroupPartition = 2
2140
+ partition := int32 (2 )
2141
+ p .PlacementGroupPartition = & partition
2141
2142
},
2142
2143
expectedOk : false ,
2143
2144
expectedError : "providerSpec.placementGroupPartition: Invalid value: 2: providerSpec.placementGroupPartition is set but providerSpec.placementGroupName is empty" ,
@@ -2146,19 +2147,21 @@ func TestValidateAWSProviderSpec(t *testing.T) {
2146
2147
testCase : "fail if placementGroupPartition is outside 1-7 range (lower)" ,
2147
2148
modifySpec : func (p * machinev1beta1.AWSMachineProviderConfig ) {
2148
2149
p .PlacementGroupName = "placement-group"
2149
- p .PlacementGroupPartition = - 1
2150
+ partition := int32 (0 )
2151
+ p .PlacementGroupPartition = & partition
2150
2152
},
2151
2153
expectedOk : false ,
2152
- expectedError : "providerSpec.placementGroupPartition: Invalid value: -1: placementGroupPartition must be between 1 and 7" ,
2154
+ expectedError : "providerSpec.placementGroupPartition: Invalid value: 0: providerSpec. placementGroupPartition must be between 1 and 7" ,
2153
2155
},
2154
2156
{
2155
2157
testCase : "fail if placementGroupPartition is outside 1-7 range (upper)" ,
2156
2158
modifySpec : func (p * machinev1beta1.AWSMachineProviderConfig ) {
2157
2159
p .PlacementGroupName = "placement-group"
2158
- p .PlacementGroupPartition = 8
2160
+ partition := int32 (8 )
2161
+ p .PlacementGroupPartition = & partition
2159
2162
},
2160
2163
expectedOk : false ,
2161
- expectedError : "providerSpec.placementGroupPartition: Invalid value: 8: placementGroupPartition must be between 1 and 7" ,
2164
+ expectedError : "providerSpec.placementGroupPartition: Invalid value: 8: providerSpec. placementGroupPartition must be between 1 and 7" ,
2162
2165
},
2163
2166
{
2164
2167
testCase : "allow if only placementGroupName is set" ,
@@ -2171,7 +2174,8 @@ func TestValidateAWSProviderSpec(t *testing.T) {
2171
2174
testCase : "allow if correct placementGroupName and placementGroupPartition are set" ,
2172
2175
modifySpec : func (p * machinev1beta1.AWSMachineProviderConfig ) {
2173
2176
p .PlacementGroupName = "placement-group"
2174
- p .PlacementGroupPartition = 2
2177
+ partition := int32 (2 )
2178
+ p .PlacementGroupPartition = & partition
2175
2179
},
2176
2180
expectedOk : true ,
2177
2181
},
0 commit comments