Skip to content

Commit

Permalink
Merge pull request #4817 from rhatdan/codespell
Browse files Browse the repository at this point in the history
Add codespell to validate spelling mistakes in code.
  • Loading branch information
openshift-merge-robot committed Jan 13, 2020
2 parents 9e2e4d7 + 4093b2c commit e83a1b8
Show file tree
Hide file tree
Showing 33 changed files with 45 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ gating_task:
build_script:
- '/usr/local/bin/entrypoint.sh podman |& ${TIMESTAMP}'
- 'cd $GOSRC && ./hack/podman-commands.sh |& ${TIMESTAMP}'
# N/B: need 'clean' so some commited files are re-generated.
# N/B: need 'clean' so some committed files are re-generated.
- '/usr/local/bin/entrypoint.sh clean podman-remote |& ${TIMESTAMP}'
- '/usr/local/bin/entrypoint.sh clean podman BUILDTAGS="exclude_graphdriver_devicemapper selinux seccomp" |& ${TIMESTAMP}'
- '/usr/local/bin/entrypoint.sh podman-remote-darwin |& ${TIMESTAMP}'
Expand Down
2 changes: 1 addition & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ varlink call -m unix:/run/podman/io.podman/io.podman.RemoveImage '{"name": "regi

method RemoveImageWithResponse(name: [string](https://godoc.org/builtin#string), force: [bool](https://godoc.org/builtin#bool)) [RemoveImageResponse](#RemoveImageResponse)</div>
RemoveImageWithResponse takes the name or ID of an image as well as a boolean that determines if containers using that image
should be deleted. If the image cannot be found, an [ImageNotFound](#ImageNotFound) error will be returned. The reponse is
should be deleted. If the image cannot be found, an [ImageNotFound](#ImageNotFound) error will be returned. The response is
in the form of a RemoveImageResponse .
### <a name="RemovePod"></a>func RemovePod
<div style="background-color: #E8E8E8; padding: 15px; margin: 10px; border-radius: 10px;">
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ install-podman-remote-%-docs: podman-remote docs $(MANPAGES)
man-page-check:
hack/man-page-checker

codespell:
codespell -S bin,vendor,.git,go.sum,changelog.txt,seccomp.json,.cirrus.yml,"*.xz,*.gz,*.tar,*.tgz,bin2img,*ico,*.png,*.1,*.5,copyimg,*.orig,apidoc.go" -L uint,iff,od,seeked

# When publishing releases include critical build-time details
.PHONY: release.txt
release.txt:
Expand Down
4 changes: 2 additions & 2 deletions cmd/podman/containers_prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ func pruneContainersCmd(c *cliconfig.PruneContainersValues) error {
reader := bufio.NewReader(os.Stdin)
fmt.Printf(`WARNING! This will remove all stopped containers.
Are you sure you want to continue? [y/N] `)
ans, err := reader.ReadString('\n')
answer, err := reader.ReadString('\n')
if err != nil {
return errors.Wrapf(err, "error reading input")
}
if strings.ToLower(ans)[0] != 'y' {
if strings.ToLower(answer)[0] != 'y' {
return nil
}
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/podman/errors_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func outputError(err error) {
}
var ne error
switch e := err.(type) {
// For some reason golang wont let me list them with commas so listing them all.
// For some reason golang won't let me list them with commas so listing them all.
case *iopodman.ImageNotFound:
ne = errors.New(e.Reason)
case *iopodman.ContainerNotFound:
Expand All @@ -48,7 +48,7 @@ func outputError(err error) {
func setExitCode(err error) int {
cause := errors.Cause(err)
switch e := cause.(type) {
// For some reason golang wont let me list them with commas so listing them all.
// For some reason golang won't let me list them with commas so listing them all.
case *iopodman.ContainerNotFound:
return 1
case *iopodman.InvalidState:
Expand Down
4 changes: 2 additions & 2 deletions cmd/podman/images_prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ func pruneImagesCmd(c *cliconfig.PruneImagesValues) error {
fmt.Printf(`
WARNING! This will remove all dangling images.
Are you sure you want to continue? [y/N] `)
ans, err := reader.ReadString('\n')
answer, err := reader.ReadString('\n')
if err != nil {
return errors.Wrapf(err, "error reading input")
}
if strings.ToLower(ans)[0] != 'y' {
if strings.ToLower(answer)[0] != 'y' {
return nil
}
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/podman/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ WARNING! This will remove:
- all images
- all build cache
Are you sure you want to continue? [y/N] `)
ans, err := reader.ReadString('\n')
answer, err := reader.ReadString('\n')
if err != nil {
return errors.Wrapf(err, "error reading input")
}
if strings.ToLower(ans)[0] != 'y' {
if strings.ToLower(answer)[0] != 'y' {
return nil
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/shared/intermediate.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
/*
attention
in this file you will see alot of struct duplication. this was done because people wanted a strongly typed
in this file you will see a lot of struct duplication. this was done because people wanted a strongly typed
varlink mechanism. this resulted in us creating this intermediate layer that allows us to take the input
from the cli and make an intermediate layer which can be transferred as strongly typed structures over a varlink
interface.
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/shared/intermediate_novarlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package shared
/*
attention
in this file you will see alot of struct duplication. this was done because people wanted a strongly typed
in this file you will see a lot of struct duplication. this was done because people wanted a strongly typed
varlink mechanism. this resulted in us creating this intermediate layer that allows us to take the input
from the cli and make an intermediate layer which can be transferred as strongly typed structures over a varlink
interface.
Expand Down
4 changes: 2 additions & 2 deletions cmd/podman/system_prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ WARNING! This will remove:
- all dangling images
- all build cache
Are you sure you want to continue? [y/N] `, volumeString)
ans, err := reader.ReadString('\n')
answer, err := reader.ReadString('\n')
if err != nil {
return errors.Wrapf(err, "error reading input")
}
if strings.ToLower(ans)[0] != 'y' {
if strings.ToLower(answer)[0] != 'y' {
return nil
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/varlink/io.podman.varlink
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ method UntagImage(name: string, tag: string) -> (image: string)
method RemoveImage(name: string, force: bool) -> (image: string)

# RemoveImageWithResponse takes the name or ID of an image as well as a boolean that determines if containers using that image
# should be deleted. If the image cannot be found, an [ImageNotFound](#ImageNotFound) error will be returned. The reponse is
# should be deleted. If the image cannot be found, an [ImageNotFound](#ImageNotFound) error will be returned. The response is
# in the form of a RemoveImageResponse .
method RemoveImageWithResponse(name: string, force: bool) -> (response: RemoveImageResponse)

Expand Down
4 changes: 2 additions & 2 deletions cmd/podman/volume_prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ func volumePruneCmd(c *cliconfig.VolumePruneValues) error {
reader := bufio.NewReader(os.Stdin)
fmt.Println("WARNING! This will remove all volumes not used by at least one container.")
fmt.Print("Are you sure you want to continue? [y/N] ")
ans, err := reader.ReadString('\n')
answer, err := reader.ReadString('\n')
if err != nil {
return errors.Wrapf(err, "error reading input")
}
if strings.ToLower(ans)[0] != 'y' {
if strings.ToLower(answer)[0] != 'y' {
return nil
}
}
Expand Down
2 changes: 1 addition & 1 deletion completions/bash/podman
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ __podman_to_extglob() {
# continue processing its completion.
#
# TODO if the preceding command has options that accept arguments and an
# argument is equal ot one of the subcommands, this is falsely detected as
# argument is equal to one of the subcommands, this is falsely detected as
# a match.
__podman_subcommands() {
local subcommands="$1"
Expand Down
2 changes: 1 addition & 1 deletion contrib/cirrus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ as the standard 'cloud-init' services.
in the ``test_build_vm_images`` Task (above).

* Base images do not need to be produced often, but doing so completely
manually would be time-consuming and error-prone. Therefor a special
manually would be time-consuming and error-prone. Therefore a special
semi-automatic *Makefile* target is provided to assist with producing
all the base-images: ``libpod_base_images``

Expand Down
2 changes: 1 addition & 1 deletion contrib/spec/podman.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
%endif

# %if ! 0% {?gobuild:1}
%define gobuild(o:) go build -tags="$BUILDTAGS" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
%define gobuild(o:) go build -tags="$BUILDTAGS" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|of -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
#% endif

# libpod hack directory
Expand Down
2 changes: 1 addition & 1 deletion dependencies/analyses/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# A set of scripts and instructions that help to analyze and debloat go-lang dependencies

Note that all scripts mentioned below follow the [KISS principle](https://en.wikipedia.org/wiki/KISS_principle) on purpose.
The scripts are meant to be used in combination to aid in understanding the packages' dependencies and how they contribute to the size of the compiled binary.
The scripts are meant to be used in combination to aid in understanding the package's dependencies and how they contribute to the size of the compiled binary.

## Size of packages

Expand Down
2 changes: 1 addition & 1 deletion docs/source/markdown/podman-create.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ You can pass `host` to copy the current configuration from the host.

Sets the username or UID used and optionally the groupname or GID for the specified command.

The followings examples are all valid:
The following examples are all valid:
--user [user | user:group | uid | uid:gid | user:gid | uid:group ]

Without this argument the command will be run as root in the container.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/markdown/podman-run.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ You can pass `host` to copy the current configuration from the host.

Sets the username or UID used and optionally the groupname or GID for the specified command.

The followings examples are all valid:
The following examples are all valid:
--user [user | user:group | uid | uid:gid | user:gid | uid:group ]

Without this argument the command will be run as root in the container.
Expand Down
2 changes: 1 addition & 1 deletion libpod/image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,7 @@ func GetLayersMapWithImageInfo(imageruntime *Runtime) (map[string]*LayerInfo, er
}
}

// scan all layers & add all childs for each layers to layerInfo
// scan all layers & add all childid's for each layers to layerInfo
for _, layer := range layers {
_, ok := layerInfoMap[layer.ID]
if ok {
Expand Down
8 changes: 4 additions & 4 deletions libpod/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,13 @@ func ocicniPortMappingToContainerPort(portMappings []ocicni.PortMapping) ([]v1.C
func libpodEnvVarsToKubeEnvVars(envs []string) ([]v1.EnvVar, error) {
var envVars []v1.EnvVar
for _, e := range envs {
splitE := strings.SplitN(e, "=", 2)
if len(splitE) != 2 {
split := strings.SplitN(e, "=", 2)
if len(split) != 2 {
return envVars, errors.Errorf("environment variable %s is malformed; should be key=value", e)
}
ev := v1.EnvVar{
Name: splitE[0],
Value: splitE[1],
Name: split[0],
Value: split[1],
}
envVars = append(envVars, ev)
}
Expand Down
2 changes: 1 addition & 1 deletion libpod/networking_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func (r *Runtime) setupRootlessNetNS(ctr *Container) (err error) {
}
defer func() {
if err := cmd.Process.Release(); err != nil {
logrus.Errorf("unable to release comman process: %q", err)
logrus.Errorf("unable to release command process: %q", err)
}
}()

Expand Down
2 changes: 1 addition & 1 deletion pkg/adapter/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ func (r *LocalRuntime) selectDetachKeys(flagValue string) (string, error) {

config, err := r.GetConfig()
if err != nil {
return "", errors.Wrapf(err, "unable to retrive runtime config")
return "", errors.Wrapf(err, "unable to retrieve runtime config")
}
if config.DetachKeys != "" {
return config.DetachKeys, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/adapter/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type Volume struct {
// VolumeFilter is for filtering volumes on the client
type VolumeFilter func(*Volume) bool

// GetRuntimeNoStore returns a localruntime struct wit an embedded runtime but
// GetRuntimeNoStore returns a localruntime struct with an embedded runtime but
// without a configured storage.
func GetRuntimeNoStore(ctx context.Context, c *cliconfig.PodmanCommand) (*LocalRuntime, error) {
runtime, err := libpodruntime.GetRuntimeNoStore(ctx, c)
Expand Down
2 changes: 1 addition & 1 deletion pkg/hooks/docs/oci-hooks.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Tools consuming this format may also opt to monitor the hook directories for cha

Hooks are injected in the order obtained by sorting the JSON file names, after converting them to lower case, based on their Unicode code points.
For example, a matching hook defined in `01-my-hook.json` would be injected before matching hooks defined in `02-another-hook.json` and `01-UPPERCASE.json`.
It is strongly recommended to make the sort oder unambiguous depending on an ASCII-only prefix (like the `01`/`02` above).
It is strongly recommended to make the sort order unambiguous depending on an ASCII-only prefix (like the `01`/`02` above).

Each JSON file should contain an object with one of the following schemas.

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/healthcheck_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var _ = Describe("Podman healthcheck run", func() {
})

It("podman healthcheck on valid container", func() {
Skip("Extremely consistent flake - reenable on debugging")
Skip("Extremely consistent flake - re-enable on debugging")
session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", healthcheck})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/mount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ var _ = Describe("Podman mount", func() {
Expect(lmount.OutputToString()).To(Equal(""))
})

It("podman list mulitple mounted containers", func() {
It("podman list multiple mounted containers", func() {
SkipIfRootless()

setup := podmanTest.Podman([]string{"create", ALPINE, "ls"})
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/run_signal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var _ = Describe("Podman run with --sig-proxy", func() {

Specify("signals are forwarded to container using sig-proxy", func() {
if podmanTest.Host.Arch == "ppc64le" {
Skip("Doesnt work on ppc64le")
Skip("Doesn't work on ppc64le")
}
signal := syscall.SIGFPE
// Set up a socket for communication
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/save_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var _ = Describe("Podman save", func() {
})

It("podman save with stdout", func() {
Skip("Pipe redirection in ginkgo probably wont work")
Skip("Pipe redirection in ginkgo probably won't work")
outfile := filepath.Join(podmanTest.TempDir, "alpine.tar")

save := podmanTest.PodmanNoCache([]string{"save", ALPINE, ">", outfile})
Expand Down
2 changes: 1 addition & 1 deletion test/endpoint/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var _ = Describe("Podman commit", func() {
// run the container to be committed
_ = endpointTest.startTopContainer("top")
result := endpointTest.Varlink("Commit", string(b), false)
// This indicates an error occured
// This indicates an error occurred
Expect(len(result.StdErrToString())).To(BeNumerically(">", 0))
})

Expand Down
2 changes: 1 addition & 1 deletion test/system/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ have been omitted as they are verified by repeated implied use.
- [ ] Container runlabel, exists, checkpoint, exists, restore, stop, prune

- Using pre-existing remote image, start it with 'podman container runlabel --pull'
- Run a named container that exits immediatly
- Run a named container that exits immediately
- Confirm 'container exists' zero exit (both containers)
- Checkpoint the running container
- Confirm 'container exists' non-zero exit (runlabel container)
Expand Down
4 changes: 2 additions & 2 deletions test/test_podman_pods.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ fi


########
# Create a named and unamed pod
# Create a named and unnamed pod
########
podman pod create --name foobar
podid=$(podman pod create)

########
# Delete a named and unamed pod
# Delete a named and unnamed pod
########
podman pod rm foobar
podman pod rm $podid
Expand Down
2 changes: 1 addition & 1 deletion test/utils/common_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ var _ = Describe("Common functions test", func() {
bytes, _ := ioutil.ReadAll(read)
json.Unmarshal(bytes, compareData)

Expect(reflect.DeepEqual(testData, compareData)).To(BeTrue(), "Data chaned after we store it to file.")
Expect(reflect.DeepEqual(testData, compareData)).To(BeTrue(), "Data changed after we store it to file.")
})

DescribeTable("Test Containerized",
Expand Down
2 changes: 1 addition & 1 deletion troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ or as root if your user has not enough privileges.

### 18) `podman run` fails with "bpf create: permission denied error"

The Kernel Lockdown patches deny eBPF programs when Secure Boot is enabled in the BIOS. [Matthew Garrett's post](https://mjg59.dreamwidth.org/50577.html) desribes the relationship between Lockdown and Secure Boot and [Jan-Philip Gehrcke's](https://gehrcke.de/2019/09/running-an-ebpf-program-may-require-lifting-the-kernel-lockdown/) connects this with eBPF. [RH bug 1768125](https://bugzilla.redhat.com/show_bug.cgi?id=1768125) contains some additional details.
The Kernel Lockdown patches deny eBPF programs when Secure Boot is enabled in the BIOS. [Matthew Garrett's post](https://mjg59.dreamwidth.org/50577.html) describes the relationship between Lockdown and Secure Boot and [Jan-Philip Gehrcke's](https://gehrcke.de/2019/09/running-an-ebpf-program-may-require-lifting-the-kernel-lockdown/) connects this with eBPF. [RH bug 1768125](https://bugzilla.redhat.com/show_bug.cgi?id=1768125) contains some additional details.

#### Symptom

Expand Down

0 comments on commit e83a1b8

Please sign in to comment.