Skip to content

🐛 (os): skip unresolved users in group.members#6850

Open
SergioChan wants to merge 1 commit intomondoohq:mainfrom
SergioChan:fix-group-members-ignore-missing-users
Open

🐛 (os): skip unresolved users in group.members#6850
SergioChan wants to merge 1 commit intomondoohq:mainfrom
SergioChan:fix-group-members-ignore-missing-users

Conversation

@SergioChan
Copy link
Copy Markdown

Summary

  • make group.members tolerate usernames that are not present in the resolved users cache
  • skip unresolved or empty member entries instead of failing the whole field evaluation
  • keeps group queries usable on systems where group member names are not resolvable via getent passwd

Testing

  • go test ./providers/os/resources/...

Related

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 8, 2026

Thank you for your submission. We really appreciate it. Before we can accept your contribution, we ask that you sign the Mondoo Contributor License Agreement. You can sign the CLA by adding a new comment to this pull request and pasting exactly the following text.


I have read the Mondoo CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review Bot left a comment

Choose a reason for hiding this comment

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

Group member queries no longer fail when a group references a nonexistent or empty user name.

Comment on lines 97 to 98
user, ok := users.usersByName[name]
if !ok {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 suggestion — Silently dropping unresolved users makes debugging harder — callers won't know why a group appears to have fewer members than expected. Consider emitting a log.Warn (or log.Debug) when a non-empty name is skipped so operators have some breadcrumb.

if !ok {
	log.Warn().Str("group", x.GetName().Data).Str("user", name).Msg("skipping unresolved group member")
	continue
}

@SergioChan
Copy link
Copy Markdown
Author

SergioChan commented Mar 8, 2026

I have read the Mondoo CLA Document and I hereby sign the CLA

recheck

@tas50 tas50 changed the title fix(os): skip unresolved users in group.members 🐛 (os): skip unresolved users in group.members Mar 8, 2026
@tas50
Copy link
Copy Markdown
Member

tas50 commented Mar 11, 2026

@SergioChan can you update your CLA signing message to be on 2 lines so the bot can process it please

@SergioChan
Copy link
Copy Markdown
Author

SergioChan commented Mar 11, 2026

I have read the Mondoo CLA Document and I hereby sign the CLA

@SergioChan
Copy link
Copy Markdown
Author

recheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error querying members in a group

2 participants