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: Move resolvers out of Adapter #2758

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

gemmahou
Copy link
Collaborator

@gemmahou gemmahou commented Sep 20, 2024

Change description

Deleting a resource does not require resolving dependencies. However, if dependencies are deleted prior to the resource itself, it will prevent the deletion of that resource.

Therefore, we should move resolvers to their own function outside the Adapter. We can resolve them during the create and update only.

Fixes #2621

Tests you have done

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

@gemmahou
Copy link
Collaborator Author

The presubmit pause job failed, I think we need to increase the timeout of this job.

@@ -673,7 +673,7 @@ func MaybeSkip(t *testing.T, name string, resources []*unstructured.Unstructured
case schema.GroupKind{Group: "compute.cnrm.cloud.google.com", Kind: "ComputeNodeGroup"}:
case schema.GroupKind{Group: "compute.cnrm.cloud.google.com", Kind: "ComputeNodeTemplate"}:
case schema.GroupKind{Group: "compute.cnrm.cloud.google.com", Kind: "ComputeManagedSSLCertificate"}:
//case schema.GroupKind{Group: "compute.cnrm.cloud.google.com", Kind: "ComputeServiceAttachment"}:
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this intended?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we started noticing this deletion issue in a forwarding rule test with service attachment dependency, and it blocked presubmits. So, we disabled this mock service. #1069

I added it back here because the issue has been addressed in this PR, and the presubmits all passed now.


---

POST https://compute.googleapis.com/compute/v1/projects/example-project-01/regions/us-west1/forwardingRules/${forwardingRuleID}/setLabels
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you know how the code change ends up with a new setLabels call? This looks weird

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I reason is I disabled this test before #1069, so I haven't updated its log to reflect the recent code changes(the set labels behavior during creation). I can collect the realGCP w/TF log to verify this change in the log is intended.

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.

/approve

2 questions: otherwise looks good

@@ -1187,6 +1187,86 @@ X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
"IPProtocol": "TCP",
Copy link
Collaborator

Choose a reason for hiding this comment

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

ipProtocal?

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

@google-oss-prow google-oss-prow bot added the lgtm label Sep 23, 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

@google-oss-prow google-oss-prow bot removed the lgtm label Sep 23, 2024
@gemmahou gemmahou force-pushed the direct-delete branch 2 times, most recently from 1a82067 to 4e1eb35 Compare September 24, 2024 21:27
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

@google-oss-prow google-oss-prow bot added the lgtm label Sep 26, 2024
@google-oss-prow google-oss-prow bot merged commit a37ae6a into GoogleCloudPlatform:master Sep 26, 2024
16 checks passed
@gemmahou gemmahou deleted the direct-delete branch September 26, 2024 23:26
@yuwenma yuwenma added this to the 1.124 milestone Oct 25, 2024
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.

Investigate presubmit samples test failures
3 participants