Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 019f459

Browse files
committed
packager.init: Do not include maintainer if user name empty
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
1 parent 5ede3cc commit 019f459

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

internal/packager/init.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,10 @@ func newMetadata(name string, description string, maintainers []string) metadata
237237
Description: description,
238238
}
239239
if len(maintainers) == 0 {
240-
var userName string
241240
userData, _ := user.Current()
242-
if userData != nil {
243-
userName = userData.Username
241+
if userData != nil && userData.Username != "" {
242+
res.Maintainers = []metadata.Maintainer{{Name: userData.Username}}
244243
}
245-
res.Maintainers = []metadata.Maintainer{{Name: userName}}
246244
} else {
247245
res.Maintainers = parseMaintainersData(maintainers)
248246
}

0 commit comments

Comments
 (0)