Skip to content
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

Closed
wants to merge 11 commits into from
Closed

Conversation

Diptipowervs
Copy link

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

@Diptipowervs Diptipowervs requested a review from michaelkad March 11, 2024 07:36
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},
Copy link
Collaborator

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},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue here.

Copy link
Collaborator

@michaelkad michaelkad left a 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},
Copy link
Collaborator

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},
Copy link
Collaborator

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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JobStatusFailed = "failed"

@michaelkad
Copy link
Collaborator

Opened #130

@michaelkad michaelkad closed this May 28, 2024
@michaelkad michaelkad deleted the image branch September 6, 2024 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants