fixed home dir resolution for $HOME less envs#671
Closed
zackbradys wants to merge 2 commits into
Closed
Conversation
Member
Author
|
Closing in favor of #672... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please check below, if the PR fulfills these requirements:
Associated Links:
Types of Changes:
Proposed Changes:
$HOMEat the start of every command (PersistentPreRunE) instead of assuming it's thereruncmd, systemd services, and cron invoke hauler without a login shell, which leaves$HOMEempty, and silently breaks credential lookup in~/.docker/config.jsonuser.Current()first, then falls back toos.UserHomeDir()if that fails, logging aWARNonly if both come up empty... this restores and extends the fallback behavior thatgetCosignPath()used to have before it was replaced during the overhaul and rewrite forv2.0.1...pkg/content/registry.go) to a silent "anonymous" fallback... now we have a real resolution error such asunreadable config,corrupt JSON,missing $HOMEand it now propagates instead of being random indistinguishable error messagesVerification/Testing of Changes:
Before the fix... NO $HOME set...
kiternetes01:/home/rancher # env -i PATH="$PATH" /usr/local/bin/hauler store copy --store /var/lib/harvester/defaultdisk/hauler/store/ registry://registry.kiternetes.kit 2026-07-17 18:24:56 INF edge/3.6/mariadb@sha256:4657b14c43d3a720c50fc1c484a36865fa5acc53edf560a6d597c0b8bec42c9d 2026-07-17 18:24:56 ERR error (attempt 1/3)... failed to copy config: push access denied, repository does not exist or may require authorization: authorization failed: no basic auth credentials 2026-07-17 18:25:01 ERR error (attempt 2/3)... failed to copy config: push access denied, repository does not exist or may require authorization: authorization failed: no basic auth credentialsBefore the fix... $HOME set...
kiternetes01:/home/rancher # env -i HOME=/root PATH="$PATH" /usr/local/bin/hauler store copy --store /var/lib/harvester/defaultdisk/hauler/store/ registry://registry.kiternetes. kit 2026-07-17 18:25:22 INF ranchergovernment/harvester-appliance-xfce:v1.7.2 2026-07-17 18:25:25 INF registry.kiternetes.kit/ranchergovernment/harvester-appliance-xfce:v1.7.2: digest: sha256:716f2b1c6d56904e0eafb6640c8fd5e3389f554e9402316f004edee030b61fb1 size: 864 2026-07-17 18:25:25 INF containers/nginx@sha256:02b935594b7aea4a7ffd1b701d4dfa8fff13af13152b5864f23129dd2a227a18 2026-07-17 18:25:26 INF registry.kiternetes.kit/containers/nginx@sha256:02b935594b7aea4a7ffd1b701d4dfa8fff13af13152b5864f23129dd2a227a18: digest: sha256:02b935594b7aea4a7ffd1b701d4dfa8fff13af13152b5864f23129dd2a227a18 size: 1622 2026-07-17 18:25:26 INF containers/postgresql:sha256-1f182741c1fef987502c2a18346b4db24be74d32e449a9141fb448f3e95ba2c7.attAfter the fix... NO $HOME set...
After the fix... $HOME set...
Additional Context:
A short story from our friend
claude...