- Notifications
You must be signed in to change notification settings - Fork929
fix(agent): start devcontainers through agentcontainers package#18471
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
25 commits Select commitHold shift + click to select a range
978c871
fix(agent): start devcontainers through agentcontainers package
DanielleMaywoodfe99bd6
chore: appease formatter
DanielleMaywoodaeae6e2
chore: fix test, appease linter
DanielleMaywood916f7e8
chore: feedback
DanielleMaywood53e256b
Merge branch 'main' into dm-devcontainer-log-spam
DanielleMaywood91bb43a
chore: re-add script timings
DanielleMaywood81fe11d
fix: change how containerAPI is stored
DanielleMaywood5c70a8c
Merge branch 'main' into dm-devcontainer-log-spam
DanielleMaywood8437ca4
chore: appease linter
DanielleMaywood2c6a2b1
chore: ensure the last log line is printed
DanielleMaywooda512ad4
chore: fix typo
DanielleMaywoodc50dc6e
chore: OOPS
DanielleMaywood4d40ef2
chore: 1 -> 2
DanielleMaywoodce32e2e
chore: add a status to the timings
DanielleMaywood32ac48a
chore: initialize containerapi even earlier
DanielleMaywood738b755
chore: only enable when devcontainers are enabled
DanielleMaywood3714fec
chore: simplify things a little
DanielleMaywood996d440
chore: recreate -> create with argument
DanielleMaywoodae5dd1e
chore: ensure we close and init
DanielleMaywood9d76cf6
chore: appease linter
DanielleMaywood7285c39
chore: mock ReadConfig any time
DanielleMaywood3fce51c
chore: feedback
DanielleMaywood54aa84a
chore: feedback
DanielleMaywood3d08d0e
chore: only set status if not set, and run create in test
DanielleMaywoodfa479fc
chore: feedback on poor error message
DanielleMaywoodFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
fix: change how containerAPI is stored
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit81fe11d05c74f6784b4a4343bbb69b89711a3a00
There are no files selected for viewing
16 changes: 15 additions & 1 deletionagent/agent.go
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
32 changes: 2 additions & 30 deletionsagent/api.go
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -7,15 +7,12 @@ | ||
"github.com/go-chi/chi/v5" | ||
"github.com/coder/coder/v2/agent/proto" | ||
"github.com/coder/coder/v2/coderd/httpapi" | ||
"github.com/coder/coder/v2/codersdk" | ||
) | ||
func (a *agent) apiHandler(aAPI proto.DRPCAgentClient26) (http.Handler, func() error) { | ||
r := chi.NewRouter() | ||
r.Get("/", func(rw http.ResponseWriter, r *http.Request) { | ||
httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.Response{ | ||
@@ -41,34 +38,9 @@ | ||
} | ||
if a.experimentalDevcontainersEnabled { | ||
if cAPI := a.containerAPI.Load(); cAPI != nil { | ||
DanielleMaywood marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
r.Mount("/api/v0/containers", cAPI.Routes()) | ||
} | ||
} else { | ||
r.HandleFunc("/api/v0/containers", func(w http.ResponseWriter, r *http.Request) { | ||
httpapi.Write(r.Context(), w, http.StatusForbidden, codersdk.Response{ | ||
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.