fix: set instance_options at launch time for IMDSv2 support - #84
Conversation
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.
|
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.
|
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. |
|
i have confirmed that the the issue with older images persists and am trying to see if there is a reasonable workaround or documentable new fork we can send users down. |
|
@warisshaikh1 - thank you for your contribution! i agree that this is the right way forward for the plugin. i am going to follow up this PR with one of my own that enables a bit of a softer landing for the legacy issues i have described in this conversation. |
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.