Skip to content

Conversation

maqiuyujoyce
Copy link
Collaborator

BRIEF Change description

Diffbase #5423

Fixes #5334

Analytics API doesn't have the endpoint to directly create an account. In order to create an Analytics account, user needs to call ProvisionAccountTicket() and then accept the ToS manually after constructing the link using the account ticket ID returned by ProvisionAccountTicket(). More details can be found in the comments in #5334.

To make this workflow work as transparently as possible, here are the customizations I did:

  1. Added the spec.redirectURI and status.observedState.accountTicketID to support ProvisionAccountTicket() API call.
  2. Used ProvisionAccountTicket() in Create and delayed setting of status.externalRef till we find a matching account in the ListAccounts() in Find.
  3. Introduced the ManualStepNotCompleted error and make it a "dependency not ready" error. Explicitly asked users to accept the ToS when account ticket ID is found. Also made this error not a blocker for the resource deletion.

Picked the GRPC client because the REST client returned the following error repetitively even if I had already done what it suggested:

Error 403: Your application is authenticating by using local Application Default Credentials. The analyticsadmin.googleapis.com API requires a quota project, which is not set by default. To learn how to set your quota project, see https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds

WHY do we need this change?

Special notes for your reviewer:

Does this PR add something which needs to be 'release noted'?


  • Reviewer reviewed release note.

Additional documentation e.g., references, usage docs, etc.:


Intended Milestone

Please indicate the intended milestone.

  • Reviewer tagged PR with the actual milestone.

Tests you have done

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

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

@maqiuyujoyce maqiuyujoyce force-pushed the 202510-analyticsaccount-controller branch from 0d8fa1e to 37b7b63 Compare October 14, 2025 00:40
@yuwenma
Copy link
Collaborator

yuwenma commented Oct 14, 2025

/hold for #5423 ##5422 to check in first

@maqiuyujoyce maqiuyujoyce force-pushed the 202510-analyticsaccount-controller branch 2 times, most recently from d82e6aa to 775666c Compare October 16, 2025 19:25
@maqiuyujoyce maqiuyujoyce force-pushed the 202510-analyticsaccount-controller branch from 775666c to d7fb02d Compare October 16, 2025 21:11
@maqiuyujoyce maqiuyujoyce force-pushed the 202510-analyticsaccount-controller branch from d7fb02d to 15baa02 Compare October 16, 2025 22:40
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.

feat: Add AnalyticsAccount as a KRM-native resource (Alpha)

2 participants