Skip to content

Conversation

R3hankhan123
Copy link

@R3hankhan123 R3hankhan123 commented Sep 1, 2025

What type of PR is this?

/kind bug

What this PR does / why we need it:

This PR fixes a compatibility issue where CRI-O generates fully numeric usernames (e.g., "1234") that are rejected by systems derived from Fedora and RHEL. The shadow utilities on these systems do not support purely numeric usernames, causing container creation failures. (shadow-maint/shadow#1339)

The fix modifies the GeneratePasswd function in utils/utils.go to detect fully numeric usernames and prefix them with "user" (e.g., "1234" becomes "user1234"). This ensures compatibility with shadow utilities while maintaining the original numeric identifier for clarity.

Which issue(s) this PR fixes:

Fixes #9432

Special notes for your reviewer:

  • The fix only affects usernames that are purely numeric (all digits)
  • Non-numeric usernames remain unchanged to preserve existing behavior
  • Added comprehensive test coverage for the new functionality
  • The solution is minimal and maintains backward compatibility
[root@a3elp75 cri-o]# ./build/bin/ginkgo run --focus "numeric username" -v utils/
2025/09/01 15:18:16 maxprocs: Leaving GOMAXPROCS=8: CPU quota undefined
Running Suite: Utils - /tmp/cri-o/utils
=======================================
Random Seed: 1756732696

Will run 1 of 39 specs
------------------------------
[BeforeSuite] 
/tmp/cri-o/utils/suite_test.go:20
[BeforeSuite] PASSED [0.000 seconds]
------------------------------
SSSSSSSSSSSSSSSSSSSSSSSSSSS
------------------------------
cri-o: Utils cri-o: GetUserInfo and GeneratePasswd should prefix numeric username to avoid issues on Fedora and its derived OS
/tmp/cri-o/utils/utils_test.go:395
• [0.001 seconds]
------------------------------
SSSSSSSSSSS
------------------------------
[AfterSuite] 
/tmp/cri-o/utils/suite_test.go:25
[AfterSuite] PASSED [0.000 seconds]
------------------------------

Ran 1 of 39 Specs in 0.003 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 38 Skipped
PASS

Does this PR introduce a user-facing change?

Fixed compatibility issue with Fedora/RHEL-based systems where fully numeric usernames generated by CRI-O were rejected by shadow utilities. Numeric usernames are now automatically prefixed with "user" (e.g., "1234" becomes "user1234").

Signed-off-by: Rehan Khan <Rehan.Khan7@ibm.com>
@openshift-ci openshift-ci bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Sep 1, 2025
@openshift-ci openshift-ci bot requested review from bitoku and littlejawa September 1, 2025 13:27
Copy link
Contributor

openshift-ci bot commented Sep 1, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: R3hankhan123
Once this PR has been reviewed and has the lgtm label, please assign giuseppe for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 1, 2025
Copy link
Contributor

openshift-ci bot commented Sep 1, 2025

Hi @R3hankhan123. Thanks for your PR.

I'm waiting for a cri-o member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

github-actions bot commented Oct 2, 2025

A friendly reminder that this PR had no activity for 30 days.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 2, 2025
@R3hankhan123
Copy link
Author

/remove-lifecycle stale

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/bug Categorizes issue or PR as related to a bug. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop using fully numeric usernames
1 participant