Skip to content

Commit

Permalink
Bump openapi-lint from 9b20f89 to 2609285 (#1136)
Browse files Browse the repository at this point in the history
* Bump openapi-lint from `9b20f89` to `2609285`

Bumps [openapi-lint](https://github.com/oxidecomputer/openapi-lint) from `9b20f89` to `2609285`.
- [Release notes](https://github.com/oxidecomputer/openapi-lint/releases)
- [Commits](oxidecomputer/openapi-lint@9b20f89...2609285)

---
updated-dependencies:
- dependency-name: openapi-lint
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* _uuid -> _id in many places

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adam H. Leventhal <ahl@oxide.computer>
  • Loading branch information
dependabot[bot] and ahl authored Jun 8, 2022
1 parent 3ae28c7 commit 3be717a
Show file tree
Hide file tree
Showing 20 changed files with 103 additions and 103 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions common/src/api/internal/nexus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ pub struct InstanceRuntimeState {
/// runtime state of the Instance
pub run_state: InstanceState,
/// which sled is running this Instance
pub sled_uuid: Uuid,
pub sled_id: Uuid,
/// which propolis-server is running this Instance
pub propolis_uuid: Uuid,
pub propolis_id: Uuid,
/// the target propolis-server during a migration of this Instance
pub dst_propolis_uuid: Option<Uuid>,
pub dst_propolis_id: Option<Uuid>,
/// address of propolis-server running this Instance
pub propolis_addr: Option<SocketAddr>,
/// migration id (if one in process)
pub migration_uuid: Option<Uuid>,
pub migration_id: Option<Uuid>,
/// number of CPUs allocated for this Instance
pub ncpus: InstanceCpuCount,
/// memory allocated for this Instance
Expand Down
8 changes: 4 additions & 4 deletions nexus-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ impl From<omicron_common::api::internal::nexus::InstanceRuntimeState>
) -> Self {
Self {
run_state: s.run_state.into(),
sled_uuid: s.sled_uuid,
propolis_uuid: s.propolis_uuid,
dst_propolis_uuid: s.dst_propolis_uuid,
sled_id: s.sled_id,
propolis_id: s.propolis_id,
dst_propolis_id: s.dst_propolis_id,
propolis_addr: s.propolis_addr.map(|addr| addr.to_string()),
migration_uuid: s.migration_uuid,
migration_id: s.migration_id,
ncpus: s.ncpus.into(),
memory: s.memory.into(),
hostname: s.hostname,
Expand Down
6 changes: 3 additions & 3 deletions nexus/src/app/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ impl super::Nexus {
&self,
instance: &db::model::Instance,
) -> Result<Arc<SledAgentClient>, Error> {
let sa_id = &instance.runtime().sled_uuid;
let sa_id = &instance.runtime().sled_id;
self.sled_client(&sa_id).await
}

Expand Down Expand Up @@ -787,15 +787,15 @@ impl super::Nexus {
Ok(true) => {
info!(log, "instance updated by sled agent";
"instance_id" => %id,
"propolis_id" => %new_runtime_state.propolis_uuid,
"propolis_id" => %new_runtime_state.propolis_id,
"new_state" => %new_runtime_state.run_state);
Ok(())
}

Ok(false) => {
info!(log, "instance update from sled agent ignored (old)";
"instance_id" => %id,
"propolis_id" => %new_runtime_state.propolis_uuid,
"propolis_id" => %new_runtime_state.propolis_id,
"requested_state" => %new_runtime_state.run_state);
Ok(())
}
Expand Down
8 changes: 4 additions & 4 deletions nexus/src/app/sagas/instance_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,14 +628,14 @@ async fn sic_create_instance_record(

let runtime = InstanceRuntimeState {
run_state: InstanceState::Creating,
sled_uuid,
propolis_uuid,
dst_propolis_uuid: None,
sled_id: sled_uuid,
propolis_id: propolis_uuid,
dst_propolis_id: None,
propolis_addr: Some(std::net::SocketAddr::new(
propolis_addr.into(),
12400,
)),
migration_uuid: None,
migration_id: None,
hostname: params.create_params.hostname.clone(),
memory: params.create_params.memory,
ncpus: params.create_params.ncpus,
Expand Down
18 changes: 9 additions & 9 deletions nexus/src/app/sagas/instance_migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,21 @@ async fn sim_instance_migrate(
let opctx = OpContext::for_saga_action(&sagactx, &params.serialized_authn);

let migration_id = sagactx.lookup::<Uuid>("migrate_id")?;
let dst_sled_uuid = params.migrate_params.dst_sled_uuid;
let dst_propolis_uuid = sagactx.lookup::<Uuid>("dst_propolis_id")?;
let dst_sled_id = params.migrate_params.dst_sled_id;
let dst_propolis_id = sagactx.lookup::<Uuid>("dst_propolis_id")?;
let (instance_id, old_runtime) =
sagactx.lookup::<(Uuid, InstanceRuntimeState)>("migrate_instance")?;

// Allocate an IP address the destination sled for the new Propolis server.
let propolis_addr = osagactx
.datastore()
.next_ipv6_address(&opctx, dst_sled_uuid)
.next_ipv6_address(&opctx, dst_sled_id)
.await
.map_err(ActionError::action_failed)?;

let runtime = InstanceRuntimeState {
sled_uuid: dst_sled_uuid,
propolis_uuid: dst_propolis_uuid,
sled_id: dst_sled_id,
propolis_id: dst_propolis_id,
propolis_addr: Some(std::net::SocketAddr::new(
propolis_addr.into(),
12400,
Expand All @@ -175,19 +175,19 @@ async fn sim_instance_migrate(
run_state: InstanceStateRequested::Migrating,
migration_params: Some(InstanceRuntimeStateMigrateParams {
migration_id,
dst_propolis_id: dst_propolis_uuid,
dst_propolis_id,
}),
};

let src_propolis_uuid = old_runtime.propolis_uuid;
let src_propolis_id = old_runtime.propolis_id;
let src_propolis_addr = old_runtime.propolis_addr.ok_or_else(|| {
ActionError::action_failed(Error::invalid_request(
"expected source propolis-addr",
))
})?;

let dst_sa = osagactx
.sled_client(&dst_sled_uuid)
.sled_client(&dst_sled_id)
.await
.map_err(ActionError::action_failed)?;

Expand All @@ -199,7 +199,7 @@ async fn sim_instance_migrate(
target,
migrate: Some(InstanceMigrateParams {
src_propolis_addr: src_propolis_addr.to_string(),
src_propolis_uuid,
src_propolis_id,
}),
},
)
Expand Down
2 changes: 1 addition & 1 deletion nexus/src/db/datastore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ impl DataStore {
.filter(
dsl::migration_id
.is_null()
.or(dsl::target_propolis_id.eq(new_runtime.propolis_uuid)),
.or(dsl::target_propolis_id.eq(new_runtime.propolis_id)),
)
.set(new_runtime.clone())
.check_if_exists::<Instance>(*instance_id)
Expand Down
32 changes: 16 additions & 16 deletions nexus/src/db/model/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ pub struct InstanceRuntimeState {
/// which sled is running this Instance
// TODO: should this be optional?
#[diesel(column_name = active_server_id)]
pub sled_uuid: Uuid,
pub sled_id: Uuid,
#[diesel(column_name = active_propolis_id)]
pub propolis_uuid: Uuid,
pub propolis_id: Uuid,
#[diesel(column_name = active_propolis_ip)]
pub propolis_ip: Option<ipnetwork::IpNetwork>,
#[diesel(column_name = target_propolis_id)]
pub dst_propolis_uuid: Option<Uuid>,
pub dst_propolis_id: Option<Uuid>,
#[diesel(column_name = migration_id)]
pub migration_uuid: Option<Uuid>,
pub migration_id: Option<Uuid>,
#[diesel(column_name = ncpus)]
pub ncpus: InstanceCpuCount,
#[diesel(column_name = memory)]
Expand All @@ -124,13 +124,13 @@ impl From<InstanceRuntimeState>
fn from(s: InstanceRuntimeState) -> Self {
Self {
run_state: s.state.into(),
sled_uuid: s.sled_uuid,
propolis_uuid: s.propolis_uuid,
dst_propolis_uuid: s.dst_propolis_uuid,
sled_id: s.sled_id,
propolis_id: s.propolis_id,
dst_propolis_id: s.dst_propolis_id,
propolis_addr: s
.propolis_ip
.map(|ip| SocketAddr::new(ip.ip(), PROPOLIS_PORT).to_string()),
migration_uuid: s.migration_uuid,
migration_id: s.migration_id,
ncpus: s.ncpus.into(),
memory: s.memory.into(),
hostname: s.hostname,
Expand All @@ -155,11 +155,11 @@ impl From<internal::nexus::InstanceRuntimeState> for InstanceRuntimeState {
fn from(state: internal::nexus::InstanceRuntimeState) -> Self {
Self {
state: InstanceState::new(state.run_state),
sled_uuid: state.sled_uuid,
propolis_uuid: state.propolis_uuid,
dst_propolis_uuid: state.dst_propolis_uuid,
sled_id: state.sled_id,
propolis_id: state.propolis_id,
dst_propolis_id: state.dst_propolis_id,
propolis_ip: state.propolis_addr.map(|addr| addr.ip().into()),
migration_uuid: state.migration_uuid,
migration_id: state.migration_id,
ncpus: state.ncpus.into(),
memory: state.memory.into(),
hostname: state.hostname,
Expand All @@ -174,13 +174,13 @@ impl Into<internal::nexus::InstanceRuntimeState> for InstanceRuntimeState {
fn into(self) -> internal::nexus::InstanceRuntimeState {
internal::nexus::InstanceRuntimeState {
run_state: *self.state.state(),
sled_uuid: self.sled_uuid,
propolis_uuid: self.propolis_uuid,
dst_propolis_uuid: self.dst_propolis_uuid,
sled_id: self.sled_id,
propolis_id: self.propolis_id,
dst_propolis_id: self.dst_propolis_id,
propolis_addr: self
.propolis_ip
.map(|ip| SocketAddr::new(ip.ip(), PROPOLIS_PORT)),
migration_uuid: self.migration_uuid,
migration_id: self.migration_id,
ncpus: self.ncpus.into(),
memory: self.memory.into(),
hostname: self.hostname,
Expand Down
2 changes: 1 addition & 1 deletion nexus/src/external_api/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ mod serde_user_data {
/// Migration parameters for an [`Instance`](omicron_common::api::external::Instance)
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)]
pub struct InstanceMigrate {
pub dst_sled_uuid: Uuid,
pub dst_sled_id: Uuid,
}

// VPCS
Expand Down
2 changes: 1 addition & 1 deletion nexus/tests/integration_tests/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ lazy_static! {
allowed_methods: vec![
AllowedMethod::Post(serde_json::to_value(
params::InstanceMigrate {
dst_sled_uuid: uuid::Uuid::new_v4(),
dst_sled_id: uuid::Uuid::new_v4(),
}
).unwrap()),
],
Expand Down
12 changes: 6 additions & 6 deletions openapi/nexus-internal.json
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@
"description": "Runtime state of the Instance, including the actual running state and minimal metadata\n\nThis state is owned by the sled agent running that Instance.",
"type": "object",
"properties": {
"dst_propolis_uuid": {
"dst_propolis_id": {
"nullable": true,
"description": "the target propolis-server during a migration of this Instance",
"type": "string",
Expand All @@ -1394,7 +1394,7 @@
}
]
},
"migration_uuid": {
"migration_id": {
"nullable": true,
"description": "migration id (if one in process)",
"type": "string",
Expand All @@ -1413,7 +1413,7 @@
"description": "address of propolis-server running this Instance",
"type": "string"
},
"propolis_uuid": {
"propolis_id": {
"description": "which propolis-server is running this Instance",
"type": "string",
"format": "uuid"
Expand All @@ -1426,7 +1426,7 @@
}
]
},
"sled_uuid": {
"sled_id": {
"description": "which sled is running this Instance",
"type": "string",
"format": "uuid"
Expand All @@ -1442,9 +1442,9 @@
"hostname",
"memory",
"ncpus",
"propolis_uuid",
"propolis_id",
"run_state",
"sled_uuid",
"sled_id",
"time_updated"
]
},
Expand Down
4 changes: 2 additions & 2 deletions openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -6329,13 +6329,13 @@
"description": "Migration parameters for an [`Instance`](omicron_common::api::external::Instance)",
"type": "object",
"properties": {
"dst_sled_uuid": {
"dst_sled_id": {
"type": "string",
"format": "uuid"
}
},
"required": [
"dst_sled_uuid"
"dst_sled_id"
]
},
"InstanceNetworkInterfaceAttachment": {
Expand Down
Loading

0 comments on commit 3be717a

Please sign in to comment.