Skip to content

Commit 260c9a2

Browse files
authored
Merge pull request #1667 from saschagrunert/typos
Check and fix typos in CI
2 parents bbfc4a7 + faf6789 commit 260c9a2

File tree

13 files changed

+57
-22
lines changed

13 files changed

+57
-22
lines changed

Diff for: .github/workflows/build.yml

+8
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,11 @@ jobs:
6868
go-version: ${{ env.GO_VERSION }}
6969
- name: Make release
7070
run: make release
71+
72+
typos:
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
76+
- uses: crate-ci/typos@d01f29c66d1bf1a08730750f61d86c210b0d039d # v1.27.0
77+
with:
78+
config: .typos.toml

Diff for: .typos.toml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[files]
2+
extend-exclude = [
3+
"go.mod",
4+
"vendor",
5+
]
6+
ignore-hidden = true
7+
ignore-files = true
8+
ignore-dot = true
9+
ignore-vcs = true
10+
ignore-global = true
11+
ignore-parent = true
12+
13+
[default]
14+
binary = false
15+
check-filename = true
16+
check-file = true
17+
unicode = true
18+
ignore-hex = true
19+
identifier-leading-digits = false
20+
locale = "en"
21+
extend-ignore-identifiers-re = []
22+
extend-ignore-re = [
23+
"InterruptableRPC", # Interrupt + able
24+
"stopp", # stop pod abbreviation
25+
"da86e6ba6ca19", # example container / pod
26+
"538721340ded1", # example container / pod
27+
]

Diff for: cmd/crictl/container.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ var createContainerCommand = &cli.Command{
214214
return cli.ShowSubcommandHelp(c)
215215
}
216216
if c.Bool("no-pull") && c.Bool("with-pull") {
217-
return errors.New("confict: no-pull and with-pull are both set")
217+
return errors.New("conflict: no-pull and with-pull are both set")
218218
}
219219

220220
withPull := (!c.Bool("no-pull") && PullImageOnCreate) || c.Bool("with-pull")
@@ -714,7 +714,7 @@ var runContainerCommand = &cli.Command{
714714
return cli.ShowSubcommandHelp(c)
715715
}
716716
if c.Bool("no-pull") && c.Bool("with-pull") {
717-
return errors.New("confict: no-pull and with-pull are both set")
717+
return errors.New("conflict: no-pull and with-pull are both set")
718718
}
719719

720720
withPull := (!DisablePullOnRun && !c.Bool("no-pull")) || c.Bool("with-pull")

Diff for: cmd/crictl/image.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ var imageFsInfoCommand = &cli.Command{
545545
}
546546

547547
if output == outputTypeTable {
548-
ouputImageFsInfoTable(r)
548+
outputImageFsInfoTable(r)
549549
} else {
550550
return outputStatusData([]statusData{{json: status}}, output, tmplStr)
551551
}
@@ -554,7 +554,7 @@ var imageFsInfoCommand = &cli.Command{
554554
},
555555
}
556556

557-
func ouputImageFsInfoTable(r *pb.ImageFsInfoResponse) {
557+
func outputImageFsInfoTable(r *pb.ImageFsInfoResponse) {
558558
tablePrintFileSystem := func(fileLabel string, filesystem []*pb.FilesystemUsage) {
559559
fmt.Printf("%s Filesystem \n", fileLabel)
560560
for i, val := range filesystem {

Diff for: cmd/crictl/portforward.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func PortForward(client internalapi.RuntimeService, opts portforwardOptions) err
106106

107107
readyChan := make(chan struct{})
108108

109-
logrus.Debugf("Ports to forword: %v", opts.ports)
109+
logrus.Debugf("Ports to forward: %v", opts.ports)
110110
pf, err := portforward.New(dialer, opts.ports, SetupInterruptSignalHandler(), readyChan, os.Stdout, os.Stderr)
111111
if err != nil {
112112
return err

Diff for: cmd/crictl/util_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func TestNameFilterByRegex(t *testing.T) {
5858
false,
5959
},
6060
{
61-
"reguar expression should match",
61+
"regular expression should match",
6262
"iner$",
6363
"i_am_a_container",
6464
true,

Diff for: hack/release-notes.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ curl -sSfL --retry 5 --retry-delay 10 -o $BINARY \
2525
https://storage.googleapis.com/k8s-artifacts-sig-release/kubernetes/release/$VERSION/release-notes-amd64-linux
2626
chmod +x $BINARY
2727

28-
PREVOUS_TAG=$(git tag | tail -2 | head -1)
28+
PREVIOUS_TAG=$(git tag | tail -2 | head -1)
2929
LATEST_TAG=$(git tag | tail -1)
3030

3131
$BINARY \
3232
--org kubernetes-sigs \
3333
--repo cri-tools \
3434
--required-author "" \
3535
--branch master \
36-
--start-rev "$PREVOUS_TAG" \
36+
--start-rev "$PREVIOUS_TAG" \
3737
--end-rev "$LATEST_TAG" \
3838
--output release-notes.md

Diff for: pkg/benchmark/util.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type LifecycleBenchmarkDatapoint struct {
4444
// The operation durations should be in the order they were executed in.
4545
// Note that the sum of OperationsDurationsNs need not be exactly equal to the duration
4646
// determined by subtracting StartTime from EndTime, as there may be additional steps
47-
// (e.g. timer setup) performed between the invidual operations.
47+
// (e.g. timer setup) performed between the individual operations.
4848
OperationsDurationsNs []int64 `json:"operationsDurationsNs"`
4949

5050
// String mapping for adding arbitrary meta-info for the lifecycle result:

Diff for: pkg/framework/test_context.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929

3030
var (
3131
testImagesFilePath string
32-
benchamrkSettingFilePath string
32+
benchmarkSettingFilePath string
3333
)
3434

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

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

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

185185
// Attempt to load benchmark settings file:
186-
if benchamrkSettingFilePath != "" {
187-
err := LoadYamlFile(benchamrkSettingFilePath, &TestContext.BenchmarkingParams)
186+
if benchmarkSettingFilePath != "" {
187+
err := LoadYamlFile(benchmarkSettingFilePath, &TestContext.BenchmarkingParams)
188188
if err != nil {
189189
return err
190190
}

Diff for: pkg/validate/apparmor_linux.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ var _ = framework.KubeDescribe("AppArmor", func() {
8383
Expect(loadTestProfiles()).NotTo(HaveOccurred())
8484
})
8585

86-
Context("runtime should support depracated apparmor_profile field", func() {
86+
Context("runtime should support deprecated apparmor_profile field", func() {
8787
var sandboxID string
8888
var sandboxConfig *runtimeapi.PodSandboxConfig
8989

@@ -114,7 +114,7 @@ var _ = framework.KubeDescribe("AppArmor", func() {
114114
checkContainerApparmor(rc, containerID, false)
115115
})
116116

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

163-
It("should enforce a permissive depracated profile", func() {
163+
It("should enforce a permissive deprecated profile", func() {
164164
profile := &runtimeapi.LinuxContainerSecurityContext{
165165
Apparmor: &runtimeapi.SecurityProfile{
166166
ProfileType: runtimeapi.SecurityProfile_Localhost,
@@ -255,12 +255,12 @@ func createContainerWithAppArmor(rc internalapi.RuntimeService, ic internalapi.I
255255
return containerID
256256
}
257257

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

263-
if shoudRun {
263+
if shouldRun {
264264
Expect(resp.GetStatus().GetExitCode()).To(Equal(int32(0)))
265265
} else {
266266
Expect(resp.GetStatus().GetExitCode()).NotTo(Equal(int32(0)))

Diff for: pkg/validate/idempotence.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ var _ = framework.KubeDescribe("Idempotence", func() {
109109
// https://github.com/kubernetes/cri-api/blob/c20fa40/pkg/apis/runtime/v1/api.proto#L74-L75
110110
Context("RemoveContainer", func() {
111111
It("should not return an error if not found", func() {
112-
By("remove not existing comtainer")
112+
By("remove not existing container")
113113
Expect(rc.RemoveContainer(c, uuid.New().String())).NotTo(HaveOccurred())
114114
})
115115
})

Diff for: pkg/validate/security_context_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ var _ = framework.KubeDescribe("Security Context", func() {
972972
statusOnce.Do(func() {
973973
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
974974
defer cancel()
975-
// Set verbose to true, other BeforeEachs calls need the info field
975+
// Set verbose to true, other BeforeEach calls need the info field
976976
// populated.
977977
// XXX: Do NOT use ":=" here, it breaks the closure reference to
978978
// statusResp.

Diff for: pkg/validate/selinux_linux.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,12 @@ func createContainerWithSelinux(rc internalapi.RuntimeService, ic internalapi.Im
195195
return containerID
196196
}
197197

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

203-
if shoudRun {
203+
if shouldRun {
204204
Expect(status.GetStatus().GetExitCode()).To(Equal(int32(0)))
205205
} else {
206206
Expect(status.GetStatus().GetExitCode()).NotTo(Equal(int32(0)))

0 commit comments

Comments
 (0)