Skip to content

Commit

Permalink
feat(ec2): Fetch metadata every boot
Browse files Browse the repository at this point in the history
Following 7f87fa3, we'll setup networking first boot and also respond
to hotplug events, but if network is modified while an instance is
powered off, updates won't be visible to the instance upon next boot.

This commit ensures that on ec2, networking information is fetched
every boot.

Salesforce case #00378972
  • Loading branch information
TheRealFalcon committed Mar 27, 2024
1 parent 4de8dc2 commit 461e4c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cloudinit/sources/DataSourceAliYun.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ class DataSourceAliYun(EC2.DataSourceEc2):
min_metadata_version = "2016-01-01"
extended_metadata_versions: List[str] = []

default_update_events = {
EventScope.NETWORK: {
EventType.BOOT_NEW_INSTANCE,
EventType.HOTPLUG,
}
}

# Aliyun metadata server security enhanced mode overwrite
@property
def imdsv2_token_put_header(self):
Expand Down
1 change: 1 addition & 0 deletions cloudinit/sources/DataSourceEc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class DataSourceEc2(sources.DataSource):
default_update_events = {
EventScope.NETWORK: {
EventType.BOOT_NEW_INSTANCE,
EventType.BOOT,
EventType.HOTPLUG,
}
}
Expand Down

0 comments on commit 461e4c3

Please sign in to comment.