Skip to content

feat: add controller, test and mock support for VMwareEngineExternalAccessRule #4403

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

Conversation

jingyih
Copy link
Collaborator

@jingyih jingyih commented Apr 20, 2025

HTTP log: real vs. mock (only includes requests relevant to this resource):
https://www.diffchecker.com/GdM306Ad/
The diff includes additional GET requests related to VMware networks, network policies, and similar resources. I think these are triggered by periodic reconciliations that occur roughly every 10 minutes during testing against real GCP, which takes considerably longer.

@jingyih jingyih force-pushed the resource-vmwareengine-externalaccessrule branch from 2ef32ba to b0ac7a3 Compare April 20, 2025 10:50
@jingyih
Copy link
Collaborator Author

jingyih commented Apr 24, 2025

/assign @maqiuyujoyce

}

paths := []string{}
if desired.Spec.Description != nil && !reflect.DeepEqual(resource.Description, a.actual.Description) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious, why do you prefer DeepEqual() here instead of CompareProtoMessage()?

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 feel it is easier to do custom diff when needed. e.g.

func backupConfigsEqual(a, b *gkebackuppb.BackupPlan_BackupConfig) bool {

var updated *pb.ExternalAccessRule
if len(paths) == 0 {
log.V(2).Info("no field needs update", "name", a.id)
updated = a.actual
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 you'll want to set externalRef here for acquisition case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, I didn’t realize the externalRef wasn’t added by the LLM. This is a blind spot on my part. I may have overlooked it in other controllers I’ve added. I’ll double-check.

@maqiuyujoyce
Copy link
Collaborator

/lgtm
/approve

@google-oss-prow google-oss-prow bot added the lgtm label Apr 24, 2025
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maqiuyujoyce

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 merged commit a97e410 into GoogleCloudPlatform:master Apr 24, 2025
52 of 53 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.

3 participants