source code comments and docs: fix typos, language, Markdown layout

- fix a/an before noun
- fix loose -> lose
- fix "the the"
- fix lets -> let's
- fix Markdown layout
- fix a few typos
- remove unnecessary text in troubleshooting.md

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
pull/18644/head
Erik Sjölund 2023-05-22 07:52:16 +02:00
parent 44807eabf1
commit 685c736185
42 changed files with 51 additions and 52 deletions

View File

@ -29,7 +29,7 @@ const KernelWarning = "WSL Kernel installation did not complete successfully. "
func setupLogging(name string) (*eventlog.Log, error) {
// Reuse the Built-in .NET Runtime Source so that we do not
// have to provide a messaage table and modify the system
// have to provide a message table and modify the system
// event configuration
log, err := eventlog.Open(".NET Runtime")
if err != nil {

View File

@ -339,7 +339,7 @@ func getPathCompletion(root string, toComplete string) ([]string, cobra.ShellCom
for _, e := range entries {
if strings.HasPrefix(e.Name(), base) {
suf := ""
// When the entry is an directory we add the "/" as suffix and do not want to add space
// When the entry is a directory we add the "/" as suffix and do not want to add space
// to match normal shell completion behavior.
// Just inc counter again to fake more than one entry in this case and thus get no space.
if e.IsDir() {
@ -383,7 +383,7 @@ func validCurrentCmdLine(cmd *cobra.Command, args []string, toComplete string) b
if err := cmd.Args(cmd, append(args, toComplete)); err != nil {
// Special case if we use ExactArgs(2) or MinimumNArgs(2),
// They will error if we try to complete the first arg.
// Lets try to parse the common error and compare if we have less args than
// Let's try to parse the common error and compare if we have less args than
// required. In this case we are fine and should provide completion.
// Clean the err msg so we can parse it with fmt.Sscanf
@ -698,7 +698,7 @@ func AutocompleteCpCommand(cmd *cobra.Command, args []string, toComplete string)
if len(args) < 2 {
if i := strings.IndexByte(toComplete, ':'); i > -1 {
// Looks like the user already set the container.
// Lets mount it and provide path completion for files in the container.
// Let's mount it and provide path completion for files in the container.
engine, err := setupContainerEngine(cmd)
if err != nil {
cobra.CompErrorln(err.Error())
@ -1328,9 +1328,9 @@ func getMethodNames(f reflect.Value, prefix string) []formatSuggestion {
if kind == reflect.Struct || kind == reflect.Map {
suffix = "."
}
// From a template users POV it is not important when the use a struct field or method.
// From a template user's POV it is not important whether they use a struct field or method.
// They only notice the difference when the function requires arguments.
// So lets be nice and let the user know that this method requires arguments via the help text.
// So let's be nice and let the user know that this method requires arguments via the help text.
// Note since this is actually a method on a type the first argument is always fix so we should skip it.
num := method.Func.Type().NumIn() - 1
if num > 0 {

View File

@ -368,7 +368,7 @@ func (l psReporter) Status() string {
// strings.Title is deprecated since go 1.18
// However for our use case it is still fine. The recommended replacement
// is adding about 400kb binary size so lets keep using this for now.
// is adding about 400kb binary size so let's keep using this for now.
//nolint:staticcheck
state = strings.Title(l.ListContainer.State)
}

View File

@ -279,7 +279,7 @@ func play(cmd *cobra.Command, args []string) error {
ch := make(chan os.Signal, 1)
var teardownReader *bytes.Reader
if playOptions.Wait {
// Stop the the shutdown signal handler so we can actually clean up after a SIGTERM or interrupt
// Stop the shutdown signal handler so we can actually clean up after a SIGTERM or interrupt
if err := shutdown.Stop(); err != nil && err != shutdown.ErrNotStarted {
return err
}

View File

@ -63,7 +63,7 @@ func ContainerEngine() entities.ContainerEngine {
return containerEngine
}
// NewContainerEngine is a wrapper for building an ContainerEngine to be used for PreRunE functions
// NewContainerEngine is a wrapper for building a ContainerEngine to be used for PreRunE functions
func NewContainerEngine(cmd *cobra.Command, args []string) (entities.ContainerEngine, error) {
if containerEngine == nil {
podmanOptions.FlagSet = cmd.Flags()

View File

@ -233,7 +233,7 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
// Special case if command is hidden completion command ("__complete","__completeNoDesc")
// Since __completeNoDesc is an alias the cm.Name is always __complete
if cmd.Name() == cobra.ShellCompRequestCmd {
// Parse the cli arguments after the the completion cmd (always called as second argument)
// Parse the cli arguments after the completion cmd (always called as second argument)
// This ensures that the --url, --identity and --connection flags are properly set
compCmd, _, err := cmd.Root().Traverse(os.Args[2:])
if err != nil {

View File

@ -51,7 +51,7 @@ func IDOrLatestArgs(cmd *cobra.Command, args []string) error {
}
// CheckAllLatestAndCIDFile checks that --all and --latest are used correctly for containers and pods
// If idFileFlag is set is set, also checks for the --cidfile or --pod-id-file flag.
// If idFileFlag is set, also checks for the --cidfile or --pod-id-file flag.
// Note: this has been deprecated, use CheckAllLatestAndIDFile instead
func CheckAllLatestAndCIDFile(c *cobra.Command, args []string, ignoreArgLen bool, cidfile bool) error {
return CheckAllLatestAndIDFile(c, args, ignoreArgLen, "cidfile")

View File

@ -101,7 +101,7 @@ func Debugf(format string, a ...interface{}) {
// and /etc/containers/systemd (for sysadmin files).
// For user generators these can live in /etc/containers/systemd/users, /etc/containers/systemd/users/$UID, and $XDG_CONFIG_HOME/containers/systemd
func getUnitDirs(rootless bool) []string {
// Allow overdiding source dir, this is mainly for the CI tests
// Allow overriding source dir, this is mainly for the CI tests
unitDirsEnv := os.Getenv("QUADLET_UNIT_DIRS")
if len(unitDirsEnv) > 0 {
return strings.Split(unitDirsEnv, ":")

View File

@ -21,7 +21,7 @@ Secret Options
- `type=mount|env` : How the secret is exposed to the container.
`mount` mounts the secret into the container as a file.
`env` exposes the secret as a environment variable.
`env` exposes the secret as an environment variable.
Defaults to `mount`.
- `target=target` : Target of secret.
For mounted secrets, this is the path to the secret inside the container.

View File

@ -29,7 +29,7 @@ $ echo $?
$
```
Check if an manifest called `mylist` exists (the manifest list does not actually exist).
Check if a manifest called `mylist` exists (the manifest list does not actually exist).
```
$ podman manifest exists mylist
$ echo $?

View File

@ -146,7 +146,7 @@ $ podman network create --subnet 192.168.33.0/24 --gateway 192.168.33.3 newnet
newnet
```
Create a network that uses a *192.168.55.0/24** subnet and has an IP address range of *192.168.55.129 - 192.168.55.254*.
Create a network that uses a *192.168.55.0/24* subnet and has an IP address range of *192.168.55.129 - 192.168.55.254*.
```
$ podman network create --subnet 192.168.55.0/24 --ip-range 192.168.55.128/25
podman5

View File

@ -12,7 +12,7 @@ The network command manages networks for Podman.
Podman supports two network backends [Netavark](https://github.com/containers/netavark)
and [CNI](https://www.cni.dev/). Netavark is the default network backend and was added in Podman v4.0. CNI will be deprecated in the future in preference of
Netavark. To configure
the network backend use the `network_backend`key under the `[Network]` in
the network backend use the `network_backend` key under the `[Network]` in
**[containers.conf(5)](https://github.com/containers/common/blob/main/docs/containers.conf.5.md)**.
New systems use netavark by default, to check what backend is used run
`podman info --format {{.Host.NetworkBackend}}`.

View File

@ -358,7 +358,7 @@ By default, Podman is run in such a way that the systemd startup notify command
the container runtime. In other words, the service is deemed started when the container runtime
starts the child in the container. However, if the container application supports
[sd_notify](https://www.freedesktop.org/software/systemd/man/sd_notify.html), then setting
`Notify`to true passes the notification details to the container allowing it to notify
`Notify` to true passes the notification details to the container allowing it to notify
of startup on its own.
### `PodmanArgs=`

View File

@ -84,7 +84,7 @@ $ podman volume create --label foo=bar myvol
## QUOTAS
podman volume create uses `XFS project quota controls` for controlling the size and the number of inodes of builtin volumes. The directory used to store the volumes must be an`XFS` file system and be mounted with the `pquota` option.
podman volume create uses `XFS project quota controls` for controlling the size and the number of inodes of builtin volumes. The directory used to store the volumes must be an `XFS` file system and be mounted with the `pquota` option.
Example /etc/fstab entry:
```

View File

@ -161,7 +161,7 @@ accessed:
127.0.0.1 - - [04/Mar/2020 11:18:21] "GET /alpine@sha256=e9b65ef660a3ff91d28cc50eba84f21798a6c5c39b4dd165047db49e84ae1fb9/signature-1 HTTP/1.1" 200 -
```
As an counterpart example, if we specify the wrong key at `/tmp/key.gpg`:
As a counterpart example, if we specify the wrong key at `/tmp/key.gpg`:
```bash
gpg --output /tmp/key.gpg --armor --export mail@saschagrunert.de

View File

@ -1115,7 +1115,7 @@ func (s *BoltState) GetNetworks(ctr *Container) (map[string]types.PerNetworkOpti
return nil
}
// lets ignore the error here there is nothing we can do
// let's ignore the error here there is nothing we can do
_ = netAliasesBkt.ForEach(func(alias, v []byte) error {
aliases = append(aliases, string(alias))
return nil

View File

@ -401,7 +401,7 @@ func (s *BoltState) getContainerConfigFromDB(id []byte, config *ContainerConfig,
config.ContainerNetworkConfig.PortMappings = ocicniPortsToNetTypesPorts(config.ContainerNetworkConfig.OldPortMappings)
// keep the OldPortMappings in case an user has to downgrade podman
// indicate the the config was modified and should be written back to the db when possible
// indicate that the config was modified and should be written back to the db when possible
config.rewrite = true
}
@ -425,7 +425,7 @@ func (s *BoltState) getContainerStateDB(id []byte, ctr *Container, ctrsBkt *bolt
return fmt.Errorf("unmarshalling container %s state: %w", ctr.ID(), err)
}
// backwards compat, previously we used a extra bucket for the netns so try to get it from there
// backwards compat, previously we used an extra bucket for the netns so try to get it from there
netNSBytes := ctrToUpdate.Get(netNSKey)
if netNSBytes != nil && newState.NetNS == "" {
newState.NetNS = string(netNSBytes)

View File

@ -20,7 +20,7 @@ import (
// ExecConfig contains the configuration of an exec session
type ExecConfig struct {
// Command the the command that will be invoked in the exec session.
// Command is the command that will be invoked in the exec session.
// Must not be empty.
Command []string `json:"command"`
// Terminal is whether the exec session will allocate a pseudoterminal.

View File

@ -2371,7 +2371,7 @@ func (c *Container) groupEntry(groupname, gid string, list []string) string {
// /etc/passwd via AddCurrentUserPasswdEntry (though this does not trigger if
// the user in question already exists in /etc/passwd) or the UID to be added
// is 0).
// 3. The user specified additional host user accounts to add the the /etc/passwd file
// 3. The user specified additional host user accounts to add to the /etc/passwd file
//
// Returns password entry (as a string that can be appended to /etc/passwd) and
// any error that occurred.

View File

@ -77,7 +77,7 @@ func (r *Runtime) info() (*define.Info, error) {
// top-level "host" info
func (r *Runtime) hostInfo() (*define.HostInfo, error) {
// lets say OS, arch, number of cpus, amount of memory, maybe os distribution/version, hostname, kernel version, uptime
// let's say OS, arch, number of cpus, amount of memory, maybe os distribution/version, hostname, kernel version, uptime
mi, err := system.ReadMemInfo()
if err != nil {
return nil, fmt.Errorf("reading memory info: %w", err)
@ -195,7 +195,7 @@ func (r *Runtime) getContainerStoreInfo() (define.ContainerStore, error) {
// top-level "store" info
func (r *Runtime) storeInfo() (*define.StoreInfo, error) {
// lets say storage driver in use, number of images, number of containers
// let's say storage driver in use, number of images, number of containers
configFile, err := storage.DefaultConfigFile(rootless.IsRootless())
if err != nil {
return nil, err

View File

@ -476,7 +476,7 @@ func (p *Pod) podWithContainers(ctx context.Context, containers []*Container, po
ctr.Ports = nil
// We add the original port declarations from the libpod infra container
// to the first kubernetes container description because otherwise we loose
// to the first kubernetes container description because otherwise we lose
// the original container/port bindings.
// Add the port configuration to the first regular container or the first
// init container if only init containers have been created in the pod.
@ -903,7 +903,7 @@ func containerToV1Container(ctx context.Context, c *Container, getService bool)
return kubeContainer, kubeVolumes, &dns, annotations, nil
}
// portMappingToContainerPort takes an portmapping and converts
// portMappingToContainerPort takes a portmapping and converts
// it to a v1.ContainerPort format for kube output
func portMappingToContainerPort(portMappings []types.PortMapping, getService bool) ([]v1.ContainerPort, error) {
containerPorts := make([]v1.ContainerPort, 0, len(portMappings))

View File

@ -167,7 +167,7 @@ func getTailLog(path string, tail int) ([]*LogLine, error) {
return tailLog, nil
}
// getColor returns a ANSI escape code for color based on the colorID
// getColor returns an ANSI escape code for color based on the colorID
func getColor(colorID int64) string {
colors := map[int64]string{
0: "\033[37m", // Light Gray

View File

@ -61,7 +61,7 @@ func (c *Container) getNetworkOptions(networkOpts map[string]types.PerNetworkOpt
return opts
}
// setUpNetwork will set up the the networks, on error it will also tear down the cni
// setUpNetwork will set up the networks, on error it will also tear down the cni
// networks. If rootless it will join/create the rootless network namespace.
func (r *Runtime) setUpNetwork(ns string, opts types.NetworkOptions) (map[string]types.StatusBlock, error) {
rootlessNetNS, err := r.GetRootlessNetNs(true)
@ -385,7 +385,7 @@ func (c *Container) NetworkDisconnect(nameOrID, netName string, force bool) erro
return err
}
// check if network exists and if the input is a ID we get the name
// check if network exists and if the input is an ID we get the name
// CNI and netavark and the libpod db only uses names so it is important that we only use the name
netName, err = c.runtime.normalizeNetworkName(netName)
if err != nil {
@ -499,7 +499,7 @@ func (c *Container) NetworkConnect(nameOrID, netName string, netOpts types.PerNe
return err
}
// check if network exists and if the input is a ID we get the name
// check if network exists and if the input is an ID we get the name
// CNI and netavark and the libpod db only uses names so it is important that we only use the name
netName, err = c.runtime.normalizeNetworkName(netName)
if err != nil {

View File

@ -541,7 +541,7 @@ func (r *Runtime) GetRootlessNetNs(new bool) (*RootlessNetNS, error) {
// The CNI plugins and netavark need access to iptables in $PATH. As it turns out debian doesn't put
// /usr/sbin in $PATH for rootless users. This will break rootless networking completely.
// We might break existing users and we cannot expect everyone to change their $PATH so
// lets add /usr/sbin to $PATH ourselves.
// let's add /usr/sbin to $PATH ourselves.
path = os.Getenv("PATH")
if !strings.Contains(path, "/usr/sbin") {
path += ":/usr/sbin"

View File

@ -749,7 +749,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// - `health`=(`starting`, `healthy`, `unhealthy` or `none`)
// - `id=<ID>` a container's ID
// - `is-task`=(`true` or `false`)
// - `label`=(`key` or `"key=value"`) of an container label
// - `label`=(`key` or `"key=value"`) of a container label
// - `name=<name>` a container's name
// - `network`=(`<network id>` or `<network name>`)
// - `pod`=(`<pod id>` or `<pod name>`)

View File

@ -1351,7 +1351,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// - images
// summary: Report on changes to images's filesystem; adds, deletes or modifications.
// description: |
// Returns which files in a images's filesystem have been added, deleted, or modified. The Kind of modification can be one of:
// Returns which files in an image's filesystem have been added, deleted, or modified. The Kind of modification can be one of:
//
// 0: Modified
// 1: Added

View File

@ -49,7 +49,7 @@ var _ = Describe("Podman pods", func() {
code, _ := bindings.CheckResponseCode(err)
Expect(code).To(BeNumerically("==", http.StatusNotFound))
// Inspect an valid pod name
// Inspect a valid pod name
response, err := pods.Inspect(bt.conn, newpod, nil)
Expect(err).ToNot(HaveOccurred())
Expect(response.Name).To(Equal(newpod))

View File

@ -179,7 +179,7 @@ type ImagePullReport struct {
// ImagePushOptions are the arguments for pushing images.
type ImagePushOptions struct {
// All indicates that all images referenced in an manifest list should be pushed
// All indicates that all images referenced in a manifest list should be pushed
All bool
// Authfile is the path to the authentication file. Ignored for remote
// calls.

View File

@ -625,7 +625,7 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY
}
}
// Add the the original container names from the kube yaml as aliases for it. This will allow network to work with
// Add the original container names from the kube yaml as aliases for it. This will allow network to work with
// both just containerName as well as containerName-podName.
// In the future, we want to extend this to the CLI as well, where the name of the container created will not have
// the podName appended to it, but this is a breaking change and will be done in podman 5.0

View File

@ -22,7 +22,7 @@ type Overrides struct {
}
// GetUserGroupInfo takes string forms of the container's mount path and the container user and
// returns a ExecUser with uid, gid, sgids, and home. And override can be provided for defaults.
// returns an ExecUser with uid, gid, sgids, and home. And override can be provided for defaults.
func GetUserGroupInfo(containerMount, containerUser string, override *Overrides) (*user.ExecUser, error) {
var (
passwdDest, groupDest string

View File

@ -133,7 +133,7 @@ func (p *Virtualization) NewMachine(opts machine.InitOptions) (machine.VM, error
"-device", "virtio-serial",
// qemu needs to establish the long name; other connections can use the symlink'd
// Note both id and chardev start with an extra "a" because qemu requires that it
// starts with an letter but users can also use numbers
// starts with a letter but users can also use numbers
"-chardev", "socket,path=" + vm.ReadySocket.Path + ",server=on,wait=off,id=a" + vm.Name + "_ready",
"-device", "virtserialport,chardev=a" + vm.Name + "_ready" + ",name=org.fedoraproject.port.0",
"-pidfile", vm.VMPidFilePath.GetPath()}...)
@ -1047,7 +1047,7 @@ func (v *MachineVM) State(bypass bool) (machine.Status, error) {
logrus.Error(err)
}
}()
// If there is a monitor, lets see if we can query state
// If there is a monitor, let's see if we can query state
return v.checkStatus(monitor)
}

View File

@ -122,7 +122,7 @@ func (n UsernsMode) IsDefaultValue() bool {
return n == "" || n == defaultType
}
// GetAutoOptions returns a AutoUserNsOptions with the settings to automatically set up
// GetAutoOptions returns an AutoUserNsOptions with the settings to automatically set up
// a user namespace.
func (n UsernsMode) GetAutoOptions() (*types.AutoUserNsOptions, error) {
parts := strings.SplitN(string(n), ":", 2)

View File

@ -181,7 +181,7 @@ func MakeContainer(ctx context.Context, rt *libpod.Runtime, s *specgen.SpecGener
_, err = rt.LookupPod(s.Hostname)
if len(s.Hostname) > 0 && !s.UtsNS.IsPrivate() && err == nil {
// ok, we are incorrectly setting the pod as the hostname, lets undo that before validation
// ok, we are incorrectly setting the pod as the hostname, let's undo that before validation
s.Hostname = ""
}
if err := s.Validate(); err != nil {

View File

@ -115,7 +115,7 @@ func securityConfigureGenerator(s *specgen.SpecGenerator, g *generate.Generator,
privCapsRequired := []string{}
// If the container image specifies an label with a
// If the container image specifies a label with a
// capabilities.ContainerImageLabel then split the comma separated list
// of capabilities and record them. This list indicates the only
// capabilities, required to run the container.

View File

@ -624,7 +624,7 @@ func SizeOfPath(path string) (uint64, error) {
return uint64(size), err
}
// EncryptConfig translates encryptionKeys into a EncriptionsConfig structure
// EncryptConfig translates encryptionKeys into an EncriptionsConfig structure
func EncryptConfig(encryptionKeys []string, encryptLayers []int) (*encconfig.EncryptConfig, *[]int, error) {
var encLayers *[]int
var encConfig *encconfig.EncryptConfig

View File

@ -93,7 +93,7 @@ var _ = Describe("Podman init containers", func() {
// Container was rm'd
// Expect(check).Should(Exit(1))
Expect(check.ExitCode()).To(Equal(1), "I dont understand why the other way does not work")
// Lets double check with a stop and start
// Let's double check with a stop and start
stopPod := podmanTest.Podman([]string{"pod", "stop", "foobar"})
stopPod.WaitWithDefaultTimeout()
Expect(stopPod).Should(Exit(0))

View File

@ -305,7 +305,7 @@ var _ = Describe("Podman ps", func() {
Expect(result).Should(Exit(0))
Expect(result.OutputToString()).To(Equal(cid))
// Query for an non-existing image using regex should not match anything
// Query for a non-existing image using regex should not match anything
result = podmanTest.Podman([]string{"ps", "-q", "--no-trunc", "-a", "--filter", "ancestor=^quai.io/libpod/alpi"})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))

View File

@ -249,7 +249,7 @@ var _ = Describe("Podman run", func() {
Expect(esession).Should(Exit(0))
Expect(tarball).Should(BeARegularFile())
// N/B: This will loose any extended attributes like SELinux types
// N/B: This will lose any extended attributes like SELinux types
GinkgoWriter.Printf("Extracting container root tarball\n")
tarsession := SystemExec("tar", []string{"xf", tarball, "-C", rootfs})
Expect(tarsession).Should(Exit(0))

View File

@ -322,7 +322,7 @@ function _log_test_follow_since() {
sh -c "sleep 1; while :; do echo $content && sleep 5; done"
# sleep is required to make sure the podman event backend no longer sees the start event in the log
# This value must be greater or equal than the the value given in --since below
# This value must be greater or equal than the value given in --since below
sleep 0.2
# Make sure podman logs actually follows by giving a low timeout and check that the command times out

View File

@ -26,7 +26,7 @@ load helpers.network
run_podman network create $net3
run_podman network ls --quiet
# just check the the order of the created networks is correct
# just check that the order of the created networks is correct
# we cannot do an exact match since developer and CI systems could contain more networks
is "$output" ".*$net1.*$net2.*$net3.*podman.*" "networks sorted alphabetically"

View File

@ -209,7 +209,7 @@ EOF
# Stop the *main* container and make sure that
# 1) The pod transitions to Exited
# 2) The service container is stopped
# #) The service container is marked as an service container
# #) The service container is marked as a service container
run_podman stop test_pod-test
_ensure_pod_state test_pod Exited
_ensure_container_running $service_container false

View File

@ -458,7 +458,6 @@ the user session completed.
Once the user logs out all the containers exit.
#### Solution
You'll need to either:
```console
# loginctl enable-linger $UID