-
Notifications
You must be signed in to change notification settings - Fork 519
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
Add fallback region to early-boot-config #2493
Conversation
f2370a9
to
82d97b8
Compare
Removed |
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.
🪶
@@ -15,7 +15,8 @@ use crate::provider::local_file::{local_file_user_data, USER_DATA_FILE}; | |||
pub(crate) struct AwsDataProvider; | |||
|
|||
impl AwsDataProvider { | |||
const IDENTITY_DOCUMENT_FILE: &'static str = "/etc/early-boot-config/identity-document"; | |||
const IDENTITY_DOCUMENT_FILE: &str = "/etc/early-boot-config/identity-document"; |
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.
I'm getting local errors now due to this:
--> api/early-boot-config/src/provider/aws.rs:18:35
|
18 | const IDENTITY_DOCUMENT_FILE: &str = "/etc/early-boot-config/identity-document";
| ^ expected named lifetime parameter
Is this a mismatch of rust toolchain versions where it's an error for me without, but an error for you with?
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.
Actually the only redundant lifetime was on USER_DATA_FILE
, but I was asked to remove it from IDENTITY_DOCUMENT_FILE
for consistency. Which rust toolchain are you currently using? Do you get the same error for USER_DATA_FILE
or just IDENTITY_DOCUMENT_FILE
?
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.
I did get it for both constants.
$ cargo --version
cargo 1.63.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.
I saw this running cargo make check
on a local change that I had rebased on to the latest from develop
. Although I got the failure locally, I did push the change up to my PR, and the GH Actions that ran against the change all passed. Those show they were running 1.64.0
.
I will try updating to 1.64.0 as well and see if I get better results. Will report back here if that's the case so we can point anyone else that runs in to this here.
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.
It looks like rust ≤ 1.63 wants 'static
on IDENTITY_DOCUMENT_FILE
and the newly added FALLBACK_REGION
, with USER_DATA_FILE
remaining &str
. Since the Bottlerocket SDK uses 1.64 this isn't a super big problem, but I'll post a fix so we can increase our toolchain compatibility.
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.
Opened a PR (#2507) for the compatibility fix .
Description of changes:
Replace
ImdsMissingRegion
panic with a fallback value in certain development scenarios without IMDS.Also addresses some clippy warnings for general housekeeping.
Testing done:
aws-k8s
variant and launch in an environment without IMDS.aws-k8s
variant and launch in EC2.Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.