mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-06-19 11:44:20 -04:00
cli: add Terraform log support (#1620)
* add Terraform logging * add TF logging to CLI * fix path * only create file if logging is enabled * update bazel files * register persistent flags manually * clidocgen * move logging code to separate file * reword yes flag parsing error * update bazel buildfile * factor out log level setting
This commit is contained in:
parent
ca1400819d
commit
1d0ee796e8
30 changed files with 688 additions and 238 deletions
|
@ -89,7 +89,7 @@ func TestIAMCreator(t *testing.T) {
|
|||
testCases := map[string]struct {
|
||||
tfClient terraformClient
|
||||
newTfClientErr error
|
||||
config *IAMConfig
|
||||
config *IAMConfigOptions
|
||||
provider cloudprovider.Provider
|
||||
wantIAMIDFile iamid.File
|
||||
wantErr bool
|
||||
|
@ -107,19 +107,19 @@ func TestIAMCreator(t *testing.T) {
|
|||
tfClient: &stubTerraformClient{iamOutput: validGCPIAMOutput},
|
||||
wantIAMIDFile: validGCPIAMIDFile,
|
||||
provider: cloudprovider.GCP,
|
||||
config: &IAMConfig{GCP: validGCPIAMConfig},
|
||||
config: &IAMConfigOptions{GCP: validGCPIAMConfig},
|
||||
},
|
||||
"azure": {
|
||||
tfClient: &stubTerraformClient{iamOutput: validAzureIAMOutput},
|
||||
wantIAMIDFile: validAzureIAMIDFile,
|
||||
provider: cloudprovider.Azure,
|
||||
config: &IAMConfig{Azure: validAzureIAMConfig},
|
||||
config: &IAMConfigOptions{Azure: validAzureIAMConfig},
|
||||
},
|
||||
"aws": {
|
||||
tfClient: &stubTerraformClient{iamOutput: validAWSIAMOutput},
|
||||
wantIAMIDFile: validAWSIAMIDFile,
|
||||
provider: cloudprovider.AWS,
|
||||
config: &IAMConfig{AWS: validAWSIAMConfig},
|
||||
config: &IAMConfigOptions{AWS: validAWSIAMConfig},
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@ func TestDestroyIAMConfiguration(t *testing.T) {
|
|||
assert := assert.New(t)
|
||||
destroyer := &IAMDestroyer{client: tc.tfClient}
|
||||
|
||||
err := destroyer.DestroyIAMConfiguration(context.Background())
|
||||
err := destroyer.DestroyIAMConfiguration(context.Background(), terraform.LogLevelNone)
|
||||
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue