diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 000000000..e199e7d14 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,3 @@ +[codespell] +skip = .git,go.sum,go.mod,*.png,*.svg,./manifests +ignore-words-list = NotIn,te,ans,AKS \ No newline at end of file diff --git a/.github/workflows/code-spell.yml b/.github/workflows/code-spell.yml new file mode 100644 index 000000000..22cdd2835 --- /dev/null +++ b/.github/workflows/code-spell.yml @@ -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 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index dd4958a9e..ffa13d8e4 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -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 diff --git a/cmd/kurator/app/pipeline/execution/logs/logs.go b/cmd/kurator/app/pipeline/execution/logs/logs.go index 9d660109a..15110f1f4 100644 --- a/cmd/kurator/app/pipeline/execution/logs/logs.go +++ b/cmd/kurator/app/pipeline/execution/logs/logs.go @@ -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) diff --git a/docs/README.md b/docs/README.md index 9d87eab42..cf7e06a12 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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 ``` diff --git a/docs/content/en/docs/Integrations/istio.md b/docs/content/en/docs/Integrations/istio.md index f8503f5b4..f909ac9ba 100644 --- a/docs/content/en/docs/Integrations/istio.md +++ b/docs/content/en/docs/Integrations/istio.md @@ -45,4 +45,4 @@ kurator install istio --primary member1 --remote member2 ### Next steps -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) diff --git a/docs/content/en/docs/Integrations/pixie-vizier.md b/docs/content/en/docs/Integrations/pixie-vizier.md index 949770c6d..079d762d3 100644 --- a/docs/content/en/docs/Integrations/pixie-vizier.md +++ b/docs/content/en/docs/Integrations/pixie-vizier.md @@ -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= diff --git a/docs/content/en/docs/fleet-manager/_index.md b/docs/content/en/docs/fleet-manager/_index.md index 37599e3f2..c857679a2 100644 --- a/docs/content/en/docs/fleet-manager/_index.md +++ b/docs/content/en/docs/fleet-manager/_index.md @@ -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. diff --git a/docs/content/en/docs/fleet-manager/application.md b/docs/content/en/docs/fleet-manager/application.md index f248f61b0..0a074c2a3 100644 --- a/docs/content/en/docs/fleet-manager/application.md +++ b/docs/content/en/docs/fleet-manager/application.md @@ -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. diff --git a/docs/content/en/docs/fleet-manager/distributedstorage-plugin.md b/docs/content/en/docs/fleet-manager/distributedstorage-plugin.md index 12329289a..08708c452 100644 --- a/docs/content/en/docs/fleet-manager/distributedstorage-plugin.md +++ b/docs/content/en/docs/fleet-manager/distributedstorage-plugin.md @@ -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 @@ -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 @@ -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 - <Application (Optional)

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.

@@ -346,7 +346,7 @@

ApplicationSpec (Optional)

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.

@@ -2270,7 +2270,7 @@

Webhook 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 @@ -2306,7 +2306,7 @@

Webhook (Optional) -

Commands define to commends that executed by webhook.

+

Commands define to commands that executed by webhook.

diff --git a/docs/content/en/references/fleet_v1alpha1_types.html b/docs/content/en/references/fleet_v1alpha1_types.html index dd4f2b9b0..b1c1dcf06 100644 --- a/docs/content/en/references/fleet_v1alpha1_types.html +++ b/docs/content/en/references/fleet_v1alpha1_types.html @@ -1430,7 +1430,7 @@

PluginConfig -

Flagger defines the configuretion for the kurator rollout engine.

+

Flagger defines the configuration for the kurator rollout engine.

diff --git a/docs/proposals/rollout/rollout.md b/docs/proposals/rollout/rollout.md index b8f24277b..934464e46 100644 --- a/docs/proposals/rollout/rollout.md +++ b/docs/proposals/rollout/rollout.md @@ -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/" @@ -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"` } diff --git a/hack/util.sh b/hack/util.sh index 897de5a8f..6c25ca4eb 100755 --- a/hack/util.sh +++ b/hack/util.sh @@ -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" @@ -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() { @@ -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" @@ -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 diff --git a/manifests/charts/fleet-manager/crds/apps.kurator.dev_applications.yaml b/manifests/charts/fleet-manager/crds/apps.kurator.dev_applications.yaml index 3fb6f0c2c..333ff9346 100644 --- a/manifests/charts/fleet-manager/crds/apps.kurator.dev_applications.yaml +++ b/manifests/charts/fleet-manager/crds/apps.kurator.dev_applications.yaml @@ -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: |- @@ -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 diff --git a/manifests/charts/fleet-manager/crds/fleet.kurator.dev_fleets.yaml b/manifests/charts/fleet-manager/crds/fleet.kurator.dev_fleets.yaml index 02e45f3d9..1fd7b9f03 100644 --- a/manifests/charts/fleet-manager/crds/fleet.kurator.dev_fleets.yaml +++ b/manifests/charts/fleet-manager/crds/fleet.kurator.dev_fleets.yaml @@ -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: diff --git a/manifests/profiles/infra/plugins/aws-cni-calico.yaml b/manifests/profiles/infra/plugins/aws-cni-calico.yaml index 4bd07c18d..421a04abb 100644 --- a/manifests/profiles/infra/plugins/aws-cni-calico.yaml +++ b/manifests/profiles/infra/plugins/aws-cni-calico.yaml @@ -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: diff --git a/pkg/apis/apps/v1alpha1/types.go b/pkg/apis/apps/v1alpha1/types.go index 78c6c9493..81829aaf5 100644 --- a/pkg/apis/apps/v1alpha1/types.go +++ b/pkg/apis/apps/v1alpha1/types.go @@ -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"` } @@ -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/" // // ``` @@ -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"` } diff --git a/pkg/apis/cluster/v1alpha1/cluster_consts.go b/pkg/apis/cluster/v1alpha1/cluster_consts.go index 9f53bff81..e02fa0766 100644 --- a/pkg/apis/cluster/v1alpha1/cluster_consts.go +++ b/pkg/apis/cluster/v1alpha1/cluster_consts.go @@ -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. diff --git a/pkg/apis/fleet/v1alpha1/types.go b/pkg/apis/fleet/v1alpha1/types.go index 5dd918390..d57042cc1 100644 --- a/pkg/apis/fleet/v1alpha1/types.go +++ b/pkg/apis/fleet/v1alpha1/types.go @@ -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"` } diff --git a/pkg/client/client.go b/pkg/client/client.go index 43fc6d618..2b445831c 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -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 { diff --git a/pkg/fleet-manager/application/rollout_helper.go b/pkg/fleet-manager/application/rollout_helper.go index 32bce3b41..0e7622fbb 100644 --- a/pkg/fleet-manager/application/rollout_helper.go +++ b/pkg/fleet-manager/application/rollout_helper.go @@ -338,7 +338,7 @@ func installPrivateTestloader(ctx context.Context, namespacedName types.Namespac func deleteResourceCreatedByKurator(ctx context.Context, namespaceName types.NamespacedName, kubeClient client.Client, obj client.Object) error { if err := kubeClient.Get(ctx, namespaceName, obj); err != nil { if !apierrors.IsNotFound(err) { - return errors.Wrapf(err, "falied to get resource %s in %s", namespaceName.Name, namespaceName.Namespace) + return errors.Wrapf(err, "failed to get resource %s in %s", namespaceName.Name, namespaceName.Namespace) } } else { // verify if the deployment were created by kurator diff --git a/pkg/fleet-manager/controlplane.go b/pkg/fleet-manager/controlplane.go index 38b2231bf..1a81ef4f3 100644 --- a/pkg/fleet-manager/controlplane.go +++ b/pkg/fleet-manager/controlplane.go @@ -37,7 +37,7 @@ const FleetWorkerClusterRoleBindingName = "fleet-worker" func (f *FleetManager) reconcileControlPlane(ctx context.Context, fleet *fleetapi.Fleet) error { controlplane := fleet.Annotations[fleetapi.ControlplaneAnnotation] // if no controlplane is specified, do nothing - // we donot support annotation update yet + // we do not support annotation update yet if controlplane == "" { fleet.Status.Phase = fleetapi.ReadyPhase fleet.Status.CredentialSecret = nil diff --git a/pkg/infra/aws/aws_pod_identity.go b/pkg/infra/aws/aws_pod_identity.go index 05593356a..c3c58dc81 100644 --- a/pkg/infra/aws/aws_pod_identity.go +++ b/pkg/infra/aws/aws_pod_identity.go @@ -32,7 +32,7 @@ import ( var _ service.PodIdentity = &AWSPodIdentity{} -// AWSPodIdentity is a service for creating AWS pod identity folow the guide: https://github.com/aws/amazon-eks-pod-identity-webhook/blob/master/SELF_HOSTED_SETUP.md +// AWSPodIdentity is a service for creating AWS pod identity follow the guide: https://github.com/aws/amazon-eks-pod-identity-webhook/blob/master/SELF_HOSTED_SETUP.md // It will create a S3 bucket and put the OIDC files(pubicl access) and certs(private access) to the bucket, then create a OpenID connect provider. type AWSPodIdentity struct { bucketName string diff --git a/pkg/infra/plugin/testdata/aws-cni-calico.yaml b/pkg/infra/plugin/testdata/aws-cni-calico.yaml index 9ef415731..c3c6ea0f7 100644 --- a/pkg/infra/plugin/testdata/aws-cni-calico.yaml +++ b/pkg/infra/plugin/testdata/aws-cni-calico.yaml @@ -325,7 +325,7 @@ data: 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: diff --git a/pkg/plugin/istio/install.go b/pkg/plugin/istio/install.go index 012b12028..2926a4f9b 100644 --- a/pkg/plugin/istio/install.go +++ b/pkg/plugin/istio/install.go @@ -152,10 +152,10 @@ func (p *IstioPlugin) createIstioCacerts() error { return util.ApplyPropagationPolicy(p.Client, p.allClusters(), s) } // err can be divided into two types: - // 1 Unexpect, return directly + // 1 Unexpected, return directly // 2 IsNotFound, to create Istio Cacerts if !apierrors.IsNotFound(err) { - return fmt.Errorf("unexpect error when get secret %s, %w", caSecret, err) + return fmt.Errorf("unexpected error when get secret %s, %w", caSecret, err) } var gen istiocert.Generator diff --git a/pkg/plugin/prometheus/plugin.go b/pkg/plugin/prometheus/plugin.go index 9cf413170..d442f2f70 100644 --- a/pkg/plugin/prometheus/plugin.go +++ b/pkg/plugin/prometheus/plugin.go @@ -322,7 +322,7 @@ func (p *Plugin) createAdditionalScrapeConfigs() error { return err } if promCfg.Namespace == "" { - return fmt.Errorf("get prom faild, %+v", promCfg) + return fmt.Errorf("get prom failed, %+v", promCfg) } op := &policyv1alpha1.OverridePolicy{ TypeMeta: typemeta.OverridePolicy, diff --git a/pkg/plugin/volcano/plugin.go b/pkg/plugin/volcano/plugin.go index f020082a5..39bb62082 100644 --- a/pkg/plugin/volcano/plugin.go +++ b/pkg/plugin/volcano/plugin.go @@ -158,7 +158,7 @@ func (p *Plugin) volcanoManifest() (string, error) { case "arm64": manifestName = "installer/volcano-development-arm64.yaml" default: - return "", fmt.Errorf("os arch %s is not supportted", runtime.GOARCH) + return "", fmt.Errorf("os arch %s is not supported", runtime.GOARCH) } url, _ := util.JoinUrlPath(volcano.ReleaseURLPrefix, ver, manifestName) yaml, err := util.DownloadResource(url, "")