- Notifications
You must be signed in to change notification settings - Fork1k
fix: add constraint and runtime check for provisioner logs size limit#18893
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
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
9f8cd50
68d8e5e
476c6ff
c8de633
908c888
c709a9e
f32ac68
29ad77c
f6134aa
cc469f8
29297d6
cd891db
1398491
395c9e1
630e2ac
e44cd47
fa118db
105de84
2923e9d
61a58f5
e7f2ec6
4a2a7f8
8115e4a
99d5090
c09f0f6
1ab1347
6964cee
a03a956
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -4489,6 +4489,22 @@ func (q *querier) UpdateProvisionerJobByID(ctx context.Context, arg database.Upd | ||
return q.db.UpdateProvisionerJobByID(ctx, arg) | ||
} | ||
func (q *querier) UpdateProvisionerJobLogsLength(ctx context.Context, arg database.UpdateProvisionerJobLogsLengthParams) error { | ||
// Not sure what the rbac should be here, going with this for now | ||
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. This is the only bit I'm unsure of, maybe include the same comment as the other provisioner related functions have?
or ask@mafredri since he opened that issue? ContributorAuthor
| ||
if err := q.authorizeContext(ctx, policy.ActionUpdate, rbac.ResourceProvisionerJobs); err != nil { | ||
return err | ||
} | ||
return q.db.UpdateProvisionerJobLogsLength(ctx, arg) | ||
} | ||
func (q *querier) UpdateProvisionerJobLogsOverflowed(ctx context.Context, arg database.UpdateProvisionerJobLogsOverflowedParams) error { | ||
// Not sure what the rbac should be here, going with this for now | ||
if err := q.authorizeContext(ctx, policy.ActionUpdate, rbac.ResourceProvisionerJobs); err != nil { | ||
return err | ||
} | ||
return q.db.UpdateProvisionerJobLogsOverflowed(ctx, arg) | ||
} | ||
func (q *querier) UpdateProvisionerJobWithCancelByID(ctx context.Context, arg database.UpdateProvisionerJobWithCancelByIDParams) error { | ||
// TODO: Remove this once we have a proper rbac check for provisioner jobs. | ||
// Details in https://github.com/coder/coder/issues/16160 | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE provisioner_jobs DROP COLUMN logs_length; | ||
ALTER TABLE provisioner_jobs DROP COLUMN logs_overflowed; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- Add logs length tracking and overflow flag, similar to workspace agents | ||
ALTER TABLE provisioner_jobs ADD COLUMN logs_length integer NOT NULL DEFAULT 0 CONSTRAINT max_provisioner_logs_length CHECK (logs_length <= 1048576); | ||
ALTER TABLE provisioner_jobs ADD COLUMN logs_overflowed boolean NOT NULL DEFAULT false; | ||
COMMENT ON COLUMN provisioner_jobs.logs_length IS 'Total length of provisioner logs'; | ||
COMMENT ON COLUMN provisioner_jobs.logs_overflowed IS 'Whether the provisioner logs overflowed in length'; |
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.