fix: consolidate custom network interface when nic type is preconfigured - #588
Open
adi-IL wants to merge 1 commit into
Open
Conversation
|
Hi @adi-IL. Thanks for your PR. I'm waiting for a GoogleCloudPlatform member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #500
What was wrong
When
TestVM.UseGVNIC()was called prior toTestVM.AddCustomNetwork(),UseGVNIC()initializedNetworkInterfaceswith a single entry containingNicType: "GVNIC"and an emptyNetworkfield. Subsequent calls toAddCustomNetworkWithStackType()appended a second network interface rather than configuring the primary NIC. This caused test VMs to spin up with two network interfaces (where NIC 0 defaulted to the default VPC network and NIC 1 had the custom network), leading to failures in environments without a default VPC.What changed
AddCustomNetworkWithStackTypeinfixtures.gofor bothinstanceandinstancebetato inspect existing network interfaces. If a single preconfigured NIC without an assigned network exists (such as from a priorUseGVNIC()call), it updates the primary interface with the custom network and preserves the preconfiguredNicType.TestAddCustomNetworkGVNICConsolidationinfixtures_test.gocoveringUseGVNIC()followed byAddCustomNetwork(),AddCustomNetwork()followed byUseGVNIC(), and beta instance consolidation.Verification
go test -v -run TestAddCustomNetworkGVNICConsolidation .-> PASSgo test . ./cleanerupper/... ./utils/...-> all unit tests PASSgofmt -d fixtures.go fixtures_test.go-> clean formatting