-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: add wait_for_destroy option when destroying and environment #946
Changes from 4 commits
cc32ff5
a166763
9619502
bc20d5b
dbfe817
351976c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ func (c *ConfigurationVariableType) WriteResourceData(fieldName string, d *schem | |
|
||
switch val := *c; val { | ||
case 0: | ||
valStr = "environment" | ||
valStr = ENVIRONMENT | ||
case 1: | ||
valStr = TERRAFORM | ||
default: | ||
|
@@ -93,6 +93,7 @@ type DeploymentLog struct { | |
Output json.RawMessage `json:"output,omitempty"` | ||
Error json.RawMessage `json:"error,omitempty"` | ||
Type string `json:"type"` | ||
Status string `json:"status"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added Status to the DeploymentLog sruct. |
||
WorkflowFile *WorkflowFile `json:"workflowFile,omitempty" tfschema:"-"` | ||
} | ||
|
||
|
@@ -165,6 +166,10 @@ type EnvironmentMoveRequest struct { | |
ProjectId string `json:"projectId"` | ||
} | ||
|
||
type EnvironmentDestroyResponse struct { | ||
yaronya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Id string `json:"id"` | ||
} | ||
|
||
func GetConfigurationVariableType(variableType string) (ConfigurationVariableType, error) { | ||
switch variableType { | ||
case "terraform": | ||
|
@@ -258,6 +263,15 @@ func (client *ApiClient) Environment(id string) (Environment, error) { | |
return result, nil | ||
} | ||
|
||
func (client *ApiClient) EnvironmentDeployment(id string) (*DeploymentLog, error) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest to call it |
||
var result DeploymentLog | ||
err := client.http.Get("/environments/deployments/"+id, nil, &result) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &result, nil | ||
} | ||
|
||
func (client *ApiClient) EnvironmentCreate(payload EnvironmentCreate) (Environment, error) { | ||
var result Environment | ||
|
||
|
@@ -285,13 +299,13 @@ func (client *ApiClient) EnvironmentCreateWithoutTemplate(payload EnvironmentCre | |
return result, nil | ||
} | ||
|
||
func (client *ApiClient) EnvironmentDestroy(id string) (Environment, error) { | ||
var result Environment | ||
func (client *ApiClient) EnvironmentDestroy(id string) (*EnvironmentDestroyResponse, error) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. old bug fixed... |
||
var result EnvironmentDestroyResponse | ||
err := client.http.Post("/environments/"+id+"/destroy", nil, &result) | ||
if err != nil { | ||
return Environment{}, err | ||
return nil, err | ||
} | ||
return result, nil | ||
return &result, nil | ||
} | ||
|
||
func (client *ApiClient) EnvironmentUpdate(id string, payload EnvironmentUpdate) (Environment, error) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,5 +63,4 @@ func TestAgentValues(t *testing.T) { | |
}, | ||
) | ||
}) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ignore all these changes... there are thousands of changes required to successfully add a new linter, so I slowly fix these with each PR I make. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,5 +146,4 @@ func TestCredentialsDataSource(t *testing.T) { | |
) | ||
}) | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,5 +125,4 @@ func TestKubernetesCredentialsDataSource(t *testing.T) { | |
) | ||
}) | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,5 +61,4 @@ func TestModuleTestingProjectDataSource(t *testing.T) { | |
}, | ||
) | ||
}) | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,5 +125,4 @@ func TestOidcCredentialDataSource(t *testing.T) { | |
) | ||
}) | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,5 +102,4 @@ func TestSourceCodeVariablesDataSource(t *testing.T) { | |
}, | ||
) | ||
}) | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an old 'bug'.