Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v6
with:
go-version: v1.23
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v5
- name: Lint
run: |
docker run --rm -v `pwd`:/go/src/k8s.io/klog -w /go/src/k8s.io/klog \
golangci/golangci-lint:v1.51.2 golangci-lint run --disable-all -v \
-E govet -E misspell -E gofmt -E ineffassign -E golint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60.1
args: --disable-all -v -E govet -E misspell -E gofmt -E ineffassign
apidiff:
runs-on: ubuntu-latest
if: github.base_ref
Expand Down
16 changes: 16 additions & 0 deletions exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package exec

import (
"context"
"errors"
"io"
"io/fs"
osexec "os/exec"
Expand Down Expand Up @@ -97,6 +98,21 @@ func New() Interface {
return &executor{}
}

// maskErrDotCmd reverts the behavior of osexec.Cmd to what it was before go1.19
// specifically set the Err field to nil (LookPath returns a new error when the file
// is resolved to the current directory.
func maskErrDotCmd(cmd *osexec.Cmd) *osexec.Cmd {
cmd.Err = maskErrDot(cmd.Err)
return cmd
}

func maskErrDot(err error) error {
if err != nil && errors.Is(err, osexec.ErrDot) {
return nil
}
return err
}

// Command is part of the Interface interface.
func (executor *executor) Command(cmd string, args ...string) Cmd {
return (*cmdWrapper)(maskErrDotCmd(osexec.Command(cmd, args...)))
Expand Down
32 changes: 0 additions & 32 deletions exec/fixup_go118.go

This file was deleted.

40 changes: 0 additions & 40 deletions exec/fixup_go119.go

This file was deleted.

4 changes: 2 additions & 2 deletions mount/mount_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ func (mounter *SafeFormatAndMount) formatAndMountSensitive(source string, target
sensitiveOptionsLog := sanitizedOptionsForLogging(options, sensitiveOptions)
detailedErr := fmt.Sprintf("format of disk %q failed: type:(%q) target:(%q) options:(%q) errcode:(%v) output:(%v) ", source, fstype, target, sensitiveOptionsLog, err, string(output))
klog.Error(detailedErr)
return NewMountError(FormatFailed, detailedErr)
return NewMountError(FormatFailed, "%s", detailedErr)
}

klog.Infof("Disk successfully formatted (mkfs): %s - %s %s", fstype, source, target)
Expand All @@ -394,7 +394,7 @@ func (mounter *SafeFormatAndMount) formatAndMountSensitive(source string, target
// Mount the disk
klog.V(4).Infof("Attempting to mount disk %s in %s format at %s", source, fstype, target)
if err := mounter.MountSensitive(source, target, fstype, options, sensitiveOptions); err != nil {
return NewMountError(mountErrorValue, err.Error())
return NewMountError(mountErrorValue, "%s", err.Error())
}

return nil
Expand Down
8 changes: 8 additions & 0 deletions set/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ func New[E ordered](items ...E) Set[E] {
return ss
}

// Clear empties the set.
// It is preferable to replace the set with a newly constructed set,
// but not all callers can do that (when there are other references to the map).
func (s Set[T]) Clear() Set[T] {
clear(s)
return s
}

// KeySet creates a Set[E] from a keys of a map[E](? extends interface{}).
func KeySet[E ordered, A any](theMap map[E]A) Set[E] {
ret := Set[E]{}
Expand Down
33 changes: 0 additions & 33 deletions set/set_go_1.20.go

This file was deleted.

27 changes: 0 additions & 27 deletions set/set_go_1.21.go

This file was deleted.

Loading