Skip to content

Commit

Permalink
Merge pull request #5888 from chaosi-zju/pr4447
Browse files Browse the repository at this point in the history
fix code typo errors
  • Loading branch information
karmada-bot authored Nov 28, 2024
2 parents 40ec488 + 13c28a0 commit 3783eaf
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion operator/pkg/controlplane/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func createKarmadaAPIServerService(client clientset.Interface, cfg *operatorv1al
return fmt.Errorf("error when decoding karmadaApiserver serive: %w", err)
}

// merge annotaions with configuration of karmada apiserver.
// merge annotations with configuration of karmada apiserver.
karmadaApiserverService.Annotations = labels.Merge(karmadaApiserverService.Annotations, cfg.ServiceAnnotations)

if err := apiclient.CreateOrUpdateService(client, karmadaApiserverService); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions operator/pkg/tasks/init/apiserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func TestRunAggregatedAPIServer(t *testing.T) {
errMsg: "aggregated-apiserver task invoked with an invalid data struct",
},
{
name: "RunAggregatedApiserver_ValidTypeAssertion_TypeAssertionSuceeded",
name: "RunAggregatedApiserver_ValidTypeAssertion_TypeAssertionSucceeded",
runData: &TestInitData{},
wantErr: false,
},
Expand Down Expand Up @@ -156,7 +156,7 @@ func TestRunAPIServer(t *testing.T) {
errMsg: "apiserver task invoked with an invalid data struct",
},
{
name: "RunAPIServer_ValidTypeAssertion_TypeAssertionSuceeded",
name: "RunAPIServer_ValidTypeAssertion_TypeAssertionSucceeded",
runData: &TestInitData{},
wantErr: false,
},
Expand Down
4 changes: 2 additions & 2 deletions operator/pkg/tasks/init/cert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func TestRunCerts(t *testing.T) {
errMsg: "certs task invoked with an invalid data struct",
},
{
name: "RunCerts_ValidTypeAssertion_TypeAssertionSuceeded",
name: "RunCerts_ValidTypeAssertion_TypeAssertionSucceeded",
runData: &TestInitData{},
wantErr: false,
},
Expand Down Expand Up @@ -119,7 +119,7 @@ func TestSkipCerts(t *testing.T) {
errMsg: "certs task invoked with an invalid data struct",
},
{
name: "SkipCerts_ValidTypeAssertion_TypeAssertionSuceeded",
name: "SkipCerts_ValidTypeAssertion_TypeAssertionSucceeded",
runData: &TestInitData{
Name: "karmada-demo",
Namespace: "test",
Expand Down
2 changes: 1 addition & 1 deletion operator/pkg/util/apiclient/wait_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func TestWaitForAPIService(t *testing.T) {
prep: func(client aggregator.Interface, apiService *apiregistrationv1.APIService) error {
apiServiceCreated, err := client.ApiregistrationV1().APIServices().Create(context.TODO(), apiService, metav1.CreateOptions{})
if err != nil {
return fmt.Errorf("faield to create api service %s, got err: %v", apiService.Name, err)
return fmt.Errorf("failed to create api service %s, got err: %v", apiService.Name, err)
}
apiServiceCreated.Status = apiregistrationv1.APIServiceStatus{
Conditions: []apiregistrationv1.APIServiceCondition{
Expand Down
2 changes: 1 addition & 1 deletion operator/pkg/util/kubeconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ users:
t.Errorf("unexpected error, got: %v", err)
}
if err != nil && test.wantErr && !strings.Contains(err.Error(), test.errMsg) {
t.Errorf("expceted error message %s to be in %s", test.errMsg, err.Error())
t.Errorf("expected error message %s to be in %s", test.errMsg, err.Error())
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion operator/pkg/util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func TestDownloadFile(t *testing.T) {
errMsg: "failed to download file",
},
{
name: "DownloadFile_FileDownlaoded_",
name: "DownloadFile_FileDownloaded_",
url: "https://www.example.com/test-file",
filePath: filepath.Join(os.TempDir(), "temp-download-file.txt"),
prep: func(_, filePath string) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func TestCertRotationController_syncCertRotation(t *testing.T) {
wantErr bool
}{
{
name: "shoud not rotate cert",
name: "should not rotate cert",
secret: &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{Namespace: "ns1", Name: "secret"},
Data: map[string][]byte{"karmada-kubeconfig": []byte(`apiVersion: v1
Expand Down
6 changes: 3 additions & 3 deletions pkg/controllers/cluster/cluster_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,19 +287,19 @@ func TestController_Reconcile(t *testing.T) {
c := newClusterController()
if tt.cluster != nil {
if err := c.Create(context.Background(), tt.cluster, &client.CreateOptions{}); err != nil {
t.Fatalf("faild to create cluster %v", err)
t.Fatalf("failed to create cluster %v", err)
}
}

if tt.ns != nil {
if err := c.Create(context.Background(), tt.ns, &client.CreateOptions{}); err != nil {
t.Fatalf("faild to create ns %v", err)
t.Fatalf("failed to create ns %v", err)
}
}

if tt.work != nil {
if err := c.Create(context.Background(), tt.work, &client.CreateOptions{}); err != nil {
t.Fatalf("faild to create work %v", err)
t.Fatalf("failed to create work %v", err)
}
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/registry/cluster/strategy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func TestStrategy_WarningsOnCreate(t *testing.T) {

wrs := clusterStrategy.WarningsOnCreate(ctx, cluster)
if len(wrs) > 0 {
t.Errorf("Cluster is validate but go warings: %v", wrs)
t.Errorf("Cluster is validate but go warnings: %v", wrs)
}
}

Expand Down Expand Up @@ -372,6 +372,6 @@ func TestStrategy_WarningsOnUpdate(t *testing.T) {

wrs := clusterStrategy.WarningsOnUpdate(ctx, cluster, nil)
if len(wrs) > 0 {
t.Errorf("Cluster is validate but go warings: %v", wrs)
t.Errorf("Cluster is validate but go warnings: %v", wrs)
}
}
2 changes: 1 addition & 1 deletion pkg/resourceinterpreter/customized/webhook/customized.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func (e *CustomizedInterpreter) callHook(ctx context.Context, hook configmanager
if err != nil {
return nil, &webhookutil.ErrCallingWebhook{
WebhookName: hook.GetUID(),
Reason: fmt.Errorf("reveived invalid webhook response: %w", err),
Reason: fmt.Errorf("received invalid webhook response: %w", err),
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ spec:
if desiredObj.spec.volumes ~= nil then
volumes = desiredObj.spec.volumes
end
for volumnIndex, volume in pairs(volumes) do
for volumeIndex, volume in pairs(volumes) do
if volume.configMap ~= nil and volume.configMap.name ~= nil and volume.configMap.name ~= '' then
dependentConfigMaps[volume.configMap.name] = true
end
Expand Down
4 changes: 2 additions & 2 deletions pkg/search/controllers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func TestUpdateClusterEventHandler(t *testing.T) {
},
verify: func(clientConnector *fakekarmadaclient.Clientset, controller *Controller) error {
var (
clusterName, resourceVersion, updatedResourceVerison = "test-cluster", "1000", "1001"
clusterName, resourceVersion, updatedResourceVersion = "test-cluster", "1000", "1001"
apiEndpoint, oldLabels, newLabels = "10.0.0.1", map[string]string{"status": "old"}, map[string]string{"status": "new"}
)

Expand All @@ -205,7 +205,7 @@ func TestUpdateClusterEventHandler(t *testing.T) {
return err
}

if err := upsertCluster(clientConnector, newLabels, apiEndpoint, clusterName, updatedResourceVerison); err != nil {
if err := upsertCluster(clientConnector, newLabels, apiEndpoint, clusterName, updatedResourceVersion); err != nil {
return err
}
if err := cacheNextWrapper(controller); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/lifted/taint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func TestParseTaints(t *testing.T) {
t.Errorf("[%s] expected no error for spec %s, but got: %v", c.name, c.spec, err)
}
if !reflect.DeepEqual(c.expectedTaints, taints) {
t.Errorf("[%s] expected returen taints as %v, but got: %v", c.name, c.expectedTaints, taints)
t.Errorf("[%s] expected return taints as %v, but got: %v", c.name, c.expectedTaints, taints)
}
if !reflect.DeepEqual(c.expectedTaintsToRemove, taintsToRemove) {
t.Errorf("[%s] expected return taints to be removed as %v, but got: %v", c.name, c.expectedTaintsToRemove, taintsToRemove)
Expand Down
2 changes: 1 addition & 1 deletion pkg/webhook/interpreter/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestComplete(t *testing.T) {
verify: verifyResourceInterpreterCompleteResponse,
},
{
name: "TestComplete_OverrideResponseUIDAndStatusCode_ResponseUIDAndStatusCodeAreOverrided",
name: "TestComplete_OverrideResponseUIDAndStatusCode_ResponseUIDAndStatusCodeAreOverridden",
req: Request{
ResourceInterpreterRequest: configv1alpha1.ResourceInterpreterRequest{
UID: "test-uid",
Expand Down
4 changes: 2 additions & 2 deletions pkg/webhook/work/mutating_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"

workv1alpha1 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha1"
Expand Down Expand Up @@ -268,7 +268,7 @@ func TestMutatingAdmission_Handle_FullCoverage(t *testing.T) {

// Unmarshal JSON into unstructured object.
if err = json.Unmarshal(wantDeploymentJSON, wantDeploymentUnstructured); err != nil {
t.Errorf("Error unmarshaling to unstructured: %v", err)
t.Errorf("Error unmarshalling to unstructured: %v", err)
}

// Remove the status and creationTimestamp fields to simulate what happen after mutations.
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/framework/resourcebinding.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func WaitGracefulEvictionTasksDone(client karmada.Interface, namespace, name str
return err
}
if len(binding.Spec.GracefulEvictionTasks) > 0 {
return fmt.Errorf("%d GracefulEvictionTasks is being precessing", len(binding.Spec.GracefulEvictionTasks))
return fmt.Errorf("%d GracefulEvictionTasks is being processing", len(binding.Spec.GracefulEvictionTasks))
}
return nil
}, pollTimeout, pollInterval).ShouldNot(gomega.HaveOccurred())
Expand Down

0 comments on commit 3783eaf

Please sign in to comment.