Skip to content

Commit 311e661

Browse files
all: fix typos discovered by codespell (zalando#2392)
``` codespell --skip .git --skip ./site --skip ./cmd | less ``` See https://github.com/codespell-project/codespell Signed-off-by: Alexander Yastrebov <[email protected]>
1 parent 47eef54 commit 311e661

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+81
-81
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ fuzz: ## run all fuzz tests
140140
lint: build staticcheck ## run all linters
141141

142142
.PHONY: clean
143-
clean: ## clean temorary files and driectories
143+
clean: ## clean temporary files and directories
144144
go clean -i -cache -testcache
145145
rm -rf .coverprofile-all .cover
146146
rm -f ./_test_plugins/*.so

config/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ func NewConfig() *Config {
367367
flag.BoolVar(&cfg.ServeRouteCounter, "serve-route-counter", false, "enables reporting counting metrics for each route. Has the route, HTTP method and status code as labels. Currently just implemented for the Prometheus metrics flavour")
368368
flag.BoolVar(&cfg.ServeHostMetrics, "serve-host-metrics", false, "enables reporting total serve time metrics for each host")
369369
flag.BoolVar(&cfg.ServeHostCounter, "serve-host-counter", false, "enables reporting counting metrics for each host. Has the route, HTTP method and status code as labels. Currently just implemented for the Prometheus metrics flavour")
370-
flag.BoolVar(&cfg.ServeMethodMetric, "serve-method-metric", true, "enables the HTTP method as a domain of the total serve time metric. It affects both route and host splitted metrics")
371-
flag.BoolVar(&cfg.ServeStatusCodeMetric, "serve-status-code-metric", true, "enables the HTTP response status code as a domain of the total serve time metric. It affects both route and host splitted metrics")
370+
flag.BoolVar(&cfg.ServeMethodMetric, "serve-method-metric", true, "enables the HTTP method as a domain of the total serve time metric. It affects both route and host split metrics")
371+
flag.BoolVar(&cfg.ServeStatusCodeMetric, "serve-status-code-metric", true, "enables the HTTP response status code as a domain of the total serve time metric. It affects both route and host split metrics")
372372
flag.BoolVar(&cfg.BackendHostMetrics, "backend-host-metrics", false, "enables reporting total serve time metrics for each backend")
373373
flag.BoolVar(&cfg.AllFiltersMetrics, "all-filters-metrics", false, "enables reporting combined filter metrics for each route")
374374
flag.BoolVar(&cfg.CombinedResponseMetrics, "combined-response-metrics", false, "enables reporting combined response time metrics")

config/defaultfilterflags_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ func Test_defaultFiltersFlags_Set(t *testing.T) {
7373
}
7474
if !tt.wantErr {
7575
if len(tt.want) != len(dpf.filters) {
76-
t.Errorf("defaultFiltersFlags size missmatch got %d want %d", len(dpf.filters), len(tt.want))
76+
t.Errorf("defaultFiltersFlags size mismatch got %d want %d", len(dpf.filters), len(tt.want))
7777
}
7878

7979
if err := yaml.Unmarshal([]byte(tt.args), dpf); err != nil {
8080
t.Errorf("defaultFiltersFlags.UnmarshalYAML() error = %v, wantErr %v", err, tt.wantErr)
8181
}
8282

8383
if len(tt.want) != len(dpf.filters) {
84-
t.Errorf("defaultFiltersFlags from yaml size missmatch got %d want %d", len(dpf.filters), len(tt.want))
84+
t.Errorf("defaultFiltersFlags from yaml size mismatch got %d want %d", len(dpf.filters), len(tt.want))
8585
}
8686
}
8787
})

config/listflag_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func TestListFlag(t *testing.T) {
109109
})
110110

111111
t.Run("unmarshal error", func(t *testing.T) {
112-
const input = "invlaid yaml"
112+
const input = "invalid yaml"
113113
current := commaListFlag()
114114
if err := yaml.Unmarshal([]byte(input), current); err == nil {
115115
t.Errorf("Failed to get error from Unmarshal() for invalid input: %q", input)

dataclients/kubernetes/kube.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ type Options struct {
202202
BackendNameTracingTag bool
203203

204204
// OnlyAllowedExternalNames will enable validation of ingress external names and route groups network
205-
// backend addresses, explicit LB endpoints validation agains the list of patterns in
205+
// backend addresses, explicit LB endpoints validation against the list of patterns in
206206
// AllowedExternalNames.
207207
OnlyAllowedExternalNames bool
208208

dataclients/kubernetes/kube_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ func TestIngress(t *testing.T) {
713713

714714
r, d, err := dc.LoadUpdate()
715715
if err != nil || len(d) != 0 {
716-
t.Error("udpate failed")
716+
t.Error("update failed")
717717
}
718718

719719
checkRoutes(t, r, map[string]string{

dataclients/kubernetes/routegroup.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ func transformExplicitGroupRoute(ctx *routeContext) (*eskip.Route, error) {
426426
gr := ctx.groupRoute
427427
r := &eskip.Route{Id: ctx.id}
428428

429-
// Path or PathSubtree, prefer Path if we have, because it is more specifc
429+
// Path or PathSubtree, prefer Path if we have, because it is more specific
430430
if gr.Path != "" {
431431
r.Predicates = appendPredicate(r.Predicates, "Path", gr.Path)
432432
} else if gr.PathSubtree != "" {
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
### Note
22

3-
In this test the directory is a file, so that readdir() fails. Error should be loged.
3+
In this test the directory is a file, so that readdir() fails. Error should be logged.

docs/kubernetes/ingress-usage.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ Custom routes specified in ingress will always add the `Host()`
254254
[predicate](../reference/predicates.md#host) to match the host header specified in
255255
the ingress `rules:`. If there is a `path:` definition in your
256256
ingress, then it will be based on the skipper command line parameter
257-
`-kubernetes-path-mode` set one of theses predicates:
257+
`-kubernetes-path-mode` set one of these predicates:
258258

259259
- [Path()](../reference/predicates.md#path)
260260
- [PathSubtree()](../reference/predicates.md#pathsubtree)
@@ -672,7 +672,7 @@ and in our [ratelimit tutorial](../tutorials/ratelimit.md).
672672
#### Client Ratelimits
673673

674674
The example shows 20 calls per hour per client, based on
675-
X-Forwarded-For header or IP incase there is no X-Forwarded-For header
675+
X-Forwarded-For header or IP in case there is no X-Forwarded-For header
676676
set, are allowed to each skipper instance for the given ingress.
677677

678678
```yaml

docs/operation/operation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ the number for all backends such that we do not run out of sockets.
4949

5050
This will set DisableKeepAlives on the
5151
[http.Transport](https://golang.org/pkg/net/http/#Transport) to disable
52-
HTTP keep-alives and to only use the connection for single request.
52+
HTTP keep-alive and to only use the connection for single request.
5353

5454
-max-idle-connection-backend int
5555
sets the maximum idle connections for all backend connections

docs/reference/development.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## How to develop a Filter
22

3-
A filter is part of a route and can change arbitary http data in the
3+
A filter is part of a route and can change arbitrary http data in the
44
`http.Request` and `http.Response` path of a proxy.
55

66
The filter example shows a non trivial diff of a filter

docs/reference/filters.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ The content type will be automatically detected when not provided.
964964

965965
Block a request based on it's body content.
966966

967-
The filter max buffer size is 2MiB by default and can be overidden with `-max-matcher-buffer-size=<int>`.
967+
The filter max buffer size is 2MiB by default and can be overridden with `-max-matcher-buffer-size=<int>`.
968968

969969
Parameters:
970970

@@ -980,7 +980,7 @@ Example:
980980

981981
Block a request based on it's body content.
982982

983-
The filter max buffer size is 2MiB by default and can be overidden with `-max-matcher-buffer-size=<int>`.
983+
The filter max buffer size is 2MiB by default and can be overridden with `-max-matcher-buffer-size=<int>`.
984984

985985
Parameters:
986986

@@ -995,7 +995,7 @@ Example:
995995

996996
### sed
997997

998-
The filter sed replaces all occurences of a pattern with a replacement string
998+
The filter sed replaces all occurrences of a pattern with a replacement string
999999
in the response body.
10001000

10011001
Example:
@@ -1011,7 +1011,7 @@ editorRoute: * -> sed("foo", "bar", 64000000) -> "https://www.example.org";
10111011
```
10121012

10131013
This filter expects a regexp pattern and a replacement string as arguments.
1014-
During the streaming of the response body, every occurence of the pattern will
1014+
During the streaming of the response body, every occurrence of the pattern will
10151015
be replaced with the replacement string. The editing doesn't happen right when
10161016
the filter is executed, only later when the streaming normally happens, after
10171017
all response filters were called.
@@ -1661,7 +1661,7 @@ oidcClaimsQuery("<path>:[<query>]", ...)
16611661
```
16621662

16631663
The filter is chained after `oauthOidc*` authentication as it parses the ID token that has been saved in the internal `StateBag` for this request. It validates access control of the requested path against the defined query.
1664-
It accepts one or more arguments, thats is a path prefix which is granted access to when the query definition evaluates positive.
1664+
It accepts one or more arguments, that is a path prefix which is granted access to when the query definition evaluates positive.
16651665
It supports exact matches of keys, key-value pairs, introspecting of arrays or exact and wildcard matching of nested structures.
16661666
The query definition can be one or more queries per path, space delimited. The query syntax is [GJSON](https://github.com/tidwall/gjson/blob/master/SYNTAX.md) with a convenience modifier of `@_` which unfolds to `[@this].#("+arg+")`
16671667

@@ -2225,7 +2225,7 @@ This enables logs of all requests with status codes `1xxs`, `301` and all `20xs`
22252225
### auditLog
22262226

22272227
Filter `auditLog()` logs the request and N bytes of the body into the
2228-
log file. N defaults to 1024 and can be overidden with
2228+
log file. N defaults to 1024 and can be overridden with
22292229
`-max-audit-body=<int>`. `N=0` omits logging the body.
22302230

22312231
Example:

docs/reference/predicates.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ Examples:
530530
Cron("* * * * *")
531531
// match only when the hour is between 5-7 (inclusive)
532532
Cron("* 5-7, * * *")
533-
// match only when the hour is between 5-7, equal to 8, or betweeen 12-15
533+
// match only when the hour is between 5-7, equal to 8, or between 12-15
534534
Cron("* 5-7,8,12-15 * * *")
535535
// match only when it is weekdays
536536
Cron("* * * * 1-5")
@@ -664,7 +664,7 @@ ignoring the chance argument.
664664
Parameters:
665665

666666
* Traffic (decimal) valid values [0.0, 1.0]
667-
* Traffic (decimal, string, string) session stickyness
667+
* Traffic (decimal, string, string) session stickiness
668668

669669
Examples:
670670

@@ -682,7 +682,7 @@ v1:
682682
"https://api-test-blue";
683683
```
684684

685-
stickyness:
685+
stickiness:
686686

687687
```
688688
// hit by 5% percent chance

docs/tutorials/auth.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ oauthOidcUserInfo("https://oidc-provider.example.com", "client_id", "client_secr
182182
```
183183
184184
This filter is similar but it verifies that the token has certain user information
185-
information fields accesible with the token return by the provider. The fields can
185+
information fields accessible with the token return by the provider. The fields can
186186
be specified at the end like in the example above where the fields `name`, `email`
187187
and `picture` are requested.
188188
189-
Upon sucessful authentication Skipper will start allowing the user requests through
190-
to the backend. Along with the orginal request to the backend Skipper will include
189+
Upon successful authentication Skipper will start allowing the user requests through
190+
to the backend. Along with the original request to the backend Skipper will include
191191
information which it obtained from the provider. The information is in `JSON` format
192192
with the header name `Skipper-Oidc-Info`. In the case of the claims container the
193193
header value is in the format.
@@ -310,7 +310,7 @@ Skipper must be configured with the following credentials and secrets:
310310
1. OAuth2 client secret for authenticating with the OAuth2 provider.
311311
1. Cookie encryption secret for encrypting and decrypting token cookies.
312312
313-
You can load all of theses secrets from separate files, in which case they get automatically
313+
You can load all of these secrets from separate files, in which case they get automatically
314314
reloaded to support secret rotation. You can provide the paths to the files containing each
315315
secret as follows:
316316

docs/tutorials/basics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ If there is more than 1024 routes used, then the paging the results is
410410
possible with the `offset` and `limit` query parameters:
411411
412412
```
413-
curl locahost:9911/routes?offset=2048&limit=512
413+
curl localhost:9911/routes?offset=2048&limit=512
414414
```
415415
416416
### Route IDs

docs/tutorials/development.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ For *Visual Studion Code* users, a simple setup could be to create following *la
6767
"-inline-routes=PathSubtree(\"/\") -> inlineContent(\"Hello World\") -> <shunt>",
6868
// example OIDC setup, using https://developer.microsoft.com/en-us/microsoft-365/dev-program
6969
// "-oidc-secrets-file=${workspaceFolder}/.vscode/launch.json",
70-
// "-inline-routes=* -> oauthOidcAnyClaims(\"https://login.microsoftonline.com/<tenant Id>/v2.0\",\"<application id>\",\"<client secret>\",\"http://localhost:9999/authcallback\", \"profile\", \"\", \"\", \"x-auth-email:claims.email x-groups:claims.groups\") -> inlineContent(\"restriced access\") -> <shunt>",
70+
// "-inline-routes=* -> oauthOidcAnyClaims(\"https://login.microsoftonline.com/<tenant Id>/v2.0\",\"<application id>\",\"<client secret>\",\"http://localhost:9999/authcallback\", \"profile\", \"\", \"\", \"x-auth-email:claims.email x-groups:claims.groups\") -> inlineContent(\"restricted access\") -> <shunt>",
7171
],
7272
"serverReadyAction": {
7373
"pattern": "route settings applied",

eskip/lexer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func scanRegexp(code string) ([]byte, string) {
191191
}
192192

193193
if escaped {
194-
//delimeter / is escaped in PathRegexp so that it means no end PathRegexp(/\//)
194+
//delimiter / is escaped in PathRegexp so that it means no end PathRegexp(/\//)
195195
if !isDelimiter && !isEscapeChar {
196196
b = append(b, escapeChar)
197197
}

eskipfile/remote.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
log "github.com/sirupsen/logrus"
1818
)
1919

20-
var errContentNotChanged = errors.New("content in cache did not change, 304 reponse status code")
20+
var errContentNotChanged = errors.New("content in cache did not change, 304 response status code")
2121

2222
type remoteEskipFile struct {
2323
once sync.Once

filters/apiusagemonitoring/spec_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ func Test_CreatePathPattern(t *testing.T) {
572572
originalPath: "//bas//customers///:customer-id//",
573573
expectedPathPattern: "^/*bas/+customers/+.+/*$",
574574
},
575-
"with escape caracters": {
575+
"with escape characters": {
576576
originalPath: "/bas/*(cust\\omers)?.id+/",
577577
expectedPathPattern: "^/*bas/+\\*\\(cust\\\\omers\\)\\?\\.id\\+/*$",
578578
},

filters/auth/doc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ filter after the auth filter.
353353
354354
The filter webhook allows you to have a custom authentication and
355355
authorization endpoint for a route. Headers from the webhook response
356-
can be copyied into the continuing request by specifying the
356+
can be copied into the continuing request by specifying the
357357
headers to copy as an optional second argument to the filter
358358
359359
a: Path("/only-allowed-by-webhook") -> webhook("https://custom-webhook.example.org/auth") -> "https://protected-backend.example.org/";

filters/auth/forwardtokenfield_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,6 @@ func TestForwardFieldFieldEmpty(t *testing.T) {
104104
f.Request(c)
105105

106106
if c.FRequest.Header.Get("Header1") != "blbabla" {
107-
t.Fatalf("Header1 should not be overriden")
107+
t.Fatalf("Header1 should not be overridden")
108108
}
109109
}

filters/fadein/fadein.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func (endpointCreated) CreateFilter(args []interface{}) (filters.Filter, error)
174174
return nil, filters.ErrInvalidFilterParameters
175175
}
176176

177-
// mitigate potential flakyness caused by clock skew. When the created time is in the future based on
177+
// mitigate potential flakiness caused by clock skew. When the created time is in the future based on
178178
// the local clock, we ignore it.
179179
now := time.Now()
180180
if ec.when.After(now) {

filters/flowid/filter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func (spec *flowIdSpec) CreateFilter(fc []interface{}) (filters.Filter, error) {
9999
return nil, filters.ErrInvalidFilterParameters
100100
}
101101
if len(fc) > 1 {
102-
log.Println("flow id filter warning: this syntaxt is deprecated and will be removed soon. " +
102+
log.Println("flow id filter warning: this syntax is deprecated and will be removed soon. " +
103103
"please check updated docs")
104104
}
105105
}

filters/ratelimit/ratelimit.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Package ratelimit provides filters to control the rate limitter settings on the route level.
2+
Package ratelimit provides filters to control the rate limiter settings on the route level.
33
44
For detailed documentation of the ratelimit, see https://godoc.org/github.com/zalando/skipper/ratelimit.
55
*/

filters/scheduler/fifo_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func TestFifo(t *testing.T) {
207207
t.Fatalf("Failed to parse filter: %v", err)
208208
}
209209
if err == nil && tt.wantParseErr {
210-
t.Fatalf("want parse error but hav no: %v", err)
210+
t.Fatalf("want parse error but have no: %v", err)
211211
}
212212
if tt.wantParseErr {
213213
return
@@ -375,7 +375,7 @@ func TestConstantRouteUpdatesFifo(t *testing.T) {
375375
t.Fatalf("Failed to parse filter: %v", err)
376376
}
377377
if err == nil && tt.wantParseErr {
378-
t.Fatalf("want parse error but hav no: %v", err)
378+
t.Fatalf("want parse error but have no: %v", err)
379379
}
380380
if tt.wantParseErr {
381381
return

filters/scheduler/lifo.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (s *lifoSpec) Name() string { return filters.LifoName }
8585
// MaxConcurrency and MaxQueueSize: total max = MaxConcurrency + MaxQueueSize
8686
//
8787
// Min values are 1 for MaxConcurrency and MaxQueueSize, and 1ms for
88-
// Timeout. All configration that is below will be set to these min
88+
// Timeout. All configuration that is below will be set to these min
8989
// values.
9090
func (s *lifoSpec) CreateFilter(args []interface{}) (filters.Filter, error) {
9191
var l lifoFilter
@@ -153,7 +153,7 @@ func (*lifoGroupSpec) Name() string { return filters.LifoGroupName }
153153
// MaxConcurrency and MaxQueueSize: total max = MaxConcurrency + MaxQueueSize
154154
//
155155
// Min values are 1 for MaxConcurrency and MaxQueueSize, and 1ms for
156-
// Timeout. All configration that is below will be set to these min
156+
// Timeout. All configuration that is below will be set to these min
157157
// values.
158158
//
159159
// It is enough to set the concurrency, queue size and timeout parameters for

filters/scheduler/lifo_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ func TestNewLIFO(t *testing.T) {
337337
t.Errorf("Queue should not be nil, got: %v", q)
338338
}
339339
} else {
340-
t.Fatalf("Failed to get lifoFilter ot lifoGroupFilter from filter: %v, ok: %v", f, ok)
340+
t.Fatalf("Failed to get lifoFilter or lifoGroupFilter from filter: %v, ok: %v", f, ok)
341341
}
342342

343343
backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

filters/sed/doc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Example with larger max buffer:
1212
editorRoute: * -> sed("foo", "bar", 64000000) -> "https://www.example.org";
1313
1414
This filter expects a regexp pattern and a replacement string as arguments.
15-
During the streaming of the response body, every occurence of the pattern will
15+
During the streaming of the response body, every occurrence of the pattern will
1616
be replaced with the replacement string. The editing doesn't happen right when
1717
the filter is executed, only later when the streaming normally happens, after
1818
all response filters were called.

filters/sed/editor.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ const (
1919
maxBufferAbort
2020
)
2121

22-
// editor provides a reader that wraps an input reader, and replaces each occurence of
22+
// editor provides a reader that wraps an input reader, and replaces each occurrence of
2323
// the provided search pattern with the provided replacement. It can be used with a
2424
// delimiter or without.
2525
//
2626
// When using it with a delimiter, it reads enough data from the input until meeting
2727
// a delimiter or reaching maxBufferSize. The chunk includes the delimiter if any. Then
28-
// every occurence of the pattern is replaced, and the entire edited chunk is returned
28+
// every occurrence of the pattern is replaced, and the entire edited chunk is returned
2929
// to the caller.
3030
//
3131
// When not using a delimiter, it reads enough data until at least a complete match of the

loadbalancer/fadein_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func testFadeIn(
146146
}
147147

148148
// Print CSV-like output for, where row number represents time and
149-
// column represents endpoint. You can vizualize it using
149+
// column represents endpoint. You can visualize it using
150150
// ./skptesting/run_fadein_test.sh from the skipper repo root.
151151
t.Log("CSV " + fmt.Sprintf("%d,", i) + strings.Join(showStats, ","))
152152
}

0 commit comments

Comments
 (0)