gcsrunner

package
v0.0.0-...-32f485c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

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

func TokenSource(ctx context.Context, sa string) (oauth2.TokenSource, error)

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.

type StartEnvoyOptions

type StartEnvoyOptions struct {
	BinaryPath        string
	ComponentLogLevel string
	ConfigPath        string
	LogLevel          string
	LogPath           string
	TerminateTimeout  time.Duration
}

StartEnvoyOptions provides a set of configurations when starting Envoy.

Directories

Path Synopsis
The runner for gcsrunner fetches an Envoy Config from GCS and writes it to a local file.
The runner for gcsrunner fetches an Envoy Config from GCS and writes it to a local file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL