Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix VM DNS in tests #42450

Merged
merged 3 commits into from
Jan 3, 2023
Merged

Fix VM DNS in tests #42450

merged 3 commits into from
Jan 3, 2023

Conversation

howardjohn
Copy link
Member

@howardjohn howardjohn commented Dec 14, 2022

Fixes #42449
Fixes #42452

Note because of #42452 this test has been broken of GCP forever. It only recently broke on GCP due to #42449

Please provide a description of this PR:

@howardjohn howardjohn added release-notes-none Indicates a PR that does not require release notes. cherrypick/release-1.14 cherrypick/release-1.16 Set this label on a PR to auto-merge it to the release-1.16 branch labels Dec 14, 2022
@howardjohn howardjohn requested a review from a team as a code owner December 14, 2022 20:04
@istio-testing istio-testing added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 14, 2022
@zirain
Copy link
Member

zirain commented Dec 15, 2022

/test integ-telemetry

@howardjohn howardjohn requested a review from a team as a code owner December 15, 2022 22:43
@istio-testing istio-testing added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 15, 2022
return &gcpEnv{}
return &gcpEnv{
fillMetadata: lazy.New(func() (bool, error) {
return shouldFillMetadata(), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be e.shouldFIllMetadata?

Or actually, isn't this a circular definition? It looks like gcpEnv.fillMetadata depends on shouldFillMetadata(), but that function depends on the existence of e.fillMetadata.

I may be missing something.

Copy link
Member Author

Choose a reason for hiding this comment

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

shouldFillMetadata() can probably be inlined and then its less confusing

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah its because we mock it, forgot about that

const metadataIP = "169.254.169.254"
host := os.Getenv(metadataHostEnv)
if host == "" {
host = metadataIP
Copy link
Contributor

Choose a reason for hiding this comment

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

As mentioned in chat, I think we need to check the additional condition that the header of the returned result matches the GCP metadata flavor header.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think if we do that we need to completely replace OnGCE. I might not have time to cover that in the short term future, does it make sense as a followup? Since right now tests are broken. The current change should be strictly an improvement

@istio-testing istio-testing merged commit 9c6ba28 into istio:master Jan 3, 2023
@istio-testing
Copy link
Collaborator

In response to a cherrypick label: #42450 failed to apply on top of branch "release-1.14":

Applying: Fix VM DNS in tests
Using index info to reconstruct a base tree...
A	pkg/test/framework/components/echo/kube/templates/vm_deployment.yaml
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): pkg/test/framework/components/echo/kube/templates/vm_deployment.yaml deleted in HEAD and modified in Fix VM DNS in tests. Version Fix VM DNS in tests of pkg/test/framework/components/echo/kube/templates/vm_deployment.yaml left in tree.
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix VM DNS in tests
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new issue created for failed cherrypick: #42644

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new pull request created: #42645

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new pull request created: #42646

howardjohn added a commit to howardjohn/istio that referenced this pull request Jan 4, 2023
* Fix VM DNS in tests

Fixes  istio#42449

* fix isMetadataEndpointAccessible as well

* fix port

(cherry picked from commit 9c6ba28)
dhawton pushed a commit to dhawton/istio that referenced this pull request Jan 6, 2023
* Fix VM DNS in tests

Fixes  istio#42449

* fix isMetadataEndpointAccessible as well

* fix port
istio-testing pushed a commit that referenced this pull request Jan 11, 2023
* Fix VM DNS in tests (#42450)

* Fix VM DNS in tests

Fixes  #42449

* fix isMetadataEndpointAccessible as well

* fix port

* cherry pick lazy pkg

* unit test fix

Co-authored-by: John Howard <howardjohn@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick/release-1.16 Set this label on a PR to auto-merge it to the release-1.16 branch release-notes-none Indicates a PR that does not require release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

isMetadataEndpointAccessible is not reliable TestVMTelemetry flaky, regression
5 participants