Skip to content

User resource looks the user up twice #35

Description

@surminus

User.Run calls userExists(name), then update() calls missingGroups() which calls user.Lookup(name) again. If the user is removed externally between the two lookups, the second fails and the resource errors.

The window is tiny and the failure is clean (any config management tool fails if the system mutates underneath it mid-run), so this is low priority. But the second lookup is avoidable: userExists could return the looked-up *user.User and update/missingGroups could reuse it.

Found during the code review of the AMI builder resources branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions