- Notifications
You must be signed in to change notification settings - Fork928
fix: fix null pointer on external provisioner daemons with daily_cost#9401
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
ac192e7
3c0d020
a91d28f
8e32e5c
8956184
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1098,26 +1098,31 @@ func (api *API) CreateInMemoryProvisionerDaemon(ctx context.Context, debounce ti | ||
} | ||
mux := drpcmux.New() | ||
srv, err := provisionerdserver.NewServer( | ||
api.AccessURL, | ||
daemon.ID, | ||
api.Logger.Named(fmt.Sprintf("provisionerd-%s", daemon.Name)), | ||
daemon.Provisioners, | ||
tags, | ||
api.Database, | ||
api.Pubsub, | ||
api.Telemetry, | ||
tracer, | ||
&api.QuotaCommitter, | ||
&api.Auditor, | ||
api.TemplateScheduleStore, | ||
api.UserQuietHoursScheduleStore, | ||
api.DeploymentValues, | ||
debounce, | ||
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 feels like a lot of args and has it's own risk of mixed up arg order when there are same types (not the case here, now). Typically I'd revert to a struct but I understand why we're making this change. Two structs may be another option. We have a linter that checks that all fields are set (only enabled for certain types atm). 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. The "a lot of args" is it's own code smell, and is a symptom of poor code architecture to have so many required args. Making it a struct makes it too easy to leave off required arguments. It doesn't reduce the amount of code, and in fact, increases it. Member 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.
I think we should value clarity more-so than reducing the number of characters. And it's not like it would increase LOC, just verbosity (but also clarity). But again, feel free to take this as a suggestion, not as an asked change. PS. I was making a case for a linter that detects missing fields. And the struct fields can be further verified in | ||
provisionerdserver.Options{ | ||
OIDCConfig: api.OIDCConfig, | ||
GitAuthConfigs: api.GitAuthConfigs, | ||
}, | ||
) | ||
if err != nil { | ||
return nil, err | ||
} | ||
err = proto.DRPCRegisterProvisionerDaemon(mux, srv) | ||
if err != nil { | ||
return nil, err | ||
} | ||
Uh oh!
There was an error while loading.Please reload this page.