Merge pull request #936 from gy95/clean

cleanup some codes
This commit is contained in:
karmada-bot 2021-11-09 04:03:28 +08:00 committed by GitHub
commit a74227e310
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 8 deletions

View File

@ -7,6 +7,7 @@ import (
"os"
"github.com/spf13/cobra"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/client-go/discovery"
"k8s.io/client-go/dynamic"
kubeclientset "k8s.io/client-go/kubernetes"
@ -37,8 +38,6 @@ import (
"github.com/karmada-io/karmada/pkg/util/overridemanager"
"github.com/karmada-io/karmada/pkg/version"
"github.com/karmada-io/karmada/pkg/version/sharedcommand"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
)
// NewControllerManagerCommand creates a *cobra.Command object with default parameters

View File

@ -149,7 +149,7 @@ function print_success() {
echo "Please use 'kubectl config use-context karmada-host/karmada-apiserver' to switch the host and control plane cluster."
echo -e "\nTo manage your member clusters, run:"
echo -e " export KUBECONFIG=${MEMBER_CLUSTER_KUBECONFIG}"
echo "Please use 'kubectl config use-context member1/member2/member3' to switch to the different member cluster."
echo "Please use 'kubectl config use-context member1/member2/member3' to switch to the different member cluster."
}
print_success

View File

@ -65,7 +65,7 @@ func NewCmdCordon(cmdOut io.Writer, karmadaConfig KarmadaConfig, cmdStr string)
return cmd
}
// NewCmdUncordon defines the `cordon` command that mark cluster as schedulable.
// NewCmdUncordon defines the `uncordon` command that mark cluster as schedulable.
func NewCmdUncordon(cmdOut io.Writer, karmadaConfig KarmadaConfig, cmdStr string) *cobra.Command {
opts := CommandCordonOption{}
cmd := &cobra.Command{

View File

@ -15,7 +15,6 @@ import (
"time"
"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/client-go/discovery"
diskcached "k8s.io/client-go/discovery/cached/disk"

View File

@ -902,6 +902,7 @@ func (s *Scheduler) establishEstimatorConnections() {
clusterList, err := s.KarmadaClient.ClusterV1alpha1().Clusters().List(context.TODO(), metav1.ListOptions{})
if err != nil {
klog.Errorf("Cannot list all clusters when establish all cluster estimator connections: %v", err)
return
}
for i := range clusterList.Items {
if err = estimatorclient.EstablishConnection(clusterList.Items[i].Name, s.schedulerEstimatorCache, s.schedulerEstimatorPort); err != nil {

View File

@ -1,11 +1,10 @@
package util
import (
"k8s.io/client-go/util/workqueue"
"k8s.io/klog/v2"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/util/workqueue"
"k8s.io/klog/v2"
)
const (