Persist Floating IP UUIDs for direct Neutron operations
This commit is contained in:
1 parent
89ac4d5bcd
commit
94124747ce
24 files changed
+918
-116
No files matched your search
@@ -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 ¬FoundError{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, ¬Found)
|
||||
}
|
||||
|
||||
// listAll collects every page of c.ListFreeFloatingIPs into one slice; it is
|
||||
|
||||
Reference in new issue
Block a user