mirror of
https://github.com/containers/podman.git
synced 2025-10-29 17:06:22 +08:00
Fix spelling "setup" -> "set up" and similar
* Replace "setup", "lookup", "cleanup", "backup" with "set up", "look up", "clean up", "back up" when used as verbs. Replace also variations of those. * Improve language in a few places. Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
This commit is contained in:
@ -58,7 +58,7 @@ func StatsContainer(w http.ResponseWriter, r *http.Request) {
|
||||
flusher.Flush()
|
||||
}
|
||||
|
||||
// Setup JSON encoder for streaming.
|
||||
// Set up JSON encoder for streaming.
|
||||
coder.SetEscapeHTML(true)
|
||||
var preRead time.Time
|
||||
var preCPUStats CPUStats
|
||||
|
||||
@ -66,7 +66,7 @@ func StatsContainer(w http.ResponseWriter, r *http.Request) {
|
||||
flusher.Flush()
|
||||
}
|
||||
|
||||
// Setup JSON encoder for streaming.
|
||||
// Set up JSON encoder for streaming.
|
||||
coder := json.NewEncoder(w)
|
||||
coder.SetEscapeHTML(true)
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ import (
|
||||
// ListenUnix follows stdlib net.Listen() API, providing a unix listener for given path
|
||||
// ListenUnix will delete and create files/directories as needed
|
||||
func ListenUnix(network string, path string) (net.Listener, error) {
|
||||
// setup custom listener for API server
|
||||
// set up custom listener for API server
|
||||
err := os.MkdirAll(filepath.Dir(path), 0770)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "api.ListenUnix() failed to create %s", filepath.Dir(path))
|
||||
|
||||
@ -95,7 +95,7 @@ func NewConnectionWithIdentity(ctx context.Context, uri string, identity string)
|
||||
return nil, errors.Wrapf(err, "Value of CONTAINER_HOST is not a valid url: %s", uri)
|
||||
}
|
||||
|
||||
// Now we setup the http Client to use the connection above
|
||||
// Now we set up the http Client to use the connection above
|
||||
var connection Connection
|
||||
switch _url.Scheme {
|
||||
case "ssh":
|
||||
|
||||
@ -38,7 +38,7 @@ import (
|
||||
)
|
||||
|
||||
// getContainersAndInputByContext gets containers whether all, latest, or a slice of names/ids
|
||||
// is specified. It also returns a list of the corresponding input name used to lookup each container.
|
||||
// is specified. It also returns a list of the corresponding input name used to look up each container.
|
||||
func getContainersAndInputByContext(all, latest bool, names []string, runtime *libpod.Runtime) (ctrs []*libpod.Container, rawInput []string, err error) {
|
||||
var ctr *libpod.Container
|
||||
ctrs = []*libpod.Container{}
|
||||
@ -183,7 +183,7 @@ func (ic *ContainerEngine) ContainerStop(ctx context.Context, namesOrIds []strin
|
||||
if err != nil {
|
||||
// Issue #7384 and #11384: If the container is configured for
|
||||
// auto-removal, it might already have been removed at this point.
|
||||
// We still need to to cleanup since we do not know if the other cleanup process is successful
|
||||
// We still need to clean up since we do not know if the other cleanup process is successful
|
||||
if c.AutoRemove() && (errors.Is(err, define.ErrNoSuchCtr) || errors.Is(err, define.ErrCtrRemoved)) {
|
||||
return nil
|
||||
}
|
||||
@ -488,7 +488,7 @@ func (ic *ContainerEngine) ContainerTop(ctx context.Context, options entities.To
|
||||
container, err = ic.Libpod.LookupContainer(options.NameOrID)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "unable to lookup requested container")
|
||||
return nil, errors.Wrap(err, "unable to look up requested container")
|
||||
}
|
||||
|
||||
// Run Top.
|
||||
@ -635,13 +635,13 @@ func (ic *ContainerEngine) ContainerRestore(ctx context.Context, namesOrIds []st
|
||||
containers, err = getContainersByContext(false, options.Latest, namesOrIds, ic.Libpod)
|
||||
default:
|
||||
for _, nameOrID := range namesOrIds {
|
||||
logrus.Debugf("lookup container: %q", nameOrID)
|
||||
logrus.Debugf("look up container: %q", nameOrID)
|
||||
ctr, err := ic.Libpod.LookupContainer(nameOrID)
|
||||
if err == nil {
|
||||
containers = append(containers, ctr)
|
||||
} else {
|
||||
// If container was not found, check if this is a checkpoint image
|
||||
logrus.Debugf("lookup image: %q", nameOrID)
|
||||
logrus.Debugf("look up image: %q", nameOrID)
|
||||
img, _, err := ic.Libpod.LibimageRuntime().LookupImage(nameOrID, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("no such container or image: %s", nameOrID)
|
||||
@ -1194,12 +1194,12 @@ func (ic *ContainerEngine) ContainerCleanup(ctx context.Context, namesOrIds []st
|
||||
var timeout *uint
|
||||
err = ic.Libpod.RemoveContainer(ctx, ctr, false, true, timeout)
|
||||
if err != nil {
|
||||
report.RmErr = errors.Wrapf(err, "failed to cleanup and remove container %v", ctr.ID())
|
||||
report.RmErr = errors.Wrapf(err, "failed to clean up and remove container %v", ctr.ID())
|
||||
}
|
||||
} else {
|
||||
err := ctr.Cleanup(ctx)
|
||||
if err != nil {
|
||||
report.CleanErr = errors.Wrapf(err, "failed to cleanup container %v", ctr.ID())
|
||||
report.CleanErr = errors.Wrapf(err, "failed to clean up container %v", ctr.ID())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -393,7 +393,7 @@ func (ic *ContainerEngine) PodTop(ctx context.Context, options entities.PodTopOp
|
||||
pod, err = ic.Libpod.LookupPod(options.NameOrID)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "unable to lookup requested container")
|
||||
return nil, errors.Wrap(err, "unable to look up requested container")
|
||||
}
|
||||
|
||||
// Run Top.
|
||||
@ -494,7 +494,7 @@ func (ic *ContainerEngine) PodInspect(ctx context.Context, options entities.PodI
|
||||
pod, err = ic.Libpod.LookupPod(options.NameOrID)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "unable to lookup requested container")
|
||||
return nil, errors.Wrap(err, "unable to look up requested container")
|
||||
}
|
||||
inspect, err := pod.Inspect()
|
||||
if err != nil {
|
||||
|
||||
@ -404,9 +404,9 @@ func (ic *ContainerEngine) Unshare(ctx context.Context, args []string, options e
|
||||
}
|
||||
// Make sure to unlock, unshare can run for a long time.
|
||||
rootlessNetNS.Lock.Unlock()
|
||||
// We do not want to cleanup the netns after unshare.
|
||||
// The problem is that we cannot know if we need to cleanup and
|
||||
// secondly unshare should allow user to setup the namespace with
|
||||
// We do not want to clean up the netns after unshare.
|
||||
// The problem is that we cannot know if we need to clean up and
|
||||
// secondly unshare should allow user to set up the namespace with
|
||||
// special things, e.g. potentially macvlan or something like that.
|
||||
return rootlessNetNS.Do(unshare)
|
||||
}
|
||||
|
||||
@ -342,7 +342,7 @@ func ParseIDMapping(mode namespaces.UsernsMode, uidMapSlice, gidMapSlice []strin
|
||||
|
||||
options.HostUIDMapping = false
|
||||
options.HostGIDMapping = false
|
||||
// Simply ignore the setting and do not setup an inner namespace for root as it is a no-op
|
||||
// Simply ignore the setting and do not set up an inner namespace for root as it is a no-op
|
||||
return &options, nil
|
||||
}
|
||||
|
||||
@ -394,7 +394,7 @@ func ParseIDMapping(mode namespaces.UsernsMode, uidMapSlice, gidMapSlice []strin
|
||||
|
||||
// StartWatcher starts a new SIGHUP go routine for the current config.
|
||||
func StartWatcher(rt *libpod.Runtime) {
|
||||
// Setup the signal notifier
|
||||
// Set up the signal notifier
|
||||
ch := make(chan os.Signal, 1)
|
||||
signal.Notify(ch, syscall.SIGHUP)
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ func getContainersByContext(contextWithConnection context.Context, all, ignore b
|
||||
|
||||
func getContainersAndInputByContext(contextWithConnection context.Context, all, ignore bool, namesOrIDs []string) ([]entities.ListContainer, []string, error) {
|
||||
if all && len(namesOrIDs) > 0 {
|
||||
return nil, nil, errors.New("cannot lookup containers and all")
|
||||
return nil, nil, errors.New("cannot look up containers and all")
|
||||
}
|
||||
options := new(containers.ListOptions).WithAll(true).WithSync(true)
|
||||
allContainers, err := containers.List(contextWithConnection, options)
|
||||
@ -77,7 +77,7 @@ func getContainersAndInputByContext(contextWithConnection context.Context, all,
|
||||
|
||||
func getPodsByContext(contextWithConnection context.Context, all bool, namesOrIDs []string) ([]*entities.ListPodsReport, error) {
|
||||
if all && len(namesOrIDs) > 0 {
|
||||
return nil, errors.New("cannot lookup specific pods and all")
|
||||
return nil, errors.New("cannot look up specific pods and all")
|
||||
}
|
||||
|
||||
allPods, err := pods.List(contextWithConnection, nil)
|
||||
|
||||
@ -93,7 +93,7 @@ func NewIgnitionFile(ign DynamicIgnition) error {
|
||||
tz string
|
||||
)
|
||||
// local means the same as the host
|
||||
// lookup where it is pointing to on the host
|
||||
// look up where it is pointing to on the host
|
||||
if ign.TimeZone == "local" {
|
||||
tz, err = getLocalTimeZone()
|
||||
if err != nil {
|
||||
@ -348,7 +348,7 @@ Delegate=memory pids cpu io
|
||||
},
|
||||
})
|
||||
|
||||
// Setup /etc/subuid and /etc/subgid
|
||||
// Set up /etc/subuid and /etc/subgid
|
||||
for _, sub := range []string{"/etc/subuid", "/etc/subgid"} {
|
||||
files = append(files, File{
|
||||
Node: Node{
|
||||
|
||||
@ -209,7 +209,7 @@ func migrateVM(configPath string, config []byte, vm *MachineVM) error {
|
||||
vm.Rootful = old.Rootful
|
||||
vm.UID = old.UID
|
||||
|
||||
// Backup the original config file
|
||||
// Back up the original config file
|
||||
if err := os.Rename(configPath, configPath+".orig"); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -580,7 +580,7 @@ func (v *MachineVM) Start(name string, _ machine.StartOptions) error {
|
||||
if !errors.Is(err, os.ErrNotExist) {
|
||||
return err
|
||||
}
|
||||
// lookup qemu again maybe the path was changed, https://github.com/containers/podman/issues/13394
|
||||
// look up qemu again maybe the path was changed, https://github.com/containers/podman/issues/13394
|
||||
cfg, err := config.Default()
|
||||
if err != nil {
|
||||
return err
|
||||
@ -1142,7 +1142,7 @@ func (p *Provider) CheckExclusiveActiveVM() (bool, string, error) {
|
||||
}
|
||||
|
||||
// startHostNetworking runs a binary on the host system that allows users
|
||||
// to setup port forwarding to the podman virtual machine
|
||||
// to set up port forwarding to the podman virtual machine
|
||||
func (v *MachineVM) startHostNetworking() (string, apiForwardingState, error) {
|
||||
cfg, err := config.Default()
|
||||
if err != nil {
|
||||
|
||||
@ -112,7 +112,7 @@ func (n UsernsMode) IsDefaultValue() bool {
|
||||
return n == "" || n == defaultType
|
||||
}
|
||||
|
||||
// GetAutoOptions returns a AutoUserNsOptions with the settings to setup automatically
|
||||
// GetAutoOptions returns a AutoUserNsOptions with the settings to automatically set up
|
||||
// a user namespace.
|
||||
func (n UsernsMode) GetAutoOptions() (*types.AutoUserNsOptions, error) {
|
||||
parts := strings.SplitN(string(n), ":", 2)
|
||||
|
||||
@ -154,7 +154,7 @@ func tryMappingTool(uid bool, pid int, hostID int, mappings []idtools.IDMap) err
|
||||
|
||||
if output, err := cmd.CombinedOutput(); err != nil {
|
||||
logrus.Errorf("running `%s`: %s", strings.Join(args, " "), output)
|
||||
errorStr := fmt.Sprintf("cannot setup namespace using %q", path)
|
||||
errorStr := fmt.Sprintf("cannot set up namespace using %q", path)
|
||||
if isSet, err := unshare.IsSetID(cmd.Path, mode, cap); err != nil {
|
||||
logrus.Errorf("Failed to check for %s on %s: %v", idtype, path, err)
|
||||
} else if !isSet {
|
||||
@ -303,7 +303,7 @@ func becomeRootInUserNS(pausePid, fileToRead string, fileOutput *os.File) (_ boo
|
||||
if retErr != nil && pid > 0 {
|
||||
if err := unix.Kill(pid, unix.SIGKILL); err != nil {
|
||||
if err != unix.ESRCH {
|
||||
logrus.Errorf("Failed to cleanup process %d: %v", pid, err)
|
||||
logrus.Errorf("Failed to clean up process %d: %v", pid, err)
|
||||
}
|
||||
}
|
||||
C.reexec_in_user_namespace_wait(C.int(pid), 0)
|
||||
|
||||
@ -204,7 +204,7 @@ func generateContainerInfo(ctr *libpod.Container, options entities.GenerateSyste
|
||||
} else {
|
||||
runRoot = ctr.Runtime().RunRoot()
|
||||
if runRoot == "" {
|
||||
return nil, errors.Errorf("could not lookup container's runroot: got empty string")
|
||||
return nil, errors.Errorf("could not look up container's runroot: got empty string")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user