diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 547f8d68a4..a0815fd1fc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000000..36ae97ea2a --- /dev/null +++ b/.typos.toml @@ -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 +] diff --git a/cmd/crictl/container.go b/cmd/crictl/container.go index bcc1f2e780..e957a0d818 100644 --- a/cmd/crictl/container.go +++ b/cmd/crictl/container.go @@ -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") @@ -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") diff --git a/cmd/crictl/image.go b/cmd/crictl/image.go index 24ab90ee68..faea7c85e4 100644 --- a/cmd/crictl/image.go +++ b/cmd/crictl/image.go @@ -545,7 +545,7 @@ var imageFsInfoCommand = &cli.Command{ } if output == outputTypeTable { - ouputImageFsInfoTable(r) + outputImageFsInfoTable(r) } else { return outputStatusData([]statusData{{json: status}}, output, tmplStr) } @@ -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 { diff --git a/cmd/crictl/portforward.go b/cmd/crictl/portforward.go index e7e09d6dbb..e3c5236b5c 100644 --- a/cmd/crictl/portforward.go +++ b/cmd/crictl/portforward.go @@ -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 diff --git a/cmd/crictl/util_test.go b/cmd/crictl/util_test.go index b771d0479f..556fb95c3b 100644 --- a/cmd/crictl/util_test.go +++ b/cmd/crictl/util_test.go @@ -58,7 +58,7 @@ func TestNameFilterByRegex(t *testing.T) { false, }, { - "reguar expression should match", + "regular expression should match", "iner$", "i_am_a_container", true, diff --git a/hack/release-notes.sh b/hack/release-notes.sh index 56972c7fff..b1257321e5 100755 --- a/hack/release-notes.sh +++ b/hack/release-notes.sh @@ -25,7 +25,7 @@ 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 \ @@ -33,6 +33,6 @@ $BINARY \ --repo cri-tools \ --required-author "" \ --branch master \ - --start-rev "$PREVOUS_TAG" \ + --start-rev "$PREVIOUS_TAG" \ --end-rev "$LATEST_TAG" \ --output release-notes.md diff --git a/pkg/benchmark/util.go b/pkg/benchmark/util.go index 0a05177486..3121104288 100644 --- a/pkg/benchmark/util.go +++ b/pkg/benchmark/util.go @@ -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: diff --git a/pkg/framework/test_context.go b/pkg/framework/test_context.go index 3190ffa032..339c0a4253 100644 --- a/pkg/framework/test_context.go +++ b/pkg/framework/test_context.go @@ -29,7 +29,7 @@ import ( var ( testImagesFilePath string - benchamrkSettingFilePath string + benchmarkSettingFilePath string ) // TestImageList aggregates references to the images used in tests. @@ -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 { @@ -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 } diff --git a/pkg/validate/apparmor_linux.go b/pkg/validate/apparmor_linux.go index 6f73600a6d..ad7436ae05 100644 --- a/pkg/validate/apparmor_linux.go +++ b/pkg/validate/apparmor_linux.go @@ -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 @@ -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", } @@ -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, @@ -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))) diff --git a/pkg/validate/idempotence.go b/pkg/validate/idempotence.go index 586ea11515..530e2ff4bc 100644 --- a/pkg/validate/idempotence.go +++ b/pkg/validate/idempotence.go @@ -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()) }) }) diff --git a/pkg/validate/security_context_linux.go b/pkg/validate/security_context_linux.go index defee3468c..14ecbb5dd0 100644 --- a/pkg/validate/security_context_linux.go +++ b/pkg/validate/security_context_linux.go @@ -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. diff --git a/pkg/validate/selinux_linux.go b/pkg/validate/selinux_linux.go index 0583275719..ad32bd528d 100644 --- a/pkg/validate/selinux_linux.go +++ b/pkg/validate/selinux_linux.go @@ -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)))