Skip to content

oci2disk: fail fast if the given destinationDevice (via env DEST_DISK…#170

Open
thees wants to merge 1 commit intotinkerbell:mainfrom
thees:feature/fail-fast-if-destination-does-not-exist
Open

oci2disk: fail fast if the given destinationDevice (via env DEST_DISK…#170
thees wants to merge 1 commit intotinkerbell:mainfrom
thees:feature/fail-fast-if-destination-does-not-exist

Conversation

@thees
Copy link

@thees thees commented Jan 30, 2026

…) does not exist. otherwise the action waits for a very long time.

maybe the os.O_CREATE is not necessary as would fix this, too, see image2disk action. However, checking before opening is a sure fix.

Description

Change affects the action oci2disk:

When a DISK_DEST is given which does not exist on the machine, the action tries to open the file and waits for a very long time (maybe indefinitely?).

The change just checks the availability of the given device before opening it.

I noted that the action image2disk just uses the flag os.O_WRONLY in openfile vs. the oci2disk action uses os.O_WRONLY|os.O_CREATE.

However, I just added the check beforehand so that it is safe to use. Maybe there is a reason for the os.O_CREATE flag here.

Fixes: #

How Has This Been Tested?

How are existing users impacted? What migration steps/scripts do we need?

A wrongly given DISK_DEST fails fast, instead of a hanging oci2disk action.

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

…) does not exist. otherwise the action waits for a very long time.

maybe the os.O_CREATE is not necessary as would fix this, too, see image2disk action. However, checking before opening is a sure fix.

Signed-off-by: Sebastian Thees <thees@users.noreply.github.com>
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