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

upgrade sdk go from v1 to v2 #95

Merged
merged 1 commit into from
Jan 17, 2023
Merged

upgrade sdk go from v1 to v2 #95

merged 1 commit into from
Jan 17, 2023

Conversation

outscale-hmi
Copy link
Contributor

@outscale-hmi outscale-hmi commented Oct 5, 2022

Signed-off-by: outscale_hmi hanen.mizouni@outscale.com

Copy link
Contributor

@outscale-mdr outscale-mdr left a comment

Choose a reason for hiding this comment

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

Good job

builder/osc/bsu/step_create_omi.go Outdated Show resolved Hide resolved
builder/osc/bsu/step_create_omi.go Outdated Show resolved Hide resolved
if err != nil {
err := fmt.Errorf("Error searching for OMI: %s", err)
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt
}
s.image = &imagesResp.Images[0]
s.image = &imagesResp.GetImages()[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

We could add a test if the array is empty (in case)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

What you add with the test "if the image is null" is good but check the size of the array before taking the first element.

if len(imagesResp.GetImages()) <= 0 {	
	err := fmt.Errorf("Error while reading the image': %s", err)
	state.Put("error", err)
	ui.Error(err.Error())
	return multistep.ActionHalt
}

builder/osc/bsu/step_create_omi.go Outdated Show resolved Hide resolved
builder/osc/bsu/step_create_omi.go Outdated Show resolved Hide resolved
Comment on lines 96 to 101
if awsErr, ok := err.(awserr.Error); ok {
if awsErr.Code() == "InvalidOMIID.NotFound" ||
awsErr.Code() == "InvalidSnapshot.NotFound" {
return false, nil
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

These will not work anymore, we could plan to update them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ll do it in a seperate PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok good

builder/osc/common/step_network_info.go Outdated Show resolved Hide resolved
Comment on lines 77 to 78
//params.Filters.SetAccountIds(oid)
//params.Filters.SetAccountAliases(oali)
Copy link
Contributor

Choose a reason for hiding this comment

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

remove comments

builder/osc/common/step_stop_bsu_backed_vm.go Outdated Show resolved Hide resolved
builder/osc/common/step_source_omi_info_test.go Outdated Show resolved Hide resolved
@outscale-hmi outscale-hmi force-pushed the upgradeSDK branch 3 times, most recently from d51428a to 518ce81 Compare December 14, 2022 18:00
@outscale-mdr outscale-mdr self-requested a review January 9, 2023 14:15
Copy link
Contributor

@outscale-mdr outscale-mdr left a comment

Choose a reason for hiding this comment

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

Good job, just add this check and we will merge it 👍

@outscale-hmi outscale-hmi force-pushed the upgradeSDK branch 2 times, most recently from 02a5583 to 5f2023f Compare January 16, 2023 13:17
Signed-off-by: outscale_hmi <hanen.mizouni@outscale.com>
@outscale-hmi outscale-hmi merged commit 259a3a0 into main Jan 17, 2023
@outscale-hmi outscale-hmi deleted the upgradeSDK branch January 17, 2023 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants