Skip to content

Conversation

@ezilber-akamai
Copy link
Contributor

@ezilber-akamai ezilber-akamai commented Jan 6, 2026

📝 Description

Added the option to add newly created Private Images directly to Image Share Groups.

✔️ How to Test

go test ./builder/linode -run TestBuilderPrepare_ImageShareGroupIDs

@ezilber-akamai ezilber-akamai marked this pull request as ready for review January 6, 2026 18:19
@ezilber-akamai ezilber-akamai requested a review from a team as a code owner January 6, 2026 18:19
@ezilber-akamai ezilber-akamai requested review from Copilot, jriddle-linode and lgarber-akamai and removed request for a team January 6, 2026 18:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for automatically adding newly created private images to Image Share Groups in the Linode builder. This allows users to specify share group IDs in their configuration, and the builder will add the image to those groups immediately after creation.

Key changes:

  • Added image_share_group_ids configuration parameter to specify share groups
  • Implemented logic to add images to share groups after image creation
  • Added comprehensive test coverage for the new configuration parameter

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
builder/linode/config.go Added ImageShareGroupIDs field to Config struct with documentation
builder/linode/config.hcl2spec.go Added HCL2 spec mapping for image_share_group_ids parameter
builder/linode/step_create_image.go Implemented logic to add images to share groups after creation
builder/linode/builder_test.go Added test case for ImageShareGroupIDs configuration
docs/builders/linode.mdx Added example usage of image_share_group_ids in documentation
.web-docs/components/builder/linode/README.md Documented the new image_share_group_ids parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +58 to +68
_, err := s.client.ImageShareGroupAddImages(
ctx,
shareGroupID,
linodego.ImageShareGroupAddImagesOptions{
Images: []linodego.ImageShareGroupImage{
{
ID: image.ID,
},
},
},
)
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

The return value from ImageShareGroupAddImages is being discarded. If the API returns important information (such as confirmation details or partial success status), it should be logged or handled appropriately.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This returns essentially the same exact information that is already contained in the image, so I think it is fine to discard the return value. Happy to hear others' thoughts on this.


// Add the image to Image Share Groups, if configured
if len(c.ImageShareGroupIDs) > 0 {
for _, shareGroupID := range c.ImageShareGroupIDs {
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

Images are being added to share groups sequentially. If multiple share groups are specified, this could be slow. Consider whether parallel addition or batch operations are supported by the API to improve performance.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The API only supports adding images to one Share Group at a time so I think adding them sequentially is fine. Again, happy to hear others' thoughts.

Copy link
Member

@zliang-akamai zliang-akamai left a comment

Choose a reason for hiding this comment

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

Works well, good job!

Copy link
Collaborator

@jriddle-linode jriddle-linode left a comment

Choose a reason for hiding this comment

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

Looks good nice work!

@ezilber-akamai ezilber-akamai merged commit 852fb88 into linode:dev Jan 15, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants