Skip to content

Conversation

@charliepark
Copy link
Contributor

Fixes #2205

This adds a Detach button for ephemeral IPs, with a confirmation:
Screenshot 2024-06-21 at 5 35 23 PM

Now that we can detach ephemeral IPs, we also need an empty state for that table, so this PR also adds that:
Screenshot 2024-06-21 at 5 32 12 PM

I believe we don't currently have a way to attach an ephemeral IP to an instance in the UI, but I suspect that's something we'll tackle separately.

@vercel
Copy link

vercel bot commented Jun 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Jun 26, 2024 9:08pm

@david-crespo
Copy link
Collaborator

Looks good! I don’t think it should say the IP twice. Agree about doing attach in a separate PR. It should be really simple — all you can do is pick the pool.

@charliepark
Copy link
Contributor Author

Screenshot 2024-06-22 at 9 45 53 AM Screenshot 2024-06-22 at 9 45 59 AM

@paryhin
Copy link

paryhin commented Jun 24, 2024

Let's make sure the title and button text match. We have two options:

  • Keep the title as is and change the button to "Detach"
  • Change the title to "Confirm detach..." and keep the "Confirm" button

@charliepark
Copy link
Contributor Author

Screenshot 2024-06-24 at 1 09 34 PM

@david-crespo
Copy link
Collaborator

Nitpick, but I have a slight preference for "Confirm detach floating IP" even though it's grammatically dubious. I think of it as an abbreviation for "Confirm (you want to) detach (the) floating IP". It fits a pattern we follow elsewhere:

image

@david-crespo
Copy link
Collaborator

david-crespo commented Jun 24, 2024

I vaguely remember that for the detach floating IP menu button, we went with non-destructive styling because the floating IP continues to exist after being detached. In this case, the ephemeral IP is no longer allocated and there's no way to guarantee you can get it back, so it is destructive. I wonder if there's a way to communicate that here. I think making this one red and the floating IP one not would be kind of weird, and it also wouldn't be sufficient to explain what's going on. I can't think of a great wording, but maybe a second sentence in this popup would help, like "Ephemeral IPs are deallocated when they are detached." Deallocated is not a user-meaningful term, really. It would be nice if we had a way to convey that that are Gone in some stronger sense, but not that strong, because the IP might well still be available in the pool.

image

We could also maybe add a sentence to each confirmation? Like on floating IP "The floating IP will still be available to be reattached to this or another instance." and on ephemeral "Unlike floating IPs, ephemeral IPs are deallocated when detached, which means they may not remain available." Too many words, but that would be the gist.

// Detach the ephemeral IP
await clickRowAction(page, 'ephemeral', 'Detach')
await page.getByRole('button', { name: 'Confirm' }).click()
await expect(externalIpTable.getByRole('cell', { name: 'ephemeral' })).toBeHidden()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add an assert before clicking the row action that this same selector is visible. The clickRowAction implicitly tests for that, but I like to use the same selector for before-and-after checks.

// https://github.com/oxidecomputer/omicron/blob/d52aad0/nexus/src/app/sagas/instance_ip_detach.rs#L79-L82
const ip = db.ephemeralIps.find((eip) => eip.instance_id === instance.id)
if (!ip) throw notFoundErr('ephemeral IP')
if (!ip) throw notFoundErr('Could not find an ephemeral IP')
Copy link
Collaborator

@david-crespo david-crespo Jun 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You had it right the first time. See this line:

const message = msg ? `not found: ${msg}` : 'not found'

I think if you wanted to be really fancy you could put the instance name or ID in there: "ephemeral IP for instance ${path.instance}"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, womp; ty

Copy link
Collaborator

@david-crespo david-crespo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!

@charliepark charliepark enabled auto-merge (squash) June 26, 2024 21:09
@charliepark charliepark merged commit ed4d92e into main Jun 26, 2024
@charliepark charliepark deleted the add-detach-button-for-ephemeral-ip branch June 26, 2024 21:17
david-crespo added a commit to oxidecomputer/omicron that referenced this pull request Jun 27, 2024
david-crespo added a commit to oxidecomputer/omicron that referenced this pull request Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Instance networking: add detach button for ephemeral IP

4 participants