-
Notifications
You must be signed in to change notification settings - Fork 949
feat: add managed agent license limit checks #18937
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -335,7 +335,7 @@ func (api *API) postWorkspaceBuilds(rw http.ResponseWriter, r *http.Request) { | |
return | ||
} | ||
|
||
builder := wsbuilder.New(workspace, database.WorkspaceTransition(createBuild.Transition)). | ||
builder := wsbuilder.New(workspace, database.WorkspaceTransition(createBuild.Transition), *api.BuildUsageChecker.Load()). | ||
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. Can panic |
||
Initiator(apiKey.UserID). | ||
RichParameterValues(createBuild.RichParameterValues). | ||
LogLevel(string(createBuild.LogLevel)). | ||
|
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.
This could panic; can you add some protection for it?
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 atomic pointer is preloaded with a value before the AGPL API gets constructed, so there's no opportunity for it to be misused or ever hold nil. We also have many other atomic pointers that get dereferenced like this, such as
*api.Auditor.Load()
which is used in every auditable API endpoint.