mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-23 14:07:11 +02:00
zero: fix bootstrap config path (#5035)
This commit is contained in:
parent
4193583301
commit
d20e99ca8c
7 changed files with 36 additions and 33 deletions
|
@ -28,19 +28,22 @@ func Run(ctx context.Context, configFile string) error {
|
|||
return errors.New("no token provided")
|
||||
}
|
||||
|
||||
bootstrapConfigFileName, err := getBootstrapConfigFileName()
|
||||
if err != nil {
|
||||
return fmt.Errorf("error getting bootstrap config path: %w", err)
|
||||
}
|
||||
|
||||
return controller.Run(
|
||||
withInterrupt(ctx),
|
||||
opts := []controller.Option{
|
||||
controller.WithAPIToken(token),
|
||||
controller.WithClusterAPIEndpoint(getClusterAPIEndpoint()),
|
||||
controller.WithConnectAPIEndpoint(getConnectAPIEndpoint()),
|
||||
controller.WithOTELAPIEndpoint(getOTELAPIEndpoint()),
|
||||
controller.WithBootstrapConfigFileName(bootstrapConfigFileName),
|
||||
)
|
||||
}
|
||||
|
||||
bootstrapConfigFileName, err := getBootstrapConfigFileName()
|
||||
if err != nil {
|
||||
log.Ctx(ctx).Error().Err(err).Msg("would not be able to save cluster bootstrap config, that will prevent Pomerium from starting independent from the control plane")
|
||||
} else {
|
||||
log.Ctx(ctx).Info().Str("file", bootstrapConfigFileName).Msg("cluster bootstrap config path")
|
||||
opts = append(opts, controller.WithBootstrapConfigFileName(bootstrapConfigFileName))
|
||||
}
|
||||
|
||||
return controller.Run(withInterrupt(ctx), opts...)
|
||||
}
|
||||
|
||||
// IsManagedMode returns true if Pomerium should start in managed mode using this command.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue