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

Make sure lima user fallback uses same validation as template #2655

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

Commits on Sep 26, 2024

  1. Make sure lima user fallback uses same validation as template

    The regex currently being used is different from the identifier's validation from containerd. The fallback test does allow an `_` but the validation for the identifier does not.
    
    This results in a bug where the a user that starts with an `_` will pass fallback validation (ie not be set to lima for the user), but will then fail the cidata validation here: https://github.com/lima-vm/lima/blob/master/pkg/cidata/template.go#L95.
    
    Error log shows as:
    ` ERRO[0000] [hostagent] identifier "_nixbld1" must match ^[A-Za-z0-9]+(?:[._-](?:[A-Za-z0-9]+))*$: invalid argument  fields.level=fatal`
    
    This PR sets the same validation check in both spots to fix this and make sure they stay in sync in the future.
    
    Update warning message to use error msg
    
    fix bad err method call.
    
    Signed-off-by: pvdvreede <[email protected]>
    pvdvreede committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    0e67f9e View commit details
    Browse the repository at this point in the history