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

test: Add test case for reference regional target tcp proxy in CFR #3148

Merged

Conversation

gemmahou
Copy link
Collaborator

@gemmahou gemmahou commented Nov 11, 2024

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

  • [N/A] Run make ready-pr to ensure this PR is ready for review.
  • Perform necessary E2E testing for changed resources.

@gemmahou gemmahou force-pushed the reference-regional-tcp branch 2 times, most recently from 956987a to 852d1e5 Compare November 11, 2024 21:44
@gemmahou gemmahou force-pushed the reference-regional-tcp branch 6 times, most recently from 0e09f51 to 8c02d43 Compare November 20, 2024 20:30
@gemmahou
Copy link
Collaborator Author

gemmahou commented Nov 20, 2024

No diffs in commit are related to forwarding rule or tcp proxy

@gemmahou gemmahou force-pushed the reference-regional-tcp branch 2 times, most recently from dbae7f1 to 0a82f6a Compare November 20, 2024 23:26
@gemmahou gemmahou modified the milestones: 1.126, 1.127 Dec 4, 2024
@@ -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"
Copy link
Collaborator

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

Copy link
Collaborator Author

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.

@gemmahou gemmahou force-pushed the reference-regional-tcp branch 3 times, most recently from 2361ea9 to 44f85c1 Compare December 13, 2024 22:41
# limitations under the License.

apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeForwardingRule
Copy link
Collaborator

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?

Copy link
Collaborator Author

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:

KCC_USE_DIRECT_RECONCILERS=ComputeForwardingRule,GKEHubFeatureMembership

Let me remove this and add direct annotation in test, to avoid confusions.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah. I see.

Copy link
Collaborator

@yuwenma yuwenma left a 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

@gemmahou
Copy link
Collaborator Author

gemmahou commented Dec 17, 2024

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
Copy link
Collaborator Author

@gemmahou gemmahou Dec 17, 2024

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.

@gemmahou gemmahou force-pushed the reference-regional-tcp branch 3 times, most recently from c57dea4 to e4f26fb Compare December 17, 2024 22:09
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
Copy link
Collaborator

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?

Copy link
Collaborator Author

@gemmahou gemmahou Dec 18, 2024

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.

Copy link
Collaborator

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".

Copy link
Collaborator

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?

Copy link
Collaborator Author

@gemmahou gemmahou Dec 18, 2024

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

Copy link
Collaborator

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?

Copy link
Collaborator Author

@gemmahou gemmahou Dec 18, 2024

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.

Copy link
Collaborator

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?

Copy link
Collaborator

@yuwenma yuwenma left a 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
Copy link
Collaborator

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".

Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

ah. I see.

@google-oss-prow google-oss-prow bot added the lgtm label Dec 19, 2024
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gemmahou gemmahou force-pushed the reference-regional-tcp branch from e4f26fb to 8a25f08 Compare December 19, 2024 17:42
@google-oss-prow google-oss-prow bot removed the lgtm label Dec 19, 2024
@gemmahou gemmahou force-pushed the reference-regional-tcp branch from 8a25f08 to dd994d1 Compare December 19, 2024 23:00
@yuwenma
Copy link
Collaborator

yuwenma commented Dec 30, 2024

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Dec 30, 2024
@google-oss-prow google-oss-prow bot merged commit 974a6ea into GoogleCloudPlatform:master Dec 30, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants