Merge pull request #87072 from fenggw-fnst/work

Fix typo in comments for func GetFullContainerName
This commit is contained in:
Kubernetes Prow Robot 2020-01-21 12:58:34 -08:00 committed by GitHub
commit 95fcc5f777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,8 +36,10 @@ import (
"k8s.io/klog"
)
// ProcFS provides a helper for getting container name via pid.
type ProcFS struct{}
// NewProcFS returns a ProcFS object.
func NewProcFS() ProcFSInterface {
return &ProcFS{}
}
@ -53,7 +55,7 @@ func containerNameFromProcCgroup(content string) (string, error) {
return "", fmt.Errorf("could not find devices cgroup location")
}
// getFullContainerName gets the container name given the root process id of the container.
// GetFullContainerName gets the container name given the root process id of the container.
// E.g. if the devices cgroup for the container is stored in /sys/fs/cgroup/devices/docker/nginx,
// return docker/nginx. Assumes that the process is part of exactly one cgroup hierarchy.
func (pfs *ProcFS) GetFullContainerName(pid int) (string, error) {
@ -68,8 +70,8 @@ func (pfs *ProcFS) GetFullContainerName(pid int) (string, error) {
return containerNameFromProcCgroup(string(content))
}
// Find process(es) using a regular expression and send a specified
// signal to each process
// PKill finds process(es) using a regular expression and send a specified
// signal to each process.
func PKill(name string, sig syscall.Signal) error {
if len(name) == 0 {
return fmt.Errorf("name should not be empty")
@ -91,8 +93,8 @@ func PKill(name string, sig syscall.Signal) error {
return utilerrors.NewAggregate(errList)
}
// Find process(es) with a specified name (regexp match)
// and return their pid(s)
// PidOf finds process(es) with a specified name (regexp match)
// and return their pid(s).
func PidOf(name string) ([]int, error) {
if len(name) == 0 {
return []int{}, fmt.Errorf("name should not be empty")