-
Notifications
You must be signed in to change notification settings - Fork 944
feat(coderd/healthcheck): add health check for proxy #10846
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
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
a17ec4c
feat(coderd/healthcheck): add health check for proxy
johnstcn 49b6e19
rm logger
johnstcn c7e202c
wire it up
johnstcn 89bae7e
add severity, convert to table-driven tests
johnstcn bcdc08c
dbauthz
johnstcn 340a276
make gen; make fmt
johnstcn d3478c8
Merge remote-tracking branch 'origin/main' into cj/workspaceproxy-hea…
johnstcn c746021
fix linter import shadowing complaint
johnstcn 05d4b09
fix generated report name
johnstcn 56be002
gen harder
johnstcn 1112b1c
address comments
johnstcn fed35bd
Merge remote-tracking branch 'origin/main' into cj/workspaceproxy-hea…
johnstcn 7f8760a
rename WorkspaceProxies -> workspace_proxies
johnstcn 5f5c486
fixup! rename WorkspaceProxies -> workspace_proxies
johnstcn b9cbdd8
use severity value instead of direct comparison
johnstcn ae30089
more tests
johnstcn 21f52bb
use errors.Join instead of multierror.Append
johnstcn 79dc190
refactor to use interface instead of atomic.Pointers
johnstcn 2530320
rm unnecessary authz
johnstcn f192488
fix typegen
johnstcn b45e9c5
Merge remote-tracking branch 'origin/main' into cj/workspaceproxy-hea…
johnstcn 63fbafb
make typescript stop whingeing
johnstcn 6de94bc
Merge remote-tracking branch 'origin/main' into cj/workspaceproxy-hea…
johnstcn b57cdeb
remove need for gosimple nolint
johnstcn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor to use interface instead of atomic.Pointers
- Loading branch information
commit 79dc190556ba3c2adba4e858e826c1bd486fefe1
There are no files selected for viewing
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
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
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
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
<
B4A5
summary class="height-full">
View file
Open in desktop
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 |
---|---|---|
|
@@ -960,3 +960,20 @@ func convertProxy(p database.WorkspaceProxy, status proxyhealth.ProxyStatus) cod | |
}, | ||
} | ||
} | ||
|
||
// workspaceProxiesFetchUpdater implements healthcheck.WorkspaceProxyFetchUpdater | ||
// in an actually useful and meaningful way. | ||
type workspaceProxiesFetchUpdater struct { | ||
fetchFunc func(context.Context) (codersdk.RegionsResponse[codersdk.WorkspaceProxy], error) | ||
updateFunc func(context.Context) error | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: You could either export this as-is to re-use in tests, or you could simplify this to just pass in the whole API ( |
||
} | ||
|
||
func (w *workspaceProxiesFetchUpdater) Fetch(ctx context.Context) (codersdk.RegionsResponse[codersdk.WorkspaceProxy], error) { | ||
//nolint:gocritic // Need perms to read all workspace proxies. | ||
authCtx := dbauthz.AsSystemRestricted(ctx) | ||
return w.fetchFunc(authCtx) | ||
} | ||
|
||
func (w *workspaceProxiesFetchUpdater) Update(ctx context.Context) error { | ||
return w.updateFunc(ctx) | ||
} |
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.
Uh oh!
There was an error while loading. Please reload this page.