Documentation
¶
Overview ¶
Package gcloud provides a set of helpers to interact with gcloud(Cloud SDK) binary
Index ¶
- func ActivateCredsAndEnvVars(t testing.TB, creds string)
- func Run(t testing.TB, cmd string, opts ...cmdOption) gjson.Result
- func RunCmd(t testing.TB, cmd string, opts ...cmdOption) string
- func RunCmdE(t testing.TB, cmd string, opts ...cmdOption) (string, error)
- func RunWithCmdOptsf(t testing.TB, opts []cmdOption, cmd string, args ...interface{}) gjson.Result
- func Runf(t testing.TB, cmd string, args ...interface{}) gjson.Result
- func TFVet(t testing.TB, planFilePath string, ...) gjson.Result
- func WithBinary(gcloudBinary string) cmdOption
- func WithCommonArgs(commonArgs []string) cmdOption
- func WithLogger(logger *logger.Logger) cmdOption
- type CmdCfg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActivateCredsAndEnvVars ¶
func ActivateCredsAndEnvVars(t testing.TB, creds string)
ActivateCredsAndEnvVars activates credentials and exports auth related envvars.
func Run ¶
Run executes a gcloud command and returns value as gjson.Result. It fails the test if there are any errors executing the gcloud command or parsing the output value.
func RunWithCmdOptsf ¶
RunWithCmdOptsf executes a gcloud command and returns value as gjson.Result.
RunWithCmdOptsf(t, ops.., "projects list --filter=%s", "projectId")
It fails the test if there are any errors executing the gcloud command or parsing the output value.
func Runf ¶
Runf executes a gcloud command and returns value as gjson.Result.
Runf(t, "projects list --filter=%s", "projectId")
It fails the test if there are any errors executing the gcloud command or parsing the output value.
func TFVet ¶ added in v0.2.0
func TFVet(t testing.TB, planFilePath string, policyLibraryPath, terraformVetProject string) gjson.Result
TFVet executes gcloud beta terraform vet
func WithBinary ¶
func WithBinary(gcloudBinary string) cmdOption
func WithCommonArgs ¶
func WithCommonArgs(commonArgs []string) cmdOption