Skip to content

Commit

Permalink
refactor(instance): get server type when loading commercialType (#3963)
Browse files Browse the repository at this point in the history
  • Loading branch information
Codelax authored Jul 8, 2024
1 parent 620fe1d commit 1bc46f4
Show file tree
Hide file tree
Showing 2 changed files with 1,275 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ func NewServerBuilder(client *scw.Client, name string, zone scw.Zone, commercial
apiInstance: instance.NewAPI(client),
}

sb.serverType = getServerType(sb.apiInstance, sb.createReq.Zone, sb.createReq.CommercialType)

return sb
}

Expand Down Expand Up @@ -141,8 +143,6 @@ func (sb *ServerBuilder) AddImage(image string) (*ServerBuilder, error) {
sb.serverImage = getImageResponse.Image
}

sb.serverType = getServerType(sb.apiInstance, sb.createReq.Zone, sb.createReq.CommercialType)

return sb, nil
}

Expand Down
Loading

0 comments on commit 1bc46f4

Please sign in to comment.