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

--attach generates a toml with an odd structure #3801

Open
fliepeltje opened this issue Jul 31, 2024 · 2 comments
Open

--attach generates a toml with an odd structure #3801

fliepeltje opened this issue Jul 31, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@fliepeltje
Copy link
Contributor

fliepeltje commented Jul 31, 2024

Describe the bug

When I use the --attach flag, this is the fly.toml that I get in my fly/apps/<app-name>/fly.toml

[experimental]
  [experimental.attached]
    [experimental.attached.secrets]
      [experimental.attached.secrets.export]
        SANDWICH_CHAT_URL = 'http://${FLYCAST_URL}/sandwich-chat'

The relevant section of the original fly.toml for the attached app looks like this:

[experimental.attached.secrets.export]
  SANDWICH_CHAT_URL = "http://${FLYCAST_URL}/sandwich-chat"

Functionally this of course works, but it looks a bit weird.

@fliepeltje fliepeltje added the bug Something isn't working label Jul 31, 2024
@rubys
Copy link
Contributor

rubys commented Jul 31, 2024

I agree it looks weird, but that appears to be the default serialization for toml so I would not be inclined to change it. Essentially, we unmarshal the toml into go structs, make a few changes (like assigning a name), and then marshal the result.

The root cause seems to be that omitempty doesn't omit the containing structs as they aren't empty.

I considered removing this information as it no longer relevant; but at the time didn't pursue that.

@fliepeltje
Copy link
Contributor Author

One reason it kind of is a problem: the attached app is also a github repo; if you want to sync with remote, you will need to stash the changes which is not very nice DX and really unintuitive; I think ideallythe cloned repo would be identical to what you get from github, but I realize that also gets problematic with the app name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants