internal/controller: support offline ATLAS_TOKEN#333
Merged
Conversation
31284f1 to
991b4df
Compare
7923f9d to
782a75c
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for “offline” Atlas Cloud tokens by persisting Atlas CLI state per resource (via a configurable data directory) and performing an explicit atlas login --grant-only when a token is provided.
Changes:
- Extend the Atlas CLI client factory to accept cloud config + a per-resource “home” path and set
HOME/ATLAS_TOKENfor Atlas CLI executions. - Perform
cli.Login(...GrantOnly: true)during schema/migration reconciliation and lint flows when a Cloud token is present. - Add PVC-backed persistence wiring (PVC +
DATA_DIRenv + mount) to kustomize manager manifest and Helm chart; bumpariga.io/atlasdependency.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/controller/common.go | Expands AtlasExec/AtlasExecFn and configures CLI env (HOME, ATLAS_TOKEN) based on DATA_DIR and Cloud token. |
| internal/controller/lint.go | Uses per-resource home and performs grant-only login before linting when token is present. |
| internal/controller/atlasschema_controller.go | Uses new atlasClient signature and performs grant-only login before schema operations; passes namespace/name for home dir. |
| internal/controller/atlasmigration_controller.go | Uses new atlasClient signature and performs grant-only login before migration operations; passes namespace/name for home dir. |
| internal/controller/testhelper.go | Updates mock runner wiring for the new AtlasExecFn signature; adds Login to mock. |
| internal/controller/atlasschema_controller_test.go | Updates atlasClient invocation signature in tests. |
| internal/controller/atlasmigration_controller_test.go | Updates atlasClient invocation signature in tests. |
| config/manager/manager.yaml | Adds a PVC and mounts it at /data, setting DATA_DIR to persist Atlas state. |
| charts/atlas-operator/values.yaml | Adds persistence configuration values. |
| charts/atlas-operator/templates/pvc.yaml | Adds an optional PVC template controlled by persistence.enabled. |
| charts/atlas-operator/templates/deployment.yaml | Wires persistence volume/mount and DATA_DIR env into the Helm deployment template. |
| Dockerfile | Removes HOME=/tmp workaround from the runtime image. |
| go.mod / go.sum | Bumps ariga.io/atlas dependency version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
f39c9c7 to
b0d58af
Compare
af5a313 to
be7ffe0
Compare
chinhnguyenh
approved these changes
Apr 1, 2026
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.
No description provided.