-
Notifications
You must be signed in to change notification settings - Fork 2
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
Refactor resource image and documentation #66
Conversation
stateConf := &resource.StateChangeConf{ | ||
Pending: []string{helpers.JobStatusQueued, helpers.JobStatusReadyForProcessing, helpers.JobStatusInProgress, helpers.JobStatusRunning, helpers.JobStatusWaiting}, | ||
Target: []string{helpers.JobStatusCompleted, helpers.JobStatusFailed}, | ||
Pending: []string{Arg_JobStatusQueued, Arg_JobStatusReadyForProcessing, Arg_JobStatusInProgress, Arg_JobStatusRunning, Arg_JobStatusWaiting}, |
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.
So these aren't arguments to the terraform resource, and the value of them should not be changed. Make a new section for the status constants. Something like:
Status_Queued = "queued"
Status_InProgress = "in_progress"
...
Pending: []string{"retry", helpers.PIImageQueStatus}, | ||
Target: []string{helpers.PIImageActiveStatus}, | ||
Pending: []string{"retry", Arg_ImageQueStatus}, | ||
Target: []string{Arg_ImageActiveStatus}, |
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.
Same issue here.
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.
Const updated incorrectly.
log.Printf("Waiting for Power Image (%s) to be available.", id) | ||
|
||
stateConf := &resource.StateChangeConf{ | ||
Pending: []string{"retry", helpers.PIImageQueStatus}, | ||
Target: []string{helpers.PIImageActiveStatus}, | ||
Pending: []string{"retry", Image_Questatus}, |
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.
PIImageQueStatus = "queued"
Pending: []string{"retry", helpers.PIImageQueStatus}, | ||
Target: []string{helpers.PIImageActiveStatus}, | ||
Pending: []string{"retry", Image_Questatus}, | ||
Target: []string{Image_ActiveStatus}, |
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.
PIImageActiveStatus = "active"
@@ -381,9 +379,9 @@ func waitForIBMPIJobCompleted(ctx context.Context, client *st.IBMPIJobClient, jo | |||
log.Printf("[DEBUG] get job failed with empty response") | |||
return nil, "", fmt.Errorf("failed to get job status for job id %s", jobID) | |||
} | |||
if *job.Status.State == helpers.JobStatusFailed { | |||
if *job.Status.State == Status_Failed { |
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.
JobStatusFailed = "failed"
Opened #130 |
Community Note
Relates OR Closes #0000
Output from acceptance testing: