Skip to content

feat: support numeric image IDs for Hetzner snapshots#52

Open
aaronshaf wants to merge 1 commit intomrsimonemms:mainfrom
aaronshaf:feat/snapshot-id-support
Open

feat: support numeric image IDs for Hetzner snapshots#52
aaronshaf wants to merge 1 commit intomrsimonemms:mainfrom
aaronshaf:feat/snapshot-id-support

Conversation

@aaronshaf
Copy link
Copy Markdown

Problem

DISK_IMAGE currently only supports named images via GetByNameAndArchitecture. Hetzner snapshots have no name field — only a numeric ID and a description. This makes it impossible to boot a DevPod workspace from a snapshot, even though snapshots are useful for pre-baking Docker images and other setup to speed up workspace creation.

Solution

If DISK_IMAGE is a numeric string, look up the image by ID using Image.GetByID. Otherwise fall back to the existing name+architecture lookup. This is fully backwards-compatible — existing string-based DISK_IMAGE values continue to work unchanged.

Usage

devpod up github.com/my/workspace \
  --provider hetzner \
  --provider-option DISK_IMAGE=123456789

Changes

  • pkg/hetzner/hetzner.go: detect numeric DISK_IMAGE and use GetByID instead of GetByNameAndArchitecture

strconv was already imported so no new dependencies are needed.

@aaronshaf aaronshaf force-pushed the feat/snapshot-id-support branch from ebbbda9 to de0d732 Compare March 16, 2026 04:24
GetByNameAndArchitecture only works for named images.
Hetzner snapshots have no name — only a numeric ID.

If DISK_IMAGE is a numeric string, look up by ID directly
using Image.GetByID. Otherwise fall back to the existing
name+architecture lookup.

This allows users to boot DevPod workspaces from a
pre-baked Hetzner snapshot, skipping slow provisioning steps.

Signed-off-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
@aaronshaf aaronshaf force-pushed the feat/snapshot-id-support branch from f81ac11 to 808d7d5 Compare March 16, 2026 04:33
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.

1 participant