Skip to content

Commit

Permalink
fix: bump sdk + fix bootscriptID & volumedID types (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
yfodil committed Jan 12, 2023
1 parent eb35b4c commit c40a687
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions builder/scaleway/step_create_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ import (
type stepImage struct{}

func (s *stepImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
var bootscriptID *string

instanceAPI := instance.NewAPI(state.Get("client").(*scw.Client))
ui := state.Get("ui").(packersdk.Ui)
c := state.Get("config").(*Config)
snapshotID := state.Get("snapshot_id").(string)
bootscriptID := ""

ui.Say(fmt.Sprintf("Creating image: %v", c.ImageName))

Expand Down Expand Up @@ -54,7 +55,7 @@ func (s *stepImage) Run(ctx context.Context, state multistep.StateBag) multistep
}

if imageResp.Image.DefaultBootscript != nil {
bootscriptID = imageResp.Image.DefaultBootscript.ID
bootscriptID = &imageResp.Image.DefaultBootscript.ID
}

createImageResp, err := instanceAPI.CreateImage(&instance.CreateImageRequest{
Expand Down
2 changes: 1 addition & 1 deletion builder/scaleway/step_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (s *stepSnapshot) Run(ctx context.Context, state multistep.StateBag) multis
ui.Say(fmt.Sprintf("Creating snapshot: %v", c.SnapshotName))
createSnapshotResp, err := instanceAPI.CreateSnapshot(&instance.CreateSnapshotRequest{
Name: c.SnapshotName,
VolumeID: volumeID,
VolumeID: &volumeID,
VolumeType: instance.SnapshotVolumeTypeUnified,
}, scw.WithContext(ctx))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/hashicorp/hcl/v2 v2.14.1
github.com/hashicorp/packer-plugin-sdk v0.3.2
github.com/mitchellh/mapstructure v1.4.1
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220713095144-987a16e8bbc0
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.10.0.20230112100009-d832801629d1
github.com/zclconf/go-cty v1.10.0
golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFo
github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220713095144-987a16e8bbc0 h1:Wk46C3vB2veB2dyguZZZ/MDWlrBuUwu3KAVI7OlTTX0=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220713095144-987a16e8bbc0/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.10.0.20230112100009-d832801629d1 h1:KpfxxuSNfxGvDC1SAIvanQOl4RgN80M8phqxJPZwicE=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.10.0.20230112100009-d832801629d1/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
Expand Down

0 comments on commit c40a687

Please sign in to comment.