Persist Floating IP UUIDs for direct Neutron operations

This commit is contained in:
ayurishchev committed 2026-11-22 21:26:19 +03:00
1 parent 89ac4d5bcd
commit 94124747ce
24 files changed
+918 -116

No files matched your search

+9 -3
View File
@@ -4,7 +4,10 @@
// mock via config alone.
package openstack
import "context"
import (
"context"
"errors"
)
type FloatingIP struct {
ID string
@@ -24,6 +27,9 @@ type FloatingIPClient interface {
// is registered in the service project.
GetFloatingIPByAddress(ctx context.Context, address string) (*FloatingIP, error)
// GetFloatingIP reads a known Neutron resource by ID.
GetFloatingIP(ctx context.Context, id string) (*FloatingIP, error)
// ListFloatingIPs returns every floating IP registered in the service
// project, both associated and free — filtering to the free pool (empty
// PortID) is the caller's job. Used to discover addresses to feed into
@@ -64,8 +70,8 @@ func ErrNotFound(address string) error { return &notFoundError{address} }
// IsNotFound reports whether err indicates the address has no matching
// Neutron floating-ip resource.
func IsNotFound(err error) bool {
_, ok := err.(*notFoundError)
return ok
var notFound *notFoundError
return errors.As(err, &notFound)
}
// listAll collects every page of c.ListFreeFloatingIPs into one slice; it is