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 replicate support #285

Merged
merged 5 commits into from
Jan 7, 2025

Conversation

zliang-akamai
Copy link
Member

📝 Description

This is to support image replication feature brought by the Image gen2 project.

✔️ How to Test

Automated Testing

make test

Manual Testing

Checkout this branch and then install the packer plugin by:

make dev

Create a file named test.pkr.hcl with the following content.

locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }

source "linode" "example" {
  image             = "linode/debian11"
  image_description = "My Private Image"
  image_label       = "private-image-${local.timestamp}"
  instance_label    = "temporary-linode-${local.timestamp}"
  instance_type     = "g6-nanode-1"
  region            = "us-mia"
  ssh_username      = "root"

  image_regions     = ["us-mia", "in-maa", "us-ord", "us-lax", "us-sea", "jp-osa", "it-mil", "nl-ams", "se-sto"]

  interface {
    purpose = "public"
  }
}

build {
  sources = ["source.linode.example"]
}

Finally, run the build command:

packer build .

Verify the image has been replicated to the selected regions in image_regions attribute in the HCL file above.

image

@zliang-akamai zliang-akamai requested a review from a team as a code owner December 28, 2024 02:57
@zliang-akamai zliang-akamai requested review from jriddle-linode, ykim-akamai, a team, lgarber-akamai and ezilber-akamai and removed request for a team December 28, 2024 02:57
Copy link
Contributor

@lgarber-akamai lgarber-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 on my end, nice work!

Copy link
Contributor

@ykim-akamai ykim-akamai left a comment

Choose a reason for hiding this comment

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

LGTM, works well locally

@zliang-akamai zliang-akamai merged commit 4dbe436 into linode:dev Jan 7, 2025
13 checks passed
@zliang-akamai zliang-akamai deleted the zhiwei/image-replicate branch January 7, 2025 17:05
@zliang-akamai zliang-akamai added the new-feature for new features in the changelog. label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature for new features in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants