Fix typos. Improve language.

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
This commit is contained in:
Erik Sjölund
2022-11-26 19:39:16 +01:00
parent d5e1e278a3
commit 08e13867a9
25 changed files with 50 additions and 50 deletions

View File

@ -146,7 +146,7 @@ func add(cmd *cobra.Command, args []string) error {
info, err := os.Stat(uri.Path)
switch {
case errors.Is(err, os.ErrNotExist):
logrus.Warnf("%q does not exists", uri.Path)
logrus.Warnf("%q does not exist", uri.Path)
case errors.Is(err, os.ErrPermission):
logrus.Warnf("You do not have permission to read %q", uri.Path)
case err != nil:

View File

@ -26,7 +26,7 @@ func (o OutputErrors) PrintErrors() (lastError error) {
}
/*
For remote client, server does not returns error with exit code
For remote client, server does not return error with exit code
instead returns a message and we cast it to a new error.
@ -45,14 +45,14 @@ func ExitCodeFromBuildError(errorMsg string) (int, error) {
return buildahCLI.ExecErrorCodeGeneric, err
}
}
return buildahCLI.ExecErrorCodeGeneric, errors.New("message does not contains a valid exit code")
return buildahCLI.ExecErrorCodeGeneric, errors.New("message does not contain a valid exit code")
}
// HandleOSExecError checks the given error for an exec.ExitError error and
// sets the same podman exit code as the error.
// No error will be returned in this case to make sure things like podman
// unshare false work correctly without extra output.
// When the exec file does not exists we set the exit code to 127, for
// When the exec file does not exist we set the exit code to 127, for
// permission errors 126 is used as exit code. In this case we still return
// the error so the user gets an error message.
// If the error is nil it returns nil.

View File

@ -79,8 +79,8 @@ func (c *Container) Init(ctx context.Context, recursive bool) error {
// ContainerStatePaused via Pause(), or to ContainerStateStopped by the process
// stopping (either due to exit, or being forced to stop by the Kill or Stop API
// calls).
// Start requites that all dependency containers (e.g. pod infra containers) be
// running before being run. The recursive parameter, if set, will start all
// Start requires that all dependency containers (e.g. pod infra containers) are
// running before starting the container. The recursive parameter, if set, will start all
// dependencies before starting this container.
func (c *Container) Start(ctx context.Context, recursive bool) (finalErr error) {
defer func() {
@ -850,7 +850,7 @@ func (c *Container) Batch(batchFunc func(*Container) error) error {
// Most of the time, Podman does not explicitly query the OCI runtime for
// container status, and instead relies upon exit files created by conmon.
// This can cause a disconnect between running state and what Podman sees in
// cases where Conmon was killed unexpected, or runc was upgraded.
// cases where Conmon was killed unexpectedly, or runc was upgraded.
// Running a manual Sync() ensures that container state will be correct in
// such situations.
func (c *Container) Sync() error {

View File

@ -367,7 +367,7 @@ type ContainerMiscConfig struct {
// RestartPolicy indicates what action the container will take upon
// exiting naturally.
// Allowed options are "no" (take no action), "on-failure" (restart on
// non-zero exit code, up an a maximum of RestartRetries times),
// non-zero exit code, up to a maximum of RestartRetries times),
// and "always" (always restart the container on any exit code).
// The empty string is treated as the default ("no")
RestartPolicy string `json:"restart_policy,omitempty"`

View File

@ -185,7 +185,7 @@ func (c *Container) getContainerInspectData(size bool, driverData *define.Driver
}
if c.config.HealthCheckConfig != nil {
// This container has a healthcheck defined in it; we need to add it's state
// This container has a healthcheck defined in it; we need to add its state
healthCheckState, err := c.getHealthCheckLog()
if err != nil {
// An error here is not considered fatal; no health state will be displayed

View File

@ -296,7 +296,7 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) {
// Check if the spec file mounts contain the options z, Z, U or idmap.
// If they have z or Z, relabel the source directory and then remove the option.
// If they have U, chown the source directory and them remove the option.
// If they have U, chown the source directory and then remove the option.
// If they have idmap, then calculate the mappings to use in the OCI config file.
for i := range g.Config.Mounts {
m := &g.Config.Mounts[i]
@ -1331,7 +1331,7 @@ func (c *Container) restore(ctx context.Context, options ContainerCheckpointOpti
}
// Let's try to stat() CRIU's inventory file. If it does not exist, it makes
// no sense to try a restore. This is a minimal check if a checkpoint exist.
// no sense to try a restore. This is a minimal check if a checkpoint exists.
if _, err := os.Stat(filepath.Join(c.CheckpointPath(), "inventory.img")); os.IsNotExist(err) {
return nil, 0, fmt.Errorf("a complete checkpoint for this container cannot be found, cannot restore: %w", err)
}

View File

@ -60,7 +60,7 @@ func (c *Container) stat(containerMountPoint string, containerPath string) (*def
}
// Not all errors from secureStat map to ErrNotExist, so we
// have to look into the error string. Turning it into an
// ENOENT let's the API handlers return the correct status code
// ENOENT lets the API handlers return the correct status code
// which is crucial for the remote client.
if os.IsNotExist(statErr) || strings.Contains(statErr.Error(), "o such file or directory") {
statErr = copy.ErrENOENT

View File

@ -29,7 +29,7 @@ var RestartPolicyMap = map[string]string{
// InitContainerTypes
const (
// AlwaysInitContainer is an init container than runs on each
// AlwaysInitContainer is an init container that runs on each
// pod start (including restart)
AlwaysInitContainer = "always"
// OneShotInitContainer is a container that only runs as init once

View File

@ -6,7 +6,7 @@ import (
)
// EventToNull is an eventer type that does nothing.
// It is meant for unittests only
// It is meant for unit tests only
type EventToNull struct{}
// Write eats the event and always returns nil

View File

@ -204,7 +204,7 @@ shm_struct_t *setup_lock_shm(char *path, uint32_t num_locks, int *error_code) {
// Returns a valid pointer on success or NULL on error.
// If an error occurs, negative ERRNO values will be written to error_code.
// ERANGE is returned for a mismatch between num_locks and the number of locks
// available in the the SHM lock struct.
// available in the SHM lock struct.
shm_struct_t *open_lock_shm(char *path, uint32_t num_locks, int *error_code) {
int shm_fd;
shm_struct_t *shm;

View File

@ -143,7 +143,7 @@ func getTailLog(path string, tail int) ([]*LogLine, error) {
nllCounter++
}
}
// if we have enough log lines, we can hangup
// if we have enough log lines, we can hang up
if nllCounter >= tail {
break
}
@ -244,7 +244,7 @@ func NewLogLine(line string) (*LogLine, error) {
}
// NewJournaldLogLine creates a LogLine from the specified line from journald.
// Note that if withID is set, the first item of the message is considerred to
// Note that if withID is set, the first item of the message is considered to
// be the container ID and set as such.
func NewJournaldLogLine(line string, withID bool) (*LogLine, error) {
splitLine := strings.Split(line, " ")

View File

@ -98,7 +98,7 @@ func (r *RootlessNetNS) Cleanup(runtime *Runtime) error {
}
// GetRootlessNetNs returns the rootless netns object. If create is set to true
// the rootless network namespace will be created if it does not exists already.
// the rootless network namespace will be created if it does not already exist.
// If called as root it returns always nil.
// On success the returned RootlessCNI lock is locked and must be unlocked by the caller.
func (r *Runtime) GetRootlessNetNs(new bool) (*RootlessNetNS, error) {

View File

@ -78,7 +78,7 @@ func (r *RootlessNetNS) Do(toRun func() error) error {
// 1. XDG_RUNTIME_DIR -> XDG_RUNTIME_DIR/rootless-netns/XDG_RUNTIME_DIR
// 2. /run/systemd -> XDG_RUNTIME_DIR/rootless-netns/run/systemd (only if it exists)
// 3. XDG_RUNTIME_DIR/rootless-netns/resolv.conf -> /etc/resolv.conf or XDG_RUNTIME_DIR/rootless-netns/run/symlink/target
// 4. XDG_RUNTIME_DIR/rootless-netns/var/lib/cni -> /var/lib/cni (if /var/lib/cni does not exists use the parent dir)
// 4. XDG_RUNTIME_DIR/rootless-netns/var/lib/cni -> /var/lib/cni (if /var/lib/cni does not exist, use the parent dir)
// 5. XDG_RUNTIME_DIR/rootless-netns/run -> /run
// Create a new mount namespace,
@ -124,7 +124,7 @@ func (r *RootlessNetNS) Do(toRun func() error) error {
// If /etc/resolv.conf has more than one symlink under /run, e.g.
// -> /run/systemd/resolve/stub-resolv.conf -> /run/systemd/resolve/resolv.conf
// we would put the netns resolv.conf file to the last path. However this will
// break dns because the second link does not exists in the mount ns.
// break dns because the second link does not exist in the mount ns.
// see https://github.com/containers/podman/issues/11222
//
// We also need to resolve all path components not just the last file.
@ -255,7 +255,7 @@ func (r *RootlessNetNS) Do(toRun func() error) error {
func (r *RootlessNetNS) Cleanup(runtime *Runtime) error {
_, err := os.Stat(r.dir)
if os.IsNotExist(err) {
// the directory does not exists no need for cleanup
// the directory does not exist, so no need for cleanup
return nil
}
activeNetns := func(c *Container) bool {
@ -322,7 +322,7 @@ func (r *RootlessNetNS) Cleanup(runtime *Runtime) error {
}
// GetRootlessNetNs returns the rootless netns object. If create is set to true
// the rootless network namespace will be created if it does not exists already.
// the rootless network namespace will be created if it does not already exist.
// If called as root it returns always nil.
// On success the returned RootlessCNI lock is locked and must be unlocked by the caller.
func (r *Runtime) GetRootlessNetNs(new bool) (*RootlessNetNS, error) {

View File

@ -249,7 +249,7 @@ func (r *Runtime) setupSlirp4netns(ctr *Container, netns string) error {
return err
}
// the slirp4netns arguments being passed are describes as follows:
// the slirp4netns arguments being passed are described as follows:
// from the slirp4netns documentation: https://github.com/rootless-containers/slirp4netns
// -c, --configure Brings up the tap interface
// -e, --exit-fd=FD specify the FD for terminating slirp4netns
@ -317,7 +317,7 @@ func (r *Runtime) setupSlirp4netns(ctr *Container, netns string) error {
go func() {
err := ns.WithNetNSPath(netnsPath, func(_ ns.NetNS) error {
// Duplicate Address Detection slows the ipv6 setup down for 1-2 seconds.
// Since slirp4netns is run it is own namespace and not directly routed
// Since slirp4netns is run in its own namespace and not directly routed
// we can skip this to make the ipv6 address immediately available.
// We change the default to make sure the slirp tap interface gets the
// correct value assigned so DAD is disabled for it
@ -326,7 +326,7 @@ func (r *Runtime) setupSlirp4netns(ctr *Container, netns string) error {
orgValue, err := os.ReadFile(ipv6ConfDefaultAcceptDadSysctl)
if err != nil {
netnsReadyWg.Done()
// on ipv6 disabled systems the sysctl does not exists
// on ipv6 disabled systems the sysctl does not exist
// so we should not error
if errors.Is(err, os.ErrNotExist) {
return nil

View File

@ -72,7 +72,7 @@ func (r *RootlessNetNS) Cleanup(runtime *Runtime) error {
}
// GetRootlessNetNs returns the rootless netns object. If create is set to true
// the rootless network namespace will be created if it does not exists already.
// the rootless network namespace will be created if it does not already exist.
// If called as root it returns always nil.
// On success the returned RootlessCNI lock is locked and must be unlocked by the caller.
func (r *Runtime) GetRootlessNetNs(new bool) (*RootlessNetNS, error) {

View File

@ -850,7 +850,7 @@ func WithIDMappings(idmappings storage.IDMappingOptions) CtrCreateOption {
}
}
// WithUTSNSFromPod indicates the the container should join the UTS namespace of
// WithUTSNSFromPod indicates that the container should join the UTS namespace of
// its pod
func WithUTSNSFromPod(p *Pod) CtrCreateOption {
return func(ctr *Container) error {
@ -872,7 +872,7 @@ func WithUTSNSFromPod(p *Pod) CtrCreateOption {
}
}
// WithIPCNSFrom indicates the the container should join the IPC namespace of
// WithIPCNSFrom indicates that the container should join the IPC namespace of
// the given container.
// If the container has joined a pod, it can only join the namespaces of
// containers in the same pod.
@ -892,7 +892,7 @@ func WithIPCNSFrom(nsCtr *Container) CtrCreateOption {
}
}
// WithMountNSFrom indicates the the container should join the mount namespace
// WithMountNSFrom indicates that the container should join the mount namespace
// of the given container.
// If the container has joined a pod, it can only join the namespaces of
// containers in the same pod.
@ -911,7 +911,7 @@ func WithMountNSFrom(nsCtr *Container) CtrCreateOption {
}
}
// WithNetNSFrom indicates the the container should join the network namespace
// WithNetNSFrom indicates that the container should join the network namespace
// of the given container.
// If the container has joined a pod, it can only join the namespaces of
// containers in the same pod.
@ -931,7 +931,7 @@ func WithNetNSFrom(nsCtr *Container) CtrCreateOption {
}
}
// WithPIDNSFrom indicates the the container should join the PID namespace of
// WithPIDNSFrom indicates that the container should join the PID namespace of
// the given container.
// If the container has joined a pod, it can only join the namespaces of
// containers in the same pod.
@ -965,7 +965,7 @@ func WithAddCurrentUserPasswdEntry() CtrCreateOption {
}
}
// WithUserNSFrom indicates the the container should join the user namespace of
// WithUserNSFrom indicates that the container should join the user namespace of
// the given container.
// If the container has joined a pod, it can only join the namespaces of
// containers in the same pod.
@ -1000,7 +1000,7 @@ func WithUserNSFrom(nsCtr *Container) CtrCreateOption {
}
}
// WithUTSNSFrom indicates the the container should join the UTS namespace of
// WithUTSNSFrom indicates that the container should join the UTS namespace of
// the given container.
// If the container has joined a pod, it can only join the namespaces of
// containers in the same pod.
@ -1020,7 +1020,7 @@ func WithUTSNSFrom(nsCtr *Container) CtrCreateOption {
}
}
// WithCgroupNSFrom indicates the the container should join the Cgroup namespace
// WithCgroupNSFrom indicates that the container should join the Cgroup namespace
// of the given container.
// If the container has joined a pod, it can only join the namespaces of
// containers in the same pod.
@ -1224,7 +1224,7 @@ func WithDNS(dnsServers []string) CtrCreateOption {
}
}
// WithDNSOption sets addition dns options for the container.
// WithDNSOption sets additional dns options for the container.
func WithDNSOption(dnsOptions []string) CtrCreateOption {
return func(ctr *Container) error {
if ctr.valid {
@ -1538,7 +1538,7 @@ func WithCreateCommand(cmd []string) CtrCreateOption {
}
}
// withIsInfra allows us to dfferentiate between infra containers and other containers
// withIsInfra allows us to differentiate between infra containers and other containers
// within the container config
func withIsInfra() CtrCreateOption {
return func(ctr *Container) error {
@ -1552,7 +1552,7 @@ func withIsInfra() CtrCreateOption {
}
}
// WithIsService allows us to dfferentiate between service containers and other container
// WithIsService allows us to differentiate between service containers and other container
// within the container config
func WithIsService() CtrCreateOption {
return func(ctr *Container) error {

View File

@ -385,7 +385,7 @@ func makeRuntime(runtime *Runtime) (retErr error) {
if err := unix.Access(runtime.storageConfig.RunRoot, unix.W_OK); err != nil {
msg := fmt.Sprintf("RunRoot is pointing to a path (%s) which is not writable. Most likely podman will fail.", runtime.storageConfig.RunRoot)
if errors.Is(err, os.ErrNotExist) {
// if dir does not exists try to create it
// if dir does not exist, try to create it
if err := os.MkdirAll(runtime.storageConfig.RunRoot, 0700); err != nil {
logrus.Warn(msg)
}
@ -704,8 +704,8 @@ var libimageEventsMap = map[libimage.EventType]events.Status{
libimage.EventTypeImageUnmount: events.Unmount,
}
// libimageEvents spawns a goroutine in the background which is listenting for
// events on the libimage.Runtime. The gourtine will be cleaned up implicitly
// libimageEvents spawns a goroutine which will listen for events on
// the libimage.Runtime. The goroutine will be cleaned up implicitly
// when the main() exists.
func (r *Runtime) libimageEvents() {
r.libimageEventsShutdown = make(chan bool)

View File

@ -477,7 +477,7 @@ func (r *Runtime) setupContainer(ctx context.Context, ctr *Container) (_ *Contai
vol.Name = stringid.GenerateRandomID()
isAnonymous = true
} else {
// Check if it exists already
// Check if it already exists
dbVol, err := r.state.Volume(vol.Name)
if err == nil {
ctrNamedVolumes = append(ctrNamedVolumes, dbVol)
@ -503,7 +503,7 @@ func (r *Runtime) setupContainer(ctx context.Context, ctr *Container) (_ *Contai
needsChown := true
// If volume-opts are set parse and add driver opts.
// If volume-opts are set, parse and add driver opts.
if len(vol.Options) > 0 {
isDriverOpts := false
driverOpts := make(map[string]string)

View File

@ -133,7 +133,7 @@ func handlePut(w http.ResponseWriter, r *http.Request, decoder *schema.Decoder,
case errors.Is(err, define.ErrNoSuchCtr) || os.IsNotExist(err):
// 404 is returned for an absent container and path. The
// clients must deal with it accordingly.
utils.Error(w, http.StatusNotFound, fmt.Errorf("the container doesn't exists: %w", err))
utils.Error(w, http.StatusNotFound, fmt.Errorf("the container does not exist: %w", err))
case strings.Contains(err.Error(), "copier: put: error creating file"):
// Not the best test but need to break this out for compatibility
// See vendor/github.com/containers/buildah/copier/copier.go:1585

View File

@ -102,7 +102,7 @@ func CreateVolume(w http.ResponseWriter, r *http.Request) {
err error
)
if len(input.Name) != 0 {
// See if the volume exists already
// See if the volume already exists
existingVolume, err = runtime.GetVolume(input.Name)
if err != nil && !errors.Is(err, define.ErrNoSuchVolume) {
utils.InternalServerError(w, err)

View File

@ -173,7 +173,7 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
return nil, err
}
// labels from the image that don't exist already
// labels from the image that don't already exist
if len(labels) > 0 && s.Labels == nil {
s.Labels = make(map[string]string)
}

View File

@ -215,7 +215,7 @@ t POST "libpod/build?remote=https%3A%2F%2Fgithub.com%2Falpinelinux%2Fdocker-alpi
# Build api response header must contain Content-type: application/json
t POST "build?dockerfile=containerfile" $CONTAINERFILE_TAR application/json 200
response_headers=$(cat "$WORKDIR/curl.headers.out")
like "$response_headers" ".*application/json.*" "header does not contains application/json"
like "$response_headers" ".*application/json.*" "header does not contain application/json"
# PR #12091: output from compat API must now include {"aux":{"ID":"sha..."}}
t POST "build?dockerfile=containerfile" $CONTAINERFILE_TAR 200 \

View File

@ -4525,7 +4525,7 @@ ENV OPENJ9_JAVA_OPTIONS=%q
Expect(inspect.OutputToString()).To(ContainSubstring(devicePath))
})
It("podman play kube reports error when the device does not exists", func() {
It("podman play kube reports error when the device does not exist", func() {
SkipIfRootless("It needs root access to create devices")
devicePath := "/dev/foodevdir/baddevice"

View File

@ -133,7 +133,7 @@ var _ = Describe("Podman volume create", func() {
})
It("podman import/export volume should fail", func() {
// try import on volume or source which does not exists
// try import on volume or source which does not exist
SkipIfRemote("Volume export check does not work with a remote client")
session := podmanTest.Podman([]string{"volume", "import", "notfound", "notfound.tar"})

View File

@ -479,7 +479,7 @@ EOF
is "$output" "tmpfs" "Should be tmpfs"
run_podman 1 run --image-volume ignore --rm volume_image stat -f -c %T /data
is "$output" "stat: can't read file system information for '/data': No such file or directory" "Should fail with /data does not exists"
is "$output" "stat: can't read file system information for '/data': No such file or directory" "Should fail with /data does not exist"
CONTAINERS_CONF="$containersconf" run_podman run --rm volume_image stat -f -c %T /data
is "$output" "tmpfs" "Should be tmpfs"
@ -491,7 +491,7 @@ EOF
is "$output" "tmpfs" "Should be tmpfs"
CONTAINERS_CONF="$containersconf" run_podman 1 run --image-volume ignore --rm volume_image stat -f -c %T /data
is "$output" "stat: can't read file system information for '/data': No such file or directory" "Should fail with /data does not exists"
is "$output" "stat: can't read file system information for '/data': No such file or directory" "Should fail with /data does not exist"
run_podman rm --all --force -t 0
run_podman image rm --force localhost/volume_image