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

Add image_pooled option #26

Merged
merged 1 commit into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions builder/yandex/common_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ type ImageConfig struct {
ImageMinDiskSizeGb int `mapstructure:"image_min_disk_size_gb" required:"false"`
// License IDs that indicate which licenses are attached to resulting image.
ImageProductIDs []string `mapstructure:"image_product_ids" required:"false"`
// When true, an image pool will be created for fast creation disks from the image.
ImagePooled bool `mapstructure:"image_pooled" required:"false"`
// Skip creating the image. Useful for setting to `true` during a build test stage. Defaults to `false`.
SkipCreateImage bool `mapstructure:"skip_create_image" required:"false"`
}
Expand Down
2 changes: 2 additions & 0 deletions builder/yandex/config.hcl2spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions builder/yandex/step_create_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func (s *stepCreateImage) Run(ctx context.Context, state multistep.StateBag) mul
Family: c.ImageFamily,
Description: c.ImageDescription,
Labels: c.ImageLabels,
Pooled: c.ImagePooled,
MinDiskSize: toBytes(c.ImageMinDiskSizeGb),
ProductIds: c.ImageProductIDs,
Source: &compute.CreateImageRequest_DiskId{
Expand Down
2 changes: 2 additions & 0 deletions docs-partials/builder/yandex/ImageConfig-not-required.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

- `image_product_ids` ([]string) - License IDs that indicate which licenses are attached to resulting image.

- `image_pooled` (boolean) - Create image optimized for deployment.

- `skip_create_image` (bool) - Skip creating the image. Useful for setting to `true` during a build test stage. Defaults to `false`.

<!-- End of code generated from the comments of the ImageConfig struct in builder/yandex/common_config.go; -->
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/hashicorp/hcl/v2 v2.10.1
github.com/hashicorp/packer-plugin-sdk v0.2.9
github.com/stretchr/testify v1.7.0
github.com/yandex-cloud/go-genproto v0.0.0-20210419102011-ea71516bb3f7
github.com/yandex-cloud/go-genproto v0.0.0-20211115083454-9ca41db5ed9e
github.com/yandex-cloud/go-sdk v0.0.0-20210413100926-1c3eb10c58d7
github.com/zclconf/go-cty v1.9.1
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,8 @@ github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgq
github.com/yandex-cloud/go-genproto v0.0.0-20210413095726-6b0dcd341e19/go.mod h1:HEUYX/p8966tMUHHT+TsS0hF/Ca/NYwqprC5WXSDMfE=
github.com/yandex-cloud/go-genproto v0.0.0-20210419102011-ea71516bb3f7 h1:qI0iykKTUTAFQ34/7cpnFZefKJTa5vprwPs8ncTkFGQ=
github.com/yandex-cloud/go-genproto v0.0.0-20210419102011-ea71516bb3f7/go.mod h1:HEUYX/p8966tMUHHT+TsS0hF/Ca/NYwqprC5WXSDMfE=
github.com/yandex-cloud/go-genproto v0.0.0-20211115083454-9ca41db5ed9e h1:9LPdmD1vqadsDQUva6t2O9MbnyvoOgo8nFNPaOIH5U8=
github.com/yandex-cloud/go-genproto v0.0.0-20211115083454-9ca41db5ed9e/go.mod h1:HEUYX/p8966tMUHHT+TsS0hF/Ca/NYwqprC5WXSDMfE=
github.com/yandex-cloud/go-sdk v0.0.0-20210413100926-1c3eb10c58d7 h1:uPMQzYjpkRcn7oWGvFpMKOwgwO4gUm3v7dITULSYw6s=
github.com/yandex-cloud/go-sdk v0.0.0-20210413100926-1c3eb10c58d7/go.mod h1:cxZ4BdZRJC1XMqb7x09H26zzy6NB9uL9SfcwqIvYmyw=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
2 changes: 2 additions & 0 deletions post-processor/yandex-import/post-processor.hcl2spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions post-processor/yandex-import/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func createYCImage(ctx context.Context, driver yandex.Driver, ui packersdk.Ui, i
Name: c.ImageConfig.ImageName,
Description: c.ImageConfig.ImageDescription,
Labels: c.ImageConfig.ImageLabels,
Pooled: c.ImageConfig.ImagePooled,
Family: c.ImageConfig.ImageFamily,
MinDiskSize: int64(c.ImageMinDiskSizeGb),
ProductIds: c.ImageProductIDs,
Expand Down