Skip to content

Commit

Permalink
Feat: Add Codespell Check CI (#679)
Browse files Browse the repository at this point in the history
* update workflows

Signed-off-by: Tom <[email protected]>

* typo fix

Signed-off-by: Tom <[email protected]>

* typo fix in app_v1alpha1

Signed-off-by: Tom <[email protected]>

* finish make gen

Signed-off-by: Tom <[email protected]>

* codespell skip manifests

Signed-off-by: Tom <[email protected]>

* trigger ci

Signed-off-by: Tom <[email protected]>

---------

Signed-off-by: Tom <[email protected]>
  • Loading branch information
Flying-Tom authored Aug 26, 2024
1 parent f47d06a commit 19220c1
Show file tree
Hide file tree
Showing 33 changed files with 78 additions and 53 deletions.
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
skip = .git,go.sum,go.mod,*.png,*.svg,./manifests
ignore-words-list = NotIn,te,ans,AKS
22 changes: 22 additions & 0 deletions .github/workflows/code-spell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
level of experience, education, socioeconomic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards
Expand Down
4 changes: 2 additions & 2 deletions cmd/kurator/app/pipeline/execution/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func NewCmd(opts *generic.Options) *cobra.Command {

PipelineList, err := logs.NewPipelineLogs(opts, &Args, pipelineExecutionName)
if err != nil {
logrus.Errorf("pipeline excution logs init error: %v", err)
return fmt.Errorf("pipeline excution logs init error: %v", err)
logrus.Errorf("pipeline execution logs init error: %v", err)
return fmt.Errorf("pipeline execution logs init error: %v", err)
}

logrus.Debugf("start logs pipeline execution obj, Global: %+v ", opts)
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Kurator doc is built by [Hugo](https://gohugo.io/) and [Docsy](https://www.docsy

for local dev please run the following command:

```cosole
```console
hugo run -p 3000 --bind 0.0.0.0
```
2 changes: 1 addition & 1 deletion docs/content/en/docs/Integrations/istio.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ kurator install istio --primary member1 --remote member2
### Next steps

<!-- provider a simple way with kurator -->
Now, you can [verify the installion](https://istio.io/latest/docs/setup/install/multicluster/verify)
Now, you can [verify the installation](https://istio.io/latest/docs/setup/install/multicluster/verify)
4 changes: 2 additions & 2 deletions docs/content/en/docs/Integrations/pixie-vizier.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Create a deployment key following the directions [here](https://docs.pixielabs.a

Kurator provides a very simple command to install Pixie vizier to all clusters joined to karmada.

- `--cloud-addr` sepcifies the address of the Pixie cloud instance that the vizier should be connected to.
- `--deploy-key` sepcifies the deploy key is used to link the deployed vizier to a specific user/project.
- `--cloud-addr` specifies the address of the Pixie cloud instance that the vizier should be connected to.
- `--deploy-key` specifies the deploy key is used to link the deployed vizier to a specific user/project.

```bash
kurator install pixie vizier --deploy-key=<your_deploy_key>
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/docs/fleet-manager/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ The overall architecture of Kurator fleet manager is shown as below:
>}}


The Kurator Fleet Manager runs as a kubernetes operator, it is in charge of fleet control plane lifecycle management and also responsible for cluster registeration and un registration.
The Kurator Fleet Manager runs as a kubernetes operator, it is in charge of fleet control plane lifecycle management and also responsible for cluster registration and un registration.
2 changes: 1 addition & 1 deletion docs/content/en/docs/fleet-manager/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ kubectl get po -A --kubeconfig=/root/.kube/kurator-member2.config

Upon examining the respective clusters, you'll find that applications originating from the same source configuration have been distributed to different clusters based on their respective policy selector labels.

## Playgroud
## Playground

Kurator uses killercoda to provide [applications demo](https://killercoda.com/965010e0-4f60-4a28-bf27-597d3kurator/scenario/application-example), allowing users to experience hands-on operations.

Expand Down
12 changes: 6 additions & 6 deletions docs/content/en/docs/fleet-manager/distributedstorage-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ rook-ceph-rgw-ceph-objectstore-a-5c4df48bbb-bf6jn 2/2 Runn

## Persistent Volume Use Guide

After rook opeartor and rook ceph cluster are installed, this chapter provides examples of using Block Storage, Filesystem Storage and Object Storage.
After rook operator and rook ceph cluster are installed, this chapter provides examples of using Block Storage, Filesystem Storage and Object Storage.

### Block Storage Class Configuration

Expand Down Expand Up @@ -168,8 +168,8 @@ allowVolumeExpansion: true
There are a few things to note in the above block storage class configuration:

- provisioner is configured in the format (operator-namespace).rbd.csi.ceph.com. Change "rook-ceph" provisioner prefix to match the operator namespace if needed.
- `parametes.clusterID` is the namespace where the rook cluster is running.
- `parametes.pool` is the `CephBlockPool` created before.
- `parameters.clusterID` is the namespace where the rook cluster is running.
- `parameters.pool` is the `CephBlockPool` created before.

### FileSystem Storage Class Configuration

Expand Down Expand Up @@ -289,7 +289,7 @@ There are a few things to note in the above filesystem storage class configurati

### Use Block Storage

After creating the storagec class for block, file and object storage, it's time to actually use this storage class. We can ues Kurator application to create Persistent Volume Claim and Pod that consume it.
After creating the storagec class for block, file and object storage, it's time to actually use this storage class. We can use Kurator application to create Persistent Volume Claim and Pod that consume it.

```console
kubectl apply -f - <<EOF
Expand Down Expand Up @@ -327,7 +327,7 @@ block-pvc Bound pvc-n6w5hd42-sx7w-f996-7bdc-l7d4c78b74b8 1Gi

### Use Filesystem Storage

Filesystem storage is similar to block storage, we also can ues Kurator application to create Persistent Volume Claim and Pod that consume it.
Filesystem storage is similar to block storage, we also can use Kurator application to create Persistent Volume Claim and Pod that consume it.

```console
kubectl apply -f - <<EOF
Expand Down Expand Up @@ -367,7 +367,7 @@ cephfs-pvc Bound filesystem-volume 1Gi RWO 1h

In a rook-ceph cluster, the use of object storage is different from the use of block storage and filesystem storage. `ObjectBucketClaim` is used instead of PersistentVolumeClaim. And the application needs secret and configmap to access the objectbucket. When Pod use object storage, they don't mount PVC like block storage and filesystem storage, but instead uniquely specify the ObjectBucketClaim with secret and configmap.

We stil can can ues Kurator application to create ObjectBucketClaim and Pod that consume it, but there will be some changes to the configuration.
We can still use Kurator application to create ObjectBucketClaim and Pod that consume it, but there will be some changes to the configuration.

```console
kubectl apply -f - <<EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This guide will walk you through the process of creating AttachedCluster resourc

### Cluster operator

As the AttachedCluster object is controlled by the cluster-operator, you need to first go to [Install cluser operator](/docs/setup/install-cluster-operator) page to create clusters using `hack/local-dev-setup.sh` and install cluster operator.
As the AttachedCluster object is controlled by the cluster-operator, you need to first go to [Install cluster operator](/docs/setup/install-cluster-operator) page to create clusters using `hack/local-dev-setup.sh` and install cluster operator.

### AttachedCluster secrets

Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/docs/fleet-manager/rollout/abtest.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ An A/B Testing is triggered by changes in any of the following objects:
If you only need to remove the Rollout Policy, simply edit the current application and remove the corresponding description:

```console
kubectl edit applicaiton abtesting-demo
kubectl edit application abtesting-demo
```

To check the results of the deletion, you can observe that the rollout-related pods have been removed:
Expand All @@ -414,7 +414,7 @@ If you want to configure an A/B Testing for it again, you can simply edit the ap

### 2.Cleanup the Application

When the application is delete, all associated resources will also be reomved:
When the application is delete, all associated resources will also be removed:

```console
kubectl delete application abtesting-demo
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/docs/fleet-manager/rollout/blue-green.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ rolloutStatus:
If you only need to remove the Rollout Policy, simply edit the current application and remove the corresponding description:

```console
kubectl edit applicaiton blue-green-demo
kubectl edit application blue-green-demo
```

To check the results of the deletion, you can observe that the rollout-related pods have been removed:
Expand All @@ -473,7 +473,7 @@ If you want to configure a Blue/Green Deployment for it again, you can simply ed

### 2.Cleanup the Application

When the application is delete, all associated resources will also be reomved:
When the application is delete, all associated resources will also be removed:

```console
kubectl delete application abtesting-demo
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/docs/fleet-manager/rollout/canary.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ A canary deployment is triggered by changes in any of the following objects:
If you only need to remove the Rollout Policy, simply edit the current application and remove the corresponding description:

```console
kubectl edit applicaiton rollout-demo
kubectl edit application rollout-demo
```

To check the results of the deletion, you can observe that the rollout-related pods have been removed:
Expand All @@ -411,7 +411,7 @@ If you want to configure a canary deployment for it again, you can simply edit t

### 2.Cleanup the Application

When the application is delete, all associated resources will also be reomved:
When the application is delete, all associated resources will also be removed:

```console
kubectl delete application rollout-demo
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/docs/pipeline/setting.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This document provides a step-by-step guide to setting up your pipeline using Ku

In the following guild, we use [Kind](https://kind.sigs.k8s.io/) clusters as examples.

You need to first go to [Install cluser operator](/docs/setup/install-cluster-operator) page to create clusters using `hack/local-dev-setup.sh` and install cluster operator.
You need to first go to [Install cluster operator](/docs/setup/install-cluster-operator) page to create clusters using `hack/local-dev-setup.sh` and install cluster operator.
We use the host cluster `kurator-host`, where kubeconfig is located in `/root/.kube/kurator-host.config`
Besides, you need setup Fleet manager by following the instructions in the [installation guide](/docs/setup/install-fleet-manager/).

Expand Down
8 changes: 4 additions & 4 deletions docs/content/en/references/apps_v1alpha1_types.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ <h3 id="apps.kurator.dev/v1alpha1.Application">Application
<td>
<em>(Optional)</em>
<p>Destination defines the destination clusters where the artifacts will be synced.
It can be overriden by the syncPolicies&rsquo; destination.</p>
It can be overridden by the syncPolicies&rsquo; destination.</p>
</td>
</tr>
</table>
Expand Down Expand Up @@ -346,7 +346,7 @@ <h3 id="apps.kurator.dev/v1alpha1.ApplicationSpec">ApplicationSpec
<td>
<em>(Optional)</em>
<p>Destination defines the destination clusters where the artifacts will be synced.
It can be overriden by the syncPolicies&rsquo; destination.</p>
It can be overridden by the syncPolicies&rsquo; destination.</p>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -2270,7 +2270,7 @@ <h3 id="apps.kurator.dev/v1alpha1.Webhook">Webhook
e.g.</p>
<pre><code class="language-yaml">webhooks:
- timeoutSeconds: 15
commend:
command:
- &quot;hey -z 1m -q 10 -c 2 http://podinfo-canary.test:9898/&quot;
</code></pre>
<p>The above example means that during trafficAnalysis, the cmd of &ldquo;<a href="http://flagger-loadtester.test/&quot;">http://flagger-loadtester.test/&rdquo;</a> is invoked
Expand Down Expand Up @@ -2306,7 +2306,7 @@ <h3 id="apps.kurator.dev/v1alpha1.Webhook">Webhook
</td>
<td>
<em>(Optional)</em>
<p>Commands define to commends that executed by webhook.</p>
<p>Commands define to commands that executed by webhook.</p>
</td>
</tr>
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/references/fleet_v1alpha1_types.html
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ <h3 id="fleet.kurator.dev/v1alpha1.PluginConfig">PluginConfig
</em>
</td>
<td>
<p>Flagger defines the configuretion for the kurator rollout engine.</p>
<p>Flagger defines the configuration for the kurator rollout engine.</p>
</td>
</tr>
</tbody>
Expand Down
4 changes: 2 additions & 2 deletions docs/proposals/rollout/rollout.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ type CrossNamespaceObjectReference struct {
// e.g.
// webhooks:
// - timeoutSeconds: 15
// commend:
// command:
// - "hey -z 1m -q 10 -c 2 http://podinfo-canary.test:9898/"
// The above example means that during trafficAnalysis, the cmd of "http://flagger-loadtester.test/" is invoked
// to execute the command "hey -z 1m -q 10 -c 2 http://podinfo-canary.test:9898/"
Expand All @@ -439,7 +439,7 @@ type Webhook struct {
// Defaults to 60
TimeoutSeconds *int `json:"timeoutSeconds,omitempty"`

// Command defines to commends that executed by webhook.
// Command defines to commands that executed by webhook.
// +optional
Command []string `json:"command,omitempty"`
}
Expand Down
10 changes: 5 additions & 5 deletions hack/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function util::wait_file_exist() {
}

# util::wait_pod_ready waits for pod state becomes ready until timeout.
# Parmeters:
# Parameters:
# - $1: pod label, such as "app=etcd"
# - $2: pod namespace, such as "karmada-system"
# - $3: time out, such as "200s"
Expand All @@ -120,7 +120,7 @@ function util::wait_pod_ready() {
}

# util::wait_apiservice_ready waits for apiservice state becomes Available until timeout.
# Parmeters:
# Parameters:
# - $1: apiservice label, such as "app=etcd"
# - $3: time out, such as "200s"
function util::wait_apiservice_ready() {
Expand All @@ -140,7 +140,7 @@ function util::wait_apiservice_ready() {

# util::create_cluster creates a kubernetes cluster
# util::create_cluster creates a kind cluster and don't wait for control plane node to be ready.
# Parmeters:
# Parameters:
# - $1: cluster name, such as "host"
# - $2: KUBECONFIG file, such as "/var/run/host.config"
# - $3: node docker image to use for booting the cluster, such as "kindest/node:v1.19.1"
Expand Down Expand Up @@ -266,8 +266,8 @@ function util::wait_pods() {
ns=$1
lb=$2
waittime=$3
# Wait for the pods to be ready in the given namespace with lable
while :; do
# Wait for the pods to be ready in the given namespace with label
while : ; do
res=$(kubectl wait --kubeconfig="$4" --context "$5" -n "${ns}" pod \
-l "${lb}" --for=condition=Ready --timeout="${waittime}s" 2>/dev/null || true)
if [[ "${res}" == *"condition met"* ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
destination:
description: |-
Destination defines the destination clusters where the artifacts will be synced.
It can be overriden by the syncPolicies' destination.
It can be overridden by the syncPolicies' destination.
properties:
clusterSelector:
description: |-
Expand Down Expand Up @@ -1360,7 +1360,7 @@ spec:
description: Webhook list for this traffic analysis
properties:
command:
description: Commands define to commends that
description: Commands define to commands that
executed by webhook.
items:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2462,7 +2462,7 @@ spec:
- storage
type: object
flagger:
description: Flagger defines the configuretion for the kurator
description: Flagger defines the configuration for the kurator
rollout engine.
properties:
chart:
Expand Down
2 changes: 1 addition & 1 deletion manifests/profiles/infra/plugins/aws-cni-calico.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ spec:
numAllowedLocalASNumbers:
description: Maximum number of local AS numbers that are allowed in
the AS path for received routes. This removes BGP loop prevention
and should only be used if absolutely necesssary.
and should only be used if absolutely necessary.
format: int32
type: integer
password:
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/apps/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type ApplicationSpec struct {
// SyncPolicies controls how the artifact will be customized and where it will be synced.
SyncPolicies []*ApplicationSyncPolicy `json:"syncPolicies"`
// Destination defines the destination clusters where the artifacts will be synced.
// It can be overriden by the syncPolicies' destination.
// It can be overridden by the syncPolicies' destination.
// +optional
Destination *ApplicationDestination `json:"destination,omitempty"`
}
Expand Down Expand Up @@ -399,7 +399,7 @@ type CrossNamespaceObjectReference struct {
// ```yaml
// webhooks:
// - timeoutSeconds: 15
// commend:
// command:
// - "hey -z 1m -q 10 -c 2 http://podinfo-canary.test:9898/"
//
// ```
Expand All @@ -411,7 +411,7 @@ type Webhook struct {
// Defaults to 60
TimeoutSeconds *int `json:"timeoutSeconds,omitempty"`

// Commands define to commends that executed by webhook.
// Commands define to commands that executed by webhook.
// +optional
Commands []string `json:"command,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/cluster/v1alpha1/cluster_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const (
ProvisioningReason = "Provisioning"
// DeletingReason (Severity=Info) documents that the cluster is being deleted.
DeletingReason = "Deleting"
// ProviderInitializeFailedReason (Severity=Error) documents that the cluster infrastructure provider initilize failed, probabily a wrong credential.
// ProviderInitializeFailedReason (Severity=Error) documents that the cluster infrastructure provider initialize failed, probably a wrong credential.

ProviderInitializeFailedReason = "ProviderInitializeFailed"
// ClusterResourceSetProvisionFailedReason (Severity=Error) documents that the additional Cluster API resources (ClusterResourceSet etc.) provisioning failed.
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/fleet/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ type PluginConfig struct {
Backup *BackupConfig `json:"backup,omitempty"`
// DistributedStorage define the configuration for the distributed storage(Implemented with Rook)
DistributedStorage *DistributedStorageConfig `json:"distributedStorage,omitempty"`
// Flagger defines the configuretion for the kurator rollout engine.
// Flagger defines the configuration for the kurator rollout engine.
Flagger *FlaggerConfig `json:"flagger,omitempty"`
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (c *Client) UpdateResource(obj interface{}) error {
return err
}

// Copied from karmada, because we donot want to build the controller-runtime client.
// Copied from karmada, because we do not want to build the controller-runtime client.
func (c *Client) memberClusterConfig(clusterName string) (*rest.Config, error) {
cluster, err := c.karmada.ClusterV1alpha1().Clusters().Get(context.TODO(), clusterName, metav1.GetOptions{})
if err != nil {
Expand Down
Loading

0 comments on commit 19220c1

Please sign in to comment.