-
Notifications
You must be signed in to change notification settings - Fork 239
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: Update compute mocks #2390
fix: Update compute mocks #2390
Conversation
Could you start the direct controller using the same API version as the existing controllers? |
Per this comment I guess we want to switch to v1 eventually? Other than the API version, the selflink format in compute mocks are inconsistent(should be |
Right - I think that should be easier. Otherwise I think all our tests will start failing with the TF-based controllers? |
// Terraform uses the /beta/ endpoints, but mocks and direct controller should use /v1/ | ||
// This special handling to avoid diffs in http logs. | ||
// This can be removed once all Compute resources are migrated to direct controller. | ||
basePath := "https://compute.googleapis.com/compute" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see! I guess this is a nice trick also. @yuwenma what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works for me.
obj.CreationTimestamp = PtrTo(s.nowString()) | ||
obj.Id = &id | ||
obj.Kind = PtrTo("compute#forwardingRule") | ||
obj.LabelFingerprint = PtrTo("abcdef0123A=") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd like to add the real logic on label fingerprint in the mockGCp and replace the value in normalize.go
// Terraform uses the /beta/ endpoints, but mocks and direct controller should use /v1/ | ||
// This special handling to avoid diffs in http logs. | ||
// This can be removed once all Compute resources are migrated to direct controller. | ||
basePath := "https://compute.googleapis.com/compute" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works for me.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: yuwenma The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
fd40b47
into
GoogleCloudPlatform:master
Change description
TF uses compute/beta/ endpoint, to avoid log diffs after migrating to Scifi, I made below changes:
The urls should be v1
https://compute.googleapis.com/compute/v1/
The self links should have format
https://www.googleapis.com/compute/v1/...
Tests you have done
make ready-pr
to ensure this PR is ready for review.