Skip to content

Commit 7a9bca3

Browse files
committed
bugfix: initialize secondary range registry with the right value
When MultiCIDRServiceAllocator feature is enabled, we added an additional feature gate DisableAllocatorDualWrite that allows to enable a mirror behavior on the old allocator to deal with problems during cluster upgrades. During the implementation the secondary range of the legacy allocator was initialized with the valuye of the primary range, hence, when a Service tried to allocate a new IP on the secondary range, it succeded in the new ip allocator but failed when it tried to allocate the same IP on the legacy allocator, since it has a different range. Expand the integration test that run over all the combinations of Service ClusterIP possibilities to run with all the possible combinations of the feature gates. The integration test need to change the way of starting the apiserver otherwise it will timeout.
1 parent 5973acc commit 7a9bca3

File tree

2 files changed

+1109
-988
lines changed

2 files changed

+1109
-988
lines changed

pkg/registry/core/rest/storage_core.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ func (c *Config) newServiceIPAllocators() (registries rangeRegistries, primaryCl
440440
if err != nil {
441441
return nil, err
442442
}
443-
rangeRegistry.Range = serviceClusterIPRange.String()
443+
rangeRegistry.Range = c.Services.SecondaryClusterIPRange.String()
444444
if len(rangeRegistry.ResourceVersion) == 0 {
445445
klog.Infof("kube-apiserver started with IP allocator and dual write enabled but bitmap allocator does not exist, recreating it ...")
446446
err := etcd.CreateOrUpdate(rangeRegistry)

0 commit comments

Comments
 (0)