Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add codespell check upon PR creation #926

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
aks
AfterAll
CROs
NotIn
fo
allReady
24 changes: 24 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# GitHub Action to automate the identification of common misspellings in text files.
# https://github.com/codespell-project/actions-codespell
# https://github.com/codespell-project/codespell
name: codespell
on: [pull_request]
permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: codespell-project/actions-codespell@406322ec52dd7b488e48c1c4b82e2a8b3a1bf630 # master
with:
check_filenames: true
skip: ./.git,./.github/workflows/codespell.yml,.git,*.png,*.jpg,*.svg,*.sum,./vendor,go.sum,testdata
ignore_words_file: .codespellignore
2 changes: 1 addition & 1 deletion apis/cluster/v1/membercluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func (m *MemberCluster) RemoveCondition(conditionType string) {

// GetAgentStatus retrieves the status of a specific member agent from the MemberCluster object.
//
// If the specificed agent does not exist, or it has not updated its status with the hub cluster
// If the specified agent does not exist, or it has not updated its status with the hub cluster
// yet, this function returns nil.
func (m *MemberCluster) GetAgentStatus(agentType AgentType) *AgentStatus {
for _, s := range m.Status.AgentStatus {
Expand Down
2 changes: 1 addition & 1 deletion apis/cluster/v1beta1/membercluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (m *MemberCluster) RemoveCondition(conditionType string) {

// GetAgentStatus retrieves the status of a specific member agent from the MemberCluster object.
//
// If the specificed agent does not exist, or it has not updated its status with the hub cluster
// If the specified agent does not exist, or it has not updated its status with the hub cluster
// yet, this function returns nil.
func (m *MemberCluster) GetAgentStatus(agentType AgentType) *AgentStatus {
for _, s := range m.Status.AgentStatus {
Expand Down
2 changes: 1 addition & 1 deletion apis/placement/v1/clusterresourceplacement_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (
// that the CRP controller can react to CRP deletions if necessary.
ClusterResourcePlacementCleanupFinalizer = fleetPrefix + "crp-cleanup"

// SchedulerCRPCleanupFinalizer is a finalizer addd by the scheduler to CRPs, to make sure
// SchedulerCRPCleanupFinalizer is a finalizer added by the scheduler to CRPs, to make sure
// that all bindings derived from a CRP can be cleaned up after the CRP is deleted.
SchedulerCRPCleanupFinalizer = fleetPrefix + "scheduler-cleanup"
)
Expand Down
6 changes: 3 additions & 3 deletions apis/placement/v1/work_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type WorkSpec struct {

// WorkloadTemplate represents the manifest workload to be deployed on spoke cluster
type WorkloadTemplate struct {
// Manifests represents a list of kuberenetes resources to be deployed on the spoke cluster.
// Manifests represents a list of kubernetes resources to be deployed on the spoke cluster.
// +optional
Manifests []Manifest `json:"manifests,omitempty"`
}
Expand All @@ -75,7 +75,7 @@ type WorkStatus struct {
// Conditions contains the different condition statuses for this work.
// Valid condition types are:
// 1. Applied represents workload in Work is applied successfully on the spoke cluster.
// 2. Progressing represents workload in Work in the trasitioning from one state to another the on the spoke cluster.
// 2. Progressing represents workload in Work in the transitioning from one state to another the on the spoke cluster.
// 3. Available represents workload in Work exists on the spoke cluster.
// 4. Degraded represents the current state of workload does not match the desired
// state for a certain period.
Expand All @@ -91,7 +91,7 @@ type WorkStatus struct {
// Renamed original "ResourceIdentifier" so that it won't conflict with ResourceIdentifier defined in the clusterresourceplacement_types.go.
type WorkResourceIdentifier struct {
// Ordinal represents an index in manifests list, so the condition can still be linked
// to a manifest even thougth manifest cannot be parsed successfully.
// to a manifest even though manifest cannot be parsed successfully.
Ordinal int `json:"ordinal"`

// Group is the group of the resource.
Expand Down
6 changes: 3 additions & 3 deletions apis/placement/v1beta1/clusterresourceplacement_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (
// that the CRP controller can react to CRP deletions if necessary.
ClusterResourcePlacementCleanupFinalizer = fleetPrefix + "crp-cleanup"

// SchedulerCRPCleanupFinalizer is a finalizer addd by the scheduler to CRPs, to make sure
// SchedulerCRPCleanupFinalizer is a finalizer added by the scheduler to CRPs, to make sure
// that all bindings derived from a CRP can be cleaned up after the CRP is deleted.
SchedulerCRPCleanupFinalizer = fleetPrefix + "scheduler-cleanup"
)
Expand Down Expand Up @@ -515,7 +515,7 @@ type ApplyStrategy struct {
// performs a client-side apply. This is the default option.
//
// Note that this strategy requires that Fleet keep the last applied configuration in the
// annoation of an applied resource. If the object gets so large that apply ops can no longer
// annotation of an applied resource. If the object gets so large that apply ops can no longer
// be executed, Fleet will switch to server-side apply.
//
// Use ComparisonOption and WhenToApply settings to control when an apply op can be executed.
Expand All @@ -531,7 +531,7 @@ type ApplyStrategy struct {
// Use ComparisonOption and WhenToApply settings to control when an apply op can be executed.
//
// * ReportDiff: Fleet will compare the desired state of a resource as kept in the hub cluster
// with its current state (if appliable) on the member cluster side, and report any
// with its current state (if applicable) on the member cluster side, and report any
// differences. No actual apply ops would be executed, and resources will be left alone as they
// are on the member clusters.
//
Expand Down
6 changes: 3 additions & 3 deletions apis/placement/v1beta1/work_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type WorkSpec struct {

// WorkloadTemplate represents the manifest workload to be deployed on spoke cluster
type WorkloadTemplate struct {
// Manifests represents a list of kuberenetes resources to be deployed on the spoke cluster.
// Manifests represents a list of kubernetes resources to be deployed on the spoke cluster.
// +optional
Manifests []Manifest `json:"manifests,omitempty"`
}
Expand All @@ -74,7 +74,7 @@ type WorkStatus struct {
// Conditions contains the different condition statuses for this work.
// Valid condition types are:
// 1. Applied represents workload in Work is applied successfully on the spoke cluster.
// 2. Progressing represents workload in Work in the trasitioning from one state to another the on the spoke cluster.
// 2. Progressing represents workload in Work in the transitioning from one state to another the on the spoke cluster.
// 3. Available represents workload in Work exists on the spoke cluster.
// 4. Degraded represents the current state of workload does not match the desired
// state for a certain period.
Expand All @@ -90,7 +90,7 @@ type WorkStatus struct {
// Renamed original "ResourceIdentifier" so that it won't conflict with ResourceIdentifier defined in the clusterresourceplacement_types.go.
type WorkResourceIdentifier struct {
// Ordinal represents an index in manifests list, so the condition can still be linked
// to a manifest even thougth manifest cannot be parsed successfully.
// to a manifest even though manifest cannot be parsed successfully.
Ordinal int `json:"ordinal"`

// Group is the group of the resource.
Expand Down
2 changes: 1 addition & 1 deletion cmd/hubagent/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (o *Options) AddFlags(flags *flag.FlagSet) {
flags.DurationVar(&o.LeaderElection.LeaseDuration.Duration, "leader-lease-duration", 15*time.Second, "This is effectively the maximum duration that a leader can be stopped before someone else will replace it.")
flag.StringVar(&o.LeaderElection.ResourceNamespace, "leader-election-namespace", utils.FleetSystemNamespace, "The namespace in which the leader election resource will be created.")
flag.BoolVar(&o.EnableWebhook, "enable-webhook", true, "If set, the fleet webhook is enabled.")
// set a defautl value 'fleetwebhook' for webhook service name for backward compatibility. The service name was hard coded to 'fleetwebhook' in the past.
// set a default value 'fleetwebhook' for webhook service name for backward compatibility. The service name was hard coded to 'fleetwebhook' in the past.
flag.StringVar(&o.WebhookServiceName, "webhook-service-name", "fleetwebhook", "Fleet webhook service name.")
flag.BoolVar(&o.EnableGuardRail, "enable-guard-rail", false, "If set, the fleet guard rail webhook configurations are enabled.")
flag.StringVar(&o.WhiteListedUsers, "whitelisted-users", "", "If set, white listed users can modify fleet related resources.")
Expand Down
4 changes: 2 additions & 2 deletions cmd/memberagent/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ func Test_buildHubConfig(t *testing.T) {
assert.Nil(t, config)
assert.NotNil(t, err)
})
t.Run("use token auth, no toke path - error", func(t *testing.T) {
t.Run("use token auth, no token path - error", func(t *testing.T) {
t.Setenv("CONFIG_PATH", "")
config, err := buildHubConfig("https://hub.domain.com", false, false)
assert.Nil(t, config)
assert.NotNil(t, err)
})
t.Run("use token auth, not exists toke path - error", func(t *testing.T) {
t.Run("use token auth, not exists token path - error", func(t *testing.T) {
t.Setenv("CONFIG_PATH", "/hot/exists/token/path")
config, err := buildHubConfig("https://hub.domain.com", false, false)
assert.Nil(t, config)
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/multicluster.x-k8s.io_appliedworks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ spec:
type: string
ordinal:
description: Ordinal represents an index in manifests list,
so the condition can still be linked to a manifest even thougth
so the condition can still be linked to a manifest even though
manifest cannot be parsed successfully.
type: integer
resource:
Expand Down
6 changes: 3 additions & 3 deletions config/crd/bases/multicluster.x-k8s.io_works.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
on spoke cluster
properties:
manifests:
description: Manifests represents a list of kuberenetes resources
description: Manifests represents a list of kubernetes resources
to be deployed on the spoke cluster.
items:
description: Manifest represents a resource to be deployed on
Expand All @@ -59,7 +59,7 @@ spec:
description: 'Conditions contains the different condition statuses
for this work. Valid condition types are: 1. Applied represents
workload in Work is applied successfully on the spoke cluster. 2.
Progressing represents workload in Work in the trasitioning from
Progressing represents workload in Work in the transitioning from
one state to another the on the spoke cluster. 3. Available represents
workload in Work exists on the spoke cluster. 4. Degraded represents
the current state of workload does not match the desired state for
Expand Down Expand Up @@ -233,7 +233,7 @@ spec:
ordinal:
description: Ordinal represents an index in manifests list,
so the condition can still be linked to a manifest even
thougth manifest cannot be parsed successfully.
though manifest cannot be parsed successfully.
type: integer
resource:
description: Resource is the resource type of the resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ spec:
ordinal:
description: |-
Ordinal represents an index in manifests list, so the condition can still be linked
to a manifest even thougth manifest cannot be parsed successfully.
to a manifest even though manifest cannot be parsed successfully.
type: integer
resource:
description: Resource is the resource type of the resource
Expand Down Expand Up @@ -199,7 +199,7 @@ spec:
ordinal:
description: |-
Ordinal represents an index in manifests list, so the condition can still be linked
to a manifest even thougth manifest cannot be parsed successfully.
to a manifest even though manifest cannot be parsed successfully.
type: integer
resource:
description: Resource is the resource type of the resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ spec:


Note that this strategy requires that Fleet keep the last applied configuration in the
annoation of an applied resource. If the object gets so large that apply ops can no longer
annotation of an applied resource. If the object gets so large that apply ops can no longer
be executed, Fleet will switch to server-side apply.


Expand All @@ -585,7 +585,7 @@ spec:


* ReportDiff: Fleet will compare the desired state of a resource as kept in the hub cluster
with its current state (if appliable) on the member cluster side, and report any
with its current state (if applicable) on the member cluster side, and report any
differences. No actual apply ops would be executed, and resources will be left alone as they
are on the member clusters.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,7 @@ spec:


Note that this strategy requires that Fleet keep the last applied configuration in the
annoation of an applied resource. If the object gets so large that apply ops can no longer
annotation of an applied resource. If the object gets so large that apply ops can no longer
be executed, Fleet will switch to server-side apply.


Expand All @@ -1913,7 +1913,7 @@ spec:


* ReportDiff: Fleet will compare the desired state of a resource as kept in the hub cluster
with its current state (if appliable) on the member cluster side, and report any
with its current state (if applicable) on the member cluster side, and report any
differences. No actual apply ops would be executed, and resources will be left alone as they
are on the member clusters.

Expand Down
16 changes: 8 additions & 8 deletions config/crd/bases/placement.kubernetes-fleet.io_works.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ spec:
on spoke cluster
properties:
manifests:
description: Manifests represents a list of kuberenetes resources
description: Manifests represents a list of kubernetes resources
to be deployed on the spoke cluster.
items:
description: Manifest represents a resource to be deployed on
Expand All @@ -107,7 +107,7 @@ spec:
Conditions contains the different condition statuses for this work.
Valid condition types are:
1. Applied represents workload in Work is applied successfully on the spoke cluster.
2. Progressing represents workload in Work in the trasitioning from one state to another the on the spoke cluster.
2. Progressing represents workload in Work in the transitioning from one state to another the on the spoke cluster.
3. Available represents workload in Work exists on the spoke cluster.
4. Degraded represents the current state of workload does not match the desired
state for a certain period.
Expand Down Expand Up @@ -283,7 +283,7 @@ spec:
ordinal:
description: |-
Ordinal represents an index in manifests list, so the condition can still be linked
to a manifest even thougth manifest cannot be parsed successfully.
to a manifest even though manifest cannot be parsed successfully.
type: integer
resource:
description: Resource is the resource type of the resource
Expand Down Expand Up @@ -473,7 +473,7 @@ spec:


Note that this strategy requires that Fleet keep the last applied configuration in the
annoation of an applied resource. If the object gets so large that apply ops can no longer
annotation of an applied resource. If the object gets so large that apply ops can no longer
be executed, Fleet will switch to server-side apply.


Expand All @@ -493,7 +493,7 @@ spec:


* ReportDiff: Fleet will compare the desired state of a resource as kept in the hub cluster
with its current state (if appliable) on the member cluster side, and report any
with its current state (if applicable) on the member cluster side, and report any
differences. No actual apply ops would be executed, and resources will be left alone as they
are on the member clusters.

Expand Down Expand Up @@ -565,7 +565,7 @@ spec:
on spoke cluster
properties:
manifests:
description: Manifests represents a list of kuberenetes resources
description: Manifests represents a list of kubernetes resources
to be deployed on the spoke cluster.
items:
description: Manifest represents a resource to be deployed on
Expand All @@ -585,7 +585,7 @@ spec:
Conditions contains the different condition statuses for this work.
Valid condition types are:
1. Applied represents workload in Work is applied successfully on the spoke cluster.
2. Progressing represents workload in Work in the trasitioning from one state to another the on the spoke cluster.
2. Progressing represents workload in Work in the transitioning from one state to another the on the spoke cluster.
3. Available represents workload in Work exists on the spoke cluster.
4. Degraded represents the current state of workload does not match the desired
state for a certain period.
Expand Down Expand Up @@ -761,7 +761,7 @@ spec:
ordinal:
description: |-
Ordinal represents an index in manifests list, so the condition can still be linked
to a manifest even thougth manifest cannot be parsed successfully.
to a manifest even though manifest cannot be parsed successfully.
type: integer
resource:
description: Resource is the resource type of the resource
Expand Down
Loading
Loading