Skip to content

fix: set instance_options at launch time for IMDSv2 support#84

Open
warisshaikh1 wants to merge 2 commits intostephenpearson:masterfrom
warisshaikh1:fix-imdsv2-at-launch
Open

fix: set instance_options at launch time for IMDSv2 support#84
warisshaikh1 wants to merge 2 commits intostephenpearson:masterfrom
warisshaikh1:fix-imdsv2-at-launch

Conversation

@warisshaikh1
Copy link

OCI security policies can deny instance creation when areLegacyEndpointsDisabled='false' at launch time. The current implementation sets instance_options via update_instance AFTER launch, which fails when such policies are in place.

This change adds launch_instance_options to ComputeLaunchDetails to set instance_options in LaunchInstanceDetails, ensuring IMDSv2 is enabled from instance creation.

OCI security policies can deny instance creation when
areLegacyEndpointsDisabled='false' at launch time. The current
implementation sets instance_options via update_instance AFTER
launch, which fails when such policies are in place.

This change adds launch_instance_options to ComputeLaunchDetails
to set instance_options in LaunchInstanceDetails, ensuring IMDSv2
is enabled from instance creation.
@justintsteele
Copy link
Collaborator

This feature was originally coded this way, but I switched to the current implementation because some older images would not launch with this instance option set. Setting it after creation was a backward compatibility compromise.

Thank you for this submission. I will review it and test it again. Maybe things have changed on the oci side since the last time I looked at it that will make it less of a breaking change.

Aligns test expectations with the IMDSv2 launch-time fix by adding
instance_options to launch_instance_request and launch_instance_from_bv_request.
@warisshaikh1
Copy link
Author

Added test fix to align expectations with the IMDSv2 launch-time change. The launch_instance_request and launch_instance_from_bv_request now include instance_options with are_legacy_imds_endpoints_disabled: true to match the updated implementation.

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.

3 participants