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

feat: Add Apigee Envgroup direct controller #3332

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

Camila-B
Copy link
Contributor

@Camila-B Camila-B commented Dec 6, 2024

Change description

Defines the Apigee Envgroup API

Tests you have done

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

@jasonvigil
Copy link
Collaborator

Seems to be a failure in presubmit validations, looks like some of the generated files need to be regenerated:

ERROR: Manifests must be regenerated. Please run 'make ready-pr' or 'make manifests' and update your PR.

@jasonvigil
Copy link
Collaborator

Also, looks like you fixed one of the issues in tests/apichecks/testdata/exceptions/acronyms.txt, and we can remove the exception now! See unit test job output: https://github.com/GoogleCloudPlatform/k8s-config-connector/actions/runs/12203794855/job/34047550729?pr=3332

@Camila-B Camila-B changed the title [WIP] Define the Apigee Envgroup API [WIP] feat: Add Apigee Envgroup direct controller Dec 18, 2024
@Camila-B Camila-B changed the title [WIP] feat: Add Apigee Envgroup direct controller feat: Add Apigee Envgroup direct controller Dec 18, 2024
@Camila-B Camila-B requested a review from jasonvigil December 18, 2024 23:47
@Camila-B Camila-B marked this pull request as ready for review December 19, 2024 00:33
apis/apigee/v1alpha1/environmentgroup_identity.go Outdated Show resolved Hide resolved
apis/apigee/v1alpha1/environmentgroup_reference.go Outdated Show resolved Hide resolved
apis/apigee/v1alpha1/environmentgroup_types.go Outdated Show resolved Hide resolved
apis/apigee/v1alpha1/environmentgroup_types.go Outdated Show resolved Hide resolved
apis/refs/v1alpha1/organizationref.go Outdated Show resolved Hide resolved
pkg/controller/direct/apigee/envgroup_controller.go Outdated Show resolved Hide resolved
@Camila-B Camila-B requested a review from jasonvigil December 19, 2024 22:00
@jasonvigil
Copy link
Collaborator

/lgtm

@jasonvigil
Copy link
Collaborator

/lgtm
/assign yuwenma

@yuwenma
Copy link
Collaborator

yuwenma commented Dec 20, 2024

/approve

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.

/hold

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.

/hold

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.

I have a few questions related to the LRO and returned value format. Can we upload the real GCP log to show the git-diff?

apis/apigee/v1alpha1/environmentgroup_identity.go Outdated Show resolved Hide resolved
// New builds a GoogleCloudApigeeV1EnvironmentGroupIdentity from the Config Connector GoogleCloudApigeeV1EnvironmentGroup object.
func NewGoogleCloudApigeeV1EnvironmentGroupIdentity(ctx context.Context, reader client.Reader, obj *ApigeeEnvgroup) (*GoogleCloudApigeeV1EnvironmentGroupIdentity, error) {
// Get Parent
orgRef, err := refs.ResolveOrganization(ctx, reader, obj, obj.Spec.Parent.OrganizationRef)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should not do the resolve reference here, because it will block this resource deletion.
Here's the scenario:
Users want to delete both env and org. Org is deleted first and this always returns error. Adapter cannot be initialized and therefore cannot be deleted forever. cc @jasonvigil

Copy link
Collaborator

@jasonvigil jasonvigil Dec 20, 2024

Choose a reason for hiding this comment

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

I am not sure that it will be possible to avoid resolving the reference here, because the organization is the parent for this resource. Even in NormalizeExternal we resolve the resource, if it is not specified in external format.

apis/apigee/v1alpha1/environmentgroup_identity.go Outdated Show resolved Hide resolved
apis/refs/v1alpha1/helper.go Outdated Show resolved Hide resolved
apis/refs/v1alpha1/organizationref.go Outdated Show resolved Hide resolved
return nil
}
}
time.Sleep(2 * time.Second)
Copy link
Collaborator

Choose a reason for hiding this comment

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

How long does this update normally takes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From testing, it seems to be close to instantaneous (< 1 second)

pkg/controller/direct/apigee/envgroup_mappings.go Outdated Show resolved Hide resolved
@@ -19,7 +19,6 @@
[acronyms] crd=apigeeaddonsconfigs.apigee.cnrm.cloud.google.com version=v1alpha1: field ".spec.addonsConfig.advancedApiOpsConfig.enabled" should be ".spec.addonsConfig.advancedAPIOpsConfig.enabled"
[acronyms] crd=apigeeendpointattachments.apigee.cnrm.cloud.google.com version=v1alpha1: field ".spec.orgId" should be ".spec.orgID"
[acronyms] crd=apigeeenvgroupattachments.apigee.cnrm.cloud.google.com version=v1alpha1: field ".spec.envgroupId" should be ".spec.envgroupID"
[acronyms] crd=apigeeenvgroups.apigee.cnrm.cloud.google.com version=v1alpha1: field ".spec.orgId" should be ".spec.orgID"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

@yuwenma
Copy link
Collaborator

yuwenma commented Dec 20, 2024

/remove-approve

Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from yuwenma. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@Camila-B Camila-B force-pushed the apigee-envgroup-2 branch 3 times, most recently from bd24dff to 9637802 Compare December 20, 2024 23:36
@Camila-B Camila-B requested a review from yuwenma January 6, 2025 17:28
@jasonvigil
Copy link
Collaborator

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Jan 13, 2025
@acpana
Copy link
Collaborator

acpana commented Jan 14, 2025

@yuwenma could we merge this in so I can build on top of it too 😆 ?

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.

4 participants