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

Fix path on flux push #3418

Merged
merged 1 commit into from
Dec 20, 2022
Merged

Fix path on flux push #3418

merged 1 commit into from
Dec 20, 2022

Conversation

somtochiama
Copy link
Member

Fixes bug introduced by #3389 where the path for the build cmd was used in the error message.

Also moves code for saving stdin to file before check for path

Signed-off-by: Somtochi Onyekwere somtochionyekwere@gmail.com

return fmt.Errorf("invalid path '%s', must point to an existing directory or file", buildArtifactArgs.path)
path := pushArtifactArgs.path
if pushArtifactArgs.path == "-" {
path, err = saveStdinToFile()
Copy link
Member

Choose a reason for hiding this comment

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

saveStdinToFile is leaving the temp file opened. We need to close it before returning, otherwise os.Remove() will fail in some systems.

Please add a test for the stdin feature.

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Copy link
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @somtochiama! 🙇

@stefanprodan stefanprodan added the area/oci OCI related issues and pull requests label Dec 20, 2022
@stefanprodan stefanprodan merged commit 38635e0 into fluxcd:main Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/oci OCI related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants