Skip to content

Conversation

@aaronfern
Copy link
Member

What this PR does / why we need it:

This PR does the following

  1. Updated the InitializeMachine() method to assign ipv6 addresses before disabling SrcAndDest check.
    a. This is required due to the check in GetMachineStatus() which determines whether a machine is uninitialized. According to the check, a machine is deemed to be uninitialized if the SrcAndDest check is not disabled. This caused an issue where if MCM crashes just after disabling the SrcAndDest check for a machine, it is no longer considered an uninitialized machine and InitializeMachine() is not called for it again. This results in missing ipv6 addresses
  2. Updates the condition for assigning ipv6 addresses such that if ipv6 prefix already exists for a machine then we do not call client.AssignIpv6Addresses() again
    a. This is needed as client.AssignIpv6Addresses() is additive in nature and does not tolerate duplicate calls

Which issue(s) this PR fixes:
Fixes #225

Special notes for your reviewer:

Release note:

Updated the `InitializeMachine()` method to assign ipv6 addresses before disabling SrcAndDest check

@aaronfern aaronfern requested review from a team as code owners December 2, 2025 13:36
@gardener-robot gardener-robot added needs/review Needs review size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) labels Dec 2, 2025
if providerSpec.SrcAndDstChecksEnabled != nil && !*providerSpec.SrcAndDstChecksEnabled {
if ptr.Deref(requiredInstance.SourceDestCheck, true) {
msg := fmt.Sprintf("VM %q associated with machine %q has SourceDestCheck=%t despite providerSpec.SrcAndDstChecksEnabled=%t",
*requiredInstance.InstanceId, req.Machine.Name, *requiredInstance.SourceDestCheck, *providerSpec.SrcAndDstChecksEnabled)
Copy link

@r4mek r4mek Dec 5, 2025

Choose a reason for hiding this comment

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

The dereference - *requiredInstance.SourceDestCheck would panic when the value is nil.
Using ptr.Deref(requiredInstance.SourceDestCheck, true) would avoid this

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

Labels

needs/review Needs review size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IPv6 address not reliably being assigned to machines during initalisation

3 participants