openstack: find node CIDR with multiple subnets

This commit is contained in:
Malte Poll 2024-02-15 10:43:48 +01:00
parent d8185fdafb
commit 31f65fb486
6 changed files with 124 additions and 36 deletions

View file

@ -11,6 +11,7 @@ import (
"github.com/edgelesssys/constellation/v2/internal/role"
"github.com/gophercloud/gophercloud/openstack/compute/v2/servers"
"github.com/gophercloud/gophercloud/openstack/networking/v2/networks"
"github.com/gophercloud/gophercloud/openstack/networking/v2/subnets"
"github.com/gophercloud/gophercloud/pagination"
)
@ -62,6 +63,7 @@ func (c *stubIMDSClient) vpcIP(_ context.Context) (string, error) {
type stubServersClient struct {
serversPager stubPager
netsPager stubPager
subnetsPager stubPager
}
@ -69,6 +71,10 @@ func (c *stubServersClient) ListServers(_ servers.ListOptsBuilder) pagerAPI {
return &c.serversPager
}
func (c *stubServersClient) ListNetworks(_ networks.ListOptsBuilder) pagerAPI {
return &c.netsPager
}
func (c *stubServersClient) ListSubnets(_ subnets.ListOpts) pagerAPI {
return &c.subnetsPager
}