Skip to content

Commit b8b8cb1

Browse files
Merge pull request #170 from RadekManak/updateDomainCount
OCPBUGS-63729: Set updateDomainCount to one when faultDomainCount is one
2 parents ceda5b5 + 8445b9c commit b8b8cb1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/cloud/azure/services/availabilitysets/availabilitysets.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ type Spec struct {
1818
Name string
1919
}
2020

21+
const defaultPlatformUpdateDomainCount = 5
22+
2123
// CreateOrUpdate creates or updates the availability set with the given name.
2224
func (s *Service) CreateOrUpdate(ctx context.Context, spec azure.Spec) error {
2325
availabilitysetsSpec, ok := spec.(*Spec)
@@ -37,6 +39,11 @@ func (s *Service) CreateOrUpdate(ctx context.Context, spec azure.Spec) error {
3739
return fmt.Errorf("failed to get fault domain count: %w", err)
3840
}
3941

42+
updateDomainCount := defaultPlatformUpdateDomainCount
43+
if faultDomainCount == 1 {
44+
updateDomainCount = 1
45+
}
46+
4047
availabilitySet = compute.AvailabilitySet{
4148
Name: to.StringPtr(availabilitysetsSpec.Name),
4249
Sku: &compute.Sku{
@@ -45,7 +52,7 @@ func (s *Service) CreateOrUpdate(ctx context.Context, spec azure.Spec) error {
4552
Location: to.StringPtr(s.Scope.Location()),
4653
AvailabilitySetProperties: &compute.AvailabilitySetProperties{
4754
PlatformFaultDomainCount: to.Int32Ptr(int32(faultDomainCount)),
48-
PlatformUpdateDomainCount: to.Int32Ptr(int32(5)),
55+
PlatformUpdateDomainCount: to.Int32Ptr(int32(updateDomainCount)),
4956
},
5057
Tags: s.Scope.Tags,
5158
}

0 commit comments

Comments
 (0)