Repository navigation
Conversation
Cluster commands call the AKP v2 API through the generated Go clients in go.bytebuilders.dev/b3/apis. Login and logout stay on the AKP v1 API: sign-in and sign-out have no v2 method yet. Signed-off-by: Tamal Saha <tamal@appscode.com>
Signed-off-by: Tamal Saha <tamal@appscode.com>
Signed-off-by: Tamal Saha <tamal@appscode.com>
An ErrorInfo of ACCOUNT_INACTIVE, LOGIN_PROHIBITED or ORG_SSO_REQUIRED adds its activation, prohibit-login or SSO sign-in URL to the error. The connect code stays, so not-found checks still work. Signed-off-by: Tamal Saha <tamal@appscode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the
ace clustercommands from the AKP v1 API to the AKP v2 API, using the generated Go clients ingo.bytebuilders.dev/b3/apis.What changed
pkg/akp: the one place that builds the v2 clients. Base URL is the context's endpoint +/api/v2. An interceptor sends the same credentials as before:Authorization: token <token>(config orACE_TOKEN), basic auth fromACE_USERNAME/ACE_PASSWORD(it replaces the token, as before), and the saved session cookies withX-Csrf-Token. It uses the default binary codec.The owner is
--org, or else the caller's username fromUserService.GetAuthenticatedUser.Calls moved:
GET /userakp.user.v2.UserService.GetAuthenticatedUserGET /user/nats/credentialsakp.user.v2.NatsService.GetNatsCredentialscluster listGET /clustersv2/:ownerakp.cluster.v2.ClusterService.ListClusterscluster get,list(per-cluster status)GET /clustersv2/:owner/:cluster/statusLifecycleService.GetClusterStatuscluster checkPOST /clustersv2/:owner/checkLifecycleService.CheckClustercluster importPOST /clustersv2/:owner/importLifecycleService.ImportClustercluster connectPOST /clustersv2/:owner/:cluster/connectLifecycleService.ConnectClustercluster reconfigurePOST /clustersv2/:owner/:cluster/reconfigureLifecycleService.ReconfigureClustercluster removePOST /clustersv2/:owner/:cluster/removeLifecycleService.RemoveClusterImport, reconfigure and remove still print their steps from NATS. The response ID goes in
OperationOptions.response_id, and AKP publishes progress under it as before."Not found" handling checks
connect.CodeNotFoundnow, not the AKP v1 API client'sErrNotFound.An AKP v2 API error with a
google.rpc.ErrorInfoofACCOUNT_INACTIVE,LOGIN_PROHIBITEDorORG_SSO_REQUIREDgets the activation, prohibit-login or SSO sign-in URL (endpoint + the path in its metadata) added to its message. The connect code is kept.The printer takes
akp.cluster.v2.Cluster. The table output is unchanged (NAME, DISPLAY_NAME, PROVIDER, PHASE).-o jsonand-o yamlnow print the v2 message (protojson) instead of the AKP v1 API'sClusterInfoobject.cluster list --provideris now applied on the client side. The AKP v1 API ignored it, and the AKP v2 API request has no provider field.go.bytebuilders.dev/resource-modelis no longer a direct dependency. Thegodirective goes to 1.26.0, which the apis module requires.Still on the AKP v1 API
ace auth login(POST /user/signin) andace auth logout(GET /user/signout). They create and clear the browser session and cookies, and the AKP v2 API has no method for that yet. They are listed under "v1 coverage" in AGENTS.md of appscode-cloud/b3. Because of them,go.bytebuilders.dev/clientstays a dependency.Before merging
go.bytebuilders.dev/b3/apisis pinned with areplacetogithub.com/appscode-cloud/b3/apisat theconnectgrpccommit9aab4bbcfac7, because the vanity host serves nogo-importfor the nested module. Bump it to the merged commit after #1497 lands.Tests
go build ./...,go vet ./...,go test ./...(pkg/akptests the ErrorInfo messages),make lint(0 issues).go mod tidy && go mod vendorleaves no diff.cluster getposts to/api/v2/akp.cluster.v2.LifecycleService/GetClusterStatuswithAuthorization: token …, and anot_foundanswer prints "Cluster does not exist.". Not tested against a live AKP.