...

Package users

import "k8s.io/kubernetes/cmd/kubeadm/app/util/users"
Overview
Index

Overview ▾

func RemoveUsersAndGroups

func RemoveUsersAndGroups() error

RemoveUsersAndGroups is a public wrapper around removeUsersAndGroupsImpl with default system file paths.

func UpdatePathOwner

func UpdatePathOwner(dirPath string, uid, gid int64) error

UpdatePathOwner recursively updates the owners of a directory. It is equivalent to calling `chown -R uid:gid /path/to/dir`.

func UpdatePathOwnerAndPermissions

func UpdatePathOwnerAndPermissions(path string, uid, gid int64, perms uint32) error

UpdatePathOwnerAndPermissions updates the owner and permissions of the given path. If the path is a directory it is not recursively updated.

type EntryMap

EntryMap holds a map of user or group entries.

type EntryMap struct {
    // contains filtered or unexported fields
}

func (*EntryMap) ID

func (u *EntryMap) ID(name string) *int64

ID returns the ID for an entry based on the entry name. In case of a user entry it returns the user UID. In case of a group entry it returns the group GID. It returns nil if no such entry exists.

func (*EntryMap) String

func (u *EntryMap) String() string

String converts an EntryMap object to a readable string.

type UsersAndGroups

UsersAndGroups is a structure that holds entry maps of users and groups. It is returned by AddUsersAndGroups.

type UsersAndGroups struct {
    // Users is an entry map of users.
    Users *EntryMap
    // Groups is an entry map of groups.
    Groups *EntryMap
}

func AddUsersAndGroups

func AddUsersAndGroups() (*UsersAndGroups, error)

AddUsersAndGroups is a public wrapper around addUsersAndGroupsImpl with default system file paths.