add linter whitespace and fix linter errors

Signed-off-by: gy95 <guoyao17@huawei.com>
This commit is contained in:
gy95 2021-05-15 11:00:33 +08:00 committed by Kevin Wang
parent f598cb4365
commit 92c5df6c35
4 changed files with 4 additions and 3 deletions

View File

@ -41,9 +41,13 @@ linters:
- typecheck
- unused
- varcheck
# other linters supported by golangci-lint.
- whitespace
linters-settings:
goimports:
local-prefixes: github.com/karmada-io/karmada
issues:
# The list of ids of default excludes to include or disable. By default it's empty.
include:

View File

@ -377,7 +377,6 @@ func ensureClusterRoleExist(client kubeclient.Interface, clusterRole *rbacv1.Clu
}
return createdObj, nil
}
// ensureClusterRoleBindingExist makes sure that the specific ClusterRoleBinding exist in cluster.

View File

@ -403,7 +403,6 @@ func (d *ResourceDetector) ApplyClusterPolicy(object *unstructured.Unstructured,
} else {
klog.V(2).Infof("ResourceBinding(%s) is up to date.", binding.GetName())
}
} else {
binding := d.BuildClusterResourceBinding(object, objectKey, policyLabels)
bindingCopy := binding.DeepCopy()

View File

@ -156,7 +156,6 @@ func FetchWorkload(dynamicClient dynamic.Interface, restMapper meta.RESTMapper,
// EnsureWork ensure Work to be created or updated.
func EnsureWork(c client.Client, workload *unstructured.Unstructured, clusterNames []string, overrideManager overridemanager.OverrideManager,
binding metav1.Object, scope apiextensionsv1.ResourceScope) error {
referenceRSP, desireReplicaInfos, err := calculateReplicasIfNeeded(c, workload, clusterNames)
if err != nil {
klog.Errorf("Failed to get ReplicaSchedulingPolicy for %s/%s/%s, err is: %v", workload.GetKind(), workload.GetNamespace(), workload.GetName(), err)