-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide internal silos in utilization #4943
Conversation
@@ -9,6 +9,7 @@ use uuid::Uuid; | |||
pub struct SiloUtilization { | |||
pub silo_id: Uuid, | |||
pub silo_name: Name, | |||
pub silo_discoverable: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strictly speaking, while this is fine to add, you don't actually need this line, right? In the query you're using it in SQL directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, perhaps. I thought this struct is what generated the type to use for the dsl
but that might actually be from the table!
call. Yeah, regardless, it shouldn't matter.
nexus/db-model/src/schema.rs
Outdated
@@ -13,7 +13,7 @@ use omicron_common::api::external::SemverVersion; | |||
/// | |||
/// This should be updated whenever the schema is changed. For more details, | |||
/// refer to: schema/crdb/README.adoc | |||
pub const SCHEMA_VERSION: SemverVersion = SemverVersion::new(30, 0, 0); | |||
pub const SCHEMA_VERSION: SemverVersion = SemverVersion::new(31, 0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to be 32 so #4852 can be 31
Logically this makes sense to me. I don't know what specifically cockroachdb supports but if this is similar to postgres you may need to use |
@augustuswm pointed out using
I'm not using the parenthesis after that name in the same way they've expressed so I assume what I have is okay? It wasn't clear to me if they're saying the select order matters. |
I've updated the PR w/ a comment in the migration about what's being added and bumped the schema version an extra number to avoid clashing with #4852 |
Looks like based on the failure it might need a drop / create instead of a replace. |
I reordered it such that the new column is at the end of the view and that causes it to pass. Seems like view migrations are order sensitive (which is what the docs I quoted above implied, I just didn't know if that meant for the select statement too). |
Fixes #4708.
I've updated the
/v1/system/utilization/silos
endpoint to only return non-discoverable silos if they have a quota set. I believe thedefault-silo
does get a quota set currently which is non-ideal, but that should be the only one that shows up on the list.I need specific eyes on the migration b/c I've never written a view migration before.