Reflect NICs defined in the VirtualMachine resource to the corresponding VirtualMachineNetworkConfig resource #43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
IMPORTANT: Please do not create a Pull Request without creating an issue first.
Problem:
The Managed DHCP add-on cannot catch any changes in the virtual machine's MAC address updates. The only way to let the add-on serve IP addresses for the updated MAC addresses is to remove the corresponding VirtualMachineNetworkConfig resource and the controller will automatically create a new one with updated MAC addresses.
Solution:
Introduce a new condition in VirtualMachineNetworkConfig—
InSynced
—which represents the synchronization between the VirtualMachine and VirtualMachineNetworkConfig resources, especially for the MAC addresses. The vm-controller will flag the condition and reflect the MAC addresses to the vmnetcfg resource. The vmnetcfg-controller will catch the changes, try to remove any stale records, and then update the IPPool resource. After that,InSynced
will becomeTrue
. This unblocks the regular allocation procedure, so the new MAC addresses (if any) will get new IP addresses from the IPPool resource.Related Issue:
harvester/harvester#7046
Test plan: