Skip to content

[Web] EICE Discover: Extract instanceId from label#34314

Merged
rudream merged 1 commit intomasterfrom
yassine/eice-fix
Nov 10, 2023
Merged

[Web] EICE Discover: Extract instanceId from label#34314
rudream merged 1 commit intomasterfrom
yassine/eice-fix

Conversation

@rudream
Copy link
Copy Markdown
Contributor

@rudream rudream commented Nov 7, 2023

Purpose

Related to #29317

Fixes an edge case in the EC2 instance list screen of the EICE Discover flow.

Also adds some unit tests.

Implementation

In order to check whether or not an EC2 instance is already enrolled, we would check to see if any of our already enrolled nodes had the same AWS Instance ID. In order to do this, we would extract the instance ID of the node from its aws metadata. However, there is an edge case which introduced a bug: if the node (ec2 instance) was added using the EC2 Auto-Discovery, then it has no aws metadata and trying to access the instance ID from there would cause an error.

In order to work around this, we now extract the instance ID from the teleport.dev/instance-id label instead, which is guaranteed to be there since it's what we are using in the predicate query which fetches the nodes.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 7, 2023

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

@rudream rudream added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v13 labels Nov 7, 2023
Copy link
Copy Markdown
Contributor

@marcoandredinis marcoandredinis left a comment

Choose a reason for hiding this comment

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

LGTM
Thank you

@rudream rudream enabled auto-merge November 10, 2023 06:51
@rudream rudream added this pull request to the merge queue Nov 10, 2023
Merged via the queue into master with commit a480040 Nov 10, 2023
@rudream rudream deleted the yassine/eice-fix branch November 10, 2023 07:10
@public-teleport-github-review-bot
Copy link
Copy Markdown

@rudream See the table below for backport results.

Branch Result
branch/v13 Create PR
branch/v14 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry size/md ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants