Skip to content

Commit

Permalink
Merge pull request containers#15511 from rhatdan/codespell
Browse files Browse the repository at this point in the history
Fix stutters
  • Loading branch information
openshift-merge-robot authored Sep 12, 2022
2 parents 3b9e31c + 2c63b84 commit 5abc08d
Show file tree
Hide file tree
Showing 116 changed files with 580 additions and 579 deletions.
12 changes: 6 additions & 6 deletions cmd/podman/containers/cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func copyContainerToContainer(sourceContainer string, sourcePath string, destCon
return err
}
if err := copyFunc(); err != nil {
return fmt.Errorf("error copying from container: %w", err)
return fmt.Errorf("copying from container: %w", err)
}
return nil
}
Expand All @@ -192,7 +192,7 @@ func copyContainerToContainer(sourceContainer string, sourcePath string, destCon
return err
}
if err := copyFunc(); err != nil {
return fmt.Errorf("error copying to container: %w", err)
return fmt.Errorf("copying to container: %w", err)
}
return nil
}
Expand Down Expand Up @@ -315,7 +315,7 @@ func copyFromContainer(container string, containerPath string, hostPath string)
dir = filepath.Dir(dir)
}
if err := buildahCopiah.Put(dir, "", putOptions, reader); err != nil {
return fmt.Errorf("error copying to host: %w", err)
return fmt.Errorf("copying to host: %w", err)
}
return nil
}
Expand All @@ -327,7 +327,7 @@ func copyFromContainer(container string, containerPath string, hostPath string)
return err
}
if err := copyFunc(); err != nil {
return fmt.Errorf("error copying from container: %w", err)
return fmt.Errorf("copying from container: %w", err)
}
return nil
}
Expand Down Expand Up @@ -424,7 +424,7 @@ func copyToContainer(container string, containerPath string, hostPath string) er
getOptions.Rename = map[string]string{filepath.Base(hostTarget): containerBaseName}
}
if err := buildahCopiah.Get("/", "", getOptions, []string{hostTarget}, writer); err != nil {
return fmt.Errorf("error copying from host: %w", err)
return fmt.Errorf("copying from host: %w", err)
}
return nil
}
Expand All @@ -441,7 +441,7 @@ func copyToContainer(container string, containerPath string, hostPath string) er
return err
}
if err := copyFunc(); err != nil {
return fmt.Errorf("error copying to container: %w", err)
return fmt.Errorf("copying to container: %w", err)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/containers/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func exec(_ *cobra.Command, args []string) error {

cliEnv, err := envLib.ParseSlice(envInput)
if err != nil {
return fmt.Errorf("error parsing environment variables: %w", err)
return fmt.Errorf("parsing environment variables: %w", err)
}

execOpts.Envs = envLib.Join(execOpts.Envs, cliEnv)
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/containers/kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func kill(_ *cobra.Command, args []string) error {
for _, cidFile := range killCidFiles {
content, err := ioutil.ReadFile(cidFile)
if err != nil {
return fmt.Errorf("error reading CIDFile: %w", err)
return fmt.Errorf("reading CIDFile: %w", err)
}
id := strings.Split(string(content), "\n")[0]
args = append(args, id)
Expand Down
4 changes: 2 additions & 2 deletions cmd/podman/containers/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ func logs(_ *cobra.Command, args []string) error {
// parse time, error out if something is wrong
since, err := util.ParseInputTime(logsOptions.SinceRaw, true)
if err != nil {
return fmt.Errorf("error parsing --since %q: %w", logsOptions.SinceRaw, err)
return fmt.Errorf("parsing --since %q: %w", logsOptions.SinceRaw, err)
}
logsOptions.Since = since
}
if logsOptions.UntilRaw != "" {
// parse time, error out if something is wrong
until, err := util.ParseInputTime(logsOptions.UntilRaw, false)
if err != nil {
return fmt.Errorf("error parsing --until %q: %w", logsOptions.UntilRaw, err)
return fmt.Errorf("parsing --until %q: %w", logsOptions.UntilRaw, err)
}
logsOptions.Until = until
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/containers/pause.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func pause(cmd *cobra.Command, args []string) error {
for _, cidFile := range pauseCidFiles {
content, err := ioutil.ReadFile(cidFile)
if err != nil {
return fmt.Errorf("error reading CIDFile: %w", err)
return fmt.Errorf("reading CIDFile: %w", err)
}
id := strings.Split(string(content), "\n")[0]
args = append(args, id)
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/containers/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func restart(cmd *cobra.Command, args []string) error {
for _, cidFile := range restartCidFiles {
content, err := ioutil.ReadFile(cidFile)
if err != nil {
return fmt.Errorf("error reading CIDFile: %w", err)
return fmt.Errorf("reading CIDFile: %w", err)
}
id := strings.Split(string(content), "\n")[0]
args = append(args, id)
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/containers/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func rm(cmd *cobra.Command, args []string) error {
for _, cidFile := range rmCidFiles {
content, err := ioutil.ReadFile(cidFile)
if err != nil {
return fmt.Errorf("error reading CIDFile: %w", err)
return fmt.Errorf("reading CIDFile: %w", err)
}
id := strings.Split(string(content), "\n")[0]
args = append(args, id)
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/containers/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func stop(cmd *cobra.Command, args []string) error {
for _, cidFile := range stopCidFiles {
content, err := ioutil.ReadFile(cidFile)
if err != nil {
return fmt.Errorf("error reading CIDFile: %w", err)
return fmt.Errorf("reading CIDFile: %w", err)
}
id := strings.Split(string(content), "\n")[0]
args = append(args, id)
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/containers/unpause.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func unpause(cmd *cobra.Command, args []string) error {
for _, cidFile := range unpauseCidFiles {
content, err := ioutil.ReadFile(cidFile)
if err != nil {
return fmt.Errorf("error reading CIDFile: %w", err)
return fmt.Errorf("reading CIDFile: %w", err)
}
id := strings.Split(string(content), "\n")[0]
args = append(args, id)
Expand Down
4 changes: 2 additions & 2 deletions cmd/podman/early_init_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ func setRLimits() error {
rlimits.Max = define.RLimitDefaultValue
if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, rlimits); err != nil {
if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, rlimits); err != nil {
return fmt.Errorf("error getting rlimits: %w", err)
return fmt.Errorf("getting rlimits: %w", err)
}
rlimits.Cur = rlimits.Max
if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, rlimits); err != nil {
return fmt.Errorf("error setting new rlimits: %w", err)
return fmt.Errorf("setting new rlimits: %w", err)
}
}
return nil
Expand Down
4 changes: 2 additions & 2 deletions cmd/podman/generate/systemd.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func systemd(cmd *cobra.Command, args []string) error {
if cmd.Flags().Changed(envFlagName) {
cliEnv, err := envLib.ParseSlice(envInput)
if err != nil {
return fmt.Errorf("error parsing environment variables: %w", err)
return fmt.Errorf("parsing environment variables: %w", err)
}
systemdOptions.AdditionalEnvVariables = envLib.Slice(cliEnv)
}
Expand All @@ -169,7 +169,7 @@ func systemd(cmd *cobra.Command, args []string) error {
if files {
cwd, err := os.Getwd()
if err != nil {
return fmt.Errorf("error getting current working directory: %w", err)
return fmt.Errorf("getting current working directory: %w", err)
}
for name, content := range reports.Units {
path := filepath.Join(cwd, fmt.Sprintf("%s.service", name))
Expand Down
6 changes: 3 additions & 3 deletions cmd/podman/images/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func build(cmd *cobra.Command, args []string) error {
// The context directory could be a URL. Try to handle that.
tempDir, subDir, err := buildahDefine.TempDirForURL("", "buildah", args[0])
if err != nil {
return fmt.Errorf("error prepping temporary context directory: %w", err)
return fmt.Errorf("prepping temporary context directory: %w", err)
}
if tempDir != "" {
// We had to download it to a temporary directory.
Expand All @@ -237,7 +237,7 @@ func build(cmd *cobra.Command, args []string) error {
// Nope, it was local. Use it as is.
absDir, err := filepath.Abs(args[0])
if err != nil {
return fmt.Errorf("error determining path to directory %q: %w", args[0], err)
return fmt.Errorf("determining path to directory %q: %w", args[0], err)
}
contextDir = absDir
}
Expand All @@ -253,7 +253,7 @@ func build(cmd *cobra.Command, args []string) error {
}
absFile, err := filepath.Abs(containerFiles[i])
if err != nil {
return fmt.Errorf("error determining path to file %q: %w", containerFiles[i], err)
return fmt.Errorf("determining path to file %q: %w", containerFiles[i], err)
}
contextDir = filepath.Dir(absFile)
containerFiles[i] = absFile
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/images/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func sortImages(imageS []*entities.ImageSummary) ([]imageReporter, error) {
h.ImageSummary = *e
h.Repository, h.Tag, err = tokenRepoTag(tag)
if err != nil {
return nil, fmt.Errorf("error parsing repository tag: %q: %w", tag, err)
return nil, fmt.Errorf("parsing repository tag: %q: %w", tag, err)
}
if h.Tag == "<none>" {
untagged = append(untagged, h)
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/images/utils_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func setupPipe() (string, func() <-chan error, error) {
if e := os.RemoveAll(pipeDir); e != nil {
logrus.Errorf("Removing named pipe: %q", e)
}
return "", nil, fmt.Errorf("error creating named pipe: %w", err)
return "", nil, fmt.Errorf("creating named pipe: %w", err)
}
go func() {
fpipe, err := os.Open(pipePath)
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/machine/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func info(cmd *cobra.Command, args []string) error {
info := entities.MachineInfo{}
version, err := define.GetVersion()
if err != nil {
return fmt.Errorf("error getting version info %w", err)
return fmt.Errorf("getting version info %w", err)
}
info.Version = version

Expand Down
4 changes: 2 additions & 2 deletions cmd/podman/pods/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ func logs(_ *cobra.Command, args []string) error {
// parse time, error out if something is wrong
since, err := util.ParseInputTime(logsPodOptions.SinceRaw, true)
if err != nil {
return fmt.Errorf("error parsing --since %q: %w", logsPodOptions.SinceRaw, err)
return fmt.Errorf("parsing --since %q: %w", logsPodOptions.SinceRaw, err)
}
logsPodOptions.Since = since
}
if logsPodOptions.UntilRaw != "" {
// parse time, error out if something is wrong
until, err := util.ParseInputTime(logsPodOptions.UntilRaw, false)
if err != nil {
return fmt.Errorf("error parsing --until %q: %w", logsPodOptions.UntilRaw, err)
return fmt.Errorf("parsing --until %q: %w", logsPodOptions.UntilRaw, err)
}
logsPodOptions.Until = until
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/system/dial_stdio.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func copier(to halfWriteCloser, from halfReadCloser, debugDescription string) er
}
}()
if _, err := io.Copy(to, from); err != nil {
return fmt.Errorf("error while Copy (%s): %w", debugDescription, err)
return fmt.Errorf("while Copy (%s): %w", debugDescription, err)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/image_signing.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Then a pull is not possible any more:
```bash
sudo podman pull --tls-verify=false localhost:5000/alpine
Trying to pull localhost:5000/alpine...
Error: error pulling image "localhost:5000/alpine": unable to pull localhost:5000/alpine: unable to pull image: Source image rejected: Invalid GPG signature: …
Error: pulling image "localhost:5000/alpine": unable to pull localhost:5000/alpine: unable to pull image: Source image rejected: Invalid GPG signature: …
```

So in general there are four main things to be taken into consideration when
Expand Down
4 changes: 2 additions & 2 deletions hack/podman-registry-go/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func StartWithOptions(options *Options) (*Registry, error) {
// Start a registry.
out, err := utils.ExecCmd(binary, args...)
if err != nil {
return nil, fmt.Errorf("error running %q: %s: %w", binary, out, err)
return nil, fmt.Errorf("running %q: %s: %w", binary, out, err)
}

// Parse the output.
Expand Down Expand Up @@ -112,7 +112,7 @@ func (r *Registry) Stop() error {
return nil
}
if _, err := utils.ExecCmd(binary, "-P", r.Port, "stop"); err != nil {
return fmt.Errorf("error stopping registry (%v) with %q: %w", *r, binary, err)
return fmt.Errorf("stopping registry (%v) with %q: %w", *r, binary, err)
}
r.running = false
return nil
Expand Down
Loading

0 comments on commit 5abc08d

Please sign in to comment.