add linter whitespace and fix linter errors
Signed-off-by: gy95 <guoyao17@huawei.com>
This commit is contained in:
parent
f598cb4365
commit
92c5df6c35
|
@ -41,9 +41,13 @@ linters:
|
||||||
- typecheck
|
- typecheck
|
||||||
- unused
|
- unused
|
||||||
- varcheck
|
- varcheck
|
||||||
|
# other linters supported by golangci-lint.
|
||||||
|
- whitespace
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
goimports:
|
goimports:
|
||||||
local-prefixes: github.com/karmada-io/karmada
|
local-prefixes: github.com/karmada-io/karmada
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
# The list of ids of default excludes to include or disable. By default it's empty.
|
# The list of ids of default excludes to include or disable. By default it's empty.
|
||||||
include:
|
include:
|
||||||
|
|
|
@ -377,7 +377,6 @@ func ensureClusterRoleExist(client kubeclient.Interface, clusterRole *rbacv1.Clu
|
||||||
}
|
}
|
||||||
|
|
||||||
return createdObj, nil
|
return createdObj, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensureClusterRoleBindingExist makes sure that the specific ClusterRoleBinding exist in cluster.
|
// ensureClusterRoleBindingExist makes sure that the specific ClusterRoleBinding exist in cluster.
|
||||||
|
|
|
@ -403,7 +403,6 @@ func (d *ResourceDetector) ApplyClusterPolicy(object *unstructured.Unstructured,
|
||||||
} else {
|
} else {
|
||||||
klog.V(2).Infof("ResourceBinding(%s) is up to date.", binding.GetName())
|
klog.V(2).Infof("ResourceBinding(%s) is up to date.", binding.GetName())
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
binding := d.BuildClusterResourceBinding(object, objectKey, policyLabels)
|
binding := d.BuildClusterResourceBinding(object, objectKey, policyLabels)
|
||||||
bindingCopy := binding.DeepCopy()
|
bindingCopy := binding.DeepCopy()
|
||||||
|
|
|
@ -156,7 +156,6 @@ func FetchWorkload(dynamicClient dynamic.Interface, restMapper meta.RESTMapper,
|
||||||
// EnsureWork ensure Work to be created or updated.
|
// EnsureWork ensure Work to be created or updated.
|
||||||
func EnsureWork(c client.Client, workload *unstructured.Unstructured, clusterNames []string, overrideManager overridemanager.OverrideManager,
|
func EnsureWork(c client.Client, workload *unstructured.Unstructured, clusterNames []string, overrideManager overridemanager.OverrideManager,
|
||||||
binding metav1.Object, scope apiextensionsv1.ResourceScope) error {
|
binding metav1.Object, scope apiextensionsv1.ResourceScope) error {
|
||||||
|
|
||||||
referenceRSP, desireReplicaInfos, err := calculateReplicasIfNeeded(c, workload, clusterNames)
|
referenceRSP, desireReplicaInfos, err := calculateReplicasIfNeeded(c, workload, clusterNames)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.Errorf("Failed to get ReplicaSchedulingPolicy for %s/%s/%s, err is: %v", workload.GetKind(), workload.GetNamespace(), workload.GetName(), err)
|
klog.Errorf("Failed to get ReplicaSchedulingPolicy for %s/%s/%s, err is: %v", workload.GetKind(), workload.GetNamespace(), workload.GetName(), err)
|
||||||
|
|
Loading…
Reference in New Issue