Skip to content

Commit

Permalink
pkg,test,config,helm,docs,scripts: fix codespell errors.
Browse files Browse the repository at this point in the history
Fix existing spelling errors all over the repo.

Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Oct 1, 2024
1 parent 7c356f8 commit d663aea
Show file tree
Hide file tree
Showing 28 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The estimated complexity and priority of a feature/task is defined like this:
- [ ] eliminate need for saving cache to disk, C2
- config
- [ ] switch to using CRDs (from ConfigMaps), C2
- [ ] consider usig 1 CRD per policy as opposed to a single 'union' CRD, C2
- [ ] consider using 1 CRD per policy as opposed to a single 'union' CRD, C2
- [ ] create helm chart support for the resource policies, C1
- policies
- [ ] remove support for multiple policies in a single binary, C1
Expand Down
6 changes: 3 additions & 3 deletions config/crd/bases/config.nri_balloonspolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ spec:
consist of a key, an operator and a set of values. An expressions is
evaluated against an object which implements the Evaluable interface.
Evaluating an expression consists of looking up the value for the key
in the object, then using the operator to check it agains the values
in the object, then using the operator to check it against the values
of the expression. The result is a single boolean value. An object is
said to satisfy the evaluated expression if this value is true. An
expression can contain 0, 1 or more values depending on the operator.
Expand Down Expand Up @@ -217,7 +217,7 @@ spec:
preferPerNamespaceBalloon:
description: |-
PreferPerNamespaceBalloon: if true, containers in different
namespaces are preferrably placed in separate balloons,
namespaces are preferably placed in separate balloons,
even if the balloon type is the same for all of them. On
the other hand, containers in the same namespace will be
placed in the same balloon instances. The default is false:
Expand Down Expand Up @@ -406,7 +406,7 @@ spec:
consist of a key, an operator and a set of values. An expressions is
evaluated against an object which implements the Evaluable interface.
Evaluating an expression consists of looking up the value for the key
in the object, then using the operator to check it agains the values
in the object, then using the operator to check it against the values
of the expression. The result is a single boolean value. An object is
said to satisfy the evaluated expression if this value is true. An
expression can contain 0, 1 or more values depending on the operator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ spec:
consist of a key, an operator and a set of values. An expressions is
evaluated against an object which implements the Evaluable interface.
Evaluating an expression consists of looking up the value for the key
in the object, then using the operator to check it agains the values
in the object, then using the operator to check it against the values
of the expression. The result is a single boolean value. An object is
said to satisfy the evaluated expression if this value is true. An
expression can contain 0, 1 or more values depending on the operator.
Expand Down Expand Up @@ -217,7 +217,7 @@ spec:
preferPerNamespaceBalloon:
description: |-
PreferPerNamespaceBalloon: if true, containers in different
namespaces are preferrably placed in separate balloons,
namespaces are preferably placed in separate balloons,
even if the balloon type is the same for all of them. On
the other hand, containers in the same namespace will be
placed in the same balloon instances. The default is false:
Expand Down Expand Up @@ -406,7 +406,7 @@ spec:
consist of a key, an operator and a set of values. An expressions is
evaluated against an object which implements the Evaluable interface.
Evaluating an expression consists of looking up the value for the key
in the object, then using the operator to check it agains the values
in the object, then using the operator to check it against the values
of the expression. The result is a single boolean value. An object is
said to satisfy the evaluated expression if this value is true. An
expression can contain 0, 1 or more values depending on the operator.
Expand Down
2 changes: 1 addition & 1 deletion docs/deployment/helm/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ All the available charts can be found in [artifacthub.io](https://artifacthub.io
- kubernetes version: 1.28.x
- containerd version: 1.7
- node image: Container-Optimized OS from Google (COS), Ubuntu 22.04
- Azure AKS
- Azure Kubernetes Service
- kubernetes version: 1.28.x
- containerd version: 1.7
- node image: Azure Linux Container Host, Ubuntu 20.04
Expand Down
2 changes: 1 addition & 1 deletion docs/memory/memory-qos.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ unifiedannotations:

This configuration defines the following.

- If a container belogs to the memory QoS class `bronze` has allocated
- If a container belongs to the memory QoS class `bronze` has allocated
half of the memory of its `resources.limits.memory`, next
allocations will cause kernel to swap out corresponding amount of
container's memory. In other words, when container's memory usage is
Expand Down
2 changes: 1 addition & 1 deletion docs/resource-policy/developers-guide/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ of activating and dispatching calls through to the configured active policy.
The generic resource controller layer defines the abstract interface the rest
of NRI-RP uses to interact with resource controller implementations and takes
care of the details of dispatching calls to the controller implementations
for post-policy enforcment of decisions.
for post-policy enforcement of decisions.

### [Metrics Collector](tree:/pkg/metrics/)

Expand Down
2 changes: 1 addition & 1 deletion docs/resource-policy/policy/balloons.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Balloons policy parameters:
balloon(s).
- `preferPerNamespaceBalloon`: if `true`, containers in the same
namespace will be placed in the same balloon(s). On the other
hand, containers in different namespaces are preferrably placed in
hand, containers in different namespaces are preferably placed in
different balloons. The default is `false`: namespace has no
effect on choosing the balloon of this type.
- `preferNewBalloons`: if `true`, prefer creating new balloons over
Expand Down
10 changes: 5 additions & 5 deletions docs/resource-policy/policy/topology-aware.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ behavior. These options can be supplied as part of the effective
- whether shared allocation is preferred by default for workloads that
would be otherwise eligible for exclusive CPU allocation
- `reservedPoolNamespaces`
- list of extra namespaces (or glob patters) that will be allocated to
- list of extra namespaces (or glob patterns) that will be allocated to
reserved CPUs
- `colocatePods`
- whether try to allocate containers in a pod to the same or close by
Expand Down Expand Up @@ -496,7 +496,7 @@ However as a general rule of thumb containers running
These hints are expressed by `container affinity annotations` on the Pod.
There are two types of affinities:

- `affinity` (or `positive affinty`): cause affected containers to *pull* each
- `affinity` (or `positive affinity`): cause affected containers to *pull* each
other closer
- `anti-affinity` (or `negative affinity`): cause affected containers to *push*
each other further away
Expand All @@ -516,7 +516,7 @@ annotation. They are specified in the `metadata` section of the `Pod YAML`, unde

```yaml
metadata:
anotations:
annotations:
resource-policy.nri.io/affinity: |
container1:
- scope:
Expand All @@ -541,7 +541,7 @@ as the annotation key.

```yaml
metadata:
anotations:
annotations:
resource-policy.nri.io/anti-affinity: |
container1:
- scope:
Expand Down Expand Up @@ -585,7 +585,7 @@ is. This is useful in situations where the policy needs to make some
compromises because an optimal placement is not possible. The weight then also
acts as a way to specify preferences of priorities between the various
compromises: the heavier the weight the stronger the pull or push and the
larger the propbability that it will be honored, if this is possible at all.
larger the probability that it will be honored, if this is possible at all.

The scope can be omitted from an affinity in which case it implies *Pod scope*,
in other words the scope of all containers that belong to the same Pod as the
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/node-resource-topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (a *Agent) UpdateNrtCR(policy string, zones []*policyapi.TopologyZone) erro

// To minimize the risk of an NRI request timeout (and the plugin getting
// kicked out) we do the update asynchronously. We can rework this to use
// a single goroutine that reads update requests from a channel to mimick
// a single goroutine that reads update requests from a channel to mimic
// the rest if necessary.
// XXX TODO(klihub): We can't/don't propagate update errors now back
// to the caller. We could do that (using a channel) if necessary...
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/config/v1alpha1/resmgr/policy/balloons/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ type BalloonDef struct {
// placing containers of a pod to the same balloon(s).
PreferSpreadingPods bool `json:"preferSpreadingPods,omitempty"`
// PreferPerNamespaceBalloon: if true, containers in different
// namespaces are preferrably placed in separate balloons,
// namespaces are preferably placed in separate balloons,
// even if the balloon type is the same for all of them. On
// the other hand, containers in the same namespace will be
// placed in the same balloon instances. The default is false:
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/resmgr/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package resmgr
// consist of a key, an operator and a set of values. An expressions is
// evaluated against an object which implements the Evaluable interface.
// Evaluating an expression consists of looking up the value for the key
// in the object, then using the operator to check it agains the values
// in the object, then using the operator to check it against the values
// of the expression. The result is a single boolean value. An object is
// said to satisfy the evaluated expression if this value is true. An
// expression can contain 0, 1 or more values depending on the operator.
Expand Down
2 changes: 1 addition & 1 deletion pkg/cgroups/cgroupblkio.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func readFromFileInDir(baseDir string, filenames []string) (string, error) {
return "", nil
}

// SetBlkioParameters writes OCI BlockIO parameters to files in cgroups blkio contoller directory.
// SetBlkioParameters writes OCI BlockIO parameters to files in cgroups blkio controller directory.
func SetBlkioParameters(cgroupsDir string, blockIO OciBlockIOParameters) error {
log.Debug("configuring cgroups blkio controller in directory %#v with parameters %+v", cgroupsDir, blockIO)
errs := []error{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cgroups/cgroupstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type NumaLine struct {
Nodes map[string]int64
}

// NumaStat has parsed contets of a NUMA statistics file.
// NumaStat has parsed contents of a NUMA statistics file.
type NumaStat struct {
Total NumaLine
File NumaLine
Expand Down
4 changes: 2 additions & 2 deletions pkg/cpuallocator/allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ func (a *allocatorHelper) takeCacheGroups() {
// c. allocate using the smallest number of groups (largest to smallest)
//
// Notes:
// We might consider letting the requestor control some aspects of allocation,
// We might consider letting the requester control some aspects of allocation,
// for instance:
// - use only full idle groups (ideal maximum isolation)
// - use only full idle groups, and 1 fragmented (maximum isolation)
Expand Down Expand Up @@ -805,7 +805,7 @@ func (a *allocatorHelper) takeCacheGroups() {
g := groups[0]
cset := sorter.cpus[g]

log.Debug("=> took reamining %d CPUs (%s) of usable cache group %s", cnt, cset, g)
log.Debug("=> took remaining %d CPUs (%s) of usable cache group %s", cnt, cset, g)

result = result.Union(cset)
from = from.Difference(cset)
Expand Down
2 changes: 1 addition & 1 deletion pkg/log/ratelimit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestRateLimit(t *testing.T) {
limiters[msg] = rl.getMessageLimit(msg)
}

// check looked up vs. stored limters
// check looked up vs. stored limiters
for msg, limiter := range limiters {
if rl.getMessageLimit(msg) != limiter {
t.Errorf("unexpected new limiter for message %s", msg)
Expand Down
2 changes: 1 addition & 1 deletion pkg/resmgr/cache/affinity.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (pca *podContainerAffinity) parseSimple(pod *pod, value string, weight int3
//
// Notes:
// We turn affinities given in the simple notation into a symmetric set of
// affinities. IOW, if X has affinity on Y with wight W, then Y will have
// affinities. IOW, if X has affinity on Y with weight W, then Y will have
// affinity on X with W as well. In practice this is done by
// 1) ensuring there is an affinity Y: X for every affinity X: Y
// 2) generating an affinity expression for every container with affinities
Expand Down
18 changes: 9 additions & 9 deletions pkg/resmgr/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ type Pod interface {
// GetProcesses returns the pids of all processes in the pod either excluding
// container processes, if called with false, or including those if called with true.
GetProcesses(bool) ([]string, error)
// GetTasks returns the pids of all threads in the pod either excluding cotnainer
// GetTasks returns the pids of all threads in the pod either excluding container
// processes, if called with false, or including those if called with true.
GetTasks(bool) ([]string, error)
}
Expand Down Expand Up @@ -339,7 +339,7 @@ type container struct {
type Mount = nri.Mount
type Device = nri.LinuxDevice

type Cachable interface {
type Cacheable interface {
// Set value (via a pointer receiver) to the object.
Set(value interface{})
// Get the object that should be cached.
Expand All @@ -349,7 +349,7 @@ type Cachable interface {
// Cache is the primary interface exposed for tracking pods and containers.
//
// Cache tracks pods and containers in the runtime, mostly by processing CRI
// requests and responses which the cache is fed as these are being procesed.
// requests and responses which the cache is fed as these are being processed.
// Cache also saves its state upon changes to secondary storage and restores
// itself upon startup.
type Cache interface {
Expand All @@ -368,7 +368,7 @@ type Cache interface {
// LookupContainerByCgroup looks up a container for the given cgroup path.
LookupContainerByCgroup(path string) (Container, bool)

// GetPendingContainers returs all containers with pending changes.
// GetPendingContainers returns all containers with pending changes.
GetPendingContainers() []Container

// GetPods returns all the pods known to the cache.
Expand Down Expand Up @@ -497,7 +497,7 @@ func (cch *cache) GetActivePolicy() string {
return cch.PolicyName
}

// SetActivePolicy updaes the name of the active policy stored in the cache.
// SetActivePolicy updates the name of the active policy stored in the cache.
func (cch *cache) SetActivePolicy(policy string) error {
cch.PolicyName = policy
return cch.Save()
Expand Down Expand Up @@ -849,8 +849,8 @@ func unmarshalEntry(data []byte, ptr interface{}) error {

// Cache an unmarshaled opaque policy entry, special-casing some simple/common types.
func (cch *cache) cacheEntry(key string, ptr interface{}) error {
if cachable, ok := ptr.(Cachable); ok {
cch.policyData[key] = cachable.Get()
if cacheable, ok := ptr.(Cacheable); ok {
cch.policyData[key] = cacheable.Get()
return nil
}

Expand Down Expand Up @@ -890,8 +890,8 @@ func (cch *cache) cacheEntry(key string, ptr interface{}) error {

// Serve an unmarshaled opaque policy entry, special-casing some simple/common types.
func (cch *cache) setEntry(key string, ptr, obj interface{}) error {
if cachable, ok := ptr.(Cachable); ok {
cachable.Set(obj)
if cacheable, ok := ptr.(Cacheable); ok {
cacheable.Set(obj)
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/resmgr/cache/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ func (c *container) PreserveMemoryResources() bool {
}

var (
// More complext rules, for Kubelet secrets and config maps
// More complex rules, for Kubelet secrets and config maps
ignoredTopologyPathRegexps = []*regexp.Regexp{
// Kubelet directory can be different, but we can detect it by structure inside of it.
// For now, we can safely ignore exposed config maps and secrets for topology hints.
Expand Down
2 changes: 1 addition & 1 deletion pkg/resmgr/control/cpu/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func getClassAssignments(c cache.Cache) *cpuClassAssignments {

// Save the state of CPU class assignments in cache
func setClassAssignments(c cache.Cache, a *cpuClassAssignments) {
c.SetPolicyEntry(cacheKeyCPUAssignments, cache.Cachable(a))
c.SetPolicyEntry(cacheKeyCPUAssignments, cache.Cacheable(a))
}

// Set the value of cached cpuClassAssignments
Expand Down
4 changes: 2 additions & 2 deletions pkg/resmgr/nri.go
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ func (p *nriPlugin) runPostStartHooks(method string, c cache.Container) error {
return nil
}

// runPostReleaseHooks runs the necessary hooks after releaseing resources of some containers
// runPostReleaseHooks runs the necessary hooks after releasing resources of some containers
func (p *nriPlugin) runPostReleaseHooks(method string, released ...cache.Container) error {
m := p.resmgr
for _, c := range released {
Expand All @@ -1058,7 +1058,7 @@ func (p *nriPlugin) runPostReleaseHooks(method string, released ...cache.Contain
return nil
}

// runPostUpdateHooks runs the necessary hooks after reconcilation.
// runPostUpdateHooks runs the necessary hooks after reconciliation.
func (p *nriPlugin) runPostUpdateHooks(method string) error {
m := p.resmgr
for _, c := range m.cache.GetPendingContainers() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/resmgr/policy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ type policy struct {

// backend is a registered Backend.
type backend struct {
name string // unqiue backend name
name string // unique backend name
description string // verbose backend description
create CreateFn // backend creation function
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/sysfs/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ func (sys *system) SocketCount() int {
return len(sys.packages)
}

// CPUCount resturns the number of discovered CPUs/cores.
// CPUCount returns the number of discovered CPUs/cores.
func (sys *system) CPUCount() int {
return len(sys.cpus)
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/testing/e2e-runner
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ usage() {
echo " --source-proxies <file> source proxy environment variables from file"
echo " --remote|r <repo> remote repository to clone/fetch from"
echo " --branch|-b <branch> name of the remote branch to test"
echo " --local|-l <dir> local directory to clone remote respository into"
echo " --local|-l <dir> local directory to clone remote repository into"
echo " --results|--out|-o <dir> top-level directory for publishing results"
echo " --name|-n <name> subdirectory for results of this run"
echo " --skip-worktree skip worktree preparation, assume already done"
Expand Down Expand Up @@ -112,7 +112,7 @@ source_proxies() {

for var in http_proxy https_proxy no_proxy HTTP_PROXY HTTPS_PROXY NO_PROXY; do
if [ -n "${!var}" ]; then
info "exporting proxy envrionment variable $var (with value ${!var})..."
info "exporting proxy environment variable $var (with value ${!var})..."
export $var
fi
done
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Before running E2E tests ensure that you have all the required components locall

The default test output directory name is generated from the used topology
and runtime name and the directory is created under test/e2e.
The test output directory can be given as a 2nd paramter to the script.
The test output directory can be given as a 2nd parameter to the script.

```shell
./run_tests.sh policies.test-suite ~/output-directory
Expand All @@ -51,7 +51,7 @@ Before running E2E tests ensure that you have all the required components locall
```

The e2e test runs can be can be configured by setting various options as
environment variables when starting the run_tests.sh script. These environent
environment variables when starting the run_tests.sh script. These environment
variables are passed to test VM so that it can establish connection to
net to download packages etc.

Expand Down
Loading

0 comments on commit d663aea

Please sign in to comment.