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

refactor: provide usage when payload sha is missing #2933

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joonas
Copy link
Contributor

@joonas joonas commented Aug 27, 2024

Description

Prior to this change, zarf-injector will panic if it's not provided a payload as an argument:

$ ./zarf-injector 
thread 'main' panicked at src/main.rs:261:35:
index out of bounds: the len is 1 but the index is 1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
zsh: abort      ./zarf-injector

With this change, zarf-injector will return usage as expected and exit gracefully:

$ ./zarf-injector 
Usage: ./zarf-injector <sha256sum>

Related Issue

I don't believe there's a related issue for this, but I figured it was worth submitting a fix for it since I came across this.

Checklist before merging

@joonas joonas requested review from a team as code owners August 27, 2024 05:12
Copy link

netlify bot commented Aug 27, 2024

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 6c2346e
🔍 Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/66cdf105c951de00089a9ac2

Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Signed-off-by: Joonas Bergius <joonas@bergi.us>
@schristoff schristoff changed the title refactor: Provide usage when payload sha is missing refactor: provide usage when payload sha is missing Aug 29, 2024
@schristoff
Copy link
Contributor

This is a great PR, thank you so much! I'm going to check that importing std doesn't put us under our 1MiB size limit.

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