Allow empty team for the Heroku connector driver
The driver now runs in personal mode when no team is configured, so the team_id-required guard would block solo accounts from ever building a driver. Drop it and let an empty or personal-account slug flow through. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
@@ -38,10 +38,9 @@ func herokuRegistration() *Registration {
|
|||||||
return nil, fmt.Errorf("cannot read heroku connector settings: %w", err)
|
return nil, fmt.Errorf("cannot read heroku connector settings: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.TeamID == "" {
|
// TeamID may be empty or the personal-account slug for a solo
|
||||||
return nil, fmt.Errorf("cannot create heroku driver: team_id is required")
|
// Heroku account (no Team); the driver runs in personal mode
|
||||||
}
|
// (app owner + collaborators) in that case.
|
||||||
|
|
||||||
return drivers.NewHerokuDriver(c, s.TeamID), nil
|
return drivers.NewHerokuDriver(c, s.TeamID), nil
|
||||||
},
|
},
|
||||||
NewNameResolver: func(ctx context.Context, c *http.Client, conn *coredata.Connector, logger *log.Logger) drivers.NameResolver {
|
NewNameResolver: func(ctx context.Context, c *http.Client, conn *coredata.Connector, logger *log.Logger) drivers.NameResolver {
|
||||||
|
|||||||
Reference in New Issue
Block a user