Skip to content

Change FloatingIpCreate address field to ip to match everything else #5046

@david-crespo

Description

@david-crespo

We should pick one or the other. To me, ip is clear and short and seems to be used in more places, but has the grammatical issue of being the IP of a FloatingIp. If that's fine we should probably stick with it. I don't like address as much.

pub struct FloatingIpCreate {
#[serde(flatten)]
pub identity: IdentityMetadataCreateParams,
/// An IP address to reserve for use as a floating IP. This field is
/// optional: when not set, an address will be automatically chosen from
/// `pool`. If set, then the IP must be available in the resolved `pool`.
pub address: Option<IpAddr>,
/// The parent IP pool that a floating IP is pulled from. If unset, the
/// default pool is selected.
pub pool: Option<NameOrId>,
}

pub struct FloatingIp {
#[serde(flatten)]
pub identity: IdentityMetadata,
/// The IP address held by this resource.
pub ip: IpAddr,
/// The project this resource exists within.
pub project_id: Uuid,
/// The ID of the instance that this Floating IP is attached to,
/// if it is presently in use.
pub instance_id: Option<Uuid>,
}

The above is the user-facing disparity, but notably, the DB model and table use ip.

pub struct FloatingIp {
#[diesel(embed)]
pub identity: FloatingIpIdentity,
pub ip_pool_id: Uuid,
pub ip_pool_range_id: Uuid,
pub is_service: bool,
pub parent_id: Option<Uuid>,
pub ip: IpNetwork,
pub project_id: Uuid,
}

omicron/schema/crdb/dbinit.sql

Lines 1726 to 1727 in e1c3dd7

/* The actual external IP address. */
ip INET NOT NULL,

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions