Skip to content

feat(hetzner): add --image flag for OS image selection - #894

Merged
cdalar merged 2 commits into
mainfrom
feat/hetzner-image-selection-4w2579
Jun 9, 2026
Merged

cdalar merged 2 commits into
mainfrom
feat/hetzner-image-selection-4w2579

Conversation

@cdalar

@cdalar cdalar commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds --image CLI flag to onctl create so users can specify any Hetzner OS image (e.g. fedora-42, ubuntu-24.04) instead of being locked to the default
  • Adds image field to the Vm struct with yaml tag, so it can also be set via --file config YAML
  • Deploy() uses the per-request image when provided, falling back to hetzner.vm.image from the config file
  • MergeConfig() respects the image field with the same CLI-takes-precedence semantics as other fields

Usage

# CLI flag
onctl create -n my-vm --image fedora-42

# Or in a --file config YAML
vm:
  image: fedora-42

The default (ubuntu-22.04 from ~/.onctl/hetzner.yaml) is unchanged when --image is not specified.


Generated by Claude Code

Allows overriding the default image (ubuntu-22.04) via --image flag or
the vm.image key in a --file config YAML, enabling images like fedora-42.

https://claude.ai/code/session_01ENYN541Kp9NUsfqLwkvJPW

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c4b6ba037

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmd/create.go Resolved
The flag was silently ignored on AWS/GCP/Azure since those providers
never read Vm.Image. Surface a fatal error instead of creating a VM
with a different image than requested.

https://claude.ai/code/session_01KFkwuKLykNdjR4pCfXMsfa
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 11.11111% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 13.96%. Comparing base (28bdf77) to head (2874bf1).

Files with missing lines Patch % Lines
pkg/cloud/hetzner.go 0.00% 4 Missing ⚠️
cmd/common.go 0.00% 1 Missing and 1 partial ⚠️
cmd/create.go 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #894      +/-   ##
==========================================
+ Coverage   13.91%   13.96%   +0.05%     
==========================================
  Files          38       38              
  Lines        3429     3437       +8     
==========================================
+ Hits          477      480       +3     
- Misses       2900     2905       +5     
  Partials       52       52              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cdalar
cdalar merged commit d2fd292 into main Jun 9, 2026
17 checks passed
@cdalar
cdalar deleted the feat/hetzner-image-selection-4w2579 branch August 19, 2026 13:53
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.

2 participants

⌂ 换网址