Documentation ¶
Overview ¶
Package gcsrunner contains helper functions to support the GCS Runner. See gcsrunner/main/runner.go for more complete details
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchConfigFromGCS ¶
func FetchConfigFromGCS(opts FetchConfigOptions) error
FetchConfigFromGCS handles fetching a config from GCS, applying any transformation, and writing it to file.
Fetching the GCS object is retried either until success or until `opts.fetchGCSObjectTimeout` has passed.
Note that writing to file does not time out.
func StartEnvoyAndWait ¶
func StartEnvoyAndWait(signalChan chan os.Signal, opts StartEnvoyOptions) error
StartEnvoyAndWait starts Envoy and waits.
Any Envoy exit is assumed to be an error.
Any signal sent to signalChan is expected to be an exit signal. A failure to signal Envoy results in an error.
func TokenSource ¶
TokenSource returns an oauth2.TokenSource which provides a short-lived token for impersonating the provided service account.
Because this token should only be used in the start-up script, this token cannot be refreshed.
Types ¶
type FetchConfigOptions ¶
type FetchConfigOptions struct { // ServiceAccount, if provided, is impersonated in the GCS fetch call. // If left blank, the default credentials are used. ServiceAccount string BucketName string ConfigFileName string WriteFilePath string FetchGCSObjectInitialInterval time.Duration FetchGCSObjectTimeout time.Duration }
FetchConfigOptions provides a set of configurations when fetching and writing config files.