-
Notifications
You must be signed in to change notification settings - Fork 238
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
test: Add test case for reference regional target tcp proxy in CFR #3148
test: Add test case for reference regional target tcp proxy in CFR #3148
Conversation
956987a
to
852d1e5
Compare
0e09f51
to
8c02d43
Compare
No diffs in commit are related to forwarding rule or tcp proxy |
dbae7f1
to
0a82f6a
Compare
@@ -87,7 +87,7 @@ type ComputeTargetTCPProxyObservedState struct { | |||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | |||
// +kubebuilder:resource:categories=gcp,shortName=gcpcomputetargettcpproxy;gcpcomputetargettcpproxies | |||
// +kubebuilder:subresource:status | |||
// +kubebuilder:metadata:labels="cnrm.cloud.google.com/tf2crd=true";"cnrm.cloud.google.com/stability-level=stable";"cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/system=true" | |||
// +kubebuilder:metadata:labels="cnrm.cloud.google.com/stability-level=stable";"cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/system=true" |
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.
Let's not turn off the TF-based controller in this PR
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.
Done. Let's enable regional TCP Proxy first #3323 before merging this PR.
2361ea9
to
44f85c1
Compare
# limitations under the License. | ||
|
||
apiVersion: compute.cnrm.cloud.google.com/v1beta1 | ||
kind: ComputeForwardingRule |
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.
I think we haven't turned on this resource to direct controller yet. Shall we add the test to make sure it works on direct?
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.
We have it turned on in test:
k8s-config-connector/dev/tasks/run-e2e
Line 29 in 811204f
KCC_USE_DIRECT_RECONCILERS=ComputeForwardingRule,GKEHubFeatureMembership |
Let me remove this and add direct annotation in test, to avoid confusions.
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.
ah. I see.
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.
/lgtm
/approve
/hold
one suggestions
44f85c1
to
85239aa
Compare
I removed the KCC_USE_DIRECT_RECONCILERS flag for CFR and used direct annotation in test yaml. Also added both TF and direct test case for CFR with regional target tcp proxy. For other existing direct tests, we can duplicate them in another PR, if needed. |
@@ -1052,18 +1052,13 @@ X-Xss-Protection: 0 | |||
|
|||
--- | |||
|
|||
POST https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/forwardingRules/${forwardingRuleID}/setLabels | |||
POST https://compute.googleapis.com/compute/v1/projects/${projectId}/regions/us-central1/forwardingRules/${forwardingRuleID}/setTarget |
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.
The diffs in this file is because the order of setTarget and setLabels are different in direct controller and TF controller. This would not affect the functionality, and I think the order in TF controller is random... I can double check and if needed we can swap the order of the API calls in direct controller.
c57dea4
to
e4f26fb
Compare
Content-Type: application/json | ||
User-Agent: kcc/controller-manager | ||
x-goog-request-params: project=${projectId}&target_tcp_proxy=${targetTcpProxyID} | ||
User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager |
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.
This means the TCPProxy resource is changed from direct to TF-based. Could you investigate what is missing?
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.
That's expected, in this test, the CFR is direct, TCP proxy is TF based. In another test globalcomputeforwardingruletcp-direct-directtcp, both are direct.
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.
ok, I think I'm confused because this test name is "-direct".
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.
Could you upload the real GCP log for this test suite?
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.
This test is for direct CFR with direct regional TCP proxy, diff: https://paste.googleplex.com/6307517609803776
No changes to golden object log, some changes to http log but nothing related to CFR
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.
ditto: Could you upload the real GCP Log for this test suite?
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.
This test is for TF-based CFR with direct regional TCP proxy, here's the diff: https://paste.googleplex.com/5134954728783872
direct regional TCP proxy is also covered in its own tests.
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.
I see. the past seems to only contain partial differences. Do you know which resource has those diff?
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.
/lgtm
/approve
Content-Type: application/json | ||
User-Agent: kcc/controller-manager | ||
x-goog-request-params: project=${projectId}&target_tcp_proxy=${targetTcpProxyID} | ||
User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager |
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.
ok, I think I'm confused because this test name is "-direct".
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.
I see. the past seems to only contain partial differences. Do you know which resource has those diff?
# limitations under the License. | ||
|
||
apiVersion: compute.cnrm.cloud.google.com/v1beta1 | ||
kind: ComputeForwardingRule |
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.
ah. I see.
[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 |
e4f26fb
to
8a25f08
Compare
8a25f08
to
dd994d1
Compare
/lgtm |
974a6ea
into
GoogleCloudPlatform:master
Change description
based on #3047, #3112
Add additional test case for compute forwarding rule, verify that it can now reference to a regional tcp proxy
Tests you have done
make ready-pr
to ensure this PR is ready for review.