-
Notifications
You must be signed in to change notification settings - Fork 12
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
internal/controller: use hcl pkg to generate atlas.hcl for declarative flow #239
Merged
Conversation
This file contains 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
datdao
force-pushed
the
d/support-atlas-config
branch
7 times, most recently
from
December 10, 2024 09:46
0f5545f
to
8308fdc
Compare
giautm
reviewed
Dec 10, 2024
giautm
reviewed
Dec 10, 2024
giautm
reviewed
Dec 10, 2024
giautm
reviewed
Dec 10, 2024
giautm
reviewed
Dec 10, 2024
datdao
force-pushed
the
d/support-atlas-config
branch
from
December 10, 2024 10:45
8308fdc
to
a7db0ab
Compare
datdao
force-pushed
the
d/support-atlas-config
branch
from
December 10, 2024 10:51
a7db0ab
to
6b40867
Compare
giautm
reviewed
Dec 11, 2024
// asBlocks returns the HCL block for the environment configuration. | ||
func (d *managedData) asBlocks() []*hclwrite.Block { | ||
var blocks []*hclwrite.Block | ||
env := hclwrite.NewBlock("env", []string{d.EnvName}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The env
shouldn't have no labels.
Suggested change
env := hclwrite.NewBlock("env", []string{d.EnvName}) | |
env := hclwrite.NewBlock("env", nil) |
giautm
reviewed
Dec 11, 2024
drop_schema = true | ||
drop_table = true | ||
expected := `env "kubernetes" { | ||
url = "mysql://root:password@localhost:3306/test" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The env
block should have no label, and the name
attribute should set to name = atlas.env
giautm
approved these changes
Dec 11, 2024
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.
This PR changes the logic for generating
atlas.hcl
by using the HCL package instead of a template. By applying this approach, we can easily merge another Atlas config file into the existing one since they follow the same HCL model.