Skip to content

Commit

Permalink
Merge pull request #1667 from saschagrunert/typos
Browse files Browse the repository at this point in the history
Check and fix typos in CI
  • Loading branch information
k8s-ci-robot authored Nov 4, 2024
2 parents bbfc4a7 + faf6789 commit 260c9a2
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 22 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,11 @@ jobs:
go-version: ${{ env.GO_VERSION }}
- name: Make release
run: make release

typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: crate-ci/typos@d01f29c66d1bf1a08730750f61d86c210b0d039d # v1.27.0
with:
config: .typos.toml
27 changes: 27 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[files]
extend-exclude = [
"go.mod",
"vendor",
]
ignore-hidden = true
ignore-files = true
ignore-dot = true
ignore-vcs = true
ignore-global = true
ignore-parent = true

[default]
binary = false
check-filename = true
check-file = true
unicode = true
ignore-hex = true
identifier-leading-digits = false
locale = "en"
extend-ignore-identifiers-re = []
extend-ignore-re = [
"InterruptableRPC", # Interrupt + able
"stopp", # stop pod abbreviation
"da86e6ba6ca19", # example container / pod
"538721340ded1", # example container / pod
]
4 changes: 2 additions & 2 deletions cmd/crictl/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ var createContainerCommand = &cli.Command{
return cli.ShowSubcommandHelp(c)
}
if c.Bool("no-pull") && c.Bool("with-pull") {
return errors.New("confict: no-pull and with-pull are both set")
return errors.New("conflict: no-pull and with-pull are both set")
}

withPull := (!c.Bool("no-pull") && PullImageOnCreate) || c.Bool("with-pull")
Expand Down Expand Up @@ -714,7 +714,7 @@ var runContainerCommand = &cli.Command{
return cli.ShowSubcommandHelp(c)
}
if c.Bool("no-pull") && c.Bool("with-pull") {
return errors.New("confict: no-pull and with-pull are both set")
return errors.New("conflict: no-pull and with-pull are both set")
}

withPull := (!DisablePullOnRun && !c.Bool("no-pull")) || c.Bool("with-pull")
Expand Down
4 changes: 2 additions & 2 deletions cmd/crictl/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ var imageFsInfoCommand = &cli.Command{
}

if output == outputTypeTable {
ouputImageFsInfoTable(r)
outputImageFsInfoTable(r)
} else {
return outputStatusData([]statusData{{json: status}}, output, tmplStr)
}
Expand All @@ -554,7 +554,7 @@ var imageFsInfoCommand = &cli.Command{
},
}

func ouputImageFsInfoTable(r *pb.ImageFsInfoResponse) {
func outputImageFsInfoTable(r *pb.ImageFsInfoResponse) {
tablePrintFileSystem := func(fileLabel string, filesystem []*pb.FilesystemUsage) {
fmt.Printf("%s Filesystem \n", fileLabel)
for i, val := range filesystem {
Expand Down
2 changes: 1 addition & 1 deletion cmd/crictl/portforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func PortForward(client internalapi.RuntimeService, opts portforwardOptions) err

readyChan := make(chan struct{})

logrus.Debugf("Ports to forword: %v", opts.ports)
logrus.Debugf("Ports to forward: %v", opts.ports)
pf, err := portforward.New(dialer, opts.ports, SetupInterruptSignalHandler(), readyChan, os.Stdout, os.Stderr)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/crictl/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestNameFilterByRegex(t *testing.T) {
false,
},
{
"reguar expression should match",
"regular expression should match",
"iner$",
"i_am_a_container",
true,
Expand Down
4 changes: 2 additions & 2 deletions hack/release-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ curl -sSfL --retry 5 --retry-delay 10 -o $BINARY \
https://storage.googleapis.com/k8s-artifacts-sig-release/kubernetes/release/$VERSION/release-notes-amd64-linux
chmod +x $BINARY

PREVOUS_TAG=$(git tag | tail -2 | head -1)
PREVIOUS_TAG=$(git tag | tail -2 | head -1)
LATEST_TAG=$(git tag | tail -1)

$BINARY \
--org kubernetes-sigs \
--repo cri-tools \
--required-author "" \
--branch master \
--start-rev "$PREVOUS_TAG" \
--start-rev "$PREVIOUS_TAG" \
--end-rev "$LATEST_TAG" \
--output release-notes.md
2 changes: 1 addition & 1 deletion pkg/benchmark/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type LifecycleBenchmarkDatapoint struct {
// The operation durations should be in the order they were executed in.
// Note that the sum of OperationsDurationsNs need not be exactly equal to the duration
// determined by subtracting StartTime from EndTime, as there may be additional steps
// (e.g. timer setup) performed between the invidual operations.
// (e.g. timer setup) performed between the individual operations.
OperationsDurationsNs []int64 `json:"operationsDurationsNs"`

// String mapping for adding arbitrary meta-info for the lifecycle result:
Expand Down
8 changes: 4 additions & 4 deletions pkg/framework/test_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

var (
testImagesFilePath string
benchamrkSettingFilePath string
benchmarkSettingFilePath string
)

// TestImageList aggregates references to the images used in tests.
Expand Down Expand Up @@ -160,7 +160,7 @@ func RegisterFlags() {
flag.DurationVar(&TestContext.RuntimeServiceTimeout, "runtime-service-timeout", 300*time.Second, "Timeout when trying to connect to a runtime service.")
flag.StringVar(&TestContext.RuntimeHandler, "runtime-handler", "", "Runtime handler to use in the test.")

flag.StringVar(&benchamrkSettingFilePath, "benchmarking-params-file", "", "Optional path to a YAML file specifying benchmarking configuration options.")
flag.StringVar(&benchmarkSettingFilePath, "benchmarking-params-file", "", "Optional path to a YAML file specifying benchmarking configuration options.")
flag.StringVar(&TestContext.BenchmarkingOutputDir, "benchmarking-output-dir", "", "Optional path to a directory in which benchmarking data should be placed.")

if runtime.GOOS == OSWindows {
Expand All @@ -183,8 +183,8 @@ func (tc *TestContextType) LoadYamlConfigFiles() error {
Logf("Testing context container image list: %+v", TestContext.TestImageList)

// Attempt to load benchmark settings file:
if benchamrkSettingFilePath != "" {
err := LoadYamlFile(benchamrkSettingFilePath, &TestContext.BenchmarkingParams)
if benchmarkSettingFilePath != "" {
err := LoadYamlFile(benchmarkSettingFilePath, &TestContext.BenchmarkingParams)
if err != nil {
return err
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/validate/apparmor_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ var _ = framework.KubeDescribe("AppArmor", func() {
Expect(loadTestProfiles()).NotTo(HaveOccurred())
})

Context("runtime should support depracated apparmor_profile field", func() {
Context("runtime should support deprecated apparmor_profile field", func() {
var sandboxID string
var sandboxConfig *runtimeapi.PodSandboxConfig

Expand Down Expand Up @@ -114,7 +114,7 @@ var _ = framework.KubeDescribe("AppArmor", func() {
checkContainerApparmor(rc, containerID, false)
})

It("should enforce a permissive depracated profile", func() {
It("should enforce a permissive deprecated profile", func() {
profile := &runtimeapi.LinuxContainerSecurityContext{
ApparmorProfile: apparmorProfileNamePrefix + "cri-validate-apparmor-test-audit-write",
}
Expand Down Expand Up @@ -160,7 +160,7 @@ var _ = framework.KubeDescribe("AppArmor", func() {
checkContainerApparmor(rc, containerID, false)
})

It("should enforce a permissive depracated profile", func() {
It("should enforce a permissive deprecated profile", func() {
profile := &runtimeapi.LinuxContainerSecurityContext{
Apparmor: &runtimeapi.SecurityProfile{
ProfileType: runtimeapi.SecurityProfile_Localhost,
Expand Down Expand Up @@ -255,12 +255,12 @@ func createContainerWithAppArmor(rc internalapi.RuntimeService, ic internalapi.I
return containerID
}

func checkContainerApparmor(rc internalapi.RuntimeService, containerID string, shoudRun bool) {
func checkContainerApparmor(rc internalapi.RuntimeService, containerID string, shouldRun bool) {
By("get container status")
resp, err := rc.ContainerStatus(context.TODO(), containerID, false)
Expect(err).NotTo(HaveOccurred())

if shoudRun {
if shouldRun {
Expect(resp.GetStatus().GetExitCode()).To(Equal(int32(0)))
} else {
Expect(resp.GetStatus().GetExitCode()).NotTo(Equal(int32(0)))
Expand Down
2 changes: 1 addition & 1 deletion pkg/validate/idempotence.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ var _ = framework.KubeDescribe("Idempotence", func() {
// https://github.com/kubernetes/cri-api/blob/c20fa40/pkg/apis/runtime/v1/api.proto#L74-L75
Context("RemoveContainer", func() {
It("should not return an error if not found", func() {
By("remove not existing comtainer")
By("remove not existing container")
Expect(rc.RemoveContainer(c, uuid.New().String())).NotTo(HaveOccurred())
})
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/validate/security_context_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ var _ = framework.KubeDescribe("Security Context", func() {
statusOnce.Do(func() {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
// Set verbose to true, other BeforeEachs calls need the info field
// Set verbose to true, other BeforeEach calls need the info field
// populated.
// XXX: Do NOT use ":=" here, it breaks the closure reference to
// statusResp.
Expand Down
4 changes: 2 additions & 2 deletions pkg/validate/selinux_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ func createContainerWithSelinux(rc internalapi.RuntimeService, ic internalapi.Im
return containerID
}

func checkContainerSelinux(rc internalapi.RuntimeService, containerID string, shoudRun bool) {
func checkContainerSelinux(rc internalapi.RuntimeService, containerID string, shouldRun bool) {
By("get container status")
status, err := rc.ContainerStatus(context.TODO(), containerID, false)
Expect(err).NotTo(HaveOccurred())

if shoudRun {
if shouldRun {
Expect(status.GetStatus().GetExitCode()).To(Equal(int32(0)))
} else {
Expect(status.GetStatus().GetExitCode()).NotTo(Equal(int32(0)))
Expand Down

0 comments on commit 260c9a2

Please sign in to comment.