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: fallback to ansible_user_id when using root user #701

Merged
merged 1 commit into from
Mar 1, 2023

Conversation

dkoshkin
Copy link
Contributor

@dkoshkin dkoshkin commented Mar 1, 2023

What problem does this PR solve?:
Fix from https://github.com/kubernetes-sigs/image-builder/pull/739/files#diff-2f3020c3867a75d1e2395d10238225e0fa343e8097cb434f647817e446354a88R149

Looks like when using root as the SSH user, ansible_env.SUDO_USER is not set.
Fallback to using ansible_user_id which will in this case already equal the ssh user.

Which issue(s) does this PR fix?:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@dkoshkin dkoshkin requested a review from supershal March 1, 2023 00:34
@dkoshkin dkoshkin self-assigned this Mar 1, 2023
@github-actions github-actions bot added the fix label Mar 1, 2023
Copy link
Collaborator

@supershal supershal left a comment

Choose a reason for hiding this comment

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

Thank you

@dkoshkin dkoshkin added the runs-e2e-tests runs e2e tests for GHA label Mar 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2023

File Coverage
All files 14%
cmd/konvoy-image-wrapper/cmd/wrapper.go 8%
cmd/konvoy-image-wrapper/image/common.go 0%
cmd/konvoy-image-wrapper/image/image_not_embedded.go 0%
pkg/ansible/runner.go 0%
pkg/app/artifacts.go 0%
pkg/app/build.go 0%
pkg/app/build_azure.go 2%
pkg/app/build_gcp.go 0%
pkg/app/config.go 50%
pkg/app/errors.go 0%
pkg/app/provision.go 0%
pkg/app/root.go 0%
pkg/app/utils.go 7%
pkg/app/validate.go 0%
pkg/appansible/io.go 0%
pkg/appansible/playbook.go 0%
pkg/azure/azure.go 0%
pkg/logging/logger.go 0%
pkg/packer/manifest.go 0%
pkg/packer/packer.go 0%
pkg/stringutil/rand.go 0%
pkg/version/info.go 8%

Minimum allowed coverage is 75%

Generated by 🐒 cobertura-action against f22d1ef

@dkoshkin dkoshkin merged commit 6ae7883 into main Mar 1, 2023
@dkoshkin dkoshkin deleted the dkoshkin/fix-ansible_user-when-root branch March 1, 2023 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix runs-e2e-tests runs e2e tests for GHA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants