Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(agent/agentcontainers): correct definition of remoteEnv #16845

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

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Mar 7, 2025

devcontainer.metadata is apparently an array, not an object. Missed this first time round!

    error= get container env info:
               github.com/coder/coder/v2/agent/reconnectingpty.(*Server).handleConn
                   /home/runner/work/coder/coder/agent/reconnectingpty/server.go:193
             - read devcontainer remoteEnv:
               github.com/coder/coder/v2/agent/agentcontainers.EnvInfo
                   /home/runner/work/coder/coder/agent/agentcontainers/containers_dockercli.go:119
             - unmarshal devcontainer.metadata:
               github.com/coder/coder/v2/agent/agentcontainers.devcontainerEnv
                   /home/runner/work/coder/coder/agent/agentcontainers/containers_dockercli.go:189
             - json: cannot unmarshal array into Go value of type struct { RemoteEnv map[string]string "json:\"remoteEnv\"" }

@johnstcn johnstcn self-assigned this Mar 7, 2025
@johnstcn johnstcn requested review from mafredri and SasSwart March 7, 2025 15:31
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This label can contain an array of json snippets that will be automatically merged with devcontainer.json contents (if any) when a container is created.

From: https://containers.dev/implementors/json_reference/

That is how I understand it as well, changes look good. 👍🏻

@johnstcn
Copy link
Member Author

johnstcn commented Mar 7, 2025

This label can contain an array of json snippets that will be automatically merged with devcontainer.json contents (if any) when a container is created.

From: https://containers.dev/implementors/json_reference/

That is how I understand it as well, changes look good. 👍🏻

TBH I'd like to auto-generate the struct based on the spec. That will give us a nice heads-up if the spec changes on us.

@johnstcn johnstcn merged commit 61246bc into main Mar 7, 2025
32 checks passed
@johnstcn johnstcn deleted the cj/agentcontainers-meta-remoteenv branch March 7, 2025 15:59
@github-actions github-actions bot locked and limited conversation to collaborators Mar 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants