diff --git a/app/cluster.go b/app/cluster.go deleted file mode 100644 index a4e16ab..0000000 --- a/app/cluster.go +++ /dev/null @@ -1,698 +0,0 @@ -package app - -import ( - "context" - "encoding/base64" - "encoding/json" - "fmt" - "github.com/gin-gonic/gin" - "jcc-schedule/model" - - //"github.com/go-sql-driver/mysql" - "github.com/golang/glog" - "github.com/karmada-io/karmada/pkg/karmadactl" - "github.com/karmada-io/karmada/pkg/karmadactl/options" - "github.com/karmada-io/karmada/pkg/util" - "gopkg.in/yaml.v3" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - v1 "k8s.io/client-go/tools/clientcmd/api/v1" - "net/http" - "net/url" - "os" - "strconv" - "strings" - "time" -) - -type Cluster struct { - ClusterName string `json:"cluster_name"` - DomainId int32 `json:"domain_id"` - DomainName string `json:"domain_name"` - Version string `json:"version"` - Mode string `json:"mode"` - Labels map[string]string `json:"labels"` - State string `json:"state"` - CreateTime time.Time `json:"create_time"` - Description *string `json:"description"` - NodeNum int32 `json:"node_num"` - Edge bool `json:"edge"` - Monitoring bool `json:"monitoring"` -} - -type JoinRequest struct { - // Name of the member cluster - MemberName string `json:"member_name"` - // ClusterProvider of the member cluster - MemberProvider string `json:"member_provider"` - - Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"` -} - -type ClusterParam struct { - ClusterName string `json:"clusterName"` - Version string `json:"version"` - UserName string `json:"userName"` - MasterNodes []string `json:"masterNodes"` - MemberNodes []string `json:"memberNodes"` -} - -// ClusterAnsible 集群结构 -type ClusterAnsible struct { - ClusterName string `json:"cluster_name"` - Nodes []NodeAnsible `json:"nodes"` - Etcds []string `json:"etcds"` - Controls []string `json:"controls"` - Workers []string `json:"workers"` -} - -// NodeAnsible 节点信息 -type NodeAnsible struct { - NodeName string `json:"node_name"` - ExtAddr string `json:"ext_addr"` - IntAddr string `json:"int_addr"` - User string `json:"user"` - Password string `json:"password"` -} - -type ProxyCluster struct { - MemberName string `json:"member_name"` - MemberClusterIp string `json:"memberClusterIp"` - DomainId string `json:"domain_id"` - Description string `json:"description"` -} - -// @Summary 查询集群列表 -// @Description 查询集群列表 -// @Tags cluster -// @accept json -// @Produce json -// @Param pageNum query int true "页码" -// @Param pageSize query int true "每页数量" -// @Success 200 -// @Failure 500 -// @Router /api/v1/cluster/list [get] -func ListCluster(c *gin.Context) { - clusterName := c.Query("cluster_name") - clusterList := make([]Cluster, 0) - clusters, err := KarmadaClient.ClusterV1alpha1().Clusters().List(context.TODO(), metav1.ListOptions{}) - if err != nil { - glog.Info("failed to retrieve cluster(%s). error: %v", clusters, err) - Response(c, http.StatusBadRequest, "failed to retrieve cluster", err) - } - //遍历集群 - for i := 0; i < len(clusters.Items); i++ { - cluster := Cluster{ - ClusterName: clusters.Items[i].Name, - State: string(clusters.Items[i].Status.Conditions[0].Status), - CreateTime: clusters.Items[i].CreationTimestamp.Time, - Labels: clusters.Items[i].Labels, - Mode: string(clusters.Items[i].Spec.SyncMode), - Version: clusters.Items[i].Status.KubernetesVersion, - NodeNum: clusters.Items[i].Status.NodeSummary.ReadyNum, - } - rows, err := DB.Query(`SELECT domain_id,domain_name,description FROM joint_domain.domain_cluster dc WHERE cluster_name = ? `, clusters.Items[i].Name) - if err != nil { - Response(c, http.StatusBadRequest, "query failed", err) - return - } - for rows.Next() { - err := rows.Scan(&cluster.DomainId, &cluster.DomainName, &cluster.Description) - if err != nil { - return - } - } - rows.Close() - // 查询是否有边缘节点 - edge := GetRedis(c, clusters.Items[i].Name) - if strings.EqualFold(edge, "edge") { - cluster.Edge = true - } - //查询是否有监控 - monitoring := GetMonitoringClusters() - for _, clusterName := range monitoring { - if strings.EqualFold(clusterName, clusters.Items[i].Name) { - cluster.Monitoring = true - } - } - if len(clusterName) != 0 && !strings.Contains(cluster.ClusterName, clusterName) { - continue - } else { - clusterList = append(clusterList, cluster) - } - - } - var clusterHistory Cluster - rows, _ := DB.Query("SELECT t.cluster_name as ClusterName, t.domain_id as DomainId ,t.domain_name as DomainName, t.node as NodeNum , t.version as Version FROM cluster_resource_history t") - for rows.Next() { - err := rows.Scan(&clusterHistory.ClusterName, &clusterHistory.DomainId, &clusterHistory.DomainName, &clusterHistory.NodeNum, &clusterHistory.Version) - if err != nil { - glog.Errorf("query failed!,error %v", err) - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - clusterList = append(clusterList, clusterHistory) - } - - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - // 分页 - page := &Page[Cluster]{} - page.List = clusterList - data := Paginator(page, int64(len(clusterList)), pageNum, pageSize) - Response(c, http.StatusOK, "success", data) -} - -// @Summary 查询有标签的集群列表 -// @Description 查询有标签的集群列表 -// @Tags cluster -// @accept json -// @Produce json -// @Param cluster_name query string true "集群名称" -// @Param pageNum query int true "页码" -// @Param pageSize query int true "每页数量" -// @Success 200 -// @Failure 500 -// @Router /api/v1/cluster/listWithLabel [get] -func ListClusterWithLabel(c *gin.Context) { - - clusterName := c.Query("cluster_name") - - clusterList := make([]Cluster, 0) - clusters, err := KarmadaClient.ClusterV1alpha1().Clusters().List(context.TODO(), metav1.ListOptions{}) - if err != nil { - glog.Info("failed to retrieve cluster(%s). error: %v", clusters, err) - Response(c, http.StatusBadRequest, "failed to retrieve cluster", err) - } - for i := 0; i < len(clusters.Items); i++ { - - cluster := Cluster{ - ClusterName: clusters.Items[i].Name, - State: string(clusters.Items[i].Status.Conditions[0].Status), - CreateTime: clusters.Items[i].CreationTimestamp.Time, - Labels: clusters.Items[i].Labels, - Mode: string(clusters.Items[i].Spec.SyncMode), - Version: clusters.Items[i].Status.KubernetesVersion, - } - rows, err := DB.Query(`SELECT domain_id,domain_name FROM domain_cluster dc WHERE cluster_name = ? `, clusters.Items[i].Name) - if err != nil { - Response(c, http.StatusBadRequest, "query failed", err) - return - } - for rows.Next() { - rows.Scan(&cluster.DomainId, &cluster.DomainName) - } - - if len(cluster.Labels) != 0 { - if len(clusterName) > 0 { - if strings.Contains(cluster.ClusterName, clusterName) { - clusterList = append(clusterList, cluster) - } else { - continue - } - } else { - clusterList = append(clusterList, cluster) - } - } else { - continue - } - rows.Close() - - } - - total := len(clusterList) - page := &Page[Cluster]{} - page.List = clusterList - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - data := Paginator(page, int64(total), pageNum, pageSize) - Response(c, http.StatusOK, "success", data) -} - -// @Summary 刪除集群 -// @Description 刪除集群 -// @Tags cluster -// @accept json -// @Produce json -// @Param cluster_name query string true "集群名称" -// @Param domain_id query string true "域id" -// @Success 200 -// @Failure 500 -// @Router /api/v1/cluster/unJoin [delete] -func UnJoin(c *gin.Context) { - clusterName := c.Query("cluster_name") - domainId := c.Query("domain_id") - if clusterName == "" || domainId == "" { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - opts := karmadactl.CommandUnjoinOption{ - DryRun: false, - ClusterNamespace: options.DefaultKarmadaClusterNamespace, - ClusterName: clusterName, - Wait: options.DefaultKarmadactlCommandDuration, - } - - go kdUnCluster(opts) - Response(c, http.StatusOK, "success", "") -} - -// 删除指定集群 -func kdUnCluster(opts karmadactl.CommandUnjoinOption) { - glog.Info("调度中心删除集群,集群名称:", opts.ClusterName) - err := karmadactl.UnJoinCluster(ControlPlaneRestConfig, nil, opts) - if err != nil { - glog.Errorf("failed to delete cluster. error: %v", err) - return - } - return -} - -// @Summary 直接连模式加入联邦 -// @Description 直连模式加入联邦 -// @Tags cluster -// @accept json -// @Produce json -// @Param member_name formData string true "集群名称" -// @Param file formData file true "配置文件" -// @Param domain_id formData string true "资源域" -// @Param description formData string false "描述" -// @Param labels formData string true "标签" -// @Success 200 -// @Failure 500 -// @Router /api/v1/cluster/join [post] -func Join(c *gin.Context) { - var labels map[string]string - //member集群名称 - memberName := c.PostForm("member_name") - if memberName == "" { - Response(c, http.StatusInternalServerError, fmt.Sprintf("failed to join cluster. memberName is null"), "") - return - } - file, _ := c.FormFile("file") - dir, _ := os.Getwd() - memberClusterConfigName := dir + "/karmadaConfig/" + memberName + ".config" - // 上传文件至指定目录 - if err := c.SaveUploadedFile(file, memberClusterConfigName); err != nil { - glog.Errorf("File uplabels = {map[string]string} load failed err %v", err) - Response(c, http.StatusInternalServerError, fmt.Sprintf("File upload failed err: %s", err), "") - return - } - //资源域名称 - domainId := c.PostForm("domain_id") - if domainId == "" { - Response(c, http.StatusInternalServerError, fmt.Sprintf("failed to join cluster. domain is null"), "") - return - } - //member集群标签 - labels, _ = jsonToMap(c.PostForm("labels")) - defaultLabel := map[string]string{ - "domain": domainId, - } - labels = mergeMap(labels, defaultLabel) - //查询域是否存在 - rows, _ := DB.Query("select domain_name from domain where domain_id = ?", domainId) - defer rows.Close() - var memberProvider string - for rows.Next() { - err := rows.Scan(&memberProvider) - if err != nil { - glog.Errorf("query failed!,error %v", err) - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - } - if memberProvider == "" { - Response(c, http.StatusInternalServerError, fmt.Sprintf("failed to join cluster. Domain does not exist"), "") - return - } - opts := karmadactl.CommandJoinOption{ - DryRun: false, - ClusterNamespace: "karmada-cluster", - ClusterName: memberName, - ClusterKubeConfig: memberClusterConfigName, - ClusterProvider: memberProvider, - } - memberClusterRestConfig, err := KarmadaConfig.GetRestConfig(opts.KarmadaContext, memberClusterConfigName) - if err != nil { - Response(c, http.StatusInternalServerError, fmt.Sprintf("failed to get member cluster rest config. context: %s, kube-config: %s, error: %v", - opts.KarmadaContext, opts.KubeConfig, err), "") - return - } - - err = karmadactl.JoinCluster(ControlPlaneRestConfig, memberClusterRestConfig, opts) - if err != nil { - Response(c, http.StatusInternalServerError, fmt.Sprintf("failed to join cluster. context: %s, kube-config: %s, error: %v", - opts.KarmadaContext, opts.KubeConfig, err), "") - return - } - //将域和集群绑定 - description := c.PostForm("description") - _, err = DB.Exec(`insert into domain_cluster(domain_id, domain_name, cluster_name, description) values(?,?,?,?)`, domainId, memberProvider, memberName, description) - - //新加入集群数据同步到PCM的计算中心下 - //longitude := c.PostForm("longitude") - //latitude := c.PostForm("latitude") - clusterNameCh := c.PostForm("member_name_ch") - _, err = DBPCM.Exec(`insert into compute_cluster (name, type, center_id, center_name, jcce_domain_id, jcce_domain_name, longitude, latitude,description) values(?,?,?,?,?,?,?,?,?)`, clusterNameCh, "cloud", 66, "国家计算中心长沙超算中心", domainId, memberProvider, 112.355042, 28.570066, description) - if err != nil { - Response(c, http.StatusBadRequest, "sync info to PCM failed", err) - } - - if labels != nil { - // 给集群打上标签 - cluster, _, err := util.GetClusterWithKarmadaClient(KarmadaClient, memberName) - if cluster == nil { - Response(c, http.StatusBadRequest, "Get cluster failed", err) - return - } - cluster.Labels = labels - _, err = KarmadaClient.ClusterV1alpha1().Clusters().Update(context.TODO(), cluster, metav1.UpdateOptions{}) - if err != nil { - Response(c, http.StatusBadRequest, "update failed", err) - } - } - Response(c, http.StatusOK, "success", "") -} - -// @Summary 代理模式加入集群 -// @Description 代理模式加入集群 -// @Tags cluster -// @accept json -// @Produce json -// @Param param body ProxyCluster true "json" -// @Success 200 -// @Failure 500 -// @Router /api/v1/cluster/proxyJoinCluster [post] -func ProxyJoinCluster(c *gin.Context) { - var proxyParam ProxyCluster - if err := c.BindJSON(&proxyParam); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - //资源域名称 - domainId := proxyParam.DomainId - if domainId == "" { - Response(c, http.StatusInternalServerError, fmt.Sprintf("failed to join cluster. domain is null"), "") - return - } - //查询域是否存在 - rows, _ := DB.Query("select domain_name from domain where domain_id = ?", domainId) - defer rows.Close() - var memberProvider string - for rows.Next() { - err := rows.Scan(&memberProvider) - if err != nil { - glog.Errorf("query failed!,error %v", err) - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - } - - if memberProvider == "" { - Response(c, http.StatusInternalServerError, fmt.Sprintf("failed to join cluster. Domain does not exist"), "") - return - } - _, err := DB.Exec(`insert into domain_cluster( domain_id, domain_name, cluster_name, description) values(?,?,?,?)`, domainId, memberProvider, proxyParam.MemberName, proxyParam.Description) - - data, err := os.ReadFile("karmadaConfig/karmada-host") - if err != nil { - fmt.Println("File reading error", err) - return - } - _karmadaConfig := &v1.Config{} - err = yaml.Unmarshal(data, &_karmadaConfig) - rawUrl := _karmadaConfig.Clusters[0].Cluster.Server - newUrl, _ := url.Parse(rawUrl) - hostIp := newUrl.Hostname() - config := GetAgentTemplate() - config = strings.Replace(config, "{member_cluster_name}", proxyParam.MemberName, -1) - config = strings.Replace(config, "{member_cluster_ip}", proxyParam.MemberClusterIp, -1) - config = strings.Replace(config, "{host_cluster_ip}", hostIp, -1) - config = strings.Replace(config, "{karmada-apiserver.config}", base64.StdEncoding.EncodeToString(data), -1) - c.String(http.StatusOK, fmt.Sprintln(config)) -} - -// @Summary 查询集群是否存在 -// @Description 查询集群是否存在 -// @Tags cluster -// @accept json -// @Produce json -// @Param clusterName path string true "集群名称" -// @Success 200 -// @Failure 500 -// @Router /api/v1/cluster/{clusterName} [get] -func ClusterExist(c *gin.Context) { - //查询集群名称在karmada集群中是否存在 - clusters, err := KarmadaClient.ClusterV1alpha1().Clusters().List(context.TODO(), metav1.ListOptions{}) - if err != nil { - glog.Info("failed to retrieve cluster(%s). error: %v", clusters, err) - Response(c, http.StatusBadRequest, "failed to retrieve cluster", err) - } - clusterName := c.Param("clusterName") - //遍历集群 - for i := 0; i < len(clusters.Items); i++ { - if clusters.Items[i].Name == clusterName { - Response(c, http.StatusOK, "true", "集群名已存在") - return - } - } - Response(c, http.StatusOK, "false", "集群名不存在") -} - -// TagCluster 集群打标签 -// @Summary 集群打标签 -// @Description 集群打标签 -// @Tags cluster -// @accept json -// @Produce json -// @Param param body Cluster true "json" -// @Success 200 -// @Failure 500 -// @Router /api/v1/cluster/tag [post] -func TagCluster(c *gin.Context) { - var clusterTag Cluster - if err := c.BindJSON(&clusterTag); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - - cluster, _, err := util.GetClusterWithKarmadaClient(KarmadaClient, clusterTag.ClusterName) - if cluster == nil { - Response(c, http.StatusBadRequest, "Get cluster failed", err) - return - } - cluster.Labels = clusterTag.Labels - _, err = KarmadaClient.ClusterV1alpha1().Clusters().Update(context.TODO(), cluster, metav1.UpdateOptions{}) - if err != nil { - Response(c, http.StatusBadRequest, "update failed", err) - } - - Response(c, http.StatusOK, "success", cluster) -} - -// UnTagCluster 集群删除标签 -// @Summary 集群删除标签 -// @Description 集群删除标签 -// @Tags cluster -// @accept json -// @Produce json -// @Param param body Cluster true "json" -// @Success 200 -// @Failure 500 -// @Router /api/v1/cluster/unTag [post] -func UnTagCluster(c *gin.Context) { - var clusterTag Cluster - if err := c.BindJSON(&clusterTag); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - - cluster, _, err := util.GetClusterWithKarmadaClient(KarmadaClient, clusterTag.ClusterName) - if cluster == nil { - Response(c, http.StatusBadRequest, "get cluster failed", err) - return - } - deleteMaps(cluster.Labels, clusterTag.Labels) - _, err = KarmadaClient.ClusterV1alpha1().Clusters().Update(context.TODO(), cluster, metav1.UpdateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, fmt.Sprintf("failed to update cluster. error: %v", err), "") - } - - Response(c, http.StatusOK, "success", cluster) -} - -// 删除map中的某个key -func deleteMaps(labels map[string]string, keys map[string]string) { - for key := range keys { - delete(labels, key) - } -} - -// ListByDomain 根据项目名称、工作负载、域id查询集群 listByDomain -// @Summary 根据项目名称、工作负载、域id查询集群 -// @Description 根据项目名称、工作负载、域id查询集群 -// @Tags cluster -// @accept json -// @Produce json -// @Param namespace path string true "项目名称" -// @Param deployment_name path string true "工作负载" -// @Param domain_id path string true "域id" -// @Success 200 -// @Failure 500 -// @Router /api/v1/cluster/listByDomain [post] -func ListByDomain(c *gin.Context) { - namespaceName := c.Query("namespace") - deploymentName := c.Query("deployment_name") - domainId := c.Query("domain_id") - - propagationPolicy, err := KarmadaClient.PolicyV1alpha1().PropagationPolicies(namespaceName).Get(context.TODO(), "deployment."+namespaceName+"."+deploymentName, metav1.GetOptions{}) - if err != nil { - } - var clusterList []string - for _, clusterName := range propagationPolicy.Spec.Placement.ClusterAffinity.ClusterNames { - clusterList = append(clusterList, clusterName) - } - var result []string - Gorm.Debug().Raw("SELECT distinct cluster_name from domain_cluster where cluster_name in (?) and domain_id = ?", clusterList, domainId).Scan(&result) - Response(c, http.StatusOK, "success", result) -} - -// @Summary 集群注册 -// @Description 集群注册 -// @Tags cluster -// @accept json -// @Produce json -// @Param param body ClusterParam true "json" -// @Success 200 -// @Failure 400 -// @Router /api/v1/cluster/createCluster [post] -func CreateCluster(c *gin.Context) { - copyContext := c.Copy() - var param ClusterParam - if err := c.BindJSON(¶m); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - //TODO 查询用户id并绑定 - //查询集群名称是否存在 - rows, _ := DB.Query("select cluster_name from cluster where cluster_name = ?", param.ClusterName) - defer rows.Close() - var _clusterName string - for rows.Next() { - var clusterName string - err := rows.Scan(&clusterName) - if err != nil { - glog.Errorf("query failed!,error %v", err) - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - _clusterName = clusterName - } - if _clusterName != "" { - Response(c, http.StatusInternalServerError, fmt.Sprintf("failed to create cluster. Cluster name already exists"), "") - return - } - - nodes := make([]NodeAnsible, 0) - //master节点 - _controls := make([]string, 0) - for i, ip := range param.MasterNodes { - nodeName := param.ClusterName + "-control-" + strconv.Itoa(i+1) - node := NodeAnsible{ - NodeName: nodeName, - ExtAddr: ip, - IntAddr: ip, - User: "root", - Password: "Nudt@123", - } - _controls = append(_controls, nodeName) - nodes = append(nodes, node) - } - //member节点 - _workers := make([]string, 0) - for i, ip := range param.MemberNodes { - nodeName := param.ClusterName + "-worker-" + strconv.Itoa(i+1) - node := NodeAnsible{ - NodeName: nodeName, - ExtAddr: ip, - IntAddr: ip, - User: "root", - Password: "Nudt@123", - } - _workers = append(_workers, nodeName) - nodes = append(nodes, node) - } - - var res = ClusterAnsible{ - ClusterName: param.ClusterName, - Nodes: nodes, - Etcds: _controls, - Controls: _controls, - Workers: _workers, - } - buf, _ := json.Marshal(res) - cli := Cli{ - addr: "10.101.15.75:22", - user: "zyen", - pwd: "Nudt@123", - } - - clusterIp := param.MasterNodes[0] - //集群入库 - _, err := DB.Exec(`insert into cluster(cluster_name, version,user_name,create_time,cluster_ip) values(?,?,?,?,?)`, param.ClusterName, param.Version, param.UserName, time.Now(), clusterIp) - - if err != nil { - Response(c, http.StatusInternalServerError, fmt.Sprintf("failed to create cluster. error: %v", err), "") - } - ansibleParam := "'" + string(buf) + "'" - go func() { - // 建立连接对象 - cl, _ := cli.Connect() - // 退出时关闭连接 - defer cl.client.Close() - glog.Info("异步执行:" + copyContext.Request.URL.Path) - _, err = cl.Run("/home/zyen/ansible-env/bin/ansible-playbook ~/playground/ansible/playbooks/gen_private_files.yaml -e " + ansibleParam) - _, err = cl.Run("/home/zyen/ansible-env/bin/ansible-playbook ~/playground/ansible/playbooks/k8s_deploy.yaml -e " + ansibleParam) - if err != nil { - glog.Errorf("创建集群失败, %v", err) - Response(c, http.StatusBadRequest, "创建集群失败!", err) - } - }() - Response(c, http.StatusOK, "success", "") -} - -// @Summary 查询自建集群列表 -// @Description 查询自建集群列表 -// @Tags cluster -// @accept json -// @Produce json -// @Param pageNum path string true "页码" -// @Param pageSize path string true "每页数量" -// @Success 200 -// @Failure 400 -// @Router /api/v1/cluster/listFree [get] -func ListFreeCluster(c *gin.Context) { - pageNumParam := c.Query("pageNum") - pageSizeParam := c.Query("pageSize") - sqlStr := `select count(*) from cluster limit ?,?` - var total int64 - pageNum, pageSize := PageParamInit(pageNumParam, pageSizeParam) - err := DB.Get(&total, sqlStr, (pageNum-1)*pageSize, pageSize) - - clusters := make([]*model.Cluster, 0, total) - sqlStr = `select - id,cluster_name,version,user_name,create_time,cluster_ip - from cluster - ORDER BY create_time - DESC - limit ?,?` - err = DB.Select(&clusters, sqlStr, (pageNum-1)*pageSize, pageSize) - if err != nil { - Response(c, http.StatusBadRequest, "服务繁忙!", err) - return - } - page := &Page[*model.Cluster]{} - page.List = clusters - data := Paginate(page, pageNum, pageSize, total) - Response(c, http.StatusOK, "success", data) -} diff --git a/app/clusterClient.go b/app/clusterClient.go new file mode 100644 index 0000000..185ba8f --- /dev/null +++ b/app/clusterClient.go @@ -0,0 +1,12 @@ +package app + +import "k8s.io/client-go/kubernetes" + +type ClusterClient struct { + KubeClient *kubernetes.Clientset + ClusterName string +} + +func NewClusterClientSet(clusterName string) { + +} diff --git a/app/clusterWatch.go b/app/clusterWatch.go deleted file mode 100644 index b3b8bc2..0000000 --- a/app/clusterWatch.go +++ /dev/null @@ -1,92 +0,0 @@ -package app - -import ( - "context" - "fmt" - "github.com/golang/glog" - "github.com/karmada-io/karmada/pkg/apis/cluster/v1alpha1" - karmadainformers "github.com/karmada-io/karmada/pkg/generated/informers/externalversions" - "github.com/karmada-io/karmada/pkg/util" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" - "time" -) - -func Watch() { - // 初始化 informer factory - informerFactory := karmadainformers.NewSharedInformerFactory(KarmadaClient, time.Second*30) - // 对 cluster 监听 - clusterInformer := informerFactory.Cluster().V1alpha1().Clusters() - // 创建 Informer(相当于注册到工厂中去,这样下面启动的时候就会去 List & Watch 对应的资源) - informer := clusterInformer.Informer() - // 创建 Lister - clusterLister := clusterInformer.Lister() - // 注册事件处理程序 - informer.AddEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: AddCluster, - UpdateFunc: updateCluster, - DeleteFunc: deleteCluster, - }) - - stopper := make(chan struct{}) - defer close(stopper) - - // 启动 informer,List & Watch - informerFactory.Start(stopper) - // 等待所有启动的 Informer 的缓存被同步 - informerFactory.WaitForCacheSync(stopper) - - // 从本地缓存中获取所有 cluster 列表 - clusters, err := clusterLister.List(labels.Everything()) - if err != nil { - panic(err) - } - for idx, cluster := range clusters { - fmt.Printf("%d -> %s\n", idx+1, cluster.Name) - } - <-stopper -} - -// OnAdd handles object add event and push the object to queue. -func AddCluster(obj interface{}) { - cluster := obj.(*v1alpha1.Cluster) - cluster, _, err := util.GetClusterWithKarmadaClient(KarmadaClient, cluster.Name) - rows, _ := DB.Query("select domain_id from domain_cluster where cluster_name = ?", cluster.Name) - defer rows.Close() - var domainId string - for rows.Next() { - err := rows.Scan(&domainId) - if err != nil { - glog.Errorf("query failed!,error %v", err) - return - } - } - if domainId == "" { - glog.Errorf(" 【%v】 - Cluster and domain are not bound, please check the data", cluster.Name) - return - } - _labels := make(map[string]string) - //新增默认域的默认标签 - _labels["domain"] = domainId - cluster.Labels = mergeMap(cluster.Labels, _labels) - _, err = KarmadaClient.ClusterV1alpha1().Clusters().Update(context.TODO(), cluster, metav1.UpdateOptions{}) - if err != nil { - glog.Errorf("Cluster default domain tag update failed,error %v", err) - return - } -} - -// OnUpdate handles object update event and push the object to queue. -func updateCluster(oldObj, newObj interface{}) { -} - -// OnDelete handles object delete event and push the object to queue. -func deleteCluster(obj interface{}) { - cluster := obj.(*v1alpha1.Cluster) - _, err := DB.Exec(`DELETE FROM domain_cluster where cluster_name = ?`, cluster.Name) - if err != nil { - glog.Errorf("Cluster deletion failure,error %v", err) - return - } -} diff --git a/app/common.go b/app/common.go index 005dbed..fde1948 100644 --- a/app/common.go +++ b/app/common.go @@ -14,11 +14,6 @@ func (e *sliceError) Error() string { return e.msg } -func Errorf(format string, args ...interface{}) error { - msg := fmt.Sprintf(format, args...) - return &sliceError{msg} -} - func mergeMap(maps ...map[string]string) map[string]string { result := make(map[string]string) for _, m := range maps { @@ -70,23 +65,6 @@ func jsonToMap(jsonStr string) (map[string]string, error) { return m, nil } -func RemoveRepeatedDomain(arr []Domain) (newArr []Domain) { - newArr = make([]Domain, 0) - for i := 0; i < len(arr); i++ { - repeat := false - for j := i + 1; j < len(arr); j++ { - if arr[i].DomainId == arr[j].DomainId { - repeat = true - break - } - } - if !repeat { - newArr = append(newArr, arr[i]) - } - } - return -} - func removeDuplicateArr(arr []string) []string { set := make(map[string]struct{}, len(arr)) j := 0 diff --git a/app/configMap.go b/app/configMap.go deleted file mode 100644 index ed6edd6..0000000 --- a/app/configMap.go +++ /dev/null @@ -1,75 +0,0 @@ -package app - -import ( - "context" - "encoding/json" - "github.com/gin-gonic/gin" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "net/http" -) - -type ConfigMap struct { - ConfigMap v1.ConfigMap `json:"configMap"` - ClusterName []string `json:"clusterName"` - TemplateId string `json:"templateId"` -} - -type SecretRes struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []v1.Secret `json:"items"` -} - -type ConfigMaoObject struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []v1.ConfigMap `json:"items"` -} - -// CreateConfigMap 创建configMap -func CreateConfigMap(c *gin.Context) { - var cmRequest ConfigMap - if err := c.BindJSON(&cmRequest); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - cmRequest.ConfigMap.Labels["jcce"] = "true" - ClientSet.CoreV1().ConfigMaps(cmRequest.ConfigMap.Namespace).Create(context.TODO(), &cmRequest.ConfigMap, metav1.CreateOptions{}) - // 创建调度策略实例 - CreatePropagationPolicies(PropagationPolicy{ - ClusterName: cmRequest.ClusterName, - TemplateId: cmRequest.TemplateId, - ResourceName: cmRequest.ConfigMap.Name, - Name: "cm" + "." + cmRequest.ConfigMap.Namespace + "." + cmRequest.ConfigMap.Name, - Namespace: cmRequest.ConfigMap.Namespace, - Kind: "ConfigMap", - }) - Response(c, http.StatusOK, "success", nil) -} - -// ListSecret 查询命名空间下的secret -func ListSecret(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - result := SearchObject(secretConst, clusterName, namespace, "") - raw, _ := result.Raw() - var secretRes SecretRes - json.Unmarshal(raw, &secretRes) - Response(c, http.StatusOK, "success", secretRes.Items) -} - -// ListConfigMap 查询命名空间下的configMap -func ListConfigMap(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - result := SearchObject(configMapConst, clusterName, namespace, "") - raw, _ := result.Raw() - var configMaoObject ConfigMaoObject - json.Unmarshal(raw, &configMaoObject) - Response(c, http.StatusOK, "success", configMaoObject.Items) -} diff --git a/app/crd.go b/app/crd.go deleted file mode 100644 index 735ecc6..0000000 --- a/app/crd.go +++ /dev/null @@ -1,89 +0,0 @@ -package app - -import ( - "context" - "encoding/json" - "fmt" - "github.com/gin-gonic/gin" - v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "strings" - - "net/http" -) - -type CRDRes struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []v1.CustomResourceDefinition `json:"items"` -} - -type CRDParam struct { - ClusterName []string `json:"clusterName"` - Domain string `json:"domain"` - TemplateId string `json:"templateId"` - CustomResourceDefinition v1.CustomResourceDefinition `json:"CustomResourceDefinition"` -} - -func ListCRD(c *gin.Context) { - clusterName := c.Query("clusterName") - Response(c, http.StatusOK, "success", queryCRD(clusterName)) -} - -func queryCRD(clusterName string) []v1.CustomResourceDefinition { - result := SearchObject(crdConst, clusterName, "", "") - raw, _ := result.Raw() - var cRDRes CRDRes - json.Unmarshal(raw, &cRDRes) - return cRDRes.Items -} - -const crUrl = "/apis/cluster.karmada.io/v1alpha1/clusters/%s/proxy/apis/%s/namespaces/%s/%s" - -func CreateCRD(c *gin.Context) { - var param CRDParam - if err := c.BindJSON(¶m); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - - crdList, err := CrDClient.ApiextensionsV1().CustomResourceDefinitions().Create(context.TODO(), ¶m.CustomResourceDefinition, metav1.CreateOptions{}) - if err != nil { - return - } - // 创建调度实例 - CreatePropagationPolicies(PropagationPolicy{ - ClusterName: param.ClusterName, - TemplateId: param.TemplateId, - ResourceName: param.CustomResourceDefinition.Name, - Name: "crd" + param.CustomResourceDefinition.Namespace + param.CustomResourceDefinition.Name, - Namespace: param.CustomResourceDefinition.Namespace, - Kind: "CustomResourceDefinition", - }) - Response(c, http.StatusOK, "success", crdList) -} - -func DetailCRD(c *gin.Context) { - - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - kind := c.Query("kind") - customResourceDefinitions := queryCRD(clusterName) - for _, crd := range customResourceDefinitions { - if strings.EqualFold(crd.Spec.Names.Plural, kind) || strings.EqualFold(crd.Spec.Names.Singular, kind) { - url := fmt.Sprintf(crUrl, clusterName, crd.Spec.Group+"/"+crd.Spec.Versions[0].Name, namespace, crd.Spec.Names.Plural) - result := KarmadaClient.SearchV1alpha1().RESTClient().Get().AbsPath(url).Do(context.TODO()) - - raw, _ := result.Raw() - - Response(c, http.StatusOK, "success", raw) - } - } - - //if err != nil { - // return - //} - //Response(c, http.StatusOK, "success", crdList) -} diff --git a/app/cron.go b/app/cron.go deleted file mode 100644 index 957ff18..0000000 --- a/app/cron.go +++ /dev/null @@ -1,96 +0,0 @@ -package app - -import ( - "bytes" - "crypto/tls" - "encoding/json" - "fmt" - "github.com/robfig/cron/v3" - "io/ioutil" - "jcc-schedule/tool" - "net/http" - "strconv" - "strings" - "time" -) - -type Monitor struct { - CpuAvgUsage float64 `json:"cpuAvgUsage"` - MemAvgUsage float64 `json:"memAvgUsage"` - CpuTotalUsage float64 `json:"cpuTotalUsage"` - MemTotalUsage float64 `json:"memTotalUsage"` - Date string `json:"date"` -} - -func SyncMonitor(c *cron.Cron) { - //创建定时任务 - EntryID, err := c.AddFunc("0 0 12 * * ?", func() { - mrs := []MetricResult{} - monitor := Monitor{Date: time.Now().Format("2006-01-02 15:04:05")} - mrs = getOverallMetrics(metric_range_1d, steps_7d) - for _, mr := range mrs { - - for _, res := range mr.MetricData.Result { - for _, value := range res { - bytes, err := json.Marshal(value) - if err != nil { - return - } - split := strings.Split(string(bytes), ",") - - if mr.MetricName == "mem_avg_usage" { - memAvg, err := strconv.ParseFloat(split[1][:13], 64) - if err != nil { - return - } - monitor.MemAvgUsage = tool.FloatConv(memAvg / 1073741824) - } - if mr.MetricName == "cpu_avg_usage" { - cpuAvg, err := strconv.ParseFloat(split[1][:5], 64) - if err != nil { - return - } - monitor.CpuAvgUsage = cpuAvg - } - if mr.MetricName == "mem_total_usage" { - memTotal, err := strconv.ParseFloat(split[1][:13], 64) - if err != nil { - return - } - monitor.MemTotalUsage = tool.FloatConv(memTotal / 1073741824) - } - if mr.MetricName == "cpu_total_usage" { - cpuTotal, err := strconv.ParseFloat(split[1][:5], 64) - if err != nil { - return - } - monitor.CpuTotalUsage = cpuTotal - } - } - } - } - jsonStr, _ := json.Marshal(monitor) - req, err := http.NewRequest("POST", "https://10.101.15.6/apis/jcc-ledger/contract/syncMonitor", bytes.NewBuffer(jsonStr)) - req.Header.Add("content-type", "application/json;charset=UTF-8") - - req.Header.Add("ledgerName", strconv.FormatInt(time.Now().Unix(), 10)) - if err != nil { - return - } - defer req.Body.Close() - - client := &http.Client{Transport: &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, - }} - resp, err := client.Do(req) - if err != nil { - return - } - defer resp.Body.Close() - - result, _ := ioutil.ReadAll(resp.Body) - println(result) - }) - - fmt.Println(time.Now(), EntryID, err) -} diff --git a/app/deployment.go b/app/deployment.go deleted file mode 100644 index b17eec1..0000000 --- a/app/deployment.go +++ /dev/null @@ -1,1133 +0,0 @@ -package app - -import ( - "context" - "encoding/json" - "github.com/bitly/go-simplejson" - "github.com/gin-gonic/gin" - appv1 "k8s.io/api/apps/v1" - v12 "k8s.io/api/autoscaling/v1" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "net/http" - "sort" - "strconv" - "strings" - "sync" - "time" -) - -var deployMutex sync.Mutex - -type HPAResult struct { - MinReplicas int32 `json:"minReplicas"` - MaxReplicas int32 `json:"maxReplicas"` - MemoryTargetValue string `json:"memoryTargetValue"` - CpuTargetUtilization string `json:"cpuTargetUtilization"` -} - -type DeploymentParam struct { - ClusterName []string `json:"clusterName"` - TemplateId string `json:"templateId"` - Deployment appv1.Deployment `json:"deployment"` -} - -type HPAParam struct { - ClusterName []string `json:"clusterName"` - TemplateId string `json:"templateId"` - Hpa v12.HorizontalPodAutoscaler `json:"hpa"` -} - -type StatefulSetParam struct { - ClusterName []string `json:"clusterName"` - TemplateId string `json:"templateId"` - StatefulSet appv1.StatefulSet `json:"statefulSet"` -} - -type DaemonSetParam struct { - ClusterName []string `json:"clusterName"` - TemplateId string `json:"templateId"` - DaemonSet appv1.DaemonSet `json:"daemonSet"` -} - -type RedeployParam struct { - ClusterName string `json:"clusterName"` - Namespace string `json:"namespace"` - DeploymentName string `json:"deploymentName"` - Num string `json:"num"` - Type string `json:"type"` -} - -type DeploymentRes struct { - Name string `json:"name"` - Namespace string `json:"namespace"` - Labels map[string]string `json:"labels"` - ContainerImage string `json:"container_image"` - ContainerName string `json:"container_name"` - Replicas int32 `json:"replicas"` -} - -type DeploymentObject struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []appv1.Deployment `json:"items"` -} - -type ControllerRevisionObject struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []appv1.ControllerRevision `json:"items"` -} - -type ReplicaSetObject struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []appv1.ReplicaSet `json:"items"` -} - -type StatefulSetObject struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []appv1.StatefulSet `json:"items"` -} - -type DaemonSetObject struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []appv1.DaemonSet `json:"items"` -} - -type BackVersionParam struct { - ClusterName string `json:"clusterName"` - Name string `json:"name"` - Namespace string `json:"namespace"` - Uid string `json:"uid"` -} - -// CreateDeployment 创建工作负载 -// @Summary 创建工作负载 -// @Description 创建工作负载 -// @Tags deployment -// @accept json -// @Produce json -// @Success 200 -// @Failure 400 -// @Router /api/v1/deployment/create [post] -func CreateDeployment(c *gin.Context) { - var param DeploymentParam - if err := c.BindJSON(¶m); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - if param.Deployment.Labels != nil && param.Deployment.Labels["jcce"] == "true" { - _, err := ClientSet.AppsV1().Deployments(param.Deployment.Namespace).Create(context.TODO(), ¶m.Deployment, metav1.CreateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "create deployment failed", err) - return - } - policyErr := CreatePropagationPolicies(PropagationPolicy{ - ClusterName: param.ClusterName, - TemplateId: param.TemplateId, - ResourceName: param.Deployment.Name, - Name: "deployment" + "." + param.Deployment.Namespace + "." + param.Deployment.Name, - Namespace: param.Deployment.Namespace, - Kind: "Deployment", - }) - if policyErr != nil { - Response(c, http.StatusInternalServerError, "create deployment policy failed", policyErr) - return - } - } else { - result := PostObject(deploymentListConst, param.ClusterName[0], param.Deployment.Namespace, param.Deployment.Name, param.Deployment) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", result.Error()) - return - } - } - Response(c, http.StatusOK, "success", "") -} - -// ListDeploymentFromCluster 查询指定集群下的命名空间 -func ListDeploymentFromCluster(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - state := c.Query("state") - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - searchObject := SearchObject(allDeploymentConst, clusterName, "", "") - raw, _ := searchObject.Raw() - var deploymentObject DeploymentObject - json.Unmarshal(raw, &deploymentObject) - deployments := deploymentObject.Items - // 根据条件过滤 - count := 0 - for i := range deployments { - if (strings.EqualFold(state, "stopped") && deployments[i-count].Status.Replicas != 0) || - (strings.EqualFold(state, "running") && deployments[i-count].Status.ReadyReplicas != deployments[i-count].Status.Replicas) || - (strings.EqualFold(state, "updating") && deployments[i-count].Status.UnavailableReplicas == 0) || - (len(name) != 0 && !strings.Contains(deployments[i-count].Name, name)) || - (len(namespace) != 0 && !strings.EqualFold(deployments[i-count].Namespace, namespace)) { - deployments = append(deployments[:i-count], deployments[i-count+1:]...) - count = count + 1 - } - } - // 分页 - page := &Page[appv1.Deployment]{} - // 排序 - sort.SliceStable(deployments, func(i, j int) bool { - return deployments[i].CreationTimestamp.Time.After(deployments[j].CreationTimestamp.Time) - }) - page.List = deployments - data := Paginator(page, int64(len(deployments)), pageNum, pageSize) - Response(c, http.StatusOK, "success", data) -} - -// ListDeployment 根据查询工作负载列表(控制平面) -// @Summary 根据查询工作负载列表 -// @Description 根据查询工作负载列表 -// @Tags deployment -// @accept json -// @Produce json -// @Param namespace query string true "项目名称" -// @Param pageNum query string true "页码 " -// @Param pageSize query string true "每页数量" -// @Success 200 -// @Failure 500 -// @Router /api/v1/deployment/list [get] -func ListDeployment(c *gin.Context) { - - namespace := c.Query("namespace") - - dpList := make([]DeploymentRes, 0) - deploymentList, err := ClientSet.AppsV1().Deployments(namespace).List(context.TODO(), metav1.ListOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "list deployment failed", err) - return - } - - for _, deploy := range deploymentList.Items { - name := deploy.ObjectMeta.Name - namespace := deploy.ObjectMeta.Namespace - labels := deploy.Labels - containerName := deploy.Spec.Template.Spec.Containers[0].Name - containerImage := deploy.Spec.Template.Spec.Containers[0].Image - replicas := deploy.Spec.Replicas - - dp := DeploymentRes{ - Name: name, - Namespace: namespace, - Labels: labels, - ContainerImage: containerImage, - ContainerName: containerName, - Replicas: *replicas, - } - dpList = append(dpList, dp) - } - - total := len(dpList) - page := &Page[DeploymentRes]{} - page.List = dpList - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - data := Paginator(page, int64(total), pageNum, pageSize) - Response(c, http.StatusOK, "success", data) - -} - -// ListClusterDeployment 查询工作负载列表(所有集群) -func ListClusterDeployment(c *gin.Context) { - //TODO 逻辑待完善 - ss, _ := KarmadaClient.SearchV1alpha1().ResourceRegistries().Get(context.TODO(), "clustercache-sample", metav1.GetOptions{}) - - Response(c, http.StatusOK, "success", ss) -} - -// DetailDeployment Deployment详情 -func DetailDeployment(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - searchObject := SearchObject(deploymentConst, clusterName, namespace, name) - raw, err := searchObject.Raw() - if err != nil { - Response(c, http.StatusInternalServerError, "query deployment failed", err) - return - } - var deployment appv1.Deployment - json.Unmarshal(raw, &deployment) - Response(c, http.StatusOK, "success", deployment) -} - -func DetailDaemonSet(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - searchObject := SearchObject(daemonSetConst, clusterName, namespace, name) - raw, _ := searchObject.Raw() - var daemonSet appv1.DaemonSet - json.Unmarshal(raw, &daemonSet) - Response(c, http.StatusOK, "success", daemonSet) -} - -func ListStatefulSetFromCluster(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - state := c.Query("state") - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - searchObject := SearchObject(allStatefulSetConst, clusterName, "", "") - raw, _ := searchObject.Raw() - var statefulSetObject StatefulSetObject - json.Unmarshal(raw, &statefulSetObject) - statefulSets := statefulSetObject.Items - // 根据条件过滤 - count := 0 - for i := range statefulSets { - if len(namespace) != 0 && !strings.EqualFold(statefulSets[i-count].Namespace, namespace) { - statefulSets = append(statefulSets[:i-count], statefulSets[i-count+1:]...) - count = count + 1 - continue - } - if len(name) != 0 && !strings.Contains(statefulSets[i-count].Name, name) { - statefulSets = append(statefulSets[:i-count], statefulSets[i-count+1:]...) - count = count + 1 - continue - } - if strings.EqualFold(state, "updating") && statefulSets[i-count].Status.UpdatedReplicas == 0 { - statefulSets = append(statefulSets[:i-count], statefulSets[i-count+1:]...) - count = count + 1 - continue - } - if strings.EqualFold(state, "running") && statefulSets[i-count].Status.ReadyReplicas != statefulSets[i-count].Status.Replicas { - statefulSets = append(statefulSets[:i-count], statefulSets[i-count+1:]...) - count = count + 1 - continue - } - if strings.EqualFold(state, "stopped") && statefulSets[i-count].Status.Replicas != 0 { - statefulSets = append(statefulSets[:i-count], statefulSets[i-count+1:]...) - count = count + 1 - continue - } - } - // 分页 - page := &Page[appv1.StatefulSet]{} - // 排序 - sort.SliceStable(statefulSets, func(i, j int) bool { - return statefulSets[i].CreationTimestamp.Time.After(statefulSets[j].CreationTimestamp.Time) - }) - page.List = statefulSets - data := Paginator(page, int64(len(statefulSets)), pageNum, pageSize) - Response(c, http.StatusOK, "success", data) -} - -func DetailStatefulSet(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - searchObject := SearchObject(statefulSetConst, clusterName, namespace, name) - raw, _ := searchObject.Raw() - var statefulSet appv1.StatefulSet - json.Unmarshal(raw, &statefulSet) - Response(c, http.StatusOK, "success", statefulSet) -} - -// DescribeDeployment 查询工作负载列表(所有集群) -// @Summary 查询工作负载列表(所有集群) -// @Description 查询工作负载列表(所有集群) -// @Tags deployment -// @accept json -// @Produce json -// @Param namespace query string true "项目名称" -// @Param deploy_name query string false "负载名称" -// @Success 200 -// @Failure 500 -// @Router /api/v1/deployment/describe [get] -func DescribeDeployment(c *gin.Context) { - - namespace := c.Query("namespace") - deployName := c.Query("deploy_name") - ClientSet.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{}) - podList := make([]Pod, 0) - pods := GetPodFromOS(namespace, deployName) - hits, _ := pods.Get("hits").Get("hits").Array() - - for i := 0; i < len(hits); i++ { - clusterName, _ := pods.Get("hits").Get("hits").GetIndex(i).Get("_source").Get("metadata").Get("annotations").Get("resource.karmada.io/cached-from-cluster").String() - podName, _ := pods.Get("hits").Get("hits").GetIndex(i).Get("_source").Get("metadata").Get("name").String() - - spec := pods.Get("hits").Get("hits").GetIndex(i).Get("_source").Get("spec") - status := pods.Get("hits").Get("hits").GetIndex(i).Get("_source").Get("status") - specString, _ := spec.String() - specJson, _ := simplejson.NewJson([]byte(specString)) - statusString, _ := status.String() - statusJson, _ := simplejson.NewJson([]byte(statusString)) - ready, _ := statusJson.Get("containerStatuses").Get("ready").String() - restartCount, _ := statusJson.Get("containerStatuses").Get("restartCount").Int64() - - startTimeString, _ := statusJson.Get("startTime").String() - startTime, _ := time.Parse("2006-01-02T15:04:05Z", startTimeString) - - podIP, _ := statusJson.Get("podIP").String() - nodeName, _ := specJson.Get("nodeName").String() - podStatus, _ := statusJson.Get("phase").String() - containerName, _ := specJson.Get("containers").GetIndex(0).Get("name").String() - containerImage, _ := specJson.Get("containers").GetIndex(0).Get("image").String() - - pod := Pod{ - Name: podName, - ClusterName: clusterName, - Ready: ready, - Status: podStatus, - Restarts: restartCount, - Age: strconv.FormatFloat(time.Now().Sub(startTime).Hours()/24, 'f', 0, 64) + "d", - IP: podIP, - Node: nodeName, - Namespace: namespace, - ContainerName: containerName, - ContainerImage: containerImage, - } - rows, _ := DB.Query("select dc.domain_id,dc.domain_name,d.longitude,d.latitude from joint_domain.domain_cluster dc,joint_domain.domain d where dc.domain_id = d.domain_id and dc.cluster_name = ?", clusterName) - var domainId int32 - var domainName string - var longitude float64 - var latitude float64 - - for rows.Next() { - err := rows.Scan(&domainId, &domainName, &longitude, &latitude) - if err != nil { - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - } - pod.DomainName = domainName - podList = append(podList, pod) - - } - - Response(c, http.StatusOK, "success", podList) -} - -// DeleteDeployment 删除工作负载 -func DeleteDeployment(c *gin.Context) { - clusterName := c.Param("clusterName") - namespace := c.Param("namespace") - name := c.Param("name") - label := c.Param("label") - if strings.EqualFold(label, "jcce") { - err := ClientSet.AppsV1().Deployments(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "delete deployment failed", err) - return - } - // 删除调度策略 - DeletePropagationPolicies(namespace, "deployment"+"."+namespace+"."+name) - } else { - result := DeleteObject(deploymentConst, clusterName, namespace, name) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "delete deployment failed", result.Error()) - return - } - } - - Response(c, http.StatusOK, "success", nil) -} - -// BackDaemonSetVersion daemonSet版本回退 -func BackDaemonSetVersion(c *gin.Context) { - var param BackVersionParam - if err := c.BindJSON(¶m); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - // 查询daemonSet - searchObject := SearchObject(daemonSetConst, param.ClusterName, param.Namespace, param.Name) - raw, stsErr := searchObject.Raw() - if stsErr != nil { - Response(c, http.StatusInternalServerError, "query daemonSet failed", stsErr) - return - } - var ds appv1.DaemonSet - json.Unmarshal(raw, &ds) - // 查询controllerRevisions - var controllerRevisionObject ControllerRevisionObject - rsResult := SearchObject(controllerVersionConst, param.ClusterName, param.Namespace, "") - crRaw, crErr := rsResult.Raw() - if crErr != nil { - Response(c, http.StatusInternalServerError, "query controllerVersion failed", crErr) - return - } - json.Unmarshal(crRaw, &controllerRevisionObject) - // 根据controllerRevision的uid匹配 - for _, controllerRevision := range controllerRevisionObject.Items { - if strings.EqualFold(param.Uid, string(controllerRevision.UID)) { - var replaceObj appv1.DaemonSet - json.Unmarshal(controllerRevision.Data.Raw, &replaceObj) - ds.Spec.Template = replaceObj.Spec.Template - ds.Annotations["restartTime"] = time.Now().String() - } - } - // 更新daemonSet - result := UpdateObject(daemonSetConst, param.ClusterName, ds.Namespace, ds.Name, ds) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "update daemonSet failed", result.Error()) - return - } - Response(c, http.StatusOK, "success", "") -} - -// BackStatefulSetVersion StatefulSet版本回退 -func BackStatefulSetVersion(c *gin.Context) { - var param BackVersionParam - if err := c.BindJSON(¶m); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - // 查询statefulSet - searchObject := SearchObject(statefulSetConst, param.ClusterName, param.Namespace, param.Name) - raw, stsErr := searchObject.Raw() - if stsErr != nil { - Response(c, http.StatusInternalServerError, "query statefulSet failed", stsErr) - return - } - var sts appv1.StatefulSet - json.Unmarshal(raw, &sts) - // 查询controllerRevisions - var controllerRevisionObject ControllerRevisionObject - rsResult := SearchObject(controllerVersionConst, param.ClusterName, param.Namespace, "") - crRaw, crErr := rsResult.Raw() - if crErr != nil { - Response(c, http.StatusInternalServerError, "query controllerVersion failed", crErr) - return - } - json.Unmarshal(crRaw, &controllerRevisionObject) - // 根据controllerRevision的uid匹配 - for _, controllerRevision := range controllerRevisionObject.Items { - if strings.EqualFold(param.Uid, string(controllerRevision.UID)) { - var replaceObj appv1.StatefulSet - json.Unmarshal(controllerRevision.Data.Raw, &replaceObj) - sts.Spec.Template = replaceObj.Spec.Template - sts.Annotations["restartTime"] = time.Now().String() - } - } - // 更新statefulSet - result := UpdateObject(statefulSetConst, param.ClusterName, sts.Namespace, sts.Name, sts) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "update statefulSet failed", result.Error()) - return - } - Response(c, http.StatusOK, "success", "") -} - -func ListDaemonSetFromCluster(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - state := c.Query("state") - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - searchObject := SearchObject(allDaemonSetConst, clusterName, "", "") - raw, _ := searchObject.Raw() - var daemonSetObject DaemonSetObject - json.Unmarshal(raw, &daemonSetObject) - daemonSets := daemonSetObject.Items - // 根据条件过滤 - count := 0 - for i := range daemonSets { - if len(namespace) != 0 && !strings.EqualFold(daemonSets[i-count].Namespace, namespace) { - daemonSets = append(daemonSets[:i-count], daemonSets[i-count+1:]...) - count = count + 1 - continue - } - if len(name) != 0 && !strings.Contains(daemonSets[i-count].Name, name) { - daemonSets = append(daemonSets[:i-count], daemonSets[i-count+1:]...) - count = count + 1 - continue - } - if strings.EqualFold(state, "updating") && daemonSets[i-count].Status.UpdatedNumberScheduled == 0 { - daemonSets = append(daemonSets[:i-count], daemonSets[i-count+1:]...) - count = count + 1 - continue - } - if strings.EqualFold(state, "running") && daemonSets[i-count].Status.CurrentNumberScheduled != daemonSets[i-count].Status.NumberReady { - daemonSets = append(daemonSets[:i-count], daemonSets[i-count+1:]...) - count = count + 1 - continue - } - if strings.EqualFold(state, "stopped") && daemonSets[i-count].Status.CurrentNumberScheduled != 0 { - daemonSets = append(daemonSets[:i-count], daemonSets[i-count+1:]...) - count = count + 1 - continue - } - } - // 分页 - page := &Page[appv1.DaemonSet]{} - // 排序 - sort.SliceStable(daemonSets, func(i, j int) bool { - return daemonSets[i].CreationTimestamp.Time.After(daemonSets[j].CreationTimestamp.Time) - }) - page.List = daemonSets - data := Paginator(page, int64(len(daemonSets)), pageNum, pageSize) - Response(c, http.StatusOK, "success", data) -} - -func IsExistDaemonSet(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - result := SearchObject(daemonSetConst, clusterName, namespace, name) - if result.Error() != nil { - Response(c, http.StatusOK, "success", false) - return - } - raw, _ := result.Raw() - var daemonSet appv1.DaemonSet - json.Unmarshal(raw, &daemonSet) - if len(daemonSet.Name) == 0 { - Response(c, http.StatusOK, "success", false) - return - } - Response(c, http.StatusOK, "success", true) -} - -func IsExistStatefulSet(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - result := SearchObject(statefulSetConst, clusterName, namespace, name) - if result.Error() != nil { - Response(c, http.StatusOK, "success", false) - return - } - raw, _ := result.Raw() - var statefulSet appv1.StatefulSet - json.Unmarshal(raw, &statefulSet) - if len(statefulSet.Name) == 0 { - Response(c, http.StatusOK, "success", false) - return - } - Response(c, http.StatusOK, "success", true) -} - -// @Summary 获取弹性伸缩信息 -// @Description 获取弹性伸缩信息 -// @Tags deployment -// @accept json -// @Produce json -// @Param clusterName query string true "集群名称" -// @Param namespace query string true "命名空间" -// @Param deployName query string true "deployName" -// @Success 200 -// @Failure 400 -// @Router /api/v1/deployment/hpa [get] -func getHpa(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - var hpa v12.HorizontalPodAutoscaler - result := SearchObject(detailHPAConst, clusterName, namespace, name) - raw, err := result.Raw() - if err != nil { - Response(c, http.StatusOK, "the server could not find the requested resource", "") - return - } - json.Unmarshal(raw, &hpa) - Response(c, http.StatusOK, "success", hpa) -} - -// @Summary 弹性伸缩 -// @Description 弹性伸缩 -// @Tags deployment -// @accept json -// @Produce json -// @Param param body HPAParam true "json" -// @Success 200 -// @Failure 400 -// @Router /api/v1/deployment/autoScaling [post] -func AutoScaling(c *gin.Context) { - clusterName := c.Query("clusterName") - var hpa v12.HorizontalPodAutoscaler - if err := c.BindJSON(&hpa); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - if len(hpa.Labels["jcce"]) != 0 { - _, err := ClientSet.AutoscalingV1().HorizontalPodAutoscalers(hpa.Namespace).Update(context.TODO(), &hpa, metav1.UpdateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "update hpa failed", err) - return - } - } else { - result := UpdateObject(detailHPAConst, clusterName, hpa.Namespace, hpa.Name, hpa) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "update hpa failed", result.Error()) - return - } - } - Response(c, http.StatusOK, "success", "") -} - -// @Summary 创建弹性伸缩 -func CreateHpa(c *gin.Context) { - var param HPAParam - if err := c.BindJSON(¶m); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - // 查询deployment来源 - searchObject := SearchObject(deploymentConst, param.ClusterName[0], param.Hpa.Namespace, param.Hpa.Spec.ScaleTargetRef.Name) - raw, _ := searchObject.Raw() - var deployment appv1.Deployment - json.Unmarshal(raw, &deployment) - if len(deployment.Labels["jcce"]) != 0 { - if param.Hpa.Labels == nil { - param.Hpa.Labels = map[string]string{} - } - param.Hpa.Labels["jcce"] = "true" - _, err := ClientSet.AutoscalingV1().HorizontalPodAutoscalers(param.Hpa.Namespace).Create(context.TODO(), ¶m.Hpa, metav1.CreateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "create hpa failed.", err) - return - } - CreatePropagationPolicies(PropagationPolicy{ - ClusterName: param.ClusterName, - TemplateId: param.TemplateId, - ResourceName: param.Hpa.Name, - Name: "hpa" + "." + param.Hpa.Namespace + "." + param.Hpa.Name, - Namespace: param.Hpa.Namespace, - Kind: "HorizontalPodAutoscaler", - }) - } else { - postObject := PostObject(hpaListConst, param.ClusterName[0], param.Hpa.Namespace, "", param.Hpa) - if postObject.Error() != nil { - Response(c, http.StatusInternalServerError, "create hpa failed.", postObject.Error()) - return - } - } - Response(c, http.StatusOK, "success", "") -} - -func UpdateDeployment(c *gin.Context) { - clusterName := c.Query("clusterName") - var deployment appv1.Deployment - if err := c.BindJSON(&deployment); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - if len(deployment.Labels["jcce"]) != 0 { - _, err := ClientSet.AppsV1().Deployments(deployment.Namespace).Update(context.TODO(), &deployment, metav1.UpdateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "failed", err) - return - } - } else { - result := UpdateObject(deploymentConst, clusterName, deployment.Namespace, deployment.Name, deployment) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "update deployment failed", result.Error()) - return - } - } - Response(c, http.StatusOK, "success", "") -} - -// @Summary 重新部署 -// @Description 重新部署 -// @Tags deployment -// @accept json -// @Produce json -// @Param param body RedeployParam true "json" -// @Success 200 -// @Failure 500 -// @Router /api/v1/deployment/deployments/redeploy [patch] -func Redeploy(c *gin.Context) { - var param RedeployParam - if err := c.BindJSON(¶m); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - if param.Type == "deploy" { - deployment, err := ClientSet.AppsV1().Deployments(param.Namespace).Get(context.TODO(), param.DeploymentName, metav1.GetOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "failed", err) - return - } - deployment.Spec.Template.Spec.Containers[0].Env = append(deployment.Spec.Template.Spec.Containers[0].Env, v1.EnvVar{Name: "RESTART_TIME", Value: time.Now().String()}) - ClientSet.AppsV1().Deployments(param.Namespace).Update(context.TODO(), deployment, metav1.UpdateOptions{}) - } else if param.Type == "sts" { - statefulSet, err := ClientSet.AppsV1().StatefulSets(param.Namespace).Get(context.TODO(), param.DeploymentName, metav1.GetOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "failed", err) - return - } - statefulSet.Spec.Template.Spec.Containers[0].Env = append(statefulSet.Spec.Template.Spec.Containers[0].Env, v1.EnvVar{Name: "RESTART_TIME", Value: time.Now().String()}) - ClientSet.AppsV1().StatefulSets(param.Namespace).Update(context.TODO(), statefulSet, metav1.UpdateOptions{}) - } else if param.Type == "ds" { - daemonSet, err := ClientSet.AppsV1().DaemonSets(param.Namespace).Get(context.TODO(), param.DeploymentName, metav1.GetOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "failed", err) - return - } - daemonSet.Spec.Template.Spec.Containers[0].Env = append(daemonSet.Spec.Template.Spec.Containers[0].Env, v1.EnvVar{Name: "RESTART_TIME", Value: time.Now().String()}) - ClientSet.AppsV1().DaemonSets(param.Namespace).Update(context.TODO(), daemonSet, metav1.UpdateOptions{}) - } - - Response(c, http.StatusOK, "success", nil) -} - -func CreateStatefulSet(c *gin.Context) { - var param StatefulSetParam - if err := c.BindJSON(¶m); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - if param.StatefulSet.Labels != nil && param.StatefulSet.Labels["jcce"] == "true" { - _, err := ClientSet.AppsV1().StatefulSets(param.StatefulSet.Namespace).Create(context.TODO(), ¶m.StatefulSet, metav1.CreateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "failed", err) - return - } - policyErr := CreatePropagationPolicies(PropagationPolicy{ - ClusterName: param.ClusterName, - TemplateId: param.TemplateId, - ResourceName: param.StatefulSet.Name, - Name: "sts" + "." + param.StatefulSet.Namespace + "." + param.StatefulSet.Name, - Namespace: param.StatefulSet.Namespace, - Kind: "StatefulSet", - }) - if policyErr != nil { - Response(c, http.StatusInternalServerError, "failed", policyErr) - return - } - } else { - result := PostObject(statefulSetConst, param.ClusterName[0], param.StatefulSet.Namespace, param.StatefulSet.Name, param.StatefulSet) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", result.Error()) - return - } - } - - Response(c, http.StatusOK, "success", "") -} - -// UpdateStatefulSet 更新statefulSet -func UpdateStatefulSet(c *gin.Context) { - clusterName := c.Query("clusterName") - var statefulSet appv1.StatefulSet - if err := c.BindJSON(&statefulSet); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - if len(statefulSet.Labels["jcce"]) != 0 { - _, err := ClientSet.AppsV1().StatefulSets(statefulSet.Namespace).Update(context.TODO(), &statefulSet, metav1.UpdateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "update statefulSet failed", err) - return - } - } else { - result := UpdateObject(statefulSetConst, clusterName, statefulSet.Namespace, statefulSet.Name, statefulSet) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "update statefulSet failed", result.Error()) - return - } - } - - Response(c, http.StatusOK, "success", "") -} - -func UpdateDaemonSet(c *gin.Context) { - clusterName := c.Query("clusterName") - var daemonSet appv1.DaemonSet - if err := c.BindJSON(&daemonSet); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - if len(daemonSet.Labels["jcce"]) != 0 { - _, err := ClientSet.AppsV1().DaemonSets(daemonSet.Namespace).Update(context.TODO(), &daemonSet, metav1.UpdateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "failed", err) - return - } - } else { - result := UpdateObject(daemonSetConst, clusterName, daemonSet.Namespace, daemonSet.Name, daemonSet) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "update daemonSet failed", result.Error()) - return - } - } - Response(c, http.StatusOK, "success", "") -} - -func CreateDaemonSet(c *gin.Context) { - var param DaemonSetParam - if err := c.BindJSON(¶m); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - if param.DaemonSet.Labels != nil && param.DaemonSet.Labels["jcce"] == "true" { - _, err := ClientSet.AppsV1().DaemonSets(param.DaemonSet.Namespace).Create(context.TODO(), ¶m.DaemonSet, metav1.CreateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "failed", err) - return - } - policyErr := CreatePropagationPolicies(PropagationPolicy{ - ClusterName: param.ClusterName, - TemplateId: param.TemplateId, - ResourceName: param.DaemonSet.Name, - Name: "ds" + "." + param.DaemonSet.Namespace + "." + param.DaemonSet.Name, - Namespace: param.DaemonSet.Namespace, - Kind: "DaemonSet", - }) - if policyErr != nil { - Response(c, http.StatusInternalServerError, "failed", policyErr) - return - } - } else { - result := PostObject(daemonSetConst, param.ClusterName[0], param.DaemonSet.Namespace, param.DaemonSet.Name, param.DaemonSet) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", result.Error()) - return - } - } - - Response(c, http.StatusOK, "success", "") -} - -func DeleteDaemonSet(c *gin.Context) { - clusterName := c.Param("clusterName") - namespace := c.Param("namespace") - name := c.Param("name") - label := c.Param("label") - if strings.EqualFold(label, "jcce") { - err := ClientSet.AppsV1().DaemonSets(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "delete deployment failed", err) - return - } - // 删除调度策略 - DeletePropagationPolicies(namespace, "ds"+"."+namespace+"."+name) - } else { - result := DeleteObject(daemonSetConst, clusterName, namespace, name) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "delete daemonSet failed", result.Error()) - return - } - Response(c, http.StatusOK, "success", nil) - } -} - -func DeleteStatefulSet(c *gin.Context) { - clusterName := c.Param("clusterName") - namespace := c.Param("namespace") - name := c.Param("name") - label := c.Param("label") - if strings.EqualFold(label, "jcce") { - err := ClientSet.AppsV1().StatefulSets(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "delete deployment failed", err) - return - } - // 删除调度策略 - DeletePropagationPolicies(namespace, "sts"+"."+namespace+"."+name) - } else { - result := DeleteObject(statefulSetConst, clusterName, namespace, name) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "delete statefulSet failed", result.Error()) - return - } - } - - Response(c, http.StatusOK, "success", nil) -} - -func IsExistDeployment(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - searchObject := SearchObject(deploymentConst, clusterName, namespace, name) - if searchObject.Error() != nil { - Response(c, http.StatusOK, "success", false) - return - } - raw, _ := searchObject.Raw() - var deploymentRes appv1.Deployment - json.Unmarshal(raw, &deploymentRes) - if len(deploymentRes.Name) == 0 { - Response(c, http.StatusOK, "success", false) - return - } - Response(c, http.StatusOK, "success", true) -} - -// @Summary 获取部署监控 -// @Description 获取部署监控 -// @Tags deployment -// @accept json -// @Produce json -// @Param clusterName query string true "集群名称" -// @Param namespace query string true "namespace" -// @Param deployment query string true "部署名称" -// @Param queryType query string true "类型" -// @Success 200 -// @Failure 500 -// @Router /api/v1/deployment/getMetrics [get] -func GetDeploymentMetrics(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - label := c.Query("label") - // 将label拼接成label集合 - var labelMap = make(map[string]string) - labelArray := strings.Split(label, ",") - for _, label := range labelArray { - labelKV := strings.Split(label, "=") - labelMap[labelKV[0]] = labelKV[1] - } - podList := GetPodForDeployment(clusterName, namespace, labelMap) - - metricUrls := make([][]MetricUrl, 4) - for _, item := range podList { - imap := map[string]string{ - ClusterName: clusterName, - PodName: item.ObjectMeta.Name, - } - metricUrls[0] = append(metricUrls[0], MetricUrl{PodName, item.ObjectMeta.Name, GetMetricUrl(pod_net_bytes_transmitted, imap, PodName, metric_range_8h, steps_8h)}) - metricUrls[1] = append(metricUrls[1], MetricUrl{PodName, item.ObjectMeta.Name, GetMetricUrl(pod_memery_usage_wo_cache, imap, PodName, metric_range_8h, steps_8h)}) - metricUrls[2] = append(metricUrls[2], MetricUrl{PodName, item.ObjectMeta.Name, GetMetricUrl(pod_net_bytes_received, imap, PodName, metric_range_8h, steps_8h)}) - metricUrls[3] = append(metricUrls[3], MetricUrl{PodName, item.ObjectMeta.Name, GetMetricUrl(pod_cpu_usage, imap, PodName, metric_range_8h, steps_8h)}) - } - - metricMap := map[string][]MetricUrl{ - "pod_net_bytes_transmitted": metricUrls[0], - "pod_memory_usage_wo_cache": metricUrls[1], - "pod_net_bytes_received": metricUrls[2], - "pod_cpu_usage": metricUrls[3], - } - - ch := make(chan MetricResult, len(metricMap)) - var wg sync.WaitGroup - - for k, v := range metricMap { - wg.Add(1) - go HttpGetMetrics(k, v, &wg, ch) - } - wg.Wait() - close(ch) - - mr := []MetricResult{} - for v := range ch { - mr = append(mr, v) - } - - Response(c, http.StatusOK, "success", mr) -} - -func BackVersion(c *gin.Context) { - var param BackVersionParam - if err := c.BindJSON(¶m); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - // 查询deployment - searchObject := SearchObject(deploymentConst, param.ClusterName, param.Namespace, param.Name) - raw, deploymentErr := searchObject.Raw() - if deploymentErr != nil { - Response(c, http.StatusInternalServerError, "query deployment failed", deploymentErr) - return - } - var deployment appv1.Deployment - json.Unmarshal(raw, &deployment) - // 查询replicaSet - var replicaSetObject ReplicaSetObject - rsResult := SearchObject(replicaSetConst, param.ClusterName, param.Namespace, "") - rsRaw, rsErr := rsResult.Raw() - if rsErr != nil { - Response(c, http.StatusInternalServerError, "query replicaSet failed", rsErr) - return - } - json.Unmarshal(rsRaw, &replicaSetObject) - // 根据replicaSet的uid匹配 - for _, replicaSet := range replicaSetObject.Items { - if strings.EqualFold(param.Uid, string(replicaSet.UID)) { - deployment.Spec.Template = replicaSet.Spec.Template - deployment.Annotations = replicaSet.Annotations - deployment.Annotations["restartTime"] = time.Now().String() - } - } - // 更新deployment - result := UpdateObject(deploymentConst, param.ClusterName, deployment.Namespace, deployment.Name, deployment) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "update deployment failed", result.Error()) - return - } - Response(c, http.StatusOK, "success", "") -} - -// ListReplicaSets 查询replicaSet列表 -func ListReplicaSets(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - label := c.Query("label") - // 将label拼接成map - labelMap := LabelsConvertToMap(label) - // 查询replicaSet - var replicaSetObject ReplicaSetObject - searchResult := SearchObject(replicaSetConst, clusterName, namespace, "") - raw, err := searchResult.Raw() - json.Unmarshal(raw, &replicaSetObject) - if err != nil { - Response(c, http.StatusInternalServerError, "query replicaSets failed", err) - return - } - var result []appv1.ReplicaSet - // 根据标签匹配 - for _, replicaSet := range replicaSetObject.Items { - for k, v := range labelMap { - if replicaSet.Labels[k] != v { - goto loop - } - } - result = append(result, replicaSet) - loop: - } - Response(c, http.StatusOK, "success", result) -} - -// ControllerRevisions 查询statefulSet和daemonSet的版本记录 -func ControllerRevisions(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - label := c.Query("label") - // 将标签放入map - labelMap := LabelsConvertToMap(label) - // 查询所有的版本记录 - var controllerRevisionObject ControllerRevisionObject - crResult := SearchObject(controllerVersionConst, clusterName, namespace, "") - raw, crErr := crResult.Raw() - if crErr != nil { - Response(c, http.StatusInternalServerError, "query controllerRevisions failed", crErr) - return - } - json.Unmarshal(raw, &controllerRevisionObject) - var controllerRevisions []appv1.ControllerRevision - // 根据标签匹配 - for _, replicaSet := range controllerRevisionObject.Items { - for k, v := range labelMap { - if replicaSet.Labels[k] != v { - goto loop - } - } - controllerRevisions = append(controllerRevisions, replicaSet) - loop: - } - Response(c, http.StatusOK, "success", controllerRevisions) -} diff --git a/app/domain.go b/app/domain.go deleted file mode 100644 index 7926666..0000000 --- a/app/domain.go +++ /dev/null @@ -1,307 +0,0 @@ -package app - -import ( - "context" - "fmt" - "github.com/gin-gonic/gin" - "github.com/karmada-io/karmada/pkg/util" - v2 "k8s.io/apimachinery/pkg/apis/meta/v1" - "net/http" - "strconv" -) - -type Domain struct { - DomainId int32 `json:"domain_id"` - DomainName string `json:"domain_name"` - LabelType string `json:"label_type"` - Location [2]float64 `json:"location"` - Labels []map[string]string `json:"labels"` - Clusters []string `json:"clusters"` - Deployments []string `json:"deployments"` - CPURate float64 `json:"cpu_rate"` - MemoryRate float64 `json:"memory_rate"` - Description string `json:"description"` - LabelId []int32 `json:"labelId"` -} - -type DomainUsedRate struct { - Rate float64 `json:"rate"` - DomainName string `json:"domainName"` - ClusterCount float64 `json:"clusterCount"` - IsUsing int32 `json:"IsUsing"` -} - -// CreateDomain 创建域 -// @Summary 创建域 -// @Description 创建域 -// @Tags domain -// @accept json -// @Produce json -// @Param param body Domain true "json" -// @Success 200 -// @Failure 400 -// @Router /api/v1/domain/create [post] -func CreateDomain(c *gin.Context) { - //获取填写的参数 - domain := Domain{} - c.BindJSON(&domain) - sqlCreateDomain := "insert into domain(domain_name,longitude,latitude) values (?,?,?)" - _, err := DB.Exec(sqlCreateDomain, domain.DomainName, domain.Location[0], domain.Location[1]) - if err != nil { - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - domainIdMax, _ := DB.Query("select max(domain_id) from domain") - defer domainIdMax.Close() - var domainId int32 - for domainIdMax.Next() { - var id int32 - err := domainIdMax.Scan(&id) - domainId = id - if err != nil { - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - } - var keys []string - var values []string - for _, label := range domain.Labels { - for k, v := range label { - keys = append(keys, k) - values = append(values, v) - } - } - - for i := 0; i < len(domain.Clusters); i++ { - sqlStr2 := "insert into domain_cluster(domain_id,domain_name,cluster_name,description) values (?,?,?,?)" - _, err := DB.Exec(sqlStr2, domainId, domain.DomainName, domain.Clusters[i], domain.Description) - if err != nil { - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - } - - for i := 0; i < len(domain.Labels[0]); i++ { - sqlDomainLabel := "insert into domain_label(domain_id,domain_name,label_id,label_type,label_name) values (?,?,?,?,?)" - _, err := DB.Exec(sqlDomainLabel, domainId, domain.DomainName, domain.LabelId[i], keys[i], values[i]) - //b, err := DB.Exec(sqlStr3, domainId, domain.DomainName, 4, keys[i], values[i]) - if err != nil { - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - } - - Response(c, http.StatusOK, "success", len(domain.Labels[0])) - -} - -// ListDomain 查询Domain列表 -// @Summary 查询Domain列表 -// @Description 查询Domain列表 -// @Tags domain -// @accept json -// @Produce json -// @Param domain_name query string false "domain名称" -// @Success 200 -// @Failure 500 -// @Router /api/v1/domain/list [get] -func ListDomain(c *gin.Context) { - - domainName := c.Query("domain_name") - - //获取域列表 - rows, _ := DB.Query("select domain_id,domain_name,longitude,latitude from domain where domain_name like ?", "%"+domainName+"%") - - defer rows.Close() - domainList := make([]Domain, 0) - for rows.Next() { - var dm Domain - var longitude float64 - var latitude float64 - err := rows.Scan(&dm.DomainId, &dm.DomainName, &longitude, &latitude) - - var location = [...]float64{longitude, latitude} - dm.Location = location - if err != nil { - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - - //获取单个域的标签 - sqlDomainLabel := "select d.domain_name,l.label_type,l.label_name from domain d,domain_label l where d.domain_id = l.domain_id and d.domain_id = ?" - rowsLabel, err := DB.Query(sqlDomainLabel, dm.DomainId) - if err != nil { - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - domainLabelList := make(map[string]string) - for rowsLabel.Next() { - var domainName string - var labelKey string - var labelValue string - err := rowsLabel.Scan(&domainName, &labelKey, &labelValue) - if err != nil { - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - domainLabelList[labelKey] = labelValue - } - dm.Labels = append(dm.Labels, domainLabelList) - - //获取单个域下的所有集群 - sqlDomainCluster := "select d.domain_name,c.cluster_name from domain d,domain_cluster c where d.domain_id = c.domain_id and d.domain_id = ?" - rowsCluster, err := DB.Query(sqlDomainCluster, dm.DomainId) - if err != nil { - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - var clusters []string - for rowsCluster.Next() { - var domainName string - var clusterName string - err := rowsCluster.Scan(&domainName, &clusterName) - if err != nil { - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - clusters = append(clusters, clusterName) - } - dm.Clusters = clusters - - domainList = append(domainList, dm) - } - - Response(c, http.StatusOK, "success", domainList) - -} - -//DescribeDomain 获取域的详细信息 -/* - 入参: domainID namespace名称 - 出参: deployment数量 资源使用量 - 首先通过domain_cluster表查出该域所有的集群列表,遍历集群列表 - 在单个集群使用namespace查询所有deployment,将deploy名称放入上层domain数组 -*/ -// @Summary 获取域的详细信息 -// @Description 获取域的详细信息 -// @Tags domain -// @accept json -// @Produce json -// @Param domain_id query string true "domainId" -// @Param namespace query string true "命名空间" -// @Success 200 -// @Failure 500 -// @Router /api/v1/domain/describe [get] -func DescribeDomain(c *gin.Context) { - - var domain Domain - domainId := c.Query("domain_id") - namespace := c.Query("namespace") - rows, _ := DB.Query("select d.domain_name,dc.cluster_name,d.longitude,d.latitude from domain_cluster dc,domain d where dc.domain_id = d.domain_id and dc.domain_id = ?", domainId) - var domainName string - var longitude float64 - var latitude float64 - var totalAllocatableCPU int64 - var totalAllocatableMemory int64 - var totalAllocatedCPU int64 - var totalAllocatedMemory int64 - for rows.Next() { - var clusterName string - err := rows.Scan(&domainName, &clusterName, &longitude, &latitude) - if err != nil { - println(err) - } - - deploys := GetDeployFromOS(namespace, "", clusterName) - hits, _ := deploys.Get("hits").Get("hits").Array() - - for i := 0; i < len(hits); i++ { - deployName, _ := deploys.Get("hits").Get("hits").GetIndex(i).Get("_source").Get("metadata").Get("name").String() - domain.Deployments = append(domain.Deployments, deployName) - } - domain.Clusters = append(domain.Clusters, clusterName) - cluster, _, _ := util.GetClusterWithKarmadaClient(KarmadaClient, clusterName) - allocatableCPU := cluster.Status.ResourceSummary.Allocatable.Cpu().MilliValue() - allocatableMemory := cluster.Status.ResourceSummary.Allocatable.Memory().MilliValue() - allocatedCPU := cluster.Status.ResourceSummary.Allocated.Cpu().MilliValue() - allocatedMemory := cluster.Status.ResourceSummary.Allocated.Memory().MilliValue() - - totalAllocatableCPU += allocatableCPU - totalAllocatableMemory += allocatableMemory - totalAllocatedCPU += allocatedCPU - totalAllocatedMemory += allocatedMemory - - } - ddId, _ := strconv.ParseInt(domainId, 10, 32) - domain.DomainId = int32(ddId) - domain.DomainName = domainName - domain.Deployments = removeDuplicateArr(domain.Deployments) - domain.Location[0] = longitude - domain.Location[1] = latitude - domain.CPURate = float64(totalAllocatedCPU) / float64(totalAllocatableCPU) - domain.MemoryRate = float64(totalAllocatedMemory) / float64(totalAllocatableMemory) - - Response(c, http.StatusOK, "success", domain) -} -func ListClusters(c *gin.Context) { - -} - -// ListByDeployment 根据项目名称和工作负载查询域列表 -// @Summary 根据项目名称和工作负载查询域列表 -// @Description 根据项目名称和工作负载查询域列表 -// @Tags domain -// @accept json -// @Produce json -// @Param deployment_name query string true "工作负载" -// @Param namespace query string true "命名空间" -// @Success 200 -// @Failure 500 -// @Router /api/v1/domain/listByDeployment [get] -func ListByDeployment(c *gin.Context) { - namespaceName := c.Query("namespace") - deploymentName := c.Query("deployment_name") - - propagationPolicy, err := KarmadaClient.PolicyV1alpha1().PropagationPolicies(namespaceName).Get(context.TODO(), "deployment."+namespaceName+"."+deploymentName, v2.GetOptions{}) - if err != nil { - - } - var clusterList []string - for _, clusterName := range propagationPolicy.Spec.Placement.ClusterAffinity.ClusterNames { - clusterList = append(clusterList, clusterName) - } - var domainInfos []DomainInfo - Gorm.Debug().Raw("SELECT distinct domain_id,domain_name from domain_cluster where cluster_name in (?)", clusterList).Scan(&domainInfos) - - Response(c, http.StatusOK, "success", domainInfos) -} - -type DomainInfo struct { - DomainId int `json:"domainId"` - DomainName string `json:"domainName"` -} - -func QueryDomainUsedRate(c *gin.Context) { - var domainUsedRates []DomainUsedRate - rows, err := DB.Query("SELECT d.domain_name,COUNT(dc.id),d.is_using IsUsing from domain d inner join domain_cluster dc on dc.domain_id = d.domain_id group by d.domain_id") - if err != nil { - Response(c, http.StatusInternalServerError, "update namespace failed", err) - return - } - var domainCount float64 - for rows.Next() { - var domainUsedRate DomainUsedRate - err := rows.Scan(&domainUsedRate.DomainName, &domainUsedRate.ClusterCount, &domainUsedRate.IsUsing) - if err != nil { - return - } - domainUsedRates = append(domainUsedRates, domainUsedRate) - domainCount = domainCount + domainUsedRate.ClusterCount - } - rows.Close() - for index, _ := range domainUsedRates { - float, _ := strconv.ParseFloat(fmt.Sprintf("%.4f", domainUsedRates[index].ClusterCount/domainCount), 64) - domainUsedRates[index].Rate = float - } - Response(c, http.StatusOK, "success", domainUsedRates) -} diff --git a/app/label.go b/app/label.go deleted file mode 100644 index 13cb800..0000000 --- a/app/label.go +++ /dev/null @@ -1,142 +0,0 @@ -package app - -import ( - "github.com/gin-gonic/gin" - "net/http" - "time" -) - -type Label struct { - LabelId int32 `json:"label_id"` - LabelTypeId int32 `json:"label_type_id"` - LabelType *string `json:"label_type"` - LabelName string `json:"label_name"` - CreateTime *string `json:"create_time"` - UpdateTime *string `json:"update_time"` -} - -// @Summary 创建域标 -// @Description 创建域标 -// @Tags label -// @accept json -// @Produce json -// @Param param body Label true "json" -// @Success 200 -// @Failure 400 -// @Router /api/v1/label/create [post] -func CreateLabel(c *gin.Context) { - var j Label - if err := c.BindJSON(&j); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", err) - return - } - _, err := DB.Exec(`INSERT label(label_type_id,label_name,create_time,update_time) VALUES (?,?,?,?)`, j.LabelTypeId, j.LabelName, time.Now(), time.Now()) - - if err != nil { - Response(c, http.StatusBadRequest, "insert failed", err) - return - } - Response(c, http.StatusOK, "success", nil) - -} - -// @Summary 删除域标 -// @Description 删除域标 -// @Tags label -// @accept json -// @Produce json -// @Param param body Label true "json" -// @Success 200 -// @Failure 400 -// @Router /api/v1/label/delete [delete] -func DeleteLabel(c *gin.Context) { - var j Label - if err := c.BindJSON(&j); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - _, err := DB.Exec(`DELETE FROM label WHERE label_id = ?`, j.LabelId) - - if err != nil { - Response(c, http.StatusBadRequest, "insert failed", err) - return - } - Response(c, http.StatusOK, "success", nil) - -} - -// @Summary 查询域标列表 -// @Description 查询域标列表 -// @Tags label -// @accept json -// @Produce json -// @Param label_name query string false "标签名" -// @Param pageNum query string true "页码 " -// @Param pageSize query string true "每页数量" -// @Success 200 -// @Failure 500 -// @Router /api/v1/label/list [post] -func ListLabel(c *gin.Context) { - - labelName := c.Query("label_name") - - LabelList := make([]Label, 0) - rows, err := DB.Query(`SELECT l.label_id,l.label_type_id ,lt.label_type ,l.label_name, l.create_time,l.update_time FROM label l,label_type lt WHERE l.label_type_id = lt.label_type_id and l.label_name like ?`, "%"+labelName+"%") - defer rows.Close() - - if err != nil { - Response(c, http.StatusBadRequest, "query failed", err) - return - } - for rows.Next() { - var lt Label - var createTimeString string - var updateTimeString string - err := rows.Scan(<.LabelId, <.LabelTypeId, <.LabelType, <.LabelName, &createTimeString, &updateTimeString) - if err != nil { - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - - lt.CreateTime = &createTimeString - lt.UpdateTime = &updateTimeString - - LabelList = append(LabelList, lt) - } - - total := len(LabelList) - page := &Page[Label]{} - page.List = LabelList - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - data := Paginator(page, int64(total), pageNum, pageSize) - Response(c, http.StatusOK, "success", data) - //Response(c, http.StatusOK, "success", LabelList) - -} - -// @Summary 更新域标 -// @Description 更新域标 -// @Tags label -// @accept json -// @Produce json -// @Param param body Label true "json" -// @Success 200 -// @Failure 400 -// @Router /api/v1/label/update [post] -func UpdateLabel(c *gin.Context) { - var j Label - if err := c.BindJSON(&j); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", err) - return - } - - _, err := DB.Exec(`UPDATE label SET label_type_id = ?,label_name = ?,update_time = ? WHERE label_id = ?`, j.LabelTypeId, j.LabelName, time.Now(), j.LabelId) - - if err != nil { - Response(c, http.StatusBadRequest, "update failed", err) - return - } - Response(c, http.StatusOK, "success", nil) - -} diff --git a/app/labelType.go b/app/labelType.go deleted file mode 100644 index 203a95a..0000000 --- a/app/labelType.go +++ /dev/null @@ -1,132 +0,0 @@ -package app - -import ( - "github.com/gin-gonic/gin" - "net/http" -) - -type LabelType struct { - LabelTypeId int32 `json:"label_type_id"` - LabelType string `json:"label_type"` - MultiCheck *bool `json:"multi_check"` -} - -// CreateLabelType 创建域标类型 -// @Summary 创建域标类型 -// @Description 创建域标类型 -// @Tags labelType -// @accept json -// @Produce json -// @Param param body LabelType true "json" -// @Success 200 -// @Failure 400 -// @Router /api/v1/labelType/create [post] -func CreateLabelType(c *gin.Context) { - var j LabelType - if err := c.BindJSON(&j); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", err) - return - } - _, err := DB.Exec(`INSERT label_type(label_type,multi_check) VALUES (?,?)`, j.LabelType, j.MultiCheck) - - if err != nil { - Response(c, http.StatusBadRequest, "insert failed", err) - return - } - Response(c, http.StatusOK, "success", nil) - -} - -// @Summary 删除域标类型 -// @Description 创建域标类型 -// @Tags labelType -// @accept json -// @Produce json -// @Param param body LabelType true "json" -// @Success 200 -// @Failure 400 -// @Router /api/v1/labelType/delete [delete] -func DeleteLabelType(c *gin.Context) { - var j LabelType - if err := c.BindJSON(&j); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", err) - return - } - _, err := DB.Exec(`DELETE FROM label_type WHERE label_type_id = ?`, j.LabelTypeId) - - if err != nil { - Response(c, http.StatusBadRequest, "insert failed", err) - return - } - Response(c, http.StatusOK, "success", nil) - -} - -// ListLabelType 查询域标类型 -// @Summary 查询域标类型 -// @Description 查询域标类型 -// @Tags labelType -// @accept json -// @Produce json -// @Param label_type query string false "标签类型" -// @Param pageNum query string true "页码 " -// @Param pageSize query string true "每页数量" -// @Success 200 -// @Failure 500 -// @Router /api/v1/labelType/list [get] -func ListLabelType(c *gin.Context) { - - labelType := c.Query("label_type") - - LabelTypeList := make([]LabelType, 0) - rows, err := DB.Query(`SELECT label_type_id,label_type,multi_check FROM label_type WHERE label_type like ?`, "%"+labelType+"%") - if err != nil { - Response(c, http.StatusBadRequest, "query failed", err) - return - } - defer rows.Close() - for rows.Next() { - var lt LabelType - err := rows.Scan(<.LabelTypeId, <.LabelType, <.MultiCheck) - if err != nil { - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - LabelTypeList = append(LabelTypeList, lt) - } - - total := len(LabelTypeList) - page := &Page[LabelType]{} - page.List = LabelTypeList - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - data := Paginator(page, int64(total), pageNum, pageSize) - Response(c, http.StatusOK, "success", data) - //Response(c, http.StatusOK, "success", LabelTypeList) - -} - -// @Summary 更新域标类型 -// @Description 更新域标类型 -// @Tags labelType -// @accept json -// @Produce json -// @Param param body LabelType true "json" -// @Success 200 -// @Failure 400 -// @Router /api/v1/labelType/update [post] -func UpdateLabelType(c *gin.Context) { - var j LabelType - if err := c.BindJSON(&j); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", err) - return - } - _, err := DB.Exec(`UPDATE label_type SET label_type = ?,multi_check = ? WHERE label_type_id = ?`, j.LabelType, j.MultiCheck, j.LabelTypeId) - - if err != nil { - Response(c, http.StatusBadRequest, "update failed", err) - return - } - Response(c, http.StatusOK, "success", nil) - -} diff --git a/app/metricsUtils.go b/app/metricsUtils.go deleted file mode 100644 index 8b22863..0000000 --- a/app/metricsUtils.go +++ /dev/null @@ -1,170 +0,0 @@ -package app - -import ( - "encoding/json" - "fmt" - log "github.com/sirupsen/logrus" - "io/ioutil" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/kubernetes/scheme" - "net/http" - "net/url" - "strconv" - "strings" - "sync" - "time" -) - -const ( - baseUrl = "http://10.101.15.8:8428/prometheus/api/v1/query_range?" - PodName_Replacer = "podName" - ClusterName_Replacer = "clusterName" - Node_Replacer = "nodeName" - Namespcae_Replacer = "nameSpace" - Schedule_Replacer = "Schedule" -) - -type ListMetricResult struct { - MetricResult []MetricResult `json:"metricResult,omitempty"` -} - -type MetricResult struct { - MetricName string `json:"metric_name, omitempty"` - MetricData MetricData `json:"data, omitempty"` -} - -type MetricData struct { - Result []map[string]interface{} `json:"result"` - ResultType string `json:"resultType"` -} - -type ResultData struct { - Status string `json:"status"` - Data MetricData `json:"data"` -} - -type MetricUrl struct { - searchType string - searchName string - urls string -} - -func AddTypeMetaToObject(obj runtime.Object) error { - versionKinds, _, err := scheme.Scheme.ObjectKinds(obj) - if err != nil { - return fmt.Errorf("apiVersion or kind not found; %w", err) - } - - for _, vk := range versionKinds { - if len(vk.Kind) == 0 { - continue - } - if len(vk.Version) == 0 || vk.Version == runtime.APIVersionInternal { - continue - } - obj.GetObjectKind().SetGroupVersionKind(vk) - break - } - - return nil -} - -func getMetricRange(metricRange string) (start int64, end int64) { - end = time.Now().Unix() - range_milli, _ := time.ParseDuration(metricRange) - start = end - int64(range_milli.Seconds()) - return start, end -} - -func replacePromql(promql string, replace_map map[string]string, replace_type string) (str string) { - newPromql := promql - switch replace_type { - case PodName_Replacer: - newPromql = strings.Replace(newPromql, ClusterName_Replacer, replace_map[ClusterName_Replacer], -1) - newPromql = strings.Replace(newPromql, PodName_Replacer, replace_map[PodName_Replacer], -1) - case ClusterName_Replacer: - newPromql = strings.Replace(newPromql, ClusterName_Replacer, replace_map[ClusterName_Replacer], -1) - case Node_Replacer: - newPromql = strings.Replace(newPromql, ClusterName_Replacer, replace_map[ClusterName_Replacer], -1) - newPromql = strings.Replace(newPromql, Node_Replacer, replace_map[Node_Replacer], -1) - case Namespcae_Replacer: - newPromql = strings.Replace(newPromql, ClusterName_Replacer, replace_map[ClusterName_Replacer], -1) - newPromql = strings.Replace(newPromql, Namespcae_Replacer, replace_map[Namespcae_Replacer], -1) - case Schedule_Replacer: - newPromql = strings.Replace(newPromql, ClusterName_Replacer, replace_map[ClusterName_Replacer], -1) - newPromql = strings.Replace(newPromql, Schedule_Replacer, replace_map[Schedule_Replacer], -1) - } - - return newPromql -} - -func GetMetricUrl(promql string, replace_map map[string]string, replace_type string, metric_range string, steps int64) (metricUrl string) { - var newPromql string - if replace_map != nil { - newPromql = replacePromql(promql, replace_map, replace_type) - } else { - newPromql = promql - } - start, end := getMetricRange(metric_range) - params := url.Values{} - params.Add("query", newPromql) - params.Add("start", strconv.FormatInt(start, 10)) - params.Add("end", strconv.FormatInt(end, 10)) - params.Add("step", strconv.FormatInt(steps, 10)) - - config := GetNacosConfig() - return config.Vmui.BaseUrl + params.Encode() -} - -func HttpGetMetrics(metricName string, metricUrls []MetricUrl, wg *sync.WaitGroup, done chan<- MetricResult) { - client := &http.Client{Timeout: 60 * time.Second} - md := MetricData{ - ResultType: "matrix", - } - for _, metricUrl := range metricUrls { - resp, err := client.Get(metricUrl.urls) - if err != nil { - log.Fatalln(err) - } - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - log.Fatalln(err) - } - var rd ResultData - err = json.Unmarshal(body, &rd) - if err != nil { - log.Panicln(err) - } - - if len(rd.Data.Result) == 0 { - m := map[string]string{ - strings.ToLower(metricUrl.searchType): metricUrl.searchName, - } - v := []interface{}{ - 0, - "0", - } - r := map[string]interface{}{ - "metric": m, - "values": v, - } - md.Result = append(md.Result, r) - } - - for _, r := range rd.Data.Result { - format, ok := r["metric"].(map[string]interface{}) - if ok && len(format) == 0 { - r["metric"] = map[string]interface{}{ - strings.ToLower(metricUrl.searchType): metricUrl.searchName, - } - } - md.Result = append(md.Result, r) - } - } - - mr := MetricResult{ - metricName, md, - } - done <- mr - wg.Done() -} diff --git a/app/nacos.go b/app/nacos.go deleted file mode 100644 index fa80b76..0000000 --- a/app/nacos.go +++ /dev/null @@ -1,124 +0,0 @@ -package app - -import ( - "github.com/nacos-group/nacos-sdk-go/clients" - "github.com/nacos-group/nacos-sdk-go/clients/config_client" - "github.com/nacos-group/nacos-sdk-go/common/constant" - "github.com/nacos-group/nacos-sdk-go/vo" - "gopkg.in/yaml.v3" - "log" - "os" -) - -type Config struct { - App struct { - Name string `yaml:"name"` - Version string `yaml:"version"` - } - OpenSearch struct { - Url string `yaml:"url"` - UserName string `yaml:"username"` - PassWord string `yaml:"password"` - } - Mysql struct { - Url string `yaml:"url"` - UrlPCM string `yaml:"url-pcm"` - MaxOpenConn int `yaml:"max-open-conn"` - MaxIdleConn int `yaml:"max-idle-conn"` - } - Redis struct { - Host string `yaml:"host"` - Password string `yaml:"password"` - DB int `yaml:"db"` - } - Karmada struct { - ConfigPath string `yaml:"config-path"` - MemberConfigPath string `yaml:"member-config-path"` - } - Vmui struct { - BaseUrl string `yaml:"base-url"` - } -} - -func GetNacosConfig() Config { - configClient := GetClient() - // 获取配置 - dataId := "dispatch_center_test" - group := "DEFAULT_GROUP" - content, err := configClient.GetConfig(vo.ConfigParam{ - DataId: dataId, - Group: group}) - - if err != nil { - log.Fatalf("获取%s配置失败: %s", dataId, err.Error()) - } - var config = Config{} - err = yaml.Unmarshal([]byte(content), &config) - if err != nil { - log.Fatalf("解析%s配置失败: %s", dataId, err.Error()) - } - CreateKarmadaHostConfig() - return config -} - -func GetClient() config_client.IConfigClient { - //开发环境需要指定nacos地址 - serverConfig := []constant.ServerConfig{ - { - IpAddr: "nacos.jcce.dev", - Port: 8848, - }, - } - // 创建clientConfig - clientConfig := constant.ClientConfig{ - NamespaceId: "test", // 如果需要支持多namespace,我们可以场景多个client,它们有不同的NamespaceId。当namespace是public时,此处填空字符串。 - TimeoutMs: 5000, - NotLoadCacheAtStart: true, - LogLevel: "debug", - } - // 创建动态配置客户端 - configClient, err := clients.CreateConfigClient(map[string]interface{}{ - "serverConfigs": serverConfig, - "clientConfig": clientConfig, - }) - if err != nil { - log.Fatalf("初始化nacos失败: %s", err.Error()) - } - return configClient -} - -// CreateKarmadaHostConfig 从nacos读取配置创建karmada-host集群配置文件 -func CreateKarmadaHostConfig() { - configName := "karmada-host" - client := GetClient() - content, err := client.GetConfig(vo.ConfigParam{ - DataId: "karmada-host", - Group: "DEFAULT_GROUP", - }) - if err != nil { - log.Fatalf("获取%s配置失败: %s", "golang", err.Error()) - } - dir, _ := os.Getwd() - err = os.MkdirAll(dir+"/karmadaConfig", 0766) - if err != nil { - log.Fatalf("nacos 配置目录创建失败,error:%s", err.Error()) - } - clusterConfig, err := os.Create("karmadaConfig/" + configName) - defer clusterConfig.Close() - clusterConfig.Write([]byte(content)) -} - -func GetAgentTemplate() string { - configClient := GetClient() - // 获取配置 - dataId := "agent-template" - group := "DEFAULT_GROUP" - content, err := configClient.GetConfig(vo.ConfigParam{ - DataId: dataId, - Group: group}) - - if err != nil { - log.Fatalf("获取%s配置失败: %s", dataId, err.Error()) - } - return content -} diff --git a/app/namespace.go b/app/namespace.go deleted file mode 100644 index 3074326..0000000 --- a/app/namespace.go +++ /dev/null @@ -1,706 +0,0 @@ -package app - -import ( - "context" - "encoding/json" - "github.com/gin-gonic/gin" - "github.com/jmoiron/sqlx" - "github.com/karmada-io/karmada/pkg/util" - "io" - v1 "k8s.io/api/batch/v1" - coreV1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "net/http" - "sigs.k8s.io/yaml" - "sort" - "strconv" - "strings" - "sync" - "time" -) - -const ( - namespace_memory_usage_wo_cache = "namespace:container_memory_usage_bytes_wo_cache:sum{cluster_name='clusterName',namespace='nameSpace', prometheus_replica='prometheus-k8s-0'}" - namespace_cpu_usage = "sum by (namespace) (namespace:workload_cpu_usage:sum{cluster_name='clusterName',namespace='nameSpace', prometheus_replica='prometheus-k8s-0'})" - namespace_pod_count = "count(sum by (pod) (kube_pod_container_info{cluster_name='clusterName', namespace='nameSpace', prometheus_replica='prometheus-k8s-0'}))" - metric_range_12h = "12h" - steps_namespace = 1080 -) - -type Namespace struct { - NsName string `json:"ns_name"` - State string `json:"state"` - Age string `json:"age"` - CrossDomain bool `json:"cross_domain"` - Domains []Domain `json:"domains"` - Clusters []string `json:"clusters"` - Deployments []string `json:"deployments"` - RequirePodNum int32 `json:"require_pod_num"` - AvailablePodNum int32 `json:"available_pod_num"` - Alias string `json:"alias"` - Describe string `json:"describe"` - TemplateId string `json:"templateId"` -} - -type NamespaceParam struct { - TemplateId string `json:"templateId"` - Namespace coreV1.Namespace `json:"namespace"` - ClusterName []string `json:"clusterName"` -} - -type DomainResult struct { - DomainName string `json:"domain_name"` - Location [2]float64 `json:"location"` -} - -type NamespaceObject struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []coreV1.Namespace `json:"items"` -} - -type JobObject struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []v1.Job `json:"items"` -} - -type NamespacePodCount struct { - Namespace string `json:"namespace"` - Count int32 `json:"count"` - DomainType bool `json:"domainType"` -} - -type NsResources struct { - PodCount int `json:"podCount"` - DeploymentCount int `json:"deploymentCount"` - StatefulSetCount int `json:"statefulSetCount"` - DaemonSetCount int `json:"daemonSetCount"` - JobCount int `json:"jobCount"` - PvcCount int `json:"pvcCount"` - ServiceCount int `json:"serviceCount"` -} - -type NsDomain struct { - DomainName string `json:"domainName"` - Clusters []NsCluster `json:"clusters"` -} - -type NsCluster struct { - ClusterName string `json:"clusterName"` - NameSpaces []NsNameSpace `json:"nameSpaces"` -} - -type NsNameSpace struct { - NameSpace string `json:"nameSpace"` - NameSpaceType string `json:"nameSpaceType"` -} - -type NsClusterType struct { - ClusterName string `db:"cluster_name" json:"clusterName"` - ClusterType string `db:"cluster_type" json:"ClusterType"` -} - -func GetNamespaceResources(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - // 查询pod - podResult := SearchObject(podListConst, clusterName, namespace, "") - var podObject PodObject - podRaw, _ := podResult.Raw() - json.Unmarshal(podRaw, &podObject) - // 查询deployment - deploymentResult := SearchObject(deploymentListConst, clusterName, namespace, "") - var deploymentObject DeploymentObject - deploymentRaw, _ := deploymentResult.Raw() - json.Unmarshal(deploymentRaw, &deploymentObject) - // 查询statefulSet - statefulSetResult := SearchObject(statefulSetListConst, clusterName, namespace, "") - var statefulSetObject StatefulSetObject - statefulSetRaw, _ := statefulSetResult.Raw() - json.Unmarshal(statefulSetRaw, &statefulSetObject) - // 查询daemonSet - daemonSetResult := SearchObject(daemonSetListConst, clusterName, namespace, "") - var daemonSetObject DaemonSetObject - daemonSetRaw, _ := daemonSetResult.Raw() - json.Unmarshal(daemonSetRaw, &daemonSetObject) - // 查询job - jobResult := SearchObject(jobListConst, clusterName, namespace, "") - var jobObject JobObject - jobRaw, _ := jobResult.Raw() - json.Unmarshal(jobRaw, &jobObject) - // 查询pvc - pvcResult := SearchObject(pvcListConst, clusterName, namespace, "") - var pvcObject PVCObject - pvcRaw, _ := pvcResult.Raw() - json.Unmarshal(pvcRaw, &pvcObject) - // 查询service - serviceResult := SearchObject(serviceConst, clusterName, namespace, "") - var serviceObject ServiceObject - serviceRaw, _ := serviceResult.Raw() - json.Unmarshal(serviceRaw, &serviceObject) - Response(c, http.StatusOK, "success", NsResources{ - PodCount: len(podObject.Items), - DeploymentCount: len(deploymentObject.Items), - StatefulSetCount: len(statefulSetObject.Items), - DaemonSetCount: len(daemonSetObject.Items), - JobCount: len(jobObject.Items), - PvcCount: len(pvcObject.Items), - ServiceCount: len(serviceObject.Items), - }) -} - -// CreateNamespace 创建命名空间(项目) -// @Summary 创建命名空间(项目) -// @Description 创建命名空间(项目) -// @Tags namespace -// @accept json -// @Produce json -// @Param param body Namespace true "json" -// @Success 200 -// @Failure 400 -// @Router /api/v1/namespace/create [post] -func CreateNamespace(c *gin.Context) { - var param NamespaceParam - if err := c.BindJSON(¶m); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - // 判断是karmada分发还是指定集群创建 - if param.Namespace.Labels != nil && param.Namespace.Labels["jcce"] == "true" { - _, createErr := ClientSet.CoreV1().Namespaces().Create(context.TODO(), ¶m.Namespace, metav1.CreateOptions{}) - if createErr != nil { - Response(c, http.StatusInternalServerError, "failed", createErr) - return - } - // 创建调度策略实例 - policyErr := CreatePropagationPolicies(PropagationPolicy{ - ClusterName: param.ClusterName, - TemplateId: param.TemplateId, - ResourceName: param.Namespace.Name, - Name: "namespace" + "." + param.Namespace.Name, - Kind: "Namespace", - }) - if policyErr != nil { - Response(c, http.StatusInternalServerError, "failed", policyErr) - return - } - } else { - result := PostObject(namespaceConst, param.ClusterName[0], "", "", param.Namespace) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", result.Error()) - return - } - } - - Response(c, http.StatusOK, "success", "") - -} - -// ListNamespaceFromCluster 根据指定集群查询命名空间 -func ListNamespaceFromCluster(c *gin.Context) { - clusterName := c.Query("clusterName") - name := c.Query("name") - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - searchObject := SearchObject(namespaceConst, clusterName, "", "") - raw, _ := searchObject.Raw() - var namespaceObject NamespaceObject - json.Unmarshal(raw, &namespaceObject) - var result []coreV1.Namespace - // 模糊查询 - if len(name) != 0 { - for _, namespace := range namespaceObject.Items { - if strings.Contains(namespace.Name, name) { - result = append(result, namespace) - } - } - } else { - result = namespaceObject.Items - } - if result == nil { - Response(c, http.StatusOK, "success", nil) - return - } - // 分页 - page := &Page[coreV1.Namespace]{} - page.List = result - // 排序 - sort.SliceStable(result, func(i, j int) bool { - return result[i].CreationTimestamp.Time.After(result[j].CreationTimestamp.Time) - }) - data := Paginator(page, int64(len(result)), pageNum, pageSize) - Response(c, http.StatusOK, "success", data) -} - -// ListName 获取所有项目名 -func ListName(c *gin.Context) { - clusterName := c.Query("clusterName") - result := SearchObject(namespaceConst, clusterName, "", "") - raw, _ := result.Raw() - var namespaceObject NamespaceObject - json.Unmarshal(raw, &namespaceObject) - var namespaceList []string - for _, namespace := range namespaceObject.Items { - namespaceList = append(namespaceList, namespace.Name) - } - Response(c, http.StatusOK, "success", namespaceList) -} - -func ListPodsCount(c *gin.Context) { - var result []NamespacePodCount - namespaceMap := make(map[string]int32) - namespaceDomainMap := make(map[string]bool) - // 查询所有工作负载 - deploymentList, err := ClientSet.AppsV1().Deployments("").List(context.TODO(), metav1.ListOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "failed", err) - return - } - policyList, err := KarmadaClient.PolicyV1alpha1().PropagationPolicies("").List(context.TODO(), metav1.ListOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "failed", err) - return - } - for _, deployment := range deploymentList.Items { - // 根据命名空间计算pod数量 - if _, ok := namespaceMap[deployment.Namespace]; ok { - namespaceMap[deployment.Namespace] = namespaceMap[deployment.Namespace] + deployment.Status.AvailableReplicas - } else { - namespaceMap[deployment.Namespace] = deployment.Status.AvailableReplicas - } - // 根据调度策略实例查询分发到多少个域 - for _, policy := range policyList.Items { - if strings.EqualFold(policy.Name, "deployment"+"."+deployment.Namespace+"."+deployment.Name) { - // 拼接查询的集群列表 - var domainCount int - query, args, _ := sqlx.In("SELECT COUNT( *) as domainCount from domain_cluster dc WHERE cluster_name in (?)", policy.Spec.Placement.ClusterAffinity.ClusterNames) - DB.QueryRow(query, args...).Scan(&domainCount) - if domainCount > 1 { - namespaceDomainMap[deployment.Namespace] = true - } - } - - } - } - for k, v := range namespaceMap { - result = append(result, NamespacePodCount{ - Namespace: k, - Count: v, - DomainType: namespaceDomainMap[k]}) - } - Response(c, http.StatusOK, "success", result) -} - -func IsExistNamespace(c *gin.Context) { - clusterName := c.Query("clusterName") - name := c.Query("name") - result := SearchObject(detailNamespaceConst, clusterName, "", name) - if result.Error() != nil { - Response(c, http.StatusOK, "success", false) - return - } - raw, _ := result.Raw() - var namespace coreV1.Namespace - json.Unmarshal(raw, &namespace) - if len(namespace.Name) == 0 { - Response(c, http.StatusOK, "success", false) - return - } - Response(c, http.StatusOK, "success", true) -} - -// ListNamespace 查询Namespace列表 -// @Summary 查询Namespace列表 -// @Description 查询Namespace列表 -// @Tags namespace -// @accept json -// @Produce json -// @Param pageNum query string true "页码 " -// @Param pageSize query string true "每页数量" -// @Success 200 -// @Failure 400 -// @Router /api/v1/namespace/list [get] -func ListNamespace(c *gin.Context) { - var nameList []string - list, err := ClientSet.CoreV1().Namespaces().List(context.TODO(), metav1.ListOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "failed", err) - return - } - for _, namespace := range list.Items { - if namespace.Labels["jcce"] == "true" { - nameList = append(nameList, namespace.Name) - } - } - Response(c, http.StatusOK, "success", nameList) -} - -// ListNamespaceByDomain 根据域查询集群下Namespace列表 -// @Summary 根据域查询集群下Namespace列表 -// @Description 根据域查询集群下Namespace列表 -// @Tags namespace -// @accept json -// @Produce json -// @Success 200 -// @Failure 400 -// @Router /api/v1/namespace/nameSpaceByRegion [get] -func ListNamespaceByDomain(c *gin.Context) { - domainNameList := make([]string, 0) - - domainList := make([]NsDomain, 0) - clusterNameList := make([]NsClusterType, 0) - var namespaceObject NamespaceObject - - //查询所有域 - err := DB.Select(&domainNameList, `select domain_name from domain_cluster group by domain_name`) - if err != nil { - Response(c, http.StatusInternalServerError, "failed", err) - return - } - //查询域下面的集群 - for _, s := range domainNameList { - cerr := DB.Select(&clusterNameList, `select cluster_name,cluster_type from domain_cluster where domain_name=?`, s) - if cerr != nil { - Response(c, http.StatusInternalServerError, "failed", cerr.Error()) - return - } - clusterList := make([]NsCluster, 0) - //查询集群下的namespace - for _, c := range clusterNameList { - cluster := NsCluster{} - cluster.ClusterName = c.ClusterName - - result := SearchObject(namespaceConst, c.ClusterName, "", "") - raw, _ := result.Raw() - json.Unmarshal(raw, &namespaceObject) - namespaceList := make([]NsNameSpace, 0) - for _, ns := range namespaceObject.Items { - namespace := NsNameSpace{} - namespace.NameSpace = ns.Name - namespace.NameSpaceType = c.ClusterType - namespaceList = append(namespaceList, namespace) - cluster.NameSpaces = namespaceList - } - - clusterList = append(clusterList, cluster) - } - domain := NsDomain{} - domain.DomainName = s - domain.Clusters = clusterList - domainList = append(domainList, domain) - } - - Response(c, http.StatusOK, "success", domainList) -} - -func DetailNamespace(c *gin.Context) { - clusterName := c.Query("clusterName") - name := c.Query("name") - result := SearchObject(detailNamespaceConst, clusterName, "", name) - raw, _ := result.Raw() - var namespace coreV1.Namespace - json.Unmarshal(raw, &namespace) - Response(c, http.StatusOK, "success", namespace) -} - -// @Summary 查询Namespace详情 -// @Description 查询Namespace详情 -// @Tags namespace -// @accept json -// @Produce json -// @Param namespace query string true "命名空间" -// @Success 200 -// @Failure 400 -// @Router /api/v1/namespace/describe [get] -func DescribeNamespace(c *gin.Context) { - - namespace := c.Query("namespace") - - optsGet := metav1.GetOptions{ - TypeMeta: metav1.TypeMeta{}, - ResourceVersion: "", - } - - nsDescribe, _ := ClientSet.CoreV1().Namespaces().Get(context.TODO(), namespace, optsGet) - - //集群工作负载分配到的所有集群和域的集合,这里的数字可以从控制平面来取 - deploymentList, err := ClientSet.AppsV1().Deployments(namespace).List(context.TODO(), metav1.ListOptions{}) - if err != nil { - return - } - var totalRequired int32 - var totalAvailable int32 - for _, deploy := range deploymentList.Items { - replicaRequired := *deploy.Spec.Replicas - replicaAvailable := deploy.Status.AvailableReplicas - totalRequired += replicaRequired - totalAvailable += replicaAvailable - } - - //通过OpenSearch查询该ns下的分布在不同集群的所有deployment - deploys := GetDeployFromOS(namespace, "", "") - hits, _ := deploys.Get("hits").Get("hits").Array() - - //集群详情中包含集群下所有的工作负载列表,所有工作负载所在的集群列表,以及所有集群所在的域列表 - var deploySet []string - var clusterSet []string - var domainSet []Domain - - for i := 0; i < len(hits); i++ { - - clusterName, _ := deploys.Get("hits").Get("hits").GetIndex(i).Get("_source").Get("metadata").Get("annotations").Get("resource.karmada.io/cached-from-cluster").String() - deployName, _ := deploys.Get("hits").Get("hits").GetIndex(i).Get("_source").Get("metadata").Get("name").String() - //通过cluster name从数据库获取 其域名 - rows, _ := DB.Query("select dc.domain_id,dc.domain_name,d.longitude,d.latitude from domain_cluster dc,domain d where dc.domain_id = d.domain_id and dc.cluster_name = ?", clusterName) - - clusterSet = append(clusterSet, clusterName) - - var domainId int32 - var domainName string - var longitude float64 - var latitude float64 - - for rows.Next() { - err := rows.Scan(&domainId, &domainName, &longitude, &latitude) - if err != nil { - return - } - } - deploySet = append(deploySet, deployName+":"+clusterName) - - var totalAllocatableCPU int64 - var totalAllocatableMemory int64 - var totalAllocatedCPU int64 - var totalAllocatedMemory int64 - var domain Domain - deploys := GetDeployFromOS(namespace, "", clusterName) - hits, _ := deploys.Get("hits").Get("hits").Array() - - for i := 0; i < len(hits); i++ { - deployName, _ := deploys.Get("hits").Get("hits").GetIndex(i).Get("_source").Get("metadata").Get("name").String() - domain.Deployments = append(domain.Deployments, deployName) - } - domain.Clusters = append(domain.Clusters, clusterName) - cluster, _, _ := util.GetClusterWithKarmadaClient(KarmadaClient, clusterName) - if cluster == nil { - continue - } - allocatableCPU := cluster.Status.ResourceSummary.Allocatable.Cpu().MilliValue() - allocatableMemory := cluster.Status.ResourceSummary.Allocatable.Memory().MilliValue() - allocatedCPU := cluster.Status.ResourceSummary.Allocated.Cpu().MilliValue() - allocatedMemory := cluster.Status.ResourceSummary.Allocated.Memory().MilliValue() - - totalAllocatableCPU += allocatableCPU - totalAllocatableMemory += allocatableMemory - totalAllocatedCPU += allocatedCPU - totalAllocatedMemory += allocatedMemory - domain.DomainId = domainId - domain.DomainName = domainName - domain.Deployments = removeDuplicateArr(domain.Deployments) - domain.Location[0] = longitude - domain.Location[1] = latitude - domain.CPURate = float64(totalAllocatedCPU) / float64(totalAllocatableCPU) - domain.MemoryRate = float64(totalAllocatedMemory) / float64(totalAllocatableMemory) - - domainSet = append(domainSet, domain) - } - - //域和集群 结果去重 - clusterSet = removeDuplicateArr(clusterSet) - domainSet = RemoveRepeatedDomain(domainSet) - - nsResult := Namespace{ - NsName: nsDescribe.Name, - State: string(nsDescribe.Status.Phase), - Age: strconv.FormatFloat(time.Now().Sub(nsDescribe.CreationTimestamp.Time).Hours()/24, 'f', 0, 64) + "d", - RequirePodNum: totalRequired, - AvailablePodNum: totalAvailable, - Deployments: deploySet, - Domains: domainSet, - Clusters: clusterSet, - } - - Response(c, http.StatusOK, "success", nsResult) -} - -// UpdateNamespace 更新命名空间(项目) -// @Summary 更新命名空间(项目) -// @Description 更新命名空间(项目) -// @Tags namespace -// @accept json -// @Produce json -// @Param param body Namespace true "json" -// @Success 200 -// @Failure 400 -// @Router /api/v1/namespace/update [post] -func UpdateNamespace(c *gin.Context) { - clusterName := c.Query("clusterName") - var namespace coreV1.Namespace - if err := c.BindJSON(&namespace); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - if len(namespace.Labels["jcce"]) != 0 { - _, err := ClientSet.CoreV1().Namespaces().Update(context.TODO(), &namespace, metav1.UpdateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "update namespace failed", err) - return - } - } else { - result := UpdateObject(detailNamespaceConst, clusterName, "", namespace.Name, namespace) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "update namespace failed", result.Error()) - return - } - } - Response(c, http.StatusOK, "success", "") - -} - -// DeleteNamespace 删除命名空间(项目) -func DeleteNamespace(c *gin.Context) { - clusterName := c.Param("clusterName") - name := c.Param("name") - label := c.Param("label") - if strings.EqualFold(label, "jcce") { - err := ClientSet.CoreV1().Namespaces().Delete(context.TODO(), name, metav1.DeleteOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "delete namespace failed", "") - return - } - // 删除数据库记录policy实例 - _, err = DB.Exec(`delete from joint_domain.namespace where namespace_name = ? `, name) - if err != nil { - Response(c, http.StatusInternalServerError, "delete db failed", err) - return - } - // 删除调度策略实例 - DeletePropagationPolicies(name, "namespace"+"."+name) - } else { - result := DeleteObject(detailNamespaceConst, clusterName, "", name) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "delete namespace failed", result.Error()) - return - } - } - Response(c, http.StatusOK, "success", "") -} - -// @Summary namespace监控 -// @Description namespace监控 -// @Tags namespace -// @accept json -// @Produce json -// @Param clusterName query string true "集群名" -// @Param namespace query string true "命名空间名称" -// @Success 200 -// @Failure 400 -// @Router /api/v1/namespace/getMetrics [get] -func GetNamespaceMetrics(c *gin.Context) { - clusterName, _ := c.GetQuery("clusterName") - namespace, _ := c.GetQuery("namespace") - - replaceMap := make(map[string]string) - replaceMap[ClusterName] = clusterName - replaceMap["nameSpace"] = namespace - - metricMap := map[string][]MetricUrl{ - "namespace_memory_usage_wo_cache": {{"nameSpace", namespace, GetMetricUrl(namespace_memory_usage_wo_cache, replaceMap, "nameSpace", metric_range_12h, steps_namespace)}}, - "namespace_cpu_usage": {{"nameSpace", namespace, GetMetricUrl(namespace_cpu_usage, replaceMap, "nameSpace", metric_range_12h, steps_namespace)}}, - } - - ch := make(chan MetricResult, len(metricMap)) - var wg sync.WaitGroup - - for k, v := range metricMap { - wg.Add(1) - go HttpGetMetrics(k, v, &wg, ch) - } - wg.Wait() - close(ch) - - mr := []MetricResult{} - for v := range ch { - mr = append(mr, v) - } - - Response(c, http.StatusOK, "success", mr) -} - -// @Summary 批量获取namespace监控 -// @Description 批量获取namespace监控 -// @Tags namespace -// @accept json -// @Produce json -// @Param clusterName query string true "集群名" -// @Param namespaces query string true "逗号分隔多个命名空间名称" -// @Success 200 -// @Failure 400 -// @Router /api/v1/namespace/getBatchMetrics [get] -func GetBatchNamespaceMetrics(c *gin.Context) { - clusterName := c.Query("clusterName") - namespaces := c.Query("namespaces") - - namespace := strings.Split(namespaces, ",") - - metricUrls := make([][]MetricUrl, 3) - for _, name := range namespace { - imap := map[string]string{ - ClusterName: clusterName, - "nameSpace": name, - } - metricUrls[0] = append(metricUrls[0], MetricUrl{"nameSpace", name, GetMetricUrl(namespace_memory_usage_wo_cache, imap, "nameSpace", metric_range_1s, steps_1s)}) - metricUrls[1] = append(metricUrls[1], MetricUrl{"nameSpace", name, GetMetricUrl(namespace_cpu_usage, imap, "nameSpace", metric_range_1s, steps_1s)}) - metricUrls[2] = append(metricUrls[2], MetricUrl{"nameSpace", name, GetMetricUrl(namespace_pod_count, imap, "nameSpace", metric_range_1s, steps_1s)}) - } - - metricMap := map[string][]MetricUrl{ - "namespace_memory_usage_wo_cache": metricUrls[0], - "namespace_cpu_usage": metricUrls[1], - "namespace_pod_count": metricUrls[2], - } - - ch := make(chan MetricResult, len(metricMap)) - var wg sync.WaitGroup - - for k, v := range metricMap { - wg.Add(1) - go HttpGetMetrics(k, v, &wg, ch) - } - wg.Wait() - close(ch) - - mr := []MetricResult{} - for v := range ch { - mr = append(mr, v) - } - - Response(c, http.StatusOK, "success", mr) -} - -func CreateNamespaceByYaml(c *gin.Context) { - file, err := c.FormFile("test") - if err != nil { - return - } - open, err := file.Open() - if err != nil { - return - } - all, err := io.ReadAll(open) - if err != nil { - return - } - var namespace coreV1.Namespace - yaml.Unmarshal(all, &namespace) - if err != nil { - return - } - result := PostObject(namespaceConst, "host", "", "", namespace) - Response(c, http.StatusOK, "success", result) -} diff --git a/app/node.go b/app/node.go deleted file mode 100644 index 0228300..0000000 --- a/app/node.go +++ /dev/null @@ -1,490 +0,0 @@ -package app - -import ( - "context" - "encoding/json" - "fmt" - "github.com/gin-gonic/gin" - "github.com/robfig/cron/v3" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/metrics/pkg/apis/metrics" - "math" - "net/http" - "sort" - "strconv" - "strings" - "sync" - "time" -) - -type NodeObject struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []v1.Node `json:"items"` -} - -type MetricsRes struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []metrics.NodeMetrics `json:"items"` -} - -type NodeExtendRes struct { - Node v1.Node `json:"node"` - PodStatus v1.PodPhase `json:"podStatus"` -} - -type NodeCountResult struct { - MasterCount int `json:"masterCount"` - AllCount int `json:"allCount"` - WorkCount int `json:"workCount"` -} - -const ( - node_cpu_utilisation_1h = "node:node_cpu_utilisation:avg1m{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_pod_utilisation_1h = "node:pod_utilization:ratio{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_memory_utilisation_1h = "node:node_memory_utilisation:{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_disk_size_utilisation_1h = "node:disk_space_utilization:ratio{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - - node_load15_8h = "node:load15:ratio{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_disk_write_iops_8h = "node:data_volume_iops_writes:sum{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_cpu_utilisation_8h = "node:node_cpu_utilisation:avg1m{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_net_bytes_transmitted_8h = "node:node_net_bytes_transmitted:sum_irate{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_disk_inode_total_8h = "node:node_inodes_total:{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_disk_read_throughput_8h = "node:data_volume_throughput_bytes_read:sum{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_net_bytes_received_8h = "node:node_net_bytes_received:sum_irate{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_memory_utilisation_8h = "node:node_memory_utilisation:{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_disk_write_throughput_8h = "node:data_volume_throughput_bytes_written:sum{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_load5_8h = "node:load5:ratio{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_disk_inode_usage_8h = "node:node_inodes_total:{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'} * node:disk_inode_utilization:ratio{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_disk_read_iops_8h = "node:data_volume_iops_reads:sum{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_disk_size_utilisation_8h = "node:disk_space_utilization:ratio{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_disk_inode_utilisation_8h = "node:disk_inode_utilization:ratio{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - node_load1_8h = "node:load1:ratio{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'}" - - node_cpu_limits = "sum by (node) (kube_pod_container_resource_limits_cpu_cores{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'})" - node_cpu_requests = "sum by (node) (kube_pod_container_resource_requests_cpu_cores{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'})" - node_memory_limits = "sum by (node) (kube_pod_container_resource_limits_memory_bytes{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'})" - node_memory_requests = "sum by (node) (kube_pod_container_resource_requests_memory_bytes{cluster_name='clusterName',node='nodeName', prometheus_replica='prometheus-k8s-0'})" - - NodeName = "nodeName" - metric_range_1h = "1h" - steps_1h = 180 - metric_range_8h = "8.333h" - steps_8h = 600 - max = 10 -) - -// NodeCount 查询节点数量 -func NodeCount(c *gin.Context) { - clusterName := c.Query("clusterName") - result := SearchObject(nodeConst, clusterName, "", "") - raw, _ := result.Raw() - var nodeRes NodeObject - json.Unmarshal(raw, &nodeRes) - var masterCount int - var edgerCount int - for i := range nodeRes.Items { - if _, ok := nodeRes.Items[i].Labels["node-role.kubernetes.io/master"]; ok { - masterCount++ - } - if _, ok := nodeRes.Items[i].Labels["node-role.kubernetes.io/edge"]; ok { - edgerCount++ - } - } - Response(c, http.StatusOK, "success", NodeCountResult{ - AllCount: len(nodeRes.Items) - edgerCount, - MasterCount: masterCount, - WorkCount: len(nodeRes.Items) - masterCount - edgerCount, - }) - -} - -// UpdateNode 更新节点信息 -func UpdateNode(c *gin.Context) { - clusterName := c.Query("clusterName") - var node v1.Node - if err := c.BindJSON(&node); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - if len(node.Labels["jcce"]) != 0 { - _, err := ClientSet.CoreV1().Nodes().Update(context.TODO(), &node, metav1.UpdateOptions{}) - if err != nil { - Response(c, http.StatusBadRequest, "update node error.", "") - return - } - } else { - result := UpdateObject(detailNodeConst, clusterName, "", node.Name, node) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "update persistentVolumeClaim failed", result.Error()) - return - } - } - Response(c, http.StatusOK, "success", "") -} - -// ListNode 查询节点列表 -// @Summary 查询节点列表 -// @Description 查询节点列表 -// @Tags node -// @accept json -// @Produce json -// @Param clusterName path string true "集群名" -// @Success 200 -// @Failure 500 -// @Router /api/v1/node/list/{clusterName} [get] -func ListNode(c *gin.Context) { - clusterName := c.Query("clusterName") - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - queryType := c.Query("queryType") - status := c.Query("status") - nodeResult := SearchObject(nodeConst, clusterName, "", "") - raw, _ := nodeResult.Raw() - var nodeRes NodeObject - json.Unmarshal(raw, &nodeRes) - var result []v1.Node - if strings.EqualFold(queryType, "edge") { - for i := range nodeRes.Items { - if _, ok := nodeRes.Items[i].Labels["node-role.kubernetes.io/edge"]; ok { - result = append(result, nodeRes.Items[i]) - } - } - } else { - for i := range nodeRes.Items { - if _, ok := nodeRes.Items[i].Labels["node-role.kubernetes.io/edge"]; !ok { - result = append(result, nodeRes.Items[i]) - } - } - } - count := 0 - for i := range result { - if (strings.EqualFold(status, "unschedulable") && result[i-count].Spec.Unschedulable != true) || - (strings.EqualFold(status, "running") && result[i-count].Spec.Unschedulable == true) || - strings.EqualFold(status, "warning") { - result = append(result[:i-count], result[i-count+1:]...) - count++ - } - } - // 分页 - page := &Page[v1.Node]{} - page.List = result - // 排序 - sort.SliceStable(page.List, func(i, j int) bool { - return page.List[i].CreationTimestamp.Time.After(page.List[j].CreationTimestamp.Time) - }) - data := Paginator(page, int64(len(result)), pageNum, pageSize) - Response(c, http.StatusOK, "success", data) -} - -// DetailNode 查询节点详情 -func DetailNode(c *gin.Context) { - clusterName := c.Query("clusterName") - name := c.Query("name") - // 查询节点信息 - nodeRes := SearchObject(detailNodeConst, clusterName, "", name) - nodeRaw, _ := nodeRes.Raw() - var node v1.Node - json.Unmarshal(nodeRaw, &node) - - cpu_capacity, _ := node.Status.Capacity.Cpu().AsInt64() - cpu_capacity_float := float64(cpu_capacity) - ephemeral_storage, _ := node.Status.Capacity.StorageEphemeral().AsInt64() - ephemeral_storage_float := float64(ephemeral_storage) - - replaceMap := make(map[string]string) - replaceMap[ClusterName] = clusterName - replaceMap[NodeName] = name - - metricMap := map[string][]MetricUrl{ - "node_cpu_limits": {{NodeName, name, GetMetricUrl(node_cpu_limits, replaceMap, NodeName, metric_range_1s, steps_1s)}}, - "node_cpu_requests": {{NodeName, name, GetMetricUrl(node_cpu_requests, replaceMap, NodeName, metric_range_1s, steps_1s)}}, - "node_memory_limits": {{NodeName, name, GetMetricUrl(node_memory_limits, replaceMap, NodeName, metric_range_1s, steps_1s)}}, - "node_memory_requests": {{NodeName, name, GetMetricUrl(node_memory_requests, replaceMap, NodeName, metric_range_1s, steps_1s)}}, - } - - ch := make(chan MetricResult, len(metricMap)) - - var wg sync.WaitGroup - - for k, v := range metricMap { - wg.Add(1) - go HttpGetMetrics(k, v, &wg, ch) - } - wg.Wait() - close(ch) - - aMap := map[string]string{} - for v := range ch { - if len(v.MetricData.Result) == 0 { - continue - } - format := v.MetricData.Result[0]["values"] - valStr := fmt.Sprintf("%v", format) - vals := strings.Split(valStr, " ") - val := strings.Trim(vals[1], "]]") - - switch v.MetricName { - case "node_cpu_limits": - aMap["node_cpu_limits"] = val - ival, _ := strconv.ParseFloat(val, 64) - fraction := ival / cpu_capacity_float - aMap["node_cpu_limits_fraction"] = fmt.Sprintf("%.0f%%", math.Round(fraction*100)) - case "node_cpu_requests": - aMap["node_cpu_requests"] = val - ival, _ := strconv.ParseFloat(val, 64) - fraction := ival / cpu_capacity_float - aMap["node_cpu_requests_fraction"] = fmt.Sprintf("%.0f%%", math.Round(fraction*100)) - case "node_memory_limits": - aMap["node_memory_limits"] = val - ival, _ := strconv.ParseFloat(val, 64) - fraction := ival / ephemeral_storage_float - aMap["node_memory_limits_fraction"] = fmt.Sprintf("%.0f%%", math.Round(fraction*100)) - case "node_memory_requests": - aMap["node_memory_requests"] = val - ival, _ := strconv.ParseFloat(val, 64) - fraction := ival / ephemeral_storage_float - aMap["node_memory_requests_fraction"] = fmt.Sprintf("%.0f%%", math.Round(fraction*100)) - } - } - - nodeMetricLength := 8 - if len(aMap) != nodeMetricLength { - Response(c, http.StatusOK, "query node list success", node) - return - } - - formatted_str := fmt.Sprintf(`[{"op":"replace","path":"/metadata/annotations/node.kubesphere.io~1cpu-limits", "value": "%s"}, - {"op":"replace","path":"/metadata/annotations/node.kubesphere.io~1cpu-limits-fraction", "value": "%s"}, - {"op":"replace","path":"/metadata/annotations/node.kubesphere.io~1cpu_requests", "value": "%s"}, - {"op":"replace","path":"/metadata/annotations/node.kubesphere.io~1cpu_requests-fraction", "value": "%s"}, - {"op":"replace","path":"/metadata/annotations/node.kubesphere.io~1memory_limits", "value": "%s"}, - {"op":"replace","path":"/metadata/annotations/node.kubesphere.io~1memory_limits-fraction", "value": "%s"}, - {"op":"replace","path":"/metadata/annotations/node.kubesphere.io~1memory_requests", "value": "%s"}, - {"op":"replace","path":"/metadata/annotations/node.kubesphere.io~1memory_requests-fraction", "value": "%s"}]`, - aMap["node_cpu_limits"], aMap["node_cpu_limits_fraction"], aMap["node_cpu_requests"], - aMap["node_cpu_requests_fraction"], aMap["node_memory_limits"], aMap["node_memory_limits_fraction"], - aMap["node_memory_requests"], aMap["node_memory_requests_fraction"]) - aliasJson := []byte(formatted_str) - - PatchObject(detailNodeConst, clusterName, "", node.Name, aliasJson, types.JSONPatchType) - - Response(c, http.StatusOK, "query node list success", node) -} - -// @Summary 根据集群名称 命名空间 pod名称查询节点信息 -// @Description 根据集群名称 命名空间 pod名称查询节点信息 -// @Tags node -// @accept json -// @Produce json -// @Param clusterName path string true "集群名" -// @Param namespace path string true "命名空间名" -// @Param podName path string true "Pod名" -// @Success 200 -// @Failure 500 -// @Router /api/v1/node/detail/{clusterName}/{namespace}/{podName} [get] -func queryNodeInfo(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - podName := c.Query("podName") - var result NodeExtendRes - // 查询节点信息 - nodeRes := SearchObject(nodeConst, clusterName, "", "") - nodeRaw, _ := nodeRes.Raw() - var nodeList NodeObject - json.Unmarshal(nodeRaw, &nodeList) - // 查询pod信息 - podResult := SearchObject(podDetailConst, clusterName, namespace, podName) - podRaw, _ := podResult.Raw() - - var pod v1.Pod - json.Unmarshal(podRaw, &pod) - for _, node := range nodeList.Items { - if strings.EqualFold(node.Name, pod.Spec.NodeName) { - result.Node = node - result.PodStatus = pod.Status.Phase - } - } - Response(c, http.StatusOK, "success", result) -} - -// ListEdgeNode 查询边缘节点列表 -// @Summary 查询边缘节点列表 -// @Description 查询边缘节点列表 -// @Tags node -// @accept json -// @Produce json -// @Param clusterName path string true "集群名" -// @Success 200 -// @Failure 500 -// @Router /api/v1/node/edge/{clusterName} [get] -func ListEdgeNode(c *gin.Context) { - clusterName := c.Query("clusterName") - result := SearchObject(nodeConst, clusterName, "", "") - raw, _ := result.Raw() - var nodeRes NodeObject - json.Unmarshal(raw, &nodeRes) - var res []v1.Node - for _, node := range nodeRes.Items { - if _, ok := node.Labels["node-role.kubernetes.io/edge"]; ok { - res = append(res, node) - } - } - Response(c, http.StatusOK, "success", res) -} - -// ListNodeMetrics 查询边缘节点指标 -// @Summary 查询边缘节点指标 -// @Description 查询边缘节点指标 -// @Tags node -// @accept json -// @Produce json -// @Param clusterName path string true "集群名" -// @Success 200 -// @Failure 500 -// @Router /api/v1/node/metrics/{clusterName} [get] -func ListNodeMetrics(c *gin.Context) { - clusterName := c.Query("clusterName") - result := SearchObject(nodeMetrics, clusterName, "", "") - raw, _ := result.Raw() - var metricsRes MetricsRes - json.Unmarshal(raw, &metricsRes) - Response(c, http.StatusOK, "success", metricsRes.Items) -} - -// @Summary 获取集群节点1h监控 -// @Description 获取集群节点1h监控 -// @Tags node -// @accept json -// @Produce json -// @Param clusterName query string true "集群名称" -// @Param nodeName query string true "节点名称" -// @Success 200 -// @Failure 400 -// @Router /api/v1/node/getNodeMetrics1h [get] -func GetNodeMetrics1h(c *gin.Context) { - clusterName := c.Query("clusterName") - nodeName := c.Query("nodeName") - - replaceMap := make(map[string]string) - replaceMap[ClusterName] = clusterName - replaceMap[NodeName] = nodeName - - metricMap := map[string][]MetricUrl{ - "node_cpu_utilisation": {{NodeName, nodeName, GetMetricUrl(node_cpu_utilisation_1h, replaceMap, NodeName, metric_range_1h, steps_1h)}}, - "node_pod_utilisation": {{NodeName, nodeName, GetMetricUrl(node_pod_utilisation_1h, replaceMap, NodeName, metric_range_1h, steps_1h)}}, - "node_memory_utilisation": {{NodeName, nodeName, GetMetricUrl(node_memory_utilisation_1h, replaceMap, NodeName, metric_range_1h, steps_1h)}}, - "node_disk_size_utilisation": {{NodeName, nodeName, GetMetricUrl(node_disk_size_utilisation_1h, replaceMap, NodeName, metric_range_1h, steps_1h)}}, - } - - ch := make(chan MetricResult, len(metricMap)) - var wg sync.WaitGroup - - for k, v := range metricMap { - wg.Add(1) - go HttpGetMetrics(k, v, &wg, ch) - } - wg.Wait() - close(ch) - - mr := []MetricResult{} - for v := range ch { - mr = append(mr, v) - } - - Response(c, http.StatusOK, "success", mr) -} - -// @Summary 获取集群节点8h监控 -// @Description 获取集群节点8h监控 -// @Tags node -// @accept json -// @Produce json -// @Param clusterName query string true "集群名称" -// @Param nodeName query string true "节点名称" -// @Success 200 -// @Failure 400 -// @Router /api/v1/node/getNodeMetrics8h [get] -func GetNodeMetrics8h(c *gin.Context) { - clusterName := c.Query("clusterName") - nodeName := c.Query("nodeName") - - replaceMap := make(map[string]string) - replaceMap[ClusterName] = clusterName - replaceMap[NodeName] = nodeName - - metricMap := map[string][]MetricUrl{ - "node_load15": {{NodeName, nodeName, GetMetricUrl(node_load15_8h, replaceMap, NodeName, metric_range_8h, steps_8h)}}, - "node_disk_write_iops": {{NodeName, nodeName, GetMetricUrl(node_disk_write_iops_8h, replaceMap, NodeName, metric_range_8h, steps_8h)}}, - "node_cpu_utilisation": {{NodeName, nodeName, GetMetricUrl(node_cpu_utilisation_8h, replaceMap, NodeName, metric_range_8h, steps_8h)}}, - "node_net_bytes_transmitted": {{NodeName, nodeName, GetMetricUrl(node_net_bytes_transmitted_8h, replaceMap, NodeName, metric_range_8h, steps_8h)}}, - "node_disk_inode_total": {{NodeName, nodeName, GetMetricUrl(node_disk_inode_total_8h, replaceMap, NodeName, metric_range_8h, steps_8h)}}, - "node_disk_read_throughput": {{NodeName, nodeName, GetMetricUrl(node_disk_read_throughput_8h, replaceMap, NodeName, metric_range_8h, steps_8h)}}, - "node_net_bytes_received": {{NodeName, nodeName, GetMetricUrl(node_net_bytes_received_8h, replaceMap, NodeName, metric_range_8h, steps_8h)}}, - "node_memory_utilisation": {{NodeName, nodeName, GetMetricUrl(node_memory_utilisation_8h, replaceMap, NodeName, metric_range_8h, steps_8h)}}, - "node_disk_write_throughput": {{NodeName, nodeName, GetMetricUrl(node_disk_write_throughput_8h, replaceMap, NodeName, metric_range_8h, steps_8h)}}, - "node_load5": {{NodeName, nodeName, GetMetricUrl(node_load5_8h, replaceMap, NodeName, metric_range_8h, steps_8h)}}, - "node_disk_inode_usage": {{NodeName, nodeName, GetMetricUrl(node_disk_inode_usage_8h, replaceMap, NodeName, metric_range_8h, steps_8h)}}, - "node_disk_read_iops": {{NodeName, nodeName, GetMetricUrl(node_disk_read_iops_8h, replaceMap, NodeName, metric_range_8h, steps_8h)}}, - "node_disk_size_utilisation": {{NodeName, nodeName, GetMetricUrl(node_disk_size_utilisation_8h, replaceMap, NodeName, metric_range_8h, steps_8h)}}, - "node_disk_inode_utilisation": {{NodeName, nodeName, GetMetricUrl(node_disk_inode_utilisation_8h, replaceMap, NodeName, metric_range_8h, steps_8h)}}, - "node_load1": {{NodeName, nodeName, GetMetricUrl(node_load1_8h, replaceMap, NodeName, metric_range_8h, steps_8h)}}, - } - - ch := make(chan MetricResult, len(metricMap)) - limit := make(chan bool, max) - - var wg sync.WaitGroup - - for k, v := range metricMap { - limit <- true - wg.Add(1) - go HttpGetMetrics(k, v, &wg, ch) - <-limit - } - wg.Wait() - close(ch) - - mr := []MetricResult{} - for v := range ch { - mr = append(mr, v) - } - - Response(c, http.StatusOK, "success", mr) -} - -func QueryNodeEdgeInfo(c *cron.Cron) { - //创建定时任务 - EntryID, err := c.AddFunc("*/1 * * * *", func() { - // 查询已有的集群列表 - var clusterNameList []string - rows, _ := DB.Query(`SELECT cluster_name FROM domain_cluster`) - for rows.Next() { - var clusterName string - err := rows.Scan(&clusterName) - if err != nil { - return - } - clusterNameList = append(clusterNameList, clusterName) - } - for _, clusterName := range clusterNameList { - nodeRes := SearchObject(detailNodeConst, clusterName, "", "") - nodeRaw, _ := nodeRes.Raw() - var nodeObject NodeObject - json.Unmarshal(nodeRaw, &nodeObject) - for _, node := range nodeObject.Items { - if _, ok := node.Labels["node-role.kubernetes.io/edge"]; ok { - SetRedis(context.TODO(), clusterName, "edge", 120) - } - } - } - }) - fmt.Println(time.Now(), EntryID, err) -} diff --git a/app/opensearch.go b/app/opensearch.go deleted file mode 100644 index b82de42..0000000 --- a/app/opensearch.go +++ /dev/null @@ -1,312 +0,0 @@ -package app - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "github.com/bitly/go-simplejson" - "github.com/opensearch-project/opensearch-go/v2/opensearchapi" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/rest" - "strings" -) - -const ( - clusterProxy = "/apis/cluster.karmada.io/v1alpha1/clusters/%s/proxy" - - nodeConst = "node" - detailHPAConst = "hpa" - deploymentConst = "deployment" - deploymentListConst = "deploymentList" - namespaceConst = "namespace" - detailNamespaceConst = "detailNamespace" - podDetailConst = "podDetail" - podListConst = "podList" - detailPvcConst = "detailPvc" - pvcListConst = "pvcList" - serviceConst = "service" - detailServiceConst = "detailService" - allServiceConst = "allService" - scConst = "sc" - pvcConst = "pvc" - pvConst = "pv" - podMetrics = "podMetrics" - nodeMetrics = "nodeMetrics" - crdConst = "crd" - secretConst = "secret" - configMapConst = "configMap" - statefulSetConst = "statefulSet" - daemonSetConst = "daemonSet" - allPodConst = "allPod" - detailPodConst = "detailPod" - detailNodeConst = "detailNode" - statefulSetListConst = "statefulSetList" - daemonSetListConst = "daemonSetList" - jobListConst = "jobList" - allDeploymentConst = "allDeployment" - allDaemonSetConst = "allDaemonSet" - allStatefulSetConst = "allStatefulSet" - controllerVersionConst = "controllerVersion" - hpaListConst = "hpaList" - replicaSetConst = "replicaSet" - - hpaListUrl = "/apis/autoscaling/v1/namespaces/%s/horizontalpodautoscalers" - detailHpaUrl = "/apis/autoscaling/v1/namespaces/%s/horizontalpodautoscalers/%s" - deploymentListUrl = "/apis/apps/v1/namespaces/%s/deployments" - daemonSetUrl = "/apis/apps/v1/namespaces/%s/daemonsets/%s" - statefulSetUrl = "/apis/apps/v1/namespaces/%s/statefulsets/%s" - statefulSetListUrl = "/apis/apps/v1/namespaces/%s/statefulsets" - daemonSetListUrl = "/apis/apps/v1/namespaces/%s/daemonsets" - replicaSetUrl = "/apis/apps/v1/namespaces/%s/replicasets" - secretUrl = "/api/v1/namespaces/%s/secrets" - configMapUrl = "/api/v1/namespaces/%s/configmaps" - scUrl = "/apis/storage.k8s.io/v1/storageclasses" - pvUrl = "/api/v1/persistentvolumes" - pvcUrl = "/api/v1/persistentvolumeclaims" - detailPvcUrl = "/api/v1/namespaces/%s/persistentvolumeclaims/%s" - nodeUrl = "/api/v1/nodes" - detailNodeUrl = "/api/v1/nodes/%s" - namespaceUrl = "/api/v1/namespaces" - deploymentUrl = "/apis/apps/v1/namespaces/%s/deployments/%s" - allDeploymentUrl = "/apis/apps/v1/deployments" - allStatefulSetUrl = "/apis/apps/v1/statefulsets" - allDaemonSetUrl = "/apis/apps/v1/daemonsets" - podListUrl = "/api/v1/namespaces/%s/pods" - allPodUrl = "/api/v1/pods" - detailPodUrl = "/api/v1/namespaces/%s/pods/%s" - podDetailUrl = "/api/v1/namespaces/%s/pods/%s" - serviceUrl = "/api/v1/namespaces/%s/services" - allServiceUrl = "/api/v1/services" - detailServiceUrl = "/api/v1/namespaces/%s/services/%s" - podMetricsUrl = "/apis/metrics.k8s.io/v1beta1/namespaces/%s/pods/%s" - nodeMetricsUrl = "/apis/metrics.k8s.io/v1beta1/nodes" - crdUrl = "/apis/apiextensions.k8s.io/v1/customresourcedefinitions" - detailNamespaceUrl = "/api/v1/namespaces/%s" - jobListUrl = "/apis/batch/v1/namespaces/%s/jobs" - pvcListUrl = "/api/v1/namespaces/%s/persistentvolumeclaims" - controllerVersionUrl = "/apis/apps/v1/namespaces/%s/controllerrevisions" -) - -func JointUrl(objectType string, clusterName string, namespace string, objectName string) string { - var url bytes.Buffer - url.WriteString(fmt.Sprintf(clusterProxy, clusterName)) - switch objectType { - case "podMetrics": - url.WriteString(fmt.Sprintf(podMetricsUrl, namespace, objectName)) - case "nodeMetrics": - url.WriteString(nodeMetricsUrl) - case "node": - url.WriteString(nodeUrl) - case "deployment": - url.WriteString(fmt.Sprintf(deploymentUrl, namespace, objectName)) - case "allStatefulSet": - url.WriteString(allStatefulSetUrl) - case "allDaemonSet": - url.WriteString(allDaemonSetUrl) - case "allDeployment": - url.WriteString(allDeploymentUrl) - case "podList": - url.WriteString(fmt.Sprintf(podListUrl, namespace)) - case "podDetail": - url.WriteString(fmt.Sprintf(podDetailUrl, namespace, objectName)) - case "pv": - url.WriteString(pvUrl) - case "pvc": - url.WriteString(pvcUrl) - case "crd": - url.WriteString(crdUrl) - case "namespace": - url.WriteString(namespaceUrl) - case "sc": - url.WriteString(scUrl) - case "service": - url.WriteString(fmt.Sprintf(serviceUrl, namespace)) - case "allService": - url.WriteString(allServiceUrl) - case "detailService": - url.WriteString(fmt.Sprintf(detailServiceUrl, namespace, objectName)) - case "secret": - url.WriteString(fmt.Sprintf(secretUrl, namespace)) - case "replicaSet": - url.WriteString(fmt.Sprintf(replicaSetUrl, namespace)) - case "statefulSet": - url.WriteString(fmt.Sprintf(statefulSetUrl, namespace, objectName)) - case "daemonSet": - url.WriteString(fmt.Sprintf(daemonSetUrl, namespace, objectName)) - case "detailPvc": - url.WriteString(fmt.Sprintf(detailPvcUrl, namespace, objectName)) - case "configMap": - url.WriteString(fmt.Sprintf(configMapUrl, namespace)) - case "allPod": - url.WriteString(fmt.Sprintf(allPodUrl)) - case "detailPod": - url.WriteString(fmt.Sprintf(detailPodUrl, namespace, objectName)) - case "detailNode": - url.WriteString(fmt.Sprintf(detailNodeUrl, objectName)) - case "detailNamespace": - url.WriteString(fmt.Sprintf(detailNamespaceUrl, objectName)) - case "deploymentList": - url.WriteString(fmt.Sprintf(deploymentListUrl, namespace)) - case "statefulSetList": - url.WriteString(fmt.Sprintf(statefulSetListUrl, namespace)) - case "daemonSetList": - url.WriteString(fmt.Sprintf(daemonSetListUrl, namespace)) - case "jobList": - url.WriteString(fmt.Sprintf(jobListUrl, namespace)) - case "pvcList": - url.WriteString(fmt.Sprintf(pvcListUrl, namespace)) - case "controllerVersion": - url.WriteString(fmt.Sprintf(controllerVersionUrl, namespace)) - case "hpa": - url.WriteString(fmt.Sprintf(detailHpaUrl, namespace, objectName)) - case "hpaList": - url.WriteString(fmt.Sprintf(hpaListUrl, namespace)) - } - - return url.String() -} - -func SearchObject(objectType string, clusterName string, namespace string, objectName string) rest.Result { - url := JointUrl(objectType, clusterName, namespace, objectName) - return KarmadaClient.SearchV1alpha1().RESTClient().Get().AbsPath(url).Do(context.TODO()) -} - -func UpdateObject(objectType string, clusterName string, namespace string, objectName string, object interface{}) rest.Result { - url := JointUrl(objectType, clusterName, namespace, objectName) - objectParam, _ := json.Marshal(object) - return KarmadaClient.SearchV1alpha1().RESTClient().Put().Body(objectParam).AbsPath(url).Do(context.TODO()) -} - -func PostObject(objectType string, clusterName string, namespace string, objectName string, object interface{}) rest.Result { - url := JointUrl(objectType, clusterName, namespace, objectName) - objectParam, _ := json.Marshal(object) - return KarmadaClient.SearchV1alpha1().RESTClient().Post().Body(objectParam).AbsPath(url).Do(context.TODO()) -} - -func DeleteObject(objectType string, clusterName string, namespace string, objectName string) rest.Result { - url := JointUrl(objectType, clusterName, namespace, objectName) - return KarmadaClient.SearchV1alpha1().RESTClient().Delete().AbsPath(url).Do(context.TODO()) -} - -func PatchObject(objectType string, clusterName string, namespace string, objectName string, object interface{}, pt types.PatchType) rest.Result { - url := JointUrl(objectType, clusterName, namespace, objectName) - return KarmadaClient.SearchV1alpha1().RESTClient().Patch(pt).Body(object).AbsPath(url).Do(context.TODO()) -} - -func GetDeployFromOS(namespaceName string, deploymentName string, clusterName string) *simplejson.Json { - - var content *strings.Reader - if clusterName == "" && namespaceName != "" && deploymentName != "" { - content = strings.NewReader(`{ - "query":{ - "bool":{ - "must":[ - { - "match_phrase":{ - "metadata.name": "` + deploymentName + `" - } - }, - { - "match_phrase":{ - "metadata.namespace": "` + namespaceName + `" - } - } - ] - } - }, - "_source": ["metadata.annotations.resource.karmada.io/cached-from-cluster", - "metadata.name", - "metadata.namespace", - "spec", - "status"] - }`) - } else if deploymentName == "" && clusterName == "" && namespaceName != "" { - content = strings.NewReader(`{ - "query":{ - "match_phrase":{ - "metadata.namespace": "` + namespaceName + `" - } - }, - "_source": ["metadata.annotations.resource.karmada.io/cached-from-cluster", - "metadata.name", - "metadata.namespace", - "spec", - "status"] - }`) - } else if deploymentName == "" && clusterName != "" && namespaceName != "" { - content = strings.NewReader(`{ - "query":{ - "bool":{ - "must":[ - { - "match_phrase":{ - "metadata.annotations.resource.karmada.io/cached-from-cluster": "` + clusterName + `" - } - }, - { - "match_phrase":{ - "metadata.namespace": "` + namespaceName + `" - } - } - ] - } - }, - "_source": ["metadata.annotations.resource.karmada.io/cached-from-cluster", - "metadata.name", - "metadata.namespace", - "spec", - "status"] - }`) - } - - //从OpenSearch根据ns名称和deploy名称查询相关信息 - searchReq := opensearchapi.SearchRequest{ - Index: []string{"kubernetes-deployment"}, - Body: content, - } - searchResp, _ := searchReq.Do(context.Background(), OpenSearchClient) - bufDeploy := new(bytes.Buffer) - bufDeploy.ReadFrom(searchResp.Body) - - deployJson, _ := simplejson.NewJson([]byte(bufDeploy.String())) - - return deployJson -} - -func GetPodFromOS(namespaceName string, deploymentName string) *simplejson.Json { - - var content *strings.Reader - - content = strings.NewReader(`{ - "query":{ - "bool":{ - "must":[ - { - "match_phrase":{ - "metadata.namespace": "` + namespaceName + `" - } - }, - { - "match_phrase":{ - "metadata.name": "` + deploymentName + `" - } - } - ] - } - } -} -`) - //从OpenSearch根据ns名称和deploy名称查询相关信息 - searchReq := opensearchapi.SearchRequest{ - Index: []string{"kubernetes-podListConst"}, - Body: content, - } - searchResp, _ := searchReq.Do(context.Background(), OpenSearchClient) - bufPod := new(bytes.Buffer) - bufPod.ReadFrom(searchResp.Body) - - podJson, _ := simplejson.NewJson([]byte(bufPod.String())) - - return podJson -} diff --git a/app/overridePolicy.go b/app/overridePolicy.go deleted file mode 100644 index a2fb41c..0000000 --- a/app/overridePolicy.go +++ /dev/null @@ -1,138 +0,0 @@ -package app - -import ( - "context" - "github.com/gin-gonic/gin" - policyv1alpha1 "github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1" - apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "net/http" -) - -type OverridePolicy struct { - Name string `json:"name"` - Namespace string `json:"namespace"` - ResourceName string `json:"resource_name"` - Kind string `json:"kind"` - Labels map[string]string `json:"labels"` - ReplicaDivisionPreference string `json:"replica_division_preference"` - ReplicaSchedulingType string `json:"replica_scheduling_type"` -} - -// @Summary 创建override策略列表 -// @Description 创建override策略列表 -// @Tags overridePolicy -// @accept json -// @Produce json -// @Param param body OverridePolicy true "json" -// @Success 200 -// @Failure 500 -// @Router /api/v1/OverridePolicy/create [post] -func CreateOverridePolicies(c *gin.Context) { - - var policyRequest OverridePolicy - if err := c.BindJSON(&policyRequest); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - - policy := &policyv1alpha1.OverridePolicy{ - - ObjectMeta: v1.ObjectMeta{ - Name: policyRequest.Name, - Namespace: policyRequest.Namespace, - }, - Spec: policyv1alpha1.OverrideSpec{ - ResourceSelectors: []policyv1alpha1.ResourceSelector{ - { - APIVersion: "apps/v1", - Kind: policyRequest.Kind, - Name: policyRequest.ResourceName, - }, - }, - OverrideRules: []policyv1alpha1.RuleWithCluster{ - { - TargetCluster: nil, - Overriders: policyv1alpha1.Overriders{ - Plaintext: []policyv1alpha1.PlaintextOverrider{ - { - Path: "/metadata/namespace", - Operator: "replace", - Value: apiextensionsv1.JSON{Raw: []byte("default")}, - }, - }, - }, - }, - }, - }, - } - - overrideList, err := KarmadaClient.PolicyV1alpha1().OverridePolicies(policyRequest.Namespace).Create(context.TODO(), policy, v1.CreateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "create policy failed", err) - return - } - Response(c, http.StatusOK, "success", overrideList) - -} - -// ListOverridePolicies 查询重写策略列表 -// @Summary 查询重写策略列表 -// @Description 查询重写策略列表 -// @Tags overridePolicy -// @accept json -// @Produce json -// @Param param body OverridePolicy true "json" -// @Success 200 -// @Failure 500 -// @Router /api/v1/overridePolicy/list [get] -func ListOverridePolicies(c *gin.Context) { - - var overridePolicyRequest OverridePolicy - if err := c.BindJSON(&overridePolicyRequest); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", err) - return - } - - overridePolicyList := make([]OverridePolicy, 0) - - propagationList, _ := KarmadaClient.PolicyV1alpha1().PropagationPolicies(overridePolicyRequest.Namespace).List(context.TODO(), v1.ListOptions{}) - - for i := 0; i < len(propagationList.Items); i++ { - name := propagationList.Items[i].ObjectMeta.Name - namespace := propagationList.Items[i].ObjectMeta.Namespace - labels := &propagationList.Items[i].Spec.Placement.ClusterAffinity.LabelSelector.MatchLabels - resourceName := propagationList.Items[i].Spec.ResourceSelectors[0].Name - kind := propagationList.Items[i].Spec.ResourceSelectors[0].Kind - rdp := string(propagationList.Items[i].Spec.Placement.ReplicaScheduling.ReplicaDivisionPreference) - rst := string(propagationList.Items[i].Spec.Placement.ReplicaScheduling.ReplicaSchedulingType) - - pp := OverridePolicy{ - Name: name, - Namespace: namespace, - Labels: *labels, - ResourceName: resourceName, - Kind: kind, - ReplicaDivisionPreference: rdp, - ReplicaSchedulingType: rst, - } - overridePolicyList = append(overridePolicyList, pp) - } - - Response(c, http.StatusOK, "success", overridePolicyList) - -} - -// UpdateOverridePolicies 查询重写策略列表 -func UpdateOverridePolicies(c *gin.Context) { - //todo - Response(c, http.StatusOK, "success", nil) - -} - -// DeleteOverridePolicies 查询重写策略列表 -func DeleteOverridePolicies(c *gin.Context) { - //todo - Response(c, http.StatusOK, "success", nil) - -} diff --git a/app/overview.go b/app/overview.go deleted file mode 100644 index 1741f52..0000000 --- a/app/overview.go +++ /dev/null @@ -1,666 +0,0 @@ -package app - -import ( - "context" - "fmt" - "github.com/gin-gonic/gin" - "github.com/golang/glog" - "github.com/shopspring/decimal" - "golang.org/x/exp/slices" - "jcc-schedule/model" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "math" - "net/http" - "strconv" - "strings" - "sync" -) - -const ( - monitoring_clusters = "group by (cluster_name) (node:load15:ratio)" - apiserver_request_rate = "apiserver:apiserver_request_total:sum_irate{cluster_name='clusterName', prometheus_replica='prometheus-k8s-0'}" - apiserver_request_latencies = "apiserver:apiserver_request_duration:avg{cluster_name='clusterName', prometheus_replica='prometheus-k8s-0'}" - - Schedule = "Schedule" - scheduler_schedule_attempts = "scheduler:scheduler_schedule_attempts:sum{cluster_name='clusterName', result='Schedule', prometheus_replica='prometheus-k8s-0'}" - - cluster_pod_running_count = "cluster:pod_running:count{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'}" - cluster_memory_total = "sum by (cluster) (node:node_memory_bytes_total:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'})" - cluster_cpu_total = "sum by (cluster) (node:node_num_cpu:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'})" - cluster_disk_size_capacity = "sum by (cluster) (node:disk_space_available:{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'} / (1 - node:disk_space_utilization:ratio{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'}))" - cluster_cpu_usage = "sum by (cluster) (node:node_num_cpu:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'} * node:node_cpu_utilisation:avg1m{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'})" - cluster_pod_quota = "sum by (cluster) (node:pod_capacity:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'})" - cluster_memory_usage_wo_cache = "sum by (cluster) (node:node_memory_bytes_total:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'} - node:node_memory_bytes_available:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'})" - cluster_disk_size_usage = "(sum by (cluster) (node:disk_space_available:{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'}) / (1 - cluster:disk_utilization:ratio{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'})) * cluster:disk_utilization:ratio{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'}" - - node_cpu_total = "node:node_num_cpu:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'}" - node_cpu_usage = "node:node_num_cpu:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'} * node:node_cpu_utilisation:avg1m{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'}" - node_cpu_utilisation = "node:node_cpu_utilisation:avg1m{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'}" - node_load1 = "node:load1:ratio{cluster_name='clusterName', prometheus_replica='prometheus-k8s-0'}" - node_load15 = "node:load15:ratio{cluster_name='clusterName', prometheus_replica='prometheus-k8s-0'}" - node_memory_total = "node:node_memory_bytes_total:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'}" - node_memory_usage_wo_cache = "node:node_memory_bytes_total:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'} - node:node_memory_bytes_available:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'}" - node_memory_utilisation = "node:node_memory_utilisation:{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'}" - node_pod_quota = "node:pod_capacity:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'}" - node_pod_running_count = "node:pod_running:count{cluster_name='clusterName', prometheus_replica='prometheus-k8s-0'}" - - nvidia_smi_utilization_gpu_ratio = "nvidia_smi_utilization_gpu_ratio{cluster_name='clusterName'}" - nvidia_smi_utilization_memory_ratio = "nvidia_smi_utilization_memory_ratio{cluster_name='clusterName'}" - - ClusterName = "clusterName" - metric_range_1s = "1s" - steps_1s = 100 - buffer = 10 - cpu_avg_usage = "avg_over_time(sum by (cluster) (node:node_num_cpu:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'} * node:node_cpu_utilisation:avg1m{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'}))" - mem_avg_usage = "avg_over_time(sum by (cluster) (node:node_memory_bytes_total:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'} - node:node_memory_bytes_available:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'}))" - cpu_total_usage = "round(:node_cpu_utilisation:avg1m{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'} * sum(node:node_num_cpu:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'}), 0.001) " - mem_total_usage = "sum(node:node_memory_bytes_total:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'}) - sum(node:node_memory_bytes_available:sum{cluster_name='clusterName',prometheus_replica='prometheus-k8s-0'})" - metric_range_temp = "72h" - steps_temp = 7000 - metric_range_7d = "168h" - steps_7d = 90000 - metric_range_1d = "24h" - metric_avg = "avg" -) - -type Overview struct { - Domain int `json:"domain"` - Cluster int `json:"cluster"` - Pod int32 `json:"pod"` - TotalFlops float64 `json:"totalFlops"` -} - -type Computility struct { - Resources []model.Resources `json:"resources"` -} - -// @Summary 获取所有kubesphere定义的监控集群 -// @Description 获取所有kubesphere定义的监控集群 -// @Tags overview -// @accept json -// @Produce json -// @Success 200 -// @Failure 400 -// @Router /api/v1/overview/getKubesphereClusters [get] -func GetMonitoringClusters() []string { - - var clusterNameList []string - rows, _ := DB.Query(`SELECT cluster_name FROM domain_cluster`) - for rows.Next() { - var clusterName string - err := rows.Scan(&clusterName) - if err != nil { - glog.Errorf("query failed!,error %v", err) - return clusterNameList - } - clusterNameList = append(clusterNameList, clusterName) - } - - //查询有数据的集群 - metricMap := map[string][]MetricUrl{ - "monitoring_clusters": {{"", "", GetMetricUrl(monitoring_clusters, nil, "", metric_range_1s, steps_1s)}}, - } - - ch := make(chan MetricResult, len(metricMap)) - var wg sync.WaitGroup - - for k, v := range metricMap { - wg.Add(1) - go HttpGetMetrics(k, v, &wg, ch) - } - wg.Wait() - close(ch) - - mr := []MetricResult{} - for v := range ch { - mr = append(mr, v) - } - - var clusters []string - - rd := mr[0] - - for _, r := range rd.MetricData.Result { - format, ok := r["metric"].(map[string]interface{}) - if ok && len(format) != 0 { - clusters = append(clusters, format["cluster_name"].(string)) - } - } - - var clusters_filtered []string - for _, e := range clusterNameList { - if slices.Contains(clusters, e) { - clusters_filtered = append(clusters_filtered, e) - } - } - - return clusters_filtered -} - -// @Summary 获取容器集群调度器监控 -// @Description 获取容器集群调度器监控 -// @Tags overview -// @accept json -// @Produce json -// @Param clusterName query string true "集群名称" -// @Success 200 -// @Failure 400 -// @Router /api/v1/overview/getScheduleMetrics [get] -func GetScheduleMetrics(c *gin.Context) { - clusterName := c.Query(ClusterName) - - scheduleSlice := []string{"error", "scheduled", "unschedulable"} - var metricUrls []MetricUrl - for _, s := range scheduleSlice { - imap := map[string]string{ - ClusterName: clusterName, - Schedule: s, - } - metricUrls = append(metricUrls, MetricUrl{Schedule, s, GetMetricUrl(scheduler_schedule_attempts, imap, Schedule, metric_range_1s, steps_1s)}) - } - - metricMap := map[string][]MetricUrl{ - "scheduler_schedule_attempts": metricUrls, - } - - ch := make(chan MetricResult, len(metricMap)) - var wg sync.WaitGroup - - for k, v := range metricMap { - wg.Add(1) - go HttpGetMetrics(k, v, &wg, ch) - } - wg.Wait() - close(ch) - - mr := []MetricResult{} - for v := range ch { - mr = append(mr, v) - } - - Response(c, http.StatusOK, "success", mr) -} - -// @Summary 获取容器集群资源监控 -// @Description 获取容器集群资源监控 -// @Tags overview -// @accept json -// @Produce json -// @Param clusterName query string true "集群名称" -// @Success 200 -// @Failure 400 -// @Router /api/v1/overview/getClusterMetrics [get] -func GetClusterMetrics(c *gin.Context) { - clusterName := c.Query(ClusterName) - - replaceMap := make(map[string]string) - replaceMap[ClusterName] = clusterName - - metricMap := map[string][]MetricUrl{ - "cluster_pod_running_count": {{ClusterName, clusterName, GetMetricUrl(cluster_pod_running_count, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "cluster_memory_total": {{ClusterName, clusterName, GetMetricUrl(cluster_memory_total, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "cluster_cpu_total": {{ClusterName, clusterName, GetMetricUrl(cluster_cpu_total, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "cluster_disk_size_capacity": {{ClusterName, clusterName, GetMetricUrl(cluster_disk_size_capacity, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "cluster_cpu_usage": {{ClusterName, clusterName, GetMetricUrl(cluster_cpu_usage, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "cluster_pod_quota": {{ClusterName, clusterName, GetMetricUrl(cluster_pod_quota, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "cluster_memory_usage_wo_cache": {{ClusterName, clusterName, GetMetricUrl(cluster_memory_usage_wo_cache, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "cluster_disk_size_usage": {{ClusterName, clusterName, GetMetricUrl(cluster_disk_size_usage, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - } - - mr := []MetricResult{} - ch := make(chan MetricResult, len(metricMap)) - limit := make(chan bool, buffer) - var wg sync.WaitGroup - - for k, v := range metricMap { - limit <- true - wg.Add(1) - go HttpGetMetrics(k, v, &wg, ch) - <-limit - } - wg.Wait() - close(ch) - - for v := range ch { - mr = append(mr, v) - } - - Response(c, http.StatusOK, "success", mr) - -} - -// @Summary 获取容器节点资源监控 -// @Description 获取容器节点资源监控 -// @Tags overview -// @accept json -// @Produce json -// @Param clusterName query string true "集群名称" -// @Success 200 -// @Failure 400 -// @Router /api/v1/overview/getNodeMetrics [get] -func GetNodeMetrics(c *gin.Context) { - clusterName := c.Query(ClusterName) - - //client, err := clientSet.GetClientSet(clusterName) - //if err != nil { - // log.Fatalln(err) - //} - //nodeList, err := client.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{}) - //if err != nil { - // log.Fatalln(err) - //} - // - //nodes := []string{} - //for i := range nodeList.Items { - // nodes = append(nodes, nodeList.Items[i].Name) - //} - replaceMap := make(map[string]string) - replaceMap[ClusterName] = clusterName - - mr := []MetricResult{} - //node_rs := []map[string]interface{}{} - //rd := ResultData { - // Status: "success", - // Data: MetricData{ - // Result: node_rs, - // ResultType: "", - // }, - //} - //nodes_mr := MetricResult{ - // MetricName: "node", - // ResultData: rd, - //} - //mr = append(mr, nodes_mr) - - metricMap := map[string][]MetricUrl{ - "node_cpu_total": {{ClusterName, clusterName, GetMetricUrl(node_cpu_total, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "node_cpu_usage": {{ClusterName, clusterName, GetMetricUrl(node_cpu_usage, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "node_cpu_utilisation": {{ClusterName, clusterName, GetMetricUrl(node_cpu_utilisation, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "node_load1": {{ClusterName, clusterName, GetMetricUrl(node_load1, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "node_load15": {{ClusterName, clusterName, GetMetricUrl(node_load15, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "node_memory_total": {{ClusterName, clusterName, GetMetricUrl(node_memory_total, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "node_memory_usage_wo_cache": {{ClusterName, clusterName, GetMetricUrl(node_memory_usage_wo_cache, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "node_memory_utilisation": {{ClusterName, clusterName, GetMetricUrl(node_memory_utilisation, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "node_pod_quota": {{ClusterName, clusterName, GetMetricUrl(node_pod_quota, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "node_pod_running_count": {{ClusterName, clusterName, GetMetricUrl(node_pod_running_count, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "nvidia_smi_utilization_gpu_ratio": {{ClusterName, clusterName, GetMetricUrl(nvidia_smi_utilization_gpu_ratio, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "nvidia_smi_utilization_memory_ratio": {{ClusterName, clusterName, GetMetricUrl(nvidia_smi_utilization_memory_ratio, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - } - - ch := make(chan MetricResult, len(metricMap)) - limit := make(chan bool, buffer) - var wg sync.WaitGroup - - for k, v := range metricMap { - limit <- true - wg.Add(1) - go HttpGetMetrics(k, v, &wg, ch) - <-limit - } - wg.Wait() - close(ch) - - for v := range ch { - mr = append(mr, v) - } - - Response(c, http.StatusOK, "success", mr) - -} - -// @Summary 获取ApiServer请求数和请求延迟 -// @Description 获取ApiServer请求数和请求延迟 -// @Tags overview -// @accept json -// @Produce json -// @Param clusterName query string true "集群名称" -// @Success 200 -// @Failure 400 -// @Router /api/v1/overview/getApiServerMetrics [get] -func GetApiServerMetrics(c *gin.Context) { - clusterName := c.Query(ClusterName) - - replaceMap := make(map[string]string) - replaceMap[ClusterName] = clusterName - - metricMap := map[string][]MetricUrl{ - "apiserver_request_rate": {{ClusterName, clusterName, GetMetricUrl(apiserver_request_rate, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "apiserver_request_latencies": {{ClusterName, clusterName, GetMetricUrl(apiserver_request_latencies, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - } - - ch := make(chan MetricResult, len(metricMap)) - var wg sync.WaitGroup - - for k, v := range metricMap { - wg.Add(1) - go HttpGetMetrics(k, v, &wg, ch) - } - wg.Wait() - close(ch) - - mr := []MetricResult{} - for v := range ch { - mr = append(mr, v) - } - - Response(c, http.StatusOK, "success", mr) -} - -func ResourceCount(c *gin.Context) { - overview := &Overview{} - //纳管资源域、纳管集群总计、容器创建数量 资源域 - rows, _ := DB.Query("SELECT count( t.domain) from (select DISTINCT d.domain_id domain from domain d inner join domain_cluster dc on dc.domain_id = d.domain_id) t ") - for rows.Next() { - err := rows.Scan(&overview.Domain) - if err != nil { - glog.Errorf("query failed!,error %v", err) - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - } - // 集群数量 - clusters, err := KarmadaClient.ClusterV1alpha1().Clusters().List(context.TODO(), metav1.ListOptions{}) - if err != nil { - glog.Info("failed to retrieve cluster(%s). error: %v", clusters, err) - Response(c, http.StatusBadRequest, "failed to retrieve cluster", err) - } - - rows, _ = DB.Query("select count(*) as historyClusterCount from cluster_resource_history") - var historyClusterCount int - for rows.Next() { - err := rows.Scan(&historyClusterCount) - if err != nil { - glog.Errorf("query failed!,error %v", err) - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - } - overview.Cluster = len(clusters.Items) + historyClusterCount - //容器数量 - overview.Pod = countPod() - //纳管算力总计 - rows, _ = DB.Query(`select ifnull(sum(gpu_GFlops), 0) + ifnull(sum(cpu_GFlops), 0) as totalFlops from resources`) - var totalFlops float64 - for rows.Next() { - err := rows.Scan(&totalFlops) - if err != nil { - glog.Errorf("query failed!,error %v", err) - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - } - totalFlops, _ = decimal.NewFromFloat(totalFlops / 1e6).Round(2).Float64() - overview.TotalFlops = totalFlops - Response(c, http.StatusOK, "success", *overview) -} - -func countPod() int32 { - var podSum int32 - opts := metav1.ListOptions{ - TypeMeta: metav1.TypeMeta{}, - LabelSelector: "jcce=true", - FieldSelector: "", - Watch: false, - AllowWatchBookmarks: false, - ResourceVersion: "", - ResourceVersionMatch: "", - TimeoutSeconds: nil, - Limit: 0, - Continue: "", - } - - nsResult, _ := ClientSet.CoreV1().Namespaces().List(context.TODO(), opts) - - for _, ns := range nsResult.Items { - deploymentList, err := ClientSet.AppsV1().Deployments(ns.Name).List(context.TODO(), metav1.ListOptions{}) - if err != nil { - panic("解析失败") - } - var totalAvailable int32 - for _, deploy := range deploymentList.Items { - replicaAvailable := deploy.Status.AvailableReplicas - totalAvailable += replicaAvailable - } - podSum += totalAvailable - } - return podSum -} - -// @Summary 获取大球监控数据 -// @Description 获取大球监控数据 -// @Tags namespace -// @accept json -// @Produce json -// @Success 200 -// @Failure 400 -// @Router /api/v1/sphere/getOverallMetrics [get] -func GetOverallMetrics(c *gin.Context) { - Response(c, http.StatusOK, "success", getOverallMetrics(metric_range_7d, steps_7d)) -} - -// @Summary 获取大球监控数据1day -// @Description 获取大球监控数据1day -// @Tags namespace -// @accept json -// @Produce json -// @Success 200 -// @Failure 400 -// @Router /api/v1/sphere/GetOverallMetricsToday [get] -func GetOverallMetricsToday() { - getOverallMetrics(metric_range_1d, steps_7d) -} - -func getOverallMetrics(metric_range string, steps int64) []MetricResult { - - cmap := make(map[string]map[string]string) - clusters := GetMonitoringClusters() - //clusters := []string{"fedjcce-fx001", "fedjcce-zj002", "fedjcce-zj003", "fedjcce-zj004", "fedjcce-zj005", - // "fedjcce-zj006", "host", "member-01", "member-02", "member-04", "member-05", "zhijiang-gpu4", "zhijiang-gpu5", "zhijiang-gpu7", "zhijiang-gpu8", "zhijiang-gpu9", - // "fedjcce-ten002", "kylin-edge", "nudt-ali", "nudt-hw", "nudt-tx", "test12077"} - for _, cluster := range clusters { - replaceMap := map[string]string{ - ClusterName: cluster, - } - imap := make(map[string]string) - imap["cpu_avg_usage"] = replacePromql(cpu_avg_usage, replaceMap, ClusterName) - imap["mem_avg_usage"] = replacePromql(mem_avg_usage, replaceMap, ClusterName) - imap["cpu_total_usage"] = replacePromql(cpu_total_usage, replaceMap, ClusterName) - imap["mem_total_usage"] = replacePromql(mem_total_usage, replaceMap, ClusterName) - cmap[cluster] = imap - } - - metricMap := make(map[string][]MetricUrl) - for _, cluster := range clusters { - var metricUrls1 []MetricUrl - var metricUrls2 []MetricUrl - var metricUrls3 []MetricUrl - var metricUrls4 []MetricUrl - metricUrls1 = append(metricUrls1, MetricUrl{ClusterName, "", GetMetricUrl(cmap[cluster]["cpu_avg_usage"], nil, "", metric_range, steps)}) - metricMap[cluster+"#"+"cpu_avg_usage"] = metricUrls1 - metricUrls2 = append(metricUrls2, MetricUrl{ClusterName, "", GetMetricUrl(cmap[cluster]["mem_avg_usage"], nil, "", metric_range, steps)}) - metricMap[cluster+"#"+"mem_avg_usage"] = metricUrls2 - metricUrls3 = append(metricUrls3, MetricUrl{ClusterName, "", GetMetricUrl(cmap[cluster]["cpu_total_usage"], nil, "", metric_range, steps)}) - metricMap[cluster+"#"+"cpu_total_usage"] = metricUrls3 - metricUrls4 = append(metricUrls4, MetricUrl{ClusterName, "", GetMetricUrl(cmap[cluster]["mem_total_usage"], nil, "", metric_range, steps)}) - metricMap[cluster+"#"+"mem_total_usage"] = metricUrls4 - } - - ch := make(chan MetricResult, len(metricMap)) - var wg sync.WaitGroup - limit := make(chan bool, buffer) - - for k, v := range metricMap { - limit <- true - wg.Add(1) - go HttpGetMetrics(k, v, &wg, ch) - <-limit - } - wg.Wait() - close(ch) - - //aggregate metrics - metricsTotal := map[string]map[float64]float64{ - "cpu_avg_usage": make(map[float64]float64), - "mem_avg_usage": make(map[float64]float64), - "cpu_total_usage": make(map[float64]float64), - "mem_total_usage": make(map[float64]float64), - } - for v := range ch { - format, ok := v.MetricData.Result[0]["values"].([]interface{}) - arraySplit := strings.Split(v.MetricName, "#") - submap := metricsTotal[arraySplit[1]] - - if ok { - for _, val := range format { - f, ok := val.([]interface{}) - if ok { - timeUnix, ok1 := f[0].(float64) - value, ok2 := f[1].(string) - if ok1 && ok2 { - f_value, _ := strconv.ParseFloat(value, 64) - submap[timeUnix] += f_value - } - } else { - continue - } - //var timeToValues TimeToValue - //t_byte, _ := json.Marshal(val) - //err := json.Unmarshal(t_byte, &timeToValues) - //if err != nil { - // fmt.Println("error") - //} - //fmt.Println(timeToValues) - } - } else { - continue - } - metricsTotal[arraySplit[1]] = submap - } - - //avg指标取平均值 - for i, _ := range metricsTotal { - metricName := i - if strings.Contains(metricName, metric_avg) { - var totalValue float64 - for i2, _ := range metricsTotal[i] { - totalValue += metricsTotal[i][i2] - } - avgValue := round((totalValue / float64(len(metricsTotal[i]))), 3) - for i2, _ := range metricsTotal[i] { - metricsTotal[i][i2] = avgValue - } - } - } - - mrs := []MetricResult{} - for i, _ := range metricsTotal { - md := MetricData{ - ResultType: "matrix", - } - var value [][]interface{} - - for i2, _ := range metricsTotal[i] { - var v []interface{} - v = append(v, i2) - //v = append(v, strconv.FormatFloat(metricsTotal[i][i2])) - v = append(v, metricsTotal[i][i2]) - value = append(value, v) - } - - r := map[string]interface{}{ - "values": value, - } - md.Result = append(md.Result, r) - mr := MetricResult{ - i, md, - } - mrs = append(mrs, mr) - } - - return mrs -} - -func GetServerResources(c *gin.Context) { - var resources []model.Resources - sql := "select name, ip, public_ip, hpc_partition, cpu_name, cpu_GHz, cpu_cores, total_threads, memory, gpu_dcu, cpu_single_cycle, num, cpu_GFlops, gpu_GFlops, region, flops from resources order by id" - err := DB.Select(&resources, sql) - if err != nil { - fmt.Println("exec failed, ", err) - return - } - rows, _ := DB.Query(`select ifnull(sum(gpu_GFlops), 0) + ifnull(sum(cpu_GFlops), 0) as totalFlops from resources`) - var totalFlops float64 - for rows.Next() { - err := rows.Scan(&totalFlops) - if err != nil { - glog.Errorf("query failed!,error %v", err) - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - } - sumResource := model.Resources{ - Name: "合计", - Flops: totalFlops, - } - resources = append(resources, sumResource) - Response(c, http.StatusOK, "success", resources) -} - -func round(f float64, precision int) float64 { - p := math.Pow10(precision) - return math.Trunc((f+0.5/p)*p) / p -} - -// @Summary 批量获取容器集群资源监控 -// @Description 批量获取容器集群资源监控 -// @Tags overview -// @accept json -// @Produce json -// @Param clusterName query string true "集群名称list" -// @Success 200 -// @Failure 400 -// @Router /api/v1/overview/getClusterMetrics [get] -func ListClusterMetrics(c *gin.Context) { - clusterNameStr := c.Query(ClusterName) - clusterNameList := strings.Split(clusterNameStr, ",") - listMr := make([]ListMetricResult, 0) - for _, clusterName := range clusterNameList { - - replaceMap := make(map[string]string) - replaceMap[ClusterName] = clusterName - - metricMap := map[string][]MetricUrl{ - "cluster_pod_running_count": {{ClusterName, clusterName, GetMetricUrl(cluster_pod_running_count, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "cluster_memory_total": {{ClusterName, clusterName, GetMetricUrl(cluster_memory_total, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "cluster_cpu_total": {{ClusterName, clusterName, GetMetricUrl(cluster_cpu_total, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "cluster_disk_size_capacity": {{ClusterName, clusterName, GetMetricUrl(cluster_disk_size_capacity, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "cluster_cpu_usage": {{ClusterName, clusterName, GetMetricUrl(cluster_cpu_usage, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "cluster_pod_quota": {{ClusterName, clusterName, GetMetricUrl(cluster_pod_quota, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "cluster_memory_usage_wo_cache": {{ClusterName, clusterName, GetMetricUrl(cluster_memory_usage_wo_cache, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - "cluster_disk_size_usage": {{ClusterName, clusterName, GetMetricUrl(cluster_disk_size_usage, replaceMap, ClusterName, metric_range_1s, steps_1s)}}, - } - - mr := []MetricResult{} - ch := make(chan MetricResult, len(metricMap)) - limit := make(chan bool, buffer) - var wg sync.WaitGroup - - for k, v := range metricMap { - limit <- true - wg.Add(1) - go HttpGetMetrics(k, v, &wg, ch) - <-limit - } - wg.Wait() - close(ch) - - for v := range ch { - mr = append(mr, v) - } - listMetricResult := ListMetricResult{} - listMetricResult.MetricResult = mr - listMr = append(listMr, listMetricResult) - } - Response(c, http.StatusOK, "success", listMr) - -} diff --git a/app/page.go b/app/page.go index dd84082..587fa07 100644 --- a/app/page.go +++ b/app/page.go @@ -1,7 +1,5 @@ package app -import "strconv" - type Page[T any] struct { // 当前页码 PageNum int64 `json:"pageNum"` @@ -16,9 +14,7 @@ type Page[T any] struct { } // Paginator 生成新的分页数据对象 -func Paginator[T any](items *Page[T], total int64, pageNumParam, pageSizeParam string) *Page[T] { - pageNum, _ := strconv.ParseInt(pageNumParam, 10, 64) - pageSize, _ := strconv.ParseInt(pageSizeParam, 10, 64) +func Paginator[T any](items *Page[T], total, pageNum, pageSize int64) *Page[T] { var ( pageStart int64 pageEnd int64 diff --git a/app/pod.go b/app/pod.go deleted file mode 100644 index acd3cc4..0000000 --- a/app/pod.go +++ /dev/null @@ -1,503 +0,0 @@ -package app - -import ( - "context" - "encoding/json" - "github.com/gin-gonic/gin" - "github.com/shopspring/decimal" - v12 "k8s.io/api/apps/v1" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/metrics/pkg/apis/metrics" - "log" - "net/http" - "sort" - "strings" - "sync" -) - -const ( - pod_cpu_usage = "irate(container_cpu_usage_seconds_total{cluster_name='clusterName', pod='podName', container='', prometheus_replica='prometheus-k8s-0'}[10m])" - pod_memery_usage_wo_cache = "container_memory_working_set_bytes{cluster_name='clusterName', pod='podName', container='', prometheus_replica='prometheus-k8s-0'}" - pod_net_bytes_transmitted = "irate(container_network_transmit_bytes_total{cluster_name='clusterName', pod='podName', interface='eth0', prometheus_replica='prometheus-k8s-0'}[10m])" - pod_net_bytes_received = "irate(container_network_receive_bytes_total{cluster_name='clusterName', pod='podName', interface='eth0',prometheus_replica='prometheus-k8s-0'}[10m])" - PodName = "podName" - pod_metric_range = "8.333h" - steps_pod = 600 -) - -type Pod struct { - PageNum string `json:"page_num"` - PageSize string `json:"page_size"` - Name string `json:"name"` - ClusterName string `json:"cluster_name"` - DomainName string `json:"domain_name"` - Ready string `json:"ready"` - Status string `json:"status"` - Restarts int64 `json:"restarts"` - Age string `json:"age"` - IP string `json:"IP"` - Node string `json:"node"` - Namespace string `json:"namespace"` - ContainerImage string `json:"container_image"` - ContainerName string `json:"container_name"` - AliasName string `json:"alias_name"` - Description string `json:"description"` - TemplateId string `json:"template_id"` -} - -type PodObject struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []v1.Pod `json:"items"` -} - -type DeploymentPods struct { - Replicas int32 `json:"replicas"` - AvailableReplicas int32 `json:"availableReplicas"` - Pods []v1.Pod `json:"pods"` -} - -type ReplicaSetRes struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []v12.ReplicaSet `json:"items"` -} - -type StatefulSetRes struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []v12.StatefulSet `json:"items"` -} - -// PodMetrics 根据集群名称、命名空间和pod名称查询pod使用率 -// @Summary 根据集群名称、命名空间和pod名称查询pod使用率 -// @Description 根据集群名称、命名空间和pod名称查询pod使用率 -// @Tags pod -// @accept json -// @Produce json -// @Param namespace path string true "项目名称" -// @Param clusterName path string true "集群 " -// @Param name path string true "名称" -// @Success 200 -// @Failure 500 -// @Router /api/v1/pod/metrics/{clusterName}/{namespace}/{name} [get] -func PodMetrics(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - result := SearchObject(podMetrics, clusterName, namespace, name) - var metrics metrics.PodMetrics - raw, _ := result.Raw() - json.Unmarshal(raw, &metrics) - var cpu int64 - var memory int64 - for _, container := range metrics.Containers { - cpu = cpu + container.Usage.Cpu().Value() - memory = memory + container.Usage.Memory().Value() - } - Response(c, http.StatusOK, "success", map[string]string{ - "cpu": decimal.NewFromInt(cpu).String(), - "memory": decimal.NewFromInt(memory).StringScaled(0), - }) -} - -// PodDetail 根据指定集群查询Pod详情 -// @Summary 根据指定集群查询Pod详情 -// @Description 根据指定集群查询Pod详情 -// @Tags pod -// @accept json -// @Produce json -// @Param clusterName path string true "集群名" -// @Param namespace path string true "命名空间名 " -// @Param name path string true "pod名" -// @Success 200 -// @Failure 500 -// @Router /api/v1/pod/detail/{clusterName}/{namespace}/{name} [get] -// PodDetail 根据指定集群查询Pod详情 -func PodDetail(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - result := SearchObject(podListConst, clusterName, namespace, "") - var podRes PodObject - raw, _ := result.Raw() - json.Unmarshal(raw, &podRes) - for _, pod := range podRes.Items { - if strings.EqualFold(name, pod.Name) { - Response(c, http.StatusOK, "success", pod) - return - } - } - Response(c, http.StatusOK, "success", nil) -} - -// IsExist 判断名称是否重复 -func IsExist(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - result := SearchObject(podDetailConst, clusterName, namespace, name) - if result.Error() != nil { - Response(c, http.StatusOK, "success", false) - return - } - var pod v1.Pod - raw, _ := result.Raw() - json.Unmarshal(raw, &pod) - if len(pod.Name) == 0 { - Response(c, http.StatusOK, "success", false) - return - } - Response(c, http.StatusOK, "success", true) -} - -// ListPod 根据指定集群查询Pod列表 -// @Summary 根据指定集群查询Pod列表 -// @Description 根据指定集群查询Pod列表 -// @Tags pod -// @accept json -// @Produce json -// @Success 200 -// @Failure 500 -// @Router /api/v1/pod/list [get] -func ListPod(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - result := SearchObject(podListConst, clusterName, namespace, "") - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", result.Error()) - return - } - var podRes PodObject - raw, _ := result.Raw() - json.Unmarshal(raw, &podRes) - - // 分页 - page := &Page[v1.Pod]{} - // 排序 - sort.SliceStable(podRes.Items, func(i, j int) bool { - return podRes.Items[i].CreationTimestamp.Time.After(podRes.Items[j].CreationTimestamp.Time) - }) - page.List = podRes.Items - data := Paginator(page, int64(len(podRes.Items)), pageNum, pageSize) - Response(c, http.StatusOK, "success", data) -} - -// ListPod 根据指定集群查询Pod列表 -// @Summary 根据指定集群查询Pod列表 -// @Description 根据指定集群查询Pod列表 -// @Param clusterName query string true "集群名称" -// @Param pageNum query int true "pageNum" -// @Param pageSize query int true "pageSize" -// @Tags pod -// @accept json -// @Produce json -// @Success 200 -// @Failure 500 -// @Router /api/v1/pod/all [get] -func ALLPod(c *gin.Context) { - clusterName := c.Query("clusterName") - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - result := SearchObject(allPodConst, clusterName, "", "") - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", result.Error()) - return - } - var podRes PodObject - raw, _ := result.Raw() - json.Unmarshal(raw, &podRes) - - // 分页 - page := &Page[v1.Pod]{} - // 排序 - sort.SliceStable(podRes.Items, func(i, j int) bool { - return podRes.Items[i].CreationTimestamp.Time.After(podRes.Items[j].CreationTimestamp.Time) - }) - page.List = podRes.Items - data := Paginator(page, int64(len(podRes.Items)), pageNum, pageSize) - Response(c, http.StatusOK, "success", data) -} - -// CreatePod 创建容器组 -// @Summary 创建容器组 -// @Description 创建容器组 -// @Tags pod -// @accept json -// @Produce json -// @Param param body Pod true "json" -// @Success 200 -// @Failure 400 -// @Router /api/v1/pod/create [post] -func CreatePod(c *gin.Context) { - var podParam Pod - if err := c.BindJSON(&podParam); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - podListConst := v1.Pod{ - TypeMeta: metav1.TypeMeta{}, - ObjectMeta: metav1.ObjectMeta{ - Name: podParam.Name, - }, - Spec: v1.PodSpec{ - Containers: []v1.Container{ - { - Name: podParam.Name, - Image: podParam.ContainerImage, - }, - }, - }, - Status: v1.PodStatus{}, - } - - podResult, err := ClientSet.CoreV1().Pods(podParam.Namespace).Create(context.TODO(), &podListConst, metav1.CreateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "create podListConst failed", err) - return - } - // 创建调度实例 - var clusterNameArray []string - clusterNameArray = append(clusterNameArray, podParam.ClusterName) - CreatePropagationPolicies(PropagationPolicy{ - ClusterName: clusterNameArray, - TemplateId: podParam.TemplateId, - ResourceName: podParam.Name, - Name: "pod" + podParam.Namespace + podParam.Name, - Namespace: podParam.Namespace, - Kind: "Pod", - }) - Response(c, http.StatusOK, "success", podResult) -} - -// DeletePod 删除容器组 -// @Summary 删除容器组 -// @Description 删除容器组 -// @Tags pod -// @accept json -// @Produce json -// @Param namespace path string true "命名空间名" -// @param name path string true "Pod名" -// @Success 200 -// @Failure 400 -// @Router /api/v1/pod/delete/{namespace}/{name} [delete] -func DeletePod(c *gin.Context) { - clusterName := c.Param("clusterName") - namespace := c.Param("namespace") - name := c.Param("name") - label := c.Param("label") - if strings.EqualFold(label, "jcce") { - err := ClientSet.CoreV1().Pods(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "delete pod failed", err) - return - } - // 删除调度策略 - DeletePropagationPolicies(namespace, "pod"+namespace+name) - } else { - result := DeleteObject(detailPodConst, clusterName, namespace, name) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "delete pod failed", result.Error()) - return - } - } - Response(c, http.StatusOK, "success", nil) -} - -// UpdatePod 更新容器组 -// @Summary 更新容器组 -// @Description 更新容器组 -// @Tags pod -// @accept json -// @Produce json -// @Param param body Pod true "json" -// @Success 200 -// @Failure 400 -// @Router /api/v1/pod/updatePod [put] -func UpdatePod(c *gin.Context) { - var param Pod - if err := c.BindJSON(¶m); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - pod := v1.Pod{ - TypeMeta: metav1.TypeMeta{}, - ObjectMeta: metav1.ObjectMeta{ - Name: param.Name, - Annotations: map[string]string{ - "kubesphere.io/alias-name": param.AliasName, - "kubesphere.io/description": param.Description, - }, - }, - Spec: v1.PodSpec{}, - Status: v1.PodStatus{}, - } - podResult, err := ClientSet.CoreV1().Pods(param.Namespace).Update(context.TODO(), &pod, metav1.UpdateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "update podListConst failed", err) - return - } - Response(c, http.StatusOK, "success", podResult) -} - -// ListPodFromNode 获取节点下的pod -func ListPodFromNode(c *gin.Context) { - clusterName := c.Query("clusterName") - nodeName := c.Query("nodeName") - podResult := SearchObject(allPodConst, clusterName, "", "") - if podResult.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", podResult.Error()) - return - } - var podRes PodObject - raw, _ := podResult.Raw() - json.Unmarshal(raw, &podRes) - var result []v1.Pod - for i := range podRes.Items { - if strings.EqualFold(podRes.Items[i].Spec.NodeName, nodeName) { - result = append(result, podRes.Items[i]) - } - } - Response(c, http.StatusOK, "success", result) -} - -func GetPodForDeployment(clusterName string, namespace string, labelMap map[string]string) []v1.Pod { - - // 查询pod当前命名空间下的列表 - podResult := SearchObject(podListConst, clusterName, namespace, "") - var podObject PodObject - podRaw, _ := podResult.Raw() - json.Unmarshal(podRaw, &podObject) - // 查询label匹配的pod - var podsResult []v1.Pod - for _, pod := range podObject.Items { - for k, v := range labelMap { - if pod.Labels[k] != v { - goto loop - } - } - podsResult = append(podsResult, pod) - loop: - } - return podsResult -} - -// ListPodFromDeployment 获取deployment下的pod -func ListPodFromDeployment(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - label := c.Query("label") - var labelMap = make(map[string]string) - labelArray := strings.Split(label, ",") - for _, label := range labelArray { - labelKV := strings.Split(label, "=") - labelMap[labelKV[0]] = labelKV[1] - } - - podList := GetPodForDeployment(clusterName, namespace, labelMap) - - var replicas, availableReplicas int32 - // 查询replicaSet - var replicaSetObject ReplicaSetObject - searchResult := SearchObject(replicaSetConst, clusterName, namespace, "") - raw, _ := searchResult.Raw() - json.Unmarshal(raw, &replicaSetObject) - for _, replicaSet := range replicaSetObject.Items { - for k, v := range labelMap { - if replicaSet.Labels[k] != v { - goto loop1 - } - } - if replicaSet.Status.Replicas != 0 { - replicas = replicas + 1 - if replicaSet.Status.AvailableReplicas != 0 { - availableReplicas = availableReplicas + 1 - } - } - loop1: - } - - Response(c, http.StatusOK, "success", DeploymentPods{ - Pods: podList, - Replicas: replicas, - AvailableReplicas: availableReplicas, - }) -} - -// GetPodDetail 获取容器组详情 -// @Summary 获取容器组详情 -// @Description 获取容器组详情 -// @Tags pod -// @accept json -// @Produce json -// @Param param body Pod true "json" -// @Success 200 -// @Failure 400 -// @Router /api/v1/pod/detail [put] -func GetPodDetail(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - rsRes := SearchObject(detailPodConst, clusterName, namespace, name) - raw, _ := rsRes.Raw() - var pod v1.Pod - json.Unmarshal(raw, &pod) - - err_ := AddTypeMetaToObject(&pod) - if err_ != nil { - log.Println(err_) - } - Response(c, http.StatusOK, "success", pod) -} - -// @Summary 获取容器组监控 -// @Description 获取容器组监控 -// @Tags pod -// @accept json -// @Produce json -// @Param clusterName query string true "集群名称" -// @Param podName query string true "容器组名称" -// @Success 200 -// @Failure 400 -// @Router /api/v1/pod/metrics [get] -func GetMetrics(c *gin.Context) { - clusterName := c.Query("clusterName") - podName := c.Query("podName") - - replaceMap := make(map[string]string) - replaceMap[ClusterName] = clusterName - replaceMap[PodName] = podName - - metricMap := map[string][]MetricUrl{ - "pod_cpu_usage": {{PodName, podName, GetMetricUrl(pod_cpu_usage, replaceMap, PodName, pod_metric_range, steps_pod)}}, - "pod_memory_usage_wo_cache": {{PodName, podName, GetMetricUrl(pod_memery_usage_wo_cache, replaceMap, PodName, pod_metric_range, steps_pod)}}, - "pod_net_bytes_transmitted": {{PodName, podName, GetMetricUrl(pod_net_bytes_transmitted, replaceMap, PodName, pod_metric_range, steps_pod)}}, - "pod_net_bytes_received": {{PodName, podName, GetMetricUrl(pod_net_bytes_received, replaceMap, PodName, pod_metric_range, steps_pod)}}, - } - - ch := make(chan MetricResult, len(metricMap)) - var wg sync.WaitGroup - - for k, v := range metricMap { - wg.Add(1) - go HttpGetMetrics(k, v, &wg, ch) - } - wg.Wait() - close(ch) - - mr := []MetricResult{} - for v := range ch { - mr = append(mr, v) - } - - Response(c, http.StatusOK, "success", mr) -} diff --git a/app/propagationPolicy.go b/app/propagationPolicy.go deleted file mode 100644 index fb051c5..0000000 --- a/app/propagationPolicy.go +++ /dev/null @@ -1,274 +0,0 @@ -package app - -import ( - "context" - "fmt" - "github.com/bitly/go-simplejson" - "github.com/gin-gonic/gin" - policyv1alpha1 "github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "net/http" - "strings" -) - -type PropagationPolicy struct { - TemplateId string `json:"template_id"` - TemplateName string `json:"template_name"` - Name string `json:"name"` - Namespace string `json:"namespace"` - ResourceName string `json:"resource_name"` - CrossDomain bool `json:"cross_domain"` - Kind string `json:"kind"` - Labels map[string]string `json:"labels"` - LabelString *string `json:"label_string"` - ReplicaSchedulingType *string `json:"replica_scheduling_type"` - ReplicaDivisionPreference *string `json:"replica_division_preference"` - ClusterPreference *string `json:"cluster_preference"` - ClusterName []string `json:"cluster_name"` -} - -// CreatePropagationPolicies 创建集群分发策略实例 -func CreatePropagationPolicies(propagationPolicy PropagationPolicy) error { - var pp PropagationPolicy - //获取模板数据 - sqlPolicyTemplate := "select template_id,template_name,labels,schedule_type,division_preference,cluster_preference from propagation_policy_template where template_id = ?" - queryErr := DB.QueryRow(sqlPolicyTemplate, propagationPolicy.TemplateId).Scan(&pp.TemplateId, &pp.TemplateName, &pp.LabelString, &pp.ReplicaSchedulingType, &pp.ReplicaDivisionPreference, &pp.ClusterPreference) - if queryErr != nil { - return queryErr - } - - labelsJson, err := simplejson.NewJson([]byte(*pp.LabelString)) - if err != nil { - return err - } - labelsMapInterface, _ := labelsJson.Map() - labelsMap := make(map[string]string, len(labelsMapInterface)) - for k, v := range labelsMapInterface { - labelsMap[k] = fmt.Sprint(v) - } - rst := policyv1alpha1.ReplicaSchedulingStrategy{} - - //复制分配类型 否则为 Divided 根据下层策略分配 - if *pp.ReplicaSchedulingType == "Duplicated" { - rst.ReplicaSchedulingType = policyv1alpha1.ReplicaSchedulingTypeDuplicated - } else if *pp.ReplicaDivisionPreference == "Aggregated" { - //划分-聚合 Aggregated 否则为 Weighted根据权重进行分配 - rst.ReplicaSchedulingType = policyv1alpha1.ReplicaSchedulingTypeDivided - rst.ReplicaDivisionPreference = policyv1alpha1.ReplicaDivisionPreferenceAggregated - } else if *pp.ClusterPreference == "DynamicWeight" { - //划分-权重-动态 DynamicWeight 否则为静态 - rst.ReplicaSchedulingType = policyv1alpha1.ReplicaSchedulingTypeDivided - rst.ReplicaDivisionPreference = policyv1alpha1.ReplicaDivisionPreferenceWeighted - rst.WeightPreference = &policyv1alpha1.ClusterPreferences{ - DynamicWeight: policyv1alpha1.DynamicWeightByAvailableReplicas, - } - } else { - //划分-权重-静态 - rst.ReplicaSchedulingType = policyv1alpha1.ReplicaSchedulingTypeDivided - rst.ReplicaDivisionPreference = policyv1alpha1.ReplicaDivisionPreferenceWeighted - } - if strings.EqualFold(propagationPolicy.Kind, "PersistentVolume") || strings.EqualFold(propagationPolicy.Kind, "Namespace") { - policy := &policyv1alpha1.ClusterPropagationPolicy{ - ObjectMeta: v1.ObjectMeta{ - Name: propagationPolicy.Name, - }, - Spec: policyv1alpha1.PropagationSpec{ - ResourceSelectors: []policyv1alpha1.ResourceSelector{ - { - APIVersion: "v1", - Kind: propagationPolicy.Kind, - Name: propagationPolicy.ResourceName, - }, - }, - Placement: policyv1alpha1.Placement{ - ClusterAffinity: &policyv1alpha1.ClusterAffinity{ - LabelSelector: &v1.LabelSelector{ - MatchLabels: labelsMap, - }, - ClusterNames: propagationPolicy.ClusterName, - }, - ReplicaScheduling: &rst, - }, - }, - } - _, clusterPolicyErr := KarmadaClient.PolicyV1alpha1().ClusterPropagationPolicies().Create(context.TODO(), policy, v1.CreateOptions{}) - if clusterPolicyErr != nil { - return clusterPolicyErr - } - } else { - policy := &policyv1alpha1.PropagationPolicy{ - ObjectMeta: v1.ObjectMeta{ - Name: propagationPolicy.Name, - Namespace: propagationPolicy.Namespace, - }, - Spec: policyv1alpha1.PropagationSpec{ - ResourceSelectors: []policyv1alpha1.ResourceSelector{ - { - Kind: propagationPolicy.Kind, - Name: propagationPolicy.ResourceName, - }, - }, - Placement: policyv1alpha1.Placement{ - ClusterAffinity: &policyv1alpha1.ClusterAffinity{ - LabelSelector: &v1.LabelSelector{ - MatchLabels: labelsMap, - }, - ClusterNames: propagationPolicy.ClusterName, - }, - ReplicaScheduling: &rst, - }, - }, - } - switch propagationPolicy.Kind { - case "HorizontalPodAutoscaler": - policy.Spec.ResourceSelectors[0].APIVersion = "autoscaling/v1" - case "Pod", "Service", "PersistentVolumeClaim", "ConfigMap", "Namespace": - policy.Spec.ResourceSelectors[0].APIVersion = "v1" - case "Deployment", "StatefulSet", "DaemonSet": - policy.Spec.ResourceSelectors[0].APIVersion = "apps/v1" - } - _, policyErr := KarmadaClient.PolicyV1alpha1().PropagationPolicies(propagationPolicy.Namespace).Create(context.TODO(), policy, v1.CreateOptions{}) - if policyErr != nil { - return policyErr - } - //数据库记录policy实例 - _, err = DB.Exec(`INSERT INTO joint_domain.propagation_policy(template_id, policy_name, namespace, resource_name) VALUES(?,?,?,?)`, propagationPolicy.TemplateId, propagationPolicy.Name, propagationPolicy.Namespace, propagationPolicy.ResourceName) - if err != nil { - return err - } - } - return err -} - -// ListPropagationPolicies 查询集群分发策略列表 -// @Summary 查询分发策略模板 -// @Description 查询分发策略模板 -// @Tags propagationPolicy -// @accept json -// @Produce json -// @Param label_key query string false "标签Key" -// @Param label_value query string false "标签Value" -// @Param policy_name query string false "policy_name" -// @Param pageNum query int true "页码" -// @Param pageSize query int true "每页数量" -// @Success 200 -// @Failure 500 -// @Router /api/v1/propagationPolicy/list [get] -func ListPropagationPolicies(c *gin.Context) { - - labelKey := c.Query("label_key") - labelValue := c.Query("label_value") - policyName := c.Query("policy_name") - - opts := v1.ListOptions{ - TypeMeta: v1.TypeMeta{}, - LabelSelector: labelKey + "=" + labelValue, - FieldSelector: "", - Watch: false, - AllowWatchBookmarks: false, - ResourceVersion: "", - ResourceVersionMatch: "", - TimeoutSeconds: nil, - Limit: 0, - Continue: "", - } - nsResult, _ := ClientSet.CoreV1().Namespaces().List(context.TODO(), opts) - proPolicyList := make([]PropagationPolicy, 0) - for i := 0; i < len(nsResult.Items); i++ { - - propagationList, _ := KarmadaClient.PolicyV1alpha1().PropagationPolicies(nsResult.Items[i].Name).List(context.TODO(), v1.ListOptions{}) - - for i := 0; i < len(propagationList.Items); i++ { - name := propagationList.Items[i].ObjectMeta.Name - namespace := propagationList.Items[i].ObjectMeta.Namespace - labels := &propagationList.Items[i].Spec.Placement.ClusterAffinity.LabelSelector.MatchLabels - resourceName := propagationList.Items[i].Spec.ResourceSelectors[0].Name - kind := propagationList.Items[i].Spec.ResourceSelectors[0].Kind - rdp := string(propagationList.Items[i].Spec.Placement.ReplicaScheduling.ReplicaDivisionPreference) - rst := string(propagationList.Items[i].Spec.Placement.ReplicaScheduling.ReplicaSchedulingType) - - //判断是否跨域 - //deployJson := GetDeployFromOS(namespace, resourceName, "") - //hits, _ := deployJson.Get("hits").Get("hits").Array() - // - //var domainSet []string - //for i := 0; i < len(hits); i++ { - // cluster, _ := deployJson.Get("hits").Get("hits").GetIndex(i).Get("_source").Get("metadata").Get("annotations").Get("resource.karmada.io/cached-from-cluster").String() - // //获取域列表 - // rows, _ := DB.Query("select domain_name,domain_id,cluster_name from domain_cluster where cluster_name = ?", cluster) - // for rows.Next() { - // var domainName string - // var clusterName string - // var domainId int32 - // rows.Scan(&domainName, &domainId, &clusterName) - // domainSet = append(domainSet, domainName) - // } - //} - // - //domainSet = removeDuplicateArr(domainSet) - //crossDomain := false - //if len(domainSet) > 1 { - // crossDomain = true - //} - - pp := PropagationPolicy{ - Name: name, - CrossDomain: true, - Namespace: namespace, - Labels: *labels, - ResourceName: resourceName, - Kind: kind, - ReplicaDivisionPreference: &rdp, - ReplicaSchedulingType: &rst, - } - - //获取分发实例对应的模板信息 - sqlPolicy := "SELECT ppt.template_id, ppt.template_name FROM joint_domain.propagation_policy pp,joint_domain.propagation_policy_template ppt WHERE pp.template_id =ppt.template_id and pp.policy_name= ?" - err := DB.QueryRow(sqlPolicy, name).Scan(&pp.TemplateId, &pp.TemplateName) - if err != nil { - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - //模糊查询 - if strings.Contains(pp.Name, policyName) { - proPolicyList = append(proPolicyList, pp) - } else { - continue - } - } - - } - - total := len(proPolicyList) - page := &Page[PropagationPolicy]{} - page.List = proPolicyList - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - data := Paginator(page, int64(total), pageNum, pageSize) - Response(c, http.StatusOK, "success", data) - -} - -// UpdatePropagationPolicies 更新集群分发策略 -func UpdatePropagationPolicies(c *gin.Context) { - var propagationPolicy policyv1alpha1.PropagationPolicy - _, err := KarmadaClient.PolicyV1alpha1().PropagationPolicies(propagationPolicy.Namespace).Update(context.TODO(), &propagationPolicy, v1.UpdateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "update propagationPolicy failed", err) - return - } - Response(c, http.StatusOK, "success", nil) -} - -// DeletePropagationPolicies 删除集群分发策略 -func DeletePropagationPolicies(namespace string, policyName string) { - err := KarmadaClient.PolicyV1alpha1().PropagationPolicies(namespace).Delete(context.TODO(), policyName, v1.DeleteOptions{}) - if err != nil { - return - } - // 删除数据库记录policy实例 - _, err = DB.Exec(`delete from joint_domain.propagation_policy where namespace = ? and policy_name = ?`, namespace, policyName) - if err != nil { - return - } -} diff --git a/app/propagationPolicyTemplate.go b/app/propagationPolicyTemplate.go deleted file mode 100644 index bc377e9..0000000 --- a/app/propagationPolicyTemplate.go +++ /dev/null @@ -1,138 +0,0 @@ -package app - -import ( - "github.com/gin-gonic/gin" - "net/http" -) - -type PropagationPolicyTemplate struct { - TemplateId int32 `json:"template_id"` - TemplateName string `json:"template_name"` - Labels *string `json:"labels"` - ScheduleType *string `json:"schedule_type"` - DivisionPreference *string `json:"division_preference"` - ClusterPreference *string `json:"cluster_preference"` -} - -// @Summary 创建策略模板 -// @Description 创建策略模板 -// @Tags propagationPolicyTemplate -// @accept json -// @Produce json -// @Param param body PropagationPolicyTemplate true "json" -// @Success 200 -// @Failure 500 -// @Router /api/v1/propagationPolicyTemplate/create [post] -func CreatePropagationPolicyTemplate(c *gin.Context) { - var j PropagationPolicyTemplate - if err := c.BindJSON(&j); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", err) - return - } - _, err := DB.Exec(`INSERT propagation_policy_template(template_name, labels, schedule_type, division_preference, cluster_preference)VALUES (?,?,?,?,?)`, j.TemplateName, j.Labels, j.ScheduleType, j.DivisionPreference, j.ClusterPreference) - - if err != nil { - Response(c, http.StatusBadRequest, "insert failed", err) - return - } - Response(c, http.StatusOK, "success", nil) - -} - -// @Summary 删除策略模板 -// @Description 删除策略模板 -// @Tags propagationPolicyTemplate -// @accept json -// @Produce json -// @Param param body PropagationPolicyTemplate true "json" -// @Success 200 -// @Failure 500 -// @Router /api/v1/propagationPolicyTemplate/delete [post] -func DeletePropagationPolicyTemplate(c *gin.Context) { - var j PropagationPolicyTemplate - if err := c.BindJSON(&j); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", err) - return - } - - _, err := DB.Exec(`DELETE FROM propagation_policy_template WHERE template_id = ?`, j.TemplateId) - - if err != nil { - Response(c, http.StatusBadRequest, "insert failed", err) - return - } - Response(c, http.StatusOK, "success", nil) - -} - -// @Summary 查询分发策略模板 -// @Description 查询分发策略模板 -// @Tags propagationPolicyTemplate -// @accept json -// @Produce json -// @Param template_name query string false "模板名称" -// @Param pageNum query int true "页码" -// @Param pageSize query int true "每页数量" -// @Success 200 -// @Failure 500 -// @Router /api/v1/propagationPolicyTemplate/list [get] -func ListPropagationPolicyTemplate(c *gin.Context) { - - pptName := c.Query("template_name") - - PptList := make([]PropagationPolicyTemplate, 0) - sqlStr := `SELECT template_name, labels, schedule_type, division_preference, cluster_preference ,template_id - FROM propagation_policy_template - where template_name like ?` - rows, err := DB.Query(sqlStr, "%"+pptName+"%") - defer rows.Close() - if err != nil { - Response(c, http.StatusBadRequest, "query failed", err) - return - } - - for rows.Next() { - var ppt PropagationPolicyTemplate - err := rows.Scan(&ppt.TemplateName, &ppt.Labels, &ppt.ScheduleType, &ppt.DivisionPreference, &ppt.ClusterPreference, &ppt.TemplateId) - if err != nil { - Response(c, http.StatusBadRequest, "query failed!", err) - return - } - PptList = append(PptList, ppt) - } - - total := len(PptList) - page := &Page[PropagationPolicyTemplate]{} - page.List = PptList - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - data := Paginator(page, int64(total), pageNum, pageSize) - Response(c, http.StatusOK, "success", data) - //Response(c, http.StatusOK, "success", PptList) - -} - -// @Summary 更新策略模板 -// @Description 更新策略模板 -// @Tags propagationPolicyTemplate -// @accept json -// @Produce json -// @Param param body PropagationPolicyTemplate true "json" -// @Success 200 -// @Failure 500 -// @Router /api/v1/propagationPolicyTemplate/update [post] -func UpdatePropagationPolicyTemplate(c *gin.Context) { - var j PropagationPolicyTemplate - if err := c.BindJSON(&j); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", err) - return - } - _, err := DB.Exec(`UPDATE propagation_policy_template SET template_name = ?, labels = ?, schedule_type = ?, division_preference = ?, cluster_preference = ? WHERE template_id = ?`, j.TemplateName, j.Labels, j.ScheduleType, j.DivisionPreference, j.ClusterPreference, j.TemplateId) - - if err != nil { - Response(c, http.StatusBadRequest, "update failed", err) - return - } - Response(c, http.StatusOK, "success", nil) - -} diff --git a/app/router.go b/app/router.go deleted file mode 100644 index 7a27a3e..0000000 --- a/app/router.go +++ /dev/null @@ -1,288 +0,0 @@ -package app - -import ( - "context" - "crypto/tls" - "github.com/gin-gonic/gin" - "github.com/go-redis/redis/v8" - _ "github.com/go-sql-driver/mysql" - "github.com/jmoiron/sqlx" - karmadaclientset "github.com/karmada-io/karmada/pkg/generated/clientset/versioned" - "github.com/karmada-io/karmada/pkg/karmadactl" - "github.com/karmada-io/karmada/pkg/karmadactl/cmdinit/utils" - "github.com/opensearch-project/opensearch-go/v2" - swaggerFiles "github.com/swaggo/files" - ginSwagger "github.com/swaggo/gin-swagger" - v2 "gorm.io/driver/mysql" - "gorm.io/gorm" - "gorm.io/gorm/schema" - _ "jcc-schedule/docs" - "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - kubeclient "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - "net/http" - "os" -) - -var DB *sqlx.DB -var DBPCM *sqlx.DB -var KarmadaClient *karmadaclientset.Clientset -var KarmadaConfig karmadactl.KarmadaConfig -var ControlPlaneRestConfig *rest.Config -var ClientSet *kubeclient.Clientset -var OpenSearchClient *opensearch.Client -var CrDClient *clientset.Clientset -var MyRedis *redis.Client -var Gorm *gorm.DB -var ConfigNacos = GetNacosConfig() - -func InitRouter() *gin.Engine { - - r := gin.New() - r.Use(gin.Logger()) - r.Use(gin.Recovery()) - r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) - - //mysql连接池 - dsn := ConfigNacos.Mysql.Url - dsnPCM := ConfigNacos.Mysql.UrlPCM - - DB, _ = sqlx.Connect("mysql", dsn) - DBPCM, _ = sqlx.Connect("mysql", dsnPCM) - - DB.SetMaxOpenConns(ConfigNacos.Mysql.MaxOpenConn) - DB.SetMaxIdleConns(ConfigNacos.Mysql.MaxIdleConn) - - DBPCM.SetMaxOpenConns(int(ConfigNacos.Mysql.MaxOpenConn)) - DBPCM.SetMaxIdleConns(int(ConfigNacos.Mysql.MaxIdleConn)) - - //启动Gorm支持 - gorm, _ := gorm.Open(v2.Open(dsn), &gorm.Config{ - NamingStrategy: schema.NamingStrategy{ - SingularTable: true, // 使用单数表名,启用该选项,此时,`User` 的表名应该是 `t_user` - }, - }) - Gorm = gorm - //redis连接 - MyRedis = redis.NewClient(&redis.Options{ - Addr: ConfigNacos.Redis.Host, - Password: ConfigNacos.Redis.Password, // no password set - DB: ConfigNacos.Redis.DB, // use default DB - }) - MyRedis.Ping(context.Background()).Result() - - //Karmada Client - dir, _ := os.Getwd() - KarmadaConfig = karmadactl.NewKarmadaConfig(clientcmd.NewDefaultPathOptions()) - KarmadaConfig.GetClientConfig("", dir+"/karmadaConfig/karmada-host") - ControlPlaneRestConfig, _ = KarmadaConfig.GetRestConfig("", dir+"/karmadaConfig/karmada-host") - KarmadaClient = karmadaclientset.NewForConfigOrDie(ControlPlaneRestConfig) - ClientSet, _ = utils.NewClientSet(ControlPlaneRestConfig) - CrDClient, _ = utils.NewCRDsClient(ControlPlaneRestConfig) - // 初始化OpenSearch客户端 - OpenSearchClient, _ = opensearch.NewClient(opensearch.Config{ - Transport: &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, - }, - Addresses: []string{ConfigNacos.OpenSearch.Url}, - Username: ConfigNacos.OpenSearch.UserName, - Password: ConfigNacos.OpenSearch.PassWord, - }) - - //创建定时任务 - - //api分组 - api := r.Group("/api") - v1 := api.Group("/v1") - { - //LabelType - labelType := v1.Group("labelType") - labelType.POST("/create", CreateLabelType) - labelType.POST("/delete", DeleteLabelType) - labelType.GET("/list", ListLabelType) - labelType.POST("/update", UpdateLabelType) - - //Label - label := v1.Group("label") - label.POST("/create", CreateLabel) - label.POST("/delete", DeleteLabel) - label.GET("/list", ListLabel) - label.POST("/update", UpdateLabel) - - //Namespace - namespace := v1.Group("namespace") - namespace.GET("/list", ListNamespace) - namespace.GET("/listPodsCount", ListPodsCount) - namespace.GET("/isExist", IsExistNamespace) - namespace.GET("/list/name", ListName) - namespace.GET("/listFromCluster", ListNamespaceFromCluster) - namespace.GET("/describe", DescribeNamespace) - namespace.GET("/detail", DetailNamespace) - namespace.POST("/create", CreateNamespace) - namespace.DELETE("/delete/:clusterName/:name/:label", DeleteNamespace) - namespace.PUT("/update", UpdateNamespace) - namespace.GET("/getBatchMetrics", GetBatchNamespaceMetrics) - namespace.GET("/getMetrics", GetNamespaceMetrics) - namespace.GET("/resources", GetNamespaceResources) - namespace.GET("/nameSpaceByRegion", ListNamespaceByDomain) - - //Domain - domain := v1.Group("domain") - domain.POST("/create", CreateDomain) - domain.GET("/describe", DescribeDomain) - domain.GET("/list", ListDomain) - domain.GET("/listByDeployment", ListByDeployment) - domain.GET("/listClusters", ListClusters) - domain.GET("/usedRate", QueryDomainUsedRate) - - //Pod - pod := v1.Group("pod") - pod.GET("/list", ListPod) - pod.GET("/all", ALLPod) - pod.GET("/isExist", IsExist) - pod.GET("/detail", PodDetail) - pod.GET("/cpuAndMemory", PodMetrics) - pod.POST("/create", CreatePod) - pod.DELETE("/delete/:clusterName/:namespace/:name/:label", DeletePod) - pod.PUT("/updatePod", UpdatePod) - pod.PUT("/detail", GetPodDetail) - pod.GET("/listFromDeployment", ListPodFromDeployment) - pod.GET("/listFromNode", ListPodFromNode) - pod.GET("/pod/metrics", ListPodFromNode) - pod.GET("/metrics", GetMetrics) - - //Cluster - cluster := v1.Group("cluster") - cluster.GET("/list", ListCluster) - cluster.GET("/listWithLabel", ListClusterWithLabel) - cluster.POST("/tag", TagCluster) - cluster.POST("/unTag", UnTagCluster) - cluster.POST("/join", Join) - cluster.DELETE("/unJoin", UnJoin) - cluster.GET("/listByDomain", ListByDomain) - cluster.POST("/createCluster", CreateCluster) - cluster.GET("/listFree", ListFreeCluster) - cluster.POST("/proxyJoinCluster", ProxyJoinCluster) - cluster.GET("/:clusterName", ClusterExist) - - //Node - node := v1.Group("node") - node.PUT("/update", UpdateNode) - node.GET("/list", ListNode) - node.GET("/count", NodeCount) - node.GET("/edge", ListEdgeNode) - node.GET("/metrics", ListNodeMetrics) - node.GET("/detail/pod", queryNodeInfo) - node.GET("/detail", DetailNode) - node.GET("/getNodeMetrics1h", GetNodeMetrics1h) - node.GET("/getNodeMetrics8h", GetNodeMetrics8h) - - //DeploymentParam - deployment := v1.Group("deployments") - deployment.POST("/create", CreateDeployment) - deployment.DELETE("/delete/:clusterName/:namespace/:name/:label", DeleteDeployment) - deployment.GET("/list", ListDeployment) - deployment.GET("/listFromCluster", ListDeploymentFromCluster) - deployment.GET("/describe", DescribeDeployment) - deployment.GET("/detail", DetailDeployment) - deployment.GET("/listGlobal", ListClusterDeployment) - deployment.PUT("/redeploy", Redeploy) - deployment.PUT("/update", UpdateDeployment) - deployment.GET("/hpa", getHpa) - deployment.PUT("/autoScaling", AutoScaling) - deployment.POST("/hpa/create", CreateHpa) - deployment.GET("/getMetrics", GetDeploymentMetrics) - deployment.GET("isExist", IsExistDeployment) - deployment.GET("/controllerVersions", ControllerRevisions) - deployment.GET("/replicaSets", ListReplicaSets) - deployment.PUT("/back", BackVersion) - - //daemonSet - daemonSet := v1.Group("daemonsets") - daemonSet.GET("/detail", DetailDaemonSet) - daemonSet.POST("/create", CreateDaemonSet) - daemonSet.DELETE("/delete/:clusterName/:namespace/:name/:label", DeleteDaemonSet) - daemonSet.PUT("/update", UpdateDaemonSet) - daemonSet.GET("isExist", IsExistDaemonSet) - daemonSet.GET("/listFromCluster", ListDaemonSetFromCluster) - daemonSet.PUT("/back", BackDaemonSetVersion) - - //statefulSet - statefulSet := v1.Group("statefulsets") - statefulSet.GET("/listFromCluster", ListStatefulSetFromCluster) - statefulSet.GET("/detail", DetailStatefulSet) - statefulSet.DELETE("/delete/:clusterName/:namespace/:name/:label", DeleteStatefulSet) - statefulSet.POST("/create", CreateStatefulSet) - statefulSet.PUT("/update", UpdateStatefulSet) - statefulSet.GET("/isExist", IsExistStatefulSet) - statefulSet.PUT("/back", BackStatefulSetVersion) - - // storage - storage := v1.Group("storage") - storage.POST("/pv", CreatePV) - storage.POST("/pvc", CreatePVC) - storage.PUT("/pvc", UpdatePVC) - storage.DELETE("/pvc/:clusterName/:namespace/:name/:label", DeletePVC) - storage.GET("/pvc/detail", DetailPVC) - storage.GET("/pvc/isExist", IsExistPVC) - storage.GET("/pv", ListPV) - storage.GET("/pvc", ListPVC) - storage.GET("/list", ListStorageClass) - - // storage - crd := v1.Group("crd") - crd.GET("/list/:clusterName", ListCRD) - crd.GET("/detail/:clusterName/:namespace/:kind", DetailCRD) - crd.GET("/create", CreateCRD) - - // configMap - configMap := v1.Group("config") - configMap.POST("/configMap/create", CreateConfigMap) - configMap.GET("/secret/list", ListSecret) - configMap.GET("/configMap/list", ListConfigMap) - - // service - service := v1.Group("service") - service.POST("/create", CreateService) - service.PUT("/update", UpdateService) - service.DELETE("/delete/:clusterName/:namespace/:name/:label", DeleteService) - service.GET("/all", AllService) - service.GET("/list", ListService) - service.GET("/isExist", IsExistService) - service.GET("/detail", DetailService) - - //PropagationPolicyTemplate - propagationPolicyTemplate := v1.Group("propagationPolicyTemplate") - propagationPolicyTemplate.POST("/create", CreatePropagationPolicyTemplate) - propagationPolicyTemplate.GET("/list", ListPropagationPolicyTemplate) - propagationPolicyTemplate.POST("/delete", DeletePropagationPolicyTemplate) - propagationPolicyTemplate.POST("/update", UpdatePropagationPolicyTemplate) - - //PropagationPolicies - propagationPolicy := v1.Group("propagationPolicy") - propagationPolicy.GET("/list", ListPropagationPolicies) - propagationPolicy.POST("/update", UpdatePropagationPolicies) - - //OverridePolicies - overridePolicy := v1.Group("overridePolicy") - overridePolicy.GET("/list", ListOverridePolicies) - overridePolicy.POST("/create", CreateOverridePolicies) - overridePolicy.POST("/delete", DeleteOverridePolicies) - overridePolicy.POST("/update", UpdateOverridePolicies) - - //Overview - overview := v1.Group("resource") - overview.GET("/count", ResourceCount) - overview.GET("/getApiServerMetrics", GetApiServerMetrics) - overview.GET("/getNodeMetrics", GetNodeMetrics) - overview.GET("/getClusterMetrics", GetClusterMetrics) - overview.GET("/getScheduleMetrics", GetScheduleMetrics) - overview.GET("/getOverallMetrics", GetOverallMetrics) - overview.GET("/getServerResources", GetServerResources) - overview.GET("/listClusterMetrics", ListClusterMetrics) - - } - - return r -} diff --git a/app/service.go b/app/service.go deleted file mode 100644 index 0079dee..0000000 --- a/app/service.go +++ /dev/null @@ -1,179 +0,0 @@ -package app - -import ( - "context" - "encoding/json" - "github.com/gin-gonic/gin" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "net/http" - "sort" - "strings" -) - -type ServiceParam struct { - Service v1.Service `json:"service"` - TemplateId string `json:"templateId"` - ClusterName []string `json:"clusterName"` -} - -type ServiceObject struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []v1.Service `json:"items"` -} - -// CreateService 创建服务 -// @Summary 创建服务 -// @Description 创建服务 -// @Tags service -// @accept json -// @Produce json -// @Success 200 -// @Failure 500 -// @Router /api/v1/service/create [post] -func CreateService(c *gin.Context) { - var sRequest ServiceParam - if err := c.BindJSON(&sRequest); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - if sRequest.Service.Labels != nil && sRequest.Service.Labels["jcce"] == "true" { - _, serviceErr := ClientSet.CoreV1().Services(sRequest.Service.Namespace).Create(context.TODO(), &sRequest.Service, metav1.CreateOptions{}) - if serviceErr != nil { - Response(c, http.StatusBadRequest, "create service error.", serviceErr) - return - } - // 创建调度策略实例 - err := CreatePropagationPolicies(PropagationPolicy{ - ClusterName: sRequest.ClusterName, - TemplateId: sRequest.TemplateId, - ResourceName: sRequest.Service.Name, - Name: "service" + "." + sRequest.Service.Namespace + "." + sRequest.Service.Name, - Namespace: sRequest.Service.Namespace, - Kind: "Service", - }) - if err != nil { - Response(c, http.StatusBadRequest, "create service error.", err) - return - } - } else { - result := PostObject(serviceConst, sRequest.ClusterName[0], sRequest.Service.Namespace, sRequest.Service.Name, sRequest.Service) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", result.Error()) - return - } - } - - Response(c, http.StatusOK, "success", nil) -} - -// UpdateService 更新服务 -func UpdateService(c *gin.Context) { - var sevice v1.Service - if err := c.BindJSON(&sevice); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - ClientSet.CoreV1().Services(sevice.Namespace).Update(context.TODO(), &sevice, metav1.UpdateOptions{}) - Response(c, http.StatusOK, "success", nil) -} - -// DeleteService 删除服务 -func DeleteService(c *gin.Context) { - clusterName := c.Param("clusterName") - namespace := c.Param("namespace") - name := c.Param("name") - label := c.Param("label") - if strings.EqualFold(label, "jcce") { - err := ClientSet.CoreV1().Services(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "delete service failed", err) - return - } - // 删除调度策略 - DeletePropagationPolicies(namespace, "service"+"."+namespace+"."+name) - } else { - result := DeleteObject(detailServiceConst, clusterName, namespace, name) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "delete service failed", result.Error()) - return - } - } - Response(c, http.StatusOK, "success", nil) -} - -// IsExistService 判断输入service名称是否重复 -func IsExistService(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - result := SearchObject(detailServiceConst, clusterName, namespace, name) - if result.Error() != nil { - Response(c, http.StatusOK, "success", false) - return - } - raw, _ := result.Raw() - var service v1.Service - json.Unmarshal(raw, &service) - if len(service.Name) == 0 { - Response(c, http.StatusOK, "success", false) - return - } - Response(c, http.StatusOK, "success", true) -} - -// DetailService 查询service详情 -func DetailService(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - result := SearchObject(detailServiceConst, clusterName, namespace, name) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", result.Error()) - return - } - raw, _ := result.Raw() - var service v1.Service - json.Unmarshal(raw, &service) - Response(c, http.StatusOK, "success", service) -} - -// ListService 查询命名空间下的service列表 -func ListService(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - result := SearchObject(serviceConst, clusterName, namespace, "") - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", result.Error()) - return - } - raw, _ := result.Raw() - var scRes SCRes - json.Unmarshal(raw, &scRes) - Response(c, http.StatusOK, "success", scRes.Items) -} - -// AllService 查询service列表 -func AllService(c *gin.Context) { - clusterName := c.Query("clusterName") - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - result := SearchObject(allServiceConst, clusterName, "", "") - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", result.Error()) - return - } - raw, _ := result.Raw() - var serviceRes ServiceObject - json.Unmarshal(raw, &serviceRes) - page := &Page[v1.Service]{} - page.List = serviceRes.Items - sort.SliceStable(serviceRes.Items, func(i, j int) bool { - return serviceRes.Items[i].CreationTimestamp.Time.After(serviceRes.Items[j].CreationTimestamp.Time) - }) - data := Paginator(page, int64(len(serviceRes.Items)), pageNum, pageSize) - Response(c, http.StatusOK, "success", data) -} diff --git a/app/storage.go b/app/storage.go deleted file mode 100644 index 2c11d65..0000000 --- a/app/storage.go +++ /dev/null @@ -1,388 +0,0 @@ -package app - -import ( - "context" - "encoding/json" - "github.com/gin-gonic/gin" - v1 "k8s.io/api/core/v1" - "k8s.io/api/storage/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "net/http" - "reflect" - "sort" - "strings" -) - -type PVRes struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []v1.PersistentVolume `json:"items"` -} - -type PVCObject struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []v1.PersistentVolumeClaim `json:"items"` -} - -type SCRes struct { - Kind string `json:"kind"` - ApiVersion string `json:"apiVersion"` - Metadata string `json:"metadata"` - ResourceVersion string `json:"resourceVersion"` - Items []v1beta1.StorageClass `json:"items"` -} - -type PersistentVolume struct { - TemplateId string `json:"templateId"` - ClusterName []string `json:"clusterName"` - PersistentVolume v1.PersistentVolume `json:"persistentVolume"` -} - -type PersistentVolume1 struct { - TemplateId string `json:"templateId"` - ClusterName []string `json:"clusterName"` - PersistentVolume JSONData1 `json:"persistentVolume"` -} - -type JSONData struct { - APIVersion string `json:"apiVersion"` - Kind string `json:"kind"` - Metadata struct { - Namespace string `json:"namespace"` - Name string `json:"name"` - Labels struct { - } `json:"labels"` - Annotations struct { - KubesphereIoCreator string `json:"kubesphere.io/creator"` - } `json:"annotations"` - } `json:"metadata"` - Spec struct { - AccessModes []string `json:"accessModes"` - Resources struct { - Requests struct { - Storage string `json:"storage"` - } `json:"requests"` - } `json:"resources"` - StorageClassName string `json:"storageClassName"` - } `json:"spec"` -} - -type JSONData1 struct { - APIVersion string `json:"apiVersion"` - Kind string `json:"kind"` - Metadata struct { - Name string `json:"name"` - } `json:"metadata"` - Spec struct { - Capacity struct { - Storage string `json:"storage"` - } `json:"capacity"` - VolumeMode string `json:"volumeMode"` - AccessModes []string `json:"accessModes"` - Nfs struct { - Path string `json:"path"` - Server string `json:"server"` - } `json:"nfs"` - } `json:"spec"` -} - -type PersistentVolumeClaim struct { - TemplateId string `json:"templateId"` - ClusterName []string `json:"clusterName"` - PersistentVolumeClaim v1.PersistentVolumeClaim `json:"persistentVolumeClaim"` -} - -// CreatePV 创建PV -type PersistentVolumeClaim1 struct { - TemplateId string `json:"templateId"` - ClusterName []string `json:"clusterName"` - PersistentVolumeClaim JSONData `json:"persistentVolumeClaim"` -} - -// @Summary 创建PV -// @Description 创建PV -// @Tags storage -// @accept json -// @Produce json -// @Param param body PersistentVolume1 true "json" -// @Success 200 -// @Failure 500 -// @Router /api/v1/storage/pv [post] -func CreatePV(c *gin.Context) { - var pvRequest PersistentVolume - if err := c.BindJSON(&pvRequest); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - persistentVolume, err := ClientSet.CoreV1().PersistentVolumes().Create(context.TODO(), &pvRequest.PersistentVolume, metav1.CreateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "create persistentVolume failed", err) - return - } - // 创建调度策略实例 - CreatePropagationPolicies(PropagationPolicy{ - ClusterName: pvRequest.ClusterName, - TemplateId: pvRequest.TemplateId, - ResourceName: pvRequest.PersistentVolume.Name, - Name: "pv" + pvRequest.PersistentVolume.Name, - Kind: "PersistentVolume", - }) - Response(c, http.StatusOK, "success", persistentVolume) -} - -// IsExistPVC 查询pvc是否存在 -func IsExistPVC(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - result := SearchObject(detailPvcConst, clusterName, namespace, name) - if result.Error() != nil { - Response(c, http.StatusOK, "success", false) - return - } - raw, _ := result.Raw() - var pvc v1.PersistentVolumeClaim - json.Unmarshal(raw, &pvc) - if len(pvc.Name) == 0 { - Response(c, http.StatusOK, "success", false) - return - } - Response(c, http.StatusOK, "success", true) -} - -// DetailPVC 查询PVC详情 -func DetailPVC(c *gin.Context) { - clusterName := c.Query("clusterName") - namespace := c.Query("namespace") - name := c.Query("name") - result := SearchObject(detailPvcConst, clusterName, namespace, name) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", result.Error()) - return - } - raw, _ := result.Raw() - var pvc v1.PersistentVolumeClaim - json.Unmarshal(raw, &pvc) - err_ := AddTypeMetaToObject(&pvc) - if err_ != nil { - Response(c, http.StatusInternalServerError, "failed", result.Error()) - } - Response(c, http.StatusOK, "success", pvc) -} - -// DeletePVC 删除存储卷 -func DeletePVC(c *gin.Context) { - clusterName := c.Param("clusterName") - namespace := c.Param("namespace") - name := c.Param("name") - label := c.Param("label") - if strings.EqualFold(label, "jcce") { - err := ClientSet.CoreV1().PersistentVolumeClaims(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "delete persistentVolumeClaim failed", err) - return - } - // 删除调度策略实例 - DeletePropagationPolicies(namespace, "pvc"+"."+name) - } else { - result := DeleteObject(detailPvcConst, clusterName, namespace, name) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "delete persistentVolumeClaim failed", result.Error()) - return - } - } - - Response(c, http.StatusOK, "success", "") -} - -// UpdatePVC 更新存储卷信息 -func UpdatePVC(c *gin.Context) { - clusterName := c.Query("clusterName") - var pvc v1.PersistentVolumeClaim - if err := c.BindJSON(&pvc); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - if len(pvc.Labels["jcce"]) != 0 { - _, err := ClientSet.CoreV1().PersistentVolumeClaims(pvc.Namespace).Update(context.TODO(), &pvc, metav1.UpdateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "update persistentVolumeClaim failed", err) - return - } - } else { - result := UpdateObject(detailPvcConst, clusterName, pvc.Namespace, pvc.Name, pvc) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "update persistentVolumeClaim failed", result.Error()) - return - } - } - Response(c, http.StatusOK, "success", "") - -} - -// @Summary 创建PVC -// @Description 创建PVC -// @Tags storage -// @accept json -// @Produce json -// @Param param body PersistentVolumeClaim1 true "json" -// @Success 200 -// @Failure 500 -// @Router /api/v1/storage/pvc [post] -func CreatePVC(c *gin.Context) { - var pvcRequest PersistentVolumeClaim - if err := c.BindJSON(&pvcRequest); err != nil { - Response(c, http.StatusBadRequest, "invalid request params.", "") - return - } - if pvcRequest.PersistentVolumeClaim.Labels != nil && pvcRequest.PersistentVolumeClaim.Labels["jcce"] == "true" { - _, err := ClientSet.CoreV1().PersistentVolumeClaims(pvcRequest.PersistentVolumeClaim.Namespace).Create(context.TODO(), &pvcRequest.PersistentVolumeClaim, metav1.CreateOptions{}) - if err != nil { - Response(c, http.StatusInternalServerError, "Create PersistentVolumeClaim Failed", err) - return - } - // 创建调度策略实例 - policyErr := CreatePropagationPolicies(PropagationPolicy{ - ClusterName: pvcRequest.ClusterName, - TemplateId: pvcRequest.TemplateId, - ResourceName: pvcRequest.PersistentVolumeClaim.Name, - Name: "pvc" + "." + pvcRequest.PersistentVolumeClaim.Namespace + "." + pvcRequest.PersistentVolumeClaim.Name, - Namespace: pvcRequest.PersistentVolumeClaim.Namespace, - Kind: "PersistentVolumeClaim", - }) - if err != nil { - Response(c, http.StatusInternalServerError, "create pvc failed", policyErr) - return - } - } else { - result := PostObject(pvcListConst, pvcRequest.ClusterName[0], pvcRequest.PersistentVolumeClaim.Namespace, pvcRequest.PersistentVolumeClaim.Name, pvcRequest.PersistentVolumeClaim) - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", result.Error()) - return - } - } - - Response(c, http.StatusOK, "success", "") -} - -// ListPV 查询PV列表 -// @Summary 查询PV列表 -// @Description 查询PV列表 -// @Tags storage -// @accept json -// @Produce json -// @Param clusterName path string true "集群" -// @Success 200 -// @Failure 500 -// @Router /api/v1/storage/pv/{clusterName} [get] -func ListPV(c *gin.Context) { - clusterName := c.Query("clusterName") - result := SearchObject(pvConst, clusterName, "", "") - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", result.Error()) - return - } - raw, _ := result.Raw() - var pvRes PVRes - json.Unmarshal(raw, &pvRes) - Response(c, http.StatusOK, "success", pvRes.Items) -} - -// ListPVC 查询PVC列表 -// @Summary 查询PV列表 -// @Description 查询PV列表 -// @Tags storage -// @accept json -// @Produce json -// @Param clusterName path string true "集群" -// @Param namespace path string true "命名空间" -// @Success 200 -// @Failure 500 -// @Router /api/v1/storage/pvc [get] -func ListPVC(c *gin.Context) { - clusterName := c.Query("clusterName") - pageNum := c.Query("pageNum") - pageSize := c.Query("pageSize") - name := c.Query("name") - status := c.Query("status") - result := SearchObject(pvcConst, clusterName, "", "") - if result.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", result.Error()) - return - } - raw, _ := result.Raw() - var pvcResult PVCObject - json.Unmarshal(raw, &pvcResult) - if len(name) != 0 { - count := 0 - for i := range pvcResult.Items { - if !strings.Contains(pvcResult.Items[i-count].Name, name) { - pvcResult.Items = append(pvcResult.Items[:i-count], pvcResult.Items[i-count+1:]...) - count = count + 1 - } - } - - } - if len(status) != 0 { - count := 0 - for i := range pvcResult.Items { - if !strings.EqualFold(reflect.ValueOf(pvcResult.Items[i-count].Status.Phase).String(), status) { - pvcResult.Items = append(pvcResult.Items[:i-count], pvcResult.Items[i-count+1:]...) - count = count + 1 - } - } - } - if len(pvcResult.Items) == 0 { - Response(c, http.StatusOK, "success", pvcResult.Items) - return - } - page := &Page[v1.PersistentVolumeClaim]{} - page.List = pvcResult.Items - sort.SliceStable(pvcResult.Items, func(i, j int) bool { - return page.List[i].CreationTimestamp.Time.After(page.List[j].CreationTimestamp.Time) - }) - data := Paginator(page, int64(len(pvcResult.Items)), pageNum, pageSize) - // 查询是否有pod挂载到当前pvc下 - podResult := SearchObject(allPodConst, clusterName, "", "") - if podResult.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", podResult.Error()) - return - } - var podRes PodObject - podRaw, _ := podResult.Raw() - json.Unmarshal(podRaw, &podRes) - for _, pvc := range data.List { - for _, pod := range podRes.Items { - for _, podPvc := range pod.Spec.Volumes { - if podPvc.PersistentVolumeClaim != nil && pvc.Annotations != nil && podPvc.PersistentVolumeClaim.ClaimName == pvc.Name { - pvc.Annotations["in-use"] = "true" - } - } - } - } - Response(c, http.StatusOK, "success", data) -} - -// ListStorageClass 查询StorageClass名称列表 -func ListStorageClass(c *gin.Context) { - clusterName := c.Query("clusterName") - scResult := SearchObject(scConst, clusterName, "", "") - if scResult.Error() != nil { - Response(c, http.StatusInternalServerError, "failed", scResult.Error()) - return - } - raw, _ := scResult.Raw() - var scRes SCRes - json.Unmarshal(raw, &scRes) - // 遍历获取名称集合 - var result []string - for i := range scRes.Items { - result = append(result, scRes.Items[i].Name) - } - Response(c, http.StatusOK, "success", result) -} diff --git a/app/utils.go b/app/utils.go index f5bc904..da069fc 100644 --- a/app/utils.go +++ b/app/utils.go @@ -1,13 +1,8 @@ package app import ( - "context" - "fmt" gossh "golang.org/x/crypto/ssh" "net" - "strconv" - "strings" - "time" ) // Cli 连接信息 @@ -53,87 +48,3 @@ func (c Cli) Run(shell string) (string, error) { c.LastResult = string(buf) return c.LastResult, err } - -func stringInclude(items []string, item string) bool { - for _, eachItem := range items { - if eachItem == item { - return true - } - } - return false -} - -func LabelsConvertToMap(label string) map[string]string { - var labelMap = make(map[string]string) - labelArray := strings.Split(label, ",") - for _, label := range labelArray { - labelKV := strings.Split(label, "=") - labelMap[labelKV[0]] = labelKV[1] - } - return labelMap -} - -func SetRedis(ctx context.Context, key string, value string, t int64) bool { - expire := time.Duration(t) * time.Second - if err := MyRedis.Set(ctx, key, value, expire).Err(); err != nil { - return false - } - return true -} - -func GetRedis(ctx context.Context, key string) string { - result, err := MyRedis.Get(ctx, key).Result() - if err != nil { - return "" - } - return result -} - -func DelRedis(ctx context.Context, key string) bool { - _, err := MyRedis.Del(ctx, key).Result() - if err != nil { - fmt.Println(err) - return false - } - return true -} - -func ExpireRedis(ctx context.Context, key string, t int64) bool { - // 延长过期时间 - expire := time.Duration(t) * time.Second - if err := MyRedis.Expire(ctx, key, expire).Err(); err != nil { - fmt.Println(err) - return false - } - return true -} - -// PageParamInit 分页参数初始化 -func PageParamInit(pageNumParam, pageSizeParam string) (pageNum, pageSize int64) { - pageNum, _ = strconv.ParseInt(pageNumParam, 10, 64) - pageSize, _ = strconv.ParseInt(pageSizeParam, 10, 64) - if pageNum <= 0 { - pageNum = 1 - } - switch { - case pageSize > 100: - pageSize = 100 // 限制一下分页大小 - case pageSize <= 0: - pageSize = 10 - } - return -} - -func Paginate[T any](page *Page[T], pageNum, pageSize, total int64) *Page[T] { - totalPages := total / pageSize - if total%pageSize > 0 { - totalPages++ - } - return &Page[T]{ - PageNum: pageNum, - PageSize: pageSize, - TotalPage: totalPages, - Total: total, - List: page.List, - } -} diff --git a/deploy/jcce-schedule-deployment.yaml b/deploy/jcce-schedule-deployment.yaml index efaa42c..c30892f 100644 --- a/deploy/jcce-schedule-deployment.yaml +++ b/deploy/jcce-schedule-deployment.yaml @@ -16,10 +16,6 @@ spec: labels: k8s-app: jcce-schedule spec: - hostAliases: - - hostnames: - - nacos.jcce.dev - ip: nacos_host imagePullSecrets: - name: SECRET_NAME containers: diff --git a/docs/docs.go b/docs/docs.go deleted file mode 100644 index 73747c4..0000000 --- a/docs/docs.go +++ /dev/null @@ -1,3082 +0,0 @@ -// Package docs GENERATED BY SWAG; DO NOT EDIT -// This file was generated by swaggo/swag -package docs - -import "github.com/swaggo/swag" - -const docTemplate = `{ - "schemes": {{ marshal .Schemes }}, - "swagger": "2.0", - "info": { - "description": "{{escape .Description}}", - "title": "{{.Title}}", - "contact": {}, - "version": "{{.Version}}" - }, - "host": "{{.Host}}", - "basePath": "{{.BasePath}}", - "paths": { - "/api/v1/OverridePolicy/create": { - "post": { - "description": "创建override策略列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "overridePolicy" - ], - "summary": "创建override策略列表", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.OverridePolicy" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/createCluster": { - "post": { - "description": "集群注册", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "集群注册", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.ClusterParam" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/cluster/join": { - "post": { - "description": "新集群加入联邦", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "新集群加入联邦", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "member_name", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/list": { - "get": { - "description": "查询集群列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "查询集群列表", - "parameters": [ - { - "type": "integer", - "description": "页码", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/listByDomain": { - "post": { - "description": "根据项目名称、工作负载、域id查询集群", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "根据项目名称、工作负载、域id查询集群", - "parameters": [ - { - "type": "string", - "description": "项目名称", - "name": "namespace", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "工作负载", - "name": "deployment_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "域id", - "name": "domain_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/listFree": { - "get": { - "description": "查询自建集群列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "查询自建集群列表", - "parameters": [ - { - "type": "string", - "description": "页码", - "name": "pageNum", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "每页数量", - "name": "pageSize", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/cluster/listWithLabel": { - "get": { - "description": "查询有标签的集群列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "查询有标签的集群列表", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "cluster_name", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "页码", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/proxyJoinCluster": { - "post": { - "description": "代理模式加入集群", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "代理模式加入集群", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.ProxyCluster" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/tag": { - "post": { - "description": "集群打标签", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "集群打标签", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Cluster" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/unJoin": { - "delete": { - "description": "刪除集群", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "刪除集群", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "cluster_name", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "域id", - "name": "domain_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/unTag": { - "post": { - "description": "集群删除标签", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "集群删除标签", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Cluster" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/{clusterName}": { - "get": { - "description": "查询集群是否存在", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "查询集群是否存在", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/deployment/autoScaling": { - "post": { - "description": "弹性伸缩", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "弹性伸缩", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.HPAParam" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/deployment/create": { - "post": { - "description": "创建工作负载", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "创建工作负载", - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/deployment/delete/{namespace}/{name}": { - "delete": { - "description": "删除工作负载", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "删除工作负载", - "parameters": [ - { - "type": "string", - "description": "项目名称", - "name": "namespace", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "负载名称", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/deployment/deployments/redeploy": { - "patch": { - "description": "重新部署", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "重新部署", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.RedeployParam" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/deployment/describe": { - "get": { - "description": "查询工作负载列表(所有集群)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "查询工作负载列表(所有集群)", - "parameters": [ - { - "type": "string", - "description": "项目名称", - "name": "namespace", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "负载名称", - "name": "deploy_name", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/deployment/getMetrics": { - "get": { - "description": "获取部署监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "获取部署监控", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "namespace", - "name": "namespace", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "部署名称", - "name": "deployment", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "类型", - "name": "queryType", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/deployment/hpa": { - "get": { - "description": "获取弹性伸缩信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "获取弹性伸缩信息", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "命名空间", - "name": "namespace", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "deployName", - "name": "deployName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/deployment/list": { - "get": { - "description": "根据查询工作负载列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "根据查询工作负载列表", - "parameters": [ - { - "type": "string", - "description": "项目名称", - "name": "namespace", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "页码 ", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/domain/create": { - "post": { - "description": "创建域", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "domain" - ], - "summary": "创建域", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Domain" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/domain/describe": { - "get": { - "description": "获取域的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "domain" - ], - "summary": "获取域的详细信息", - "parameters": [ - { - "type": "string", - "description": "domainId", - "name": "domain_id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "命名空间", - "name": "namespace", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/domain/list": { - "get": { - "description": "查询Domain列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "domain" - ], - "summary": "查询Domain列表", - "parameters": [ - { - "type": "string", - "description": "domain名称", - "name": "domain_name", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/domain/listByDeployment": { - "get": { - "description": "根据项目名称和工作负载查询域列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "domain" - ], - "summary": "根据项目名称和工作负载查询域列表", - "parameters": [ - { - "type": "string", - "description": "工作负载", - "name": "deployment_name", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "命名空间", - "name": "namespace", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/label/create": { - "post": { - "description": "创建域标", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "label" - ], - "summary": "创建域标", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Label" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/label/delete": { - "delete": { - "description": "删除域标", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "label" - ], - "summary": "删除域标", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Label" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/label/list": { - "post": { - "description": "查询域标列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "label" - ], - "summary": "查询域标列表", - "parameters": [ - { - "type": "string", - "description": "标签名", - "name": "label_name", - "in": "query" - }, - { - "type": "string", - "description": "页码 ", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/label/update": { - "post": { - "description": "更新域标", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "label" - ], - "summary": "更新域标", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Label" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/labelType/create": { - "post": { - "description": "创建域标类型", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "labelType" - ], - "summary": "创建域标类型", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.LabelType" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/labelType/delete": { - "delete": { - "description": "创建域标类型", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "labelType" - ], - "summary": "删除域标类型", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.LabelType" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/labelType/list": { - "get": { - "description": "查询域标类型", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "labelType" - ], - "summary": "查询域标类型", - "parameters": [ - { - "type": "string", - "description": "标签类型", - "name": "label_type", - "in": "query" - }, - { - "type": "string", - "description": "页码 ", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/labelType/update": { - "post": { - "description": "更新域标类型", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "labelType" - ], - "summary": "更新域标类型", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.LabelType" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/namespace/create": { - "post": { - "description": "创建命名空间(项目)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "创建命名空间(项目)", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Namespace" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/namespace/describe": { - "get": { - "description": "查询Namespace详情", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "查询Namespace详情", - "parameters": [ - { - "type": "string", - "description": "命名空间", - "name": "namespace", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/namespace/getBatchMetrics": { - "get": { - "description": "批量获取namespace监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "批量获取namespace监控", - "parameters": [ - { - "type": "string", - "description": "集群名", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "逗号分隔多个命名空间名称", - "name": "namespaces", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/namespace/getMetrics": { - "get": { - "description": "namespace监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "namespace监控", - "parameters": [ - { - "type": "string", - "description": "集群名", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespace", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/namespace/list": { - "get": { - "description": "查询Namespace列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "查询Namespace列表", - "parameters": [ - { - "type": "string", - "description": "页码 ", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/namespace/update": { - "post": { - "description": "更新命名空间(项目)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "更新命名空间(项目)", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Namespace" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/node/detail/{clusterName}/{namespace}/{podName}": { - "get": { - "description": "根据集群名称 命名空间 pod名称查询节点信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "node" - ], - "summary": "根据集群名称 命名空间 pod名称查询节点信息", - "parameters": [ - { - "type": "string", - "description": "集群名", - "name": "clusterName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名", - "name": "namespace", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Pod名", - "name": "podName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/node/edge/{clusterName}": { - "get": { - "description": "查询边缘节点列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "node" - ], - "summary": "查询边缘节点列表", - "parameters": [ - { - "type": "string", - "description": "集群名", - "name": "clusterName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/node/getNodeMetrics1h": { - "get": { - "description": "获取集群节点1h监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "node" - ], - "summary": "获取集群节点1h监控", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "节点名称", - "name": "nodeName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/node/getNodeMetrics8h": { - "get": { - "description": "获取集群节点8h监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "node" - ], - "summary": "获取集群节点8h监控", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "节点名称", - "name": "nodeName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/node/list/{clusterName}": { - "get": { - "description": "查询节点列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "node" - ], - "summary": "查询节点列表", - "parameters": [ - { - "type": "string", - "description": "集群名", - "name": "clusterName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/node/metrics/{clusterName}": { - "get": { - "description": "查询边缘节点指标", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "node" - ], - "summary": "查询边缘节点指标", - "parameters": [ - { - "type": "string", - "description": "集群名", - "name": "clusterName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/overridePolicy/list": { - "get": { - "description": "查询重写策略列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "overridePolicy" - ], - "summary": "查询重写策略列表", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.OverridePolicy" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/overview/getApiServerMetrics": { - "get": { - "description": "获取ApiServer请求数和请求延迟", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "overview" - ], - "summary": "获取ApiServer请求数和请求延迟", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/overview/getClusterMetrics": { - "get": { - "description": "获取容器集群资源监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "overview" - ], - "summary": "获取容器集群资源监控", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/overview/getNodeMetrics": { - "get": { - "description": "获取容器节点资源监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "overview" - ], - "summary": "获取容器节点资源监控", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/overview/getScheduleMetrics": { - "get": { - "description": "获取容器集群调度器监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "overview" - ], - "summary": "获取容器集群调度器监控", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/pod/all": { - "get": { - "description": "根据指定集群查询Pod列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "根据指定集群查询Pod列表", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "pageNum", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "pageSize", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/pod/create": { - "post": { - "description": "创建容器组", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "创建容器组", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Pod" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/pod/delete/{namespace}/{name}": { - "delete": { - "description": "删除容器组", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "删除容器组", - "parameters": [ - { - "type": "string", - "description": "命名空间名", - "name": "namespace", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Pod名", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/pod/detail": { - "put": { - "description": "获取容器组详情", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "获取容器组详情", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Pod" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/pod/detail/{clusterName}/{namespace}/{name}": { - "get": { - "description": "根据指定集群查询Pod详情", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "根据指定集群查询Pod详情", - "parameters": [ - { - "type": "string", - "description": "集群名", - "name": "clusterName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名 ", - "name": "namespace", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "pod名", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/pod/list": { - "get": { - "description": "根据指定集群查询Pod列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "根据指定集群查询Pod列表", - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/pod/metrics": { - "get": { - "description": "获取容器组监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "获取容器组监控", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "容器组名称", - "name": "podName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/pod/metrics/{clusterName}/{namespace}/{name}": { - "get": { - "description": "根据集群名称、命名空间和pod名称查询pod使用率", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "根据集群名称、命名空间和pod名称查询pod使用率", - "parameters": [ - { - "type": "string", - "description": "项目名称", - "name": "namespace", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "集群 ", - "name": "clusterName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "名称", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/pod/updatePod": { - "put": { - "description": "更新容器组", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "更新容器组", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Pod" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/propagationPolicy/list": { - "get": { - "description": "查询分发策略模板", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "propagationPolicy" - ], - "summary": "查询分发策略模板", - "parameters": [ - { - "type": "string", - "description": "标签Key", - "name": "label_key", - "in": "query" - }, - { - "type": "string", - "description": "标签Value", - "name": "label_value", - "in": "query" - }, - { - "type": "string", - "description": "policy_name", - "name": "policy_name", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/propagationPolicyTemplate/create": { - "post": { - "description": "创建策略模板", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "propagationPolicyTemplate" - ], - "summary": "创建策略模板", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.PropagationPolicyTemplate" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/propagationPolicyTemplate/delete": { - "post": { - "description": "删除策略模板", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "propagationPolicyTemplate" - ], - "summary": "删除策略模板", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.PropagationPolicyTemplate" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/propagationPolicyTemplate/list": { - "get": { - "description": "查询分发策略模板", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "propagationPolicyTemplate" - ], - "summary": "查询分发策略模板", - "parameters": [ - { - "type": "string", - "description": "模板名称", - "name": "template_name", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/propagationPolicyTemplate/update": { - "post": { - "description": "更新策略模板", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "propagationPolicyTemplate" - ], - "summary": "更新策略模板", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.PropagationPolicyTemplate" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/service/create": { - "post": { - "description": "创建服务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "service" - ], - "summary": "创建服务", - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/sphere/getOverallMetrics": { - "get": { - "description": "获取大球监控数据", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "获取大球监控数据", - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/storage/pv": { - "post": { - "description": "创建PV", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "storage" - ], - "summary": "创建PV", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.PersistentVolume1" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/storage/pv/{clusterName}": { - "get": { - "description": "查询PV列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "storage" - ], - "summary": "查询PV列表", - "parameters": [ - { - "type": "string", - "description": "集群", - "name": "clusterName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/storage/pvc": { - "get": { - "description": "查询PVC列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "storage" - ], - "summary": "查询PVC列表", - "parameters": [ - { - "type": "string", - "description": "集群", - "name": "clusterName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间", - "name": "namespace", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - }, - "post": { - "description": "创建PVC", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "storage" - ], - "summary": "创建PVC", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.PersistentVolumeClaim1" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - } - }, - "definitions": { - "app.Cluster": { - "type": "object", - "properties": { - "cluster_name": { - "type": "string" - }, - "create_time": { - "type": "string" - }, - "description": { - "type": "string" - }, - "domain_id": { - "type": "integer" - }, - "domain_name": { - "type": "string" - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mode": { - "type": "string" - }, - "node_num": { - "type": "integer" - }, - "state": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "app.ClusterParam": { - "type": "object", - "properties": { - "clusterName": { - "type": "string" - }, - "masterNodes": { - "type": "array", - "items": { - "type": "string" - } - }, - "memberNodes": { - "type": "array", - "items": { - "type": "string" - } - }, - "userName": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "app.Domain": { - "type": "object", - "properties": { - "clusters": { - "type": "array", - "items": { - "type": "string" - } - }, - "cpu_rate": { - "type": "number" - }, - "deployments": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "domain_id": { - "type": "integer" - }, - "domain_name": { - "type": "string" - }, - "labelId": { - "type": "array", - "items": { - "type": "integer" - } - }, - "label_type": { - "type": "string" - }, - "labels": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "location": { - "type": "array", - "items": { - "type": "number" - } - }, - "memory_rate": { - "type": "number" - } - } - }, - "app.HPAParam": { - "type": "object", - "properties": { - "HPAName": { - "type": "string" - }, - "clusterName": { - "type": "string" - }, - "cpuTargetUtilization": { - "type": "string" - }, - "maxReplicas": { - "type": "integer" - }, - "memoryTargetValue": { - "type": "string" - }, - "minReplicas": { - "type": "integer" - }, - "namespace": { - "type": "string" - } - } - }, - "app.JSONData": { - "type": "object", - "properties": { - "apiVersion": { - "type": "string" - }, - "kind": { - "type": "string" - }, - "metadata": { - "type": "object", - "properties": { - "annotations": { - "type": "object", - "properties": { - "kubesphere.io/creator": { - "type": "string" - } - } - }, - "labels": { - "type": "object" - }, - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - } - } - }, - "spec": { - "type": "object", - "properties": { - "accessModes": { - "type": "array", - "items": { - "type": "string" - } - }, - "resources": { - "type": "object", - "properties": { - "requests": { - "type": "object", - "properties": { - "storage": { - "type": "string" - } - } - } - } - }, - "storageClassName": { - "type": "string" - } - } - } - } - }, - "app.JSONData1": { - "type": "object", - "properties": { - "apiVersion": { - "type": "string" - }, - "kind": { - "type": "string" - }, - "metadata": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - }, - "spec": { - "type": "object", - "properties": { - "accessModes": { - "type": "array", - "items": { - "type": "string" - } - }, - "capacity": { - "type": "object", - "properties": { - "storage": { - "type": "string" - } - } - }, - "nfs": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "server": { - "type": "string" - } - } - }, - "volumeMode": { - "type": "string" - } - } - } - } - }, - "app.Label": { - "type": "object", - "properties": { - "create_time": { - "type": "string" - }, - "label_id": { - "type": "integer" - }, - "label_name": { - "type": "string" - }, - "label_type": { - "type": "string" - }, - "label_type_id": { - "type": "integer" - }, - "update_time": { - "type": "string" - } - } - }, - "app.LabelType": { - "type": "object", - "properties": { - "label_type": { - "type": "string" - }, - "label_type_id": { - "type": "integer" - }, - "multi_check": { - "type": "boolean" - } - } - }, - "app.Namespace": { - "type": "object", - "properties": { - "age": { - "type": "string" - }, - "alias": { - "type": "string" - }, - "available_pod_num": { - "type": "integer" - }, - "clusters": { - "type": "array", - "items": { - "type": "string" - } - }, - "cross_domain": { - "type": "boolean" - }, - "deployments": { - "type": "array", - "items": { - "type": "string" - } - }, - "describe": { - "type": "string" - }, - "domains": { - "type": "array", - "items": { - "$ref": "#/definitions/app.Domain" - } - }, - "ns_name": { - "type": "string" - }, - "require_pod_num": { - "type": "integer" - }, - "state": { - "type": "string" - }, - "templateId": { - "type": "string" - } - } - }, - "app.OverridePolicy": { - "type": "object", - "properties": { - "kind": { - "type": "string" - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "replica_division_preference": { - "type": "string" - }, - "replica_scheduling_type": { - "type": "string" - }, - "resource_name": { - "type": "string" - } - } - }, - "app.PersistentVolume1": { - "type": "object", - "properties": { - "clusterName": { - "type": "array", - "items": { - "type": "string" - } - }, - "persistentVolume": { - "$ref": "#/definitions/app.JSONData1" - }, - "templateId": { - "type": "string" - } - } - }, - "app.PersistentVolumeClaim1": { - "type": "object", - "properties": { - "clusterName": { - "type": "array", - "items": { - "type": "string" - } - }, - "persistentVolumeClaim": { - "$ref": "#/definitions/app.JSONData" - }, - "templateId": { - "type": "string" - } - } - }, - "app.Pod": { - "type": "object", - "properties": { - "IP": { - "type": "string" - }, - "age": { - "type": "string" - }, - "alias_name": { - "type": "string" - }, - "cluster_name": { - "type": "string" - }, - "container_image": { - "type": "string" - }, - "container_name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "domain_name": { - "type": "string" - }, - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "node": { - "type": "string" - }, - "page_num": { - "type": "string" - }, - "page_size": { - "type": "string" - }, - "ready": { - "type": "string" - }, - "restarts": { - "type": "integer" - }, - "status": { - "type": "string" - }, - "template_id": { - "type": "string" - } - } - }, - "app.PropagationPolicyTemplate": { - "type": "object", - "properties": { - "cluster_preference": { - "type": "string" - }, - "division_preference": { - "type": "string" - }, - "labels": { - "type": "string" - }, - "schedule_type": { - "type": "string" - }, - "template_id": { - "type": "integer" - }, - "template_name": { - "type": "string" - } - } - }, - "app.ProxyCluster": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "domain_id": { - "type": "string" - }, - "memberClusterIp": { - "type": "string" - }, - "member_name": { - "type": "string" - } - } - }, - "app.RedeployParam": { - "type": "object", - "properties": { - "clusterName": { - "type": "string" - }, - "deploymentName": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "num": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - } -}` - -// SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = &swag.Spec{ - Version: "1.0", - Host: "", - BasePath: "", - Schemes: []string{}, - Title: "jcc调度中心", - Description: "jcc", - InfoInstanceName: "swagger", - SwaggerTemplate: docTemplate, -} - -func init() { - swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) -} diff --git a/docs/swagger.json b/docs/swagger.json deleted file mode 100644 index 1465280..0000000 --- a/docs/swagger.json +++ /dev/null @@ -1,3057 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "description": "jcc", - "title": "jcc调度中心", - "contact": {}, - "version": "1.0" - }, - "paths": { - "/api/v1/OverridePolicy/create": { - "post": { - "description": "创建override策略列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "overridePolicy" - ], - "summary": "创建override策略列表", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.OverridePolicy" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/createCluster": { - "post": { - "description": "集群注册", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "集群注册", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.ClusterParam" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/cluster/join": { - "post": { - "description": "新集群加入联邦", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "新集群加入联邦", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "member_name", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/list": { - "get": { - "description": "查询集群列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "查询集群列表", - "parameters": [ - { - "type": "integer", - "description": "页码", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/listByDomain": { - "post": { - "description": "根据项目名称、工作负载、域id查询集群", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "根据项目名称、工作负载、域id查询集群", - "parameters": [ - { - "type": "string", - "description": "项目名称", - "name": "namespace", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "工作负载", - "name": "deployment_name", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "域id", - "name": "domain_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/listFree": { - "get": { - "description": "查询自建集群列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "查询自建集群列表", - "parameters": [ - { - "type": "string", - "description": "页码", - "name": "pageNum", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "每页数量", - "name": "pageSize", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/cluster/listWithLabel": { - "get": { - "description": "查询有标签的集群列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "查询有标签的集群列表", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "cluster_name", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "页码", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/proxyJoinCluster": { - "post": { - "description": "代理模式加入集群", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "代理模式加入集群", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.ProxyCluster" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/tag": { - "post": { - "description": "集群打标签", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "集群打标签", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Cluster" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/unJoin": { - "delete": { - "description": "刪除集群", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "刪除集群", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "cluster_name", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "域id", - "name": "domain_id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/unTag": { - "post": { - "description": "集群删除标签", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "集群删除标签", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Cluster" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/cluster/{clusterName}": { - "get": { - "description": "查询集群是否存在", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "cluster" - ], - "summary": "查询集群是否存在", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/deployment/autoScaling": { - "post": { - "description": "弹性伸缩", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "弹性伸缩", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.HPAParam" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/deployment/create": { - "post": { - "description": "创建工作负载", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "创建工作负载", - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/deployment/delete/{namespace}/{name}": { - "delete": { - "description": "删除工作负载", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "删除工作负载", - "parameters": [ - { - "type": "string", - "description": "项目名称", - "name": "namespace", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "负载名称", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/deployment/deployments/redeploy": { - "patch": { - "description": "重新部署", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "重新部署", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.RedeployParam" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/deployment/describe": { - "get": { - "description": "查询工作负载列表(所有集群)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "查询工作负载列表(所有集群)", - "parameters": [ - { - "type": "string", - "description": "项目名称", - "name": "namespace", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "负载名称", - "name": "deploy_name", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/deployment/getMetrics": { - "get": { - "description": "获取部署监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "获取部署监控", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "namespace", - "name": "namespace", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "部署名称", - "name": "deployment", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "类型", - "name": "queryType", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/deployment/hpa": { - "get": { - "description": "获取弹性伸缩信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "获取弹性伸缩信息", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "命名空间", - "name": "namespace", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "deployName", - "name": "deployName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/deployment/list": { - "get": { - "description": "根据查询工作负载列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "deployment" - ], - "summary": "根据查询工作负载列表", - "parameters": [ - { - "type": "string", - "description": "项目名称", - "name": "namespace", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "页码 ", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/domain/create": { - "post": { - "description": "创建域", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "domain" - ], - "summary": "创建域", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Domain" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/domain/describe": { - "get": { - "description": "获取域的详细信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "domain" - ], - "summary": "获取域的详细信息", - "parameters": [ - { - "type": "string", - "description": "domainId", - "name": "domain_id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "命名空间", - "name": "namespace", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/domain/list": { - "get": { - "description": "查询Domain列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "domain" - ], - "summary": "查询Domain列表", - "parameters": [ - { - "type": "string", - "description": "domain名称", - "name": "domain_name", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/domain/listByDeployment": { - "get": { - "description": "根据项目名称和工作负载查询域列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "domain" - ], - "summary": "根据项目名称和工作负载查询域列表", - "parameters": [ - { - "type": "string", - "description": "工作负载", - "name": "deployment_name", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "命名空间", - "name": "namespace", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/label/create": { - "post": { - "description": "创建域标", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "label" - ], - "summary": "创建域标", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Label" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/label/delete": { - "delete": { - "description": "删除域标", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "label" - ], - "summary": "删除域标", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Label" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/label/list": { - "post": { - "description": "查询域标列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "label" - ], - "summary": "查询域标列表", - "parameters": [ - { - "type": "string", - "description": "标签名", - "name": "label_name", - "in": "query" - }, - { - "type": "string", - "description": "页码 ", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/label/update": { - "post": { - "description": "更新域标", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "label" - ], - "summary": "更新域标", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Label" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/labelType/create": { - "post": { - "description": "创建域标类型", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "labelType" - ], - "summary": "创建域标类型", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.LabelType" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/labelType/delete": { - "delete": { - "description": "创建域标类型", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "labelType" - ], - "summary": "删除域标类型", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.LabelType" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/labelType/list": { - "get": { - "description": "查询域标类型", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "labelType" - ], - "summary": "查询域标类型", - "parameters": [ - { - "type": "string", - "description": "标签类型", - "name": "label_type", - "in": "query" - }, - { - "type": "string", - "description": "页码 ", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/labelType/update": { - "post": { - "description": "更新域标类型", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "labelType" - ], - "summary": "更新域标类型", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.LabelType" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/namespace/create": { - "post": { - "description": "创建命名空间(项目)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "创建命名空间(项目)", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Namespace" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/namespace/describe": { - "get": { - "description": "查询Namespace详情", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "查询Namespace详情", - "parameters": [ - { - "type": "string", - "description": "命名空间", - "name": "namespace", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/namespace/getBatchMetrics": { - "get": { - "description": "批量获取namespace监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "批量获取namespace监控", - "parameters": [ - { - "type": "string", - "description": "集群名", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "逗号分隔多个命名空间名称", - "name": "namespaces", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/namespace/getMetrics": { - "get": { - "description": "namespace监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "namespace监控", - "parameters": [ - { - "type": "string", - "description": "集群名", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "命名空间名称", - "name": "namespace", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/namespace/list": { - "get": { - "description": "查询Namespace列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "查询Namespace列表", - "parameters": [ - { - "type": "string", - "description": "页码 ", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/namespace/update": { - "post": { - "description": "更新命名空间(项目)", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "更新命名空间(项目)", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Namespace" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/node/detail/{clusterName}/{namespace}/{podName}": { - "get": { - "description": "根据集群名称 命名空间 pod名称查询节点信息", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "node" - ], - "summary": "根据集群名称 命名空间 pod名称查询节点信息", - "parameters": [ - { - "type": "string", - "description": "集群名", - "name": "clusterName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名", - "name": "namespace", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Pod名", - "name": "podName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/node/edge/{clusterName}": { - "get": { - "description": "查询边缘节点列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "node" - ], - "summary": "查询边缘节点列表", - "parameters": [ - { - "type": "string", - "description": "集群名", - "name": "clusterName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/node/getNodeMetrics1h": { - "get": { - "description": "获取集群节点1h监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "node" - ], - "summary": "获取集群节点1h监控", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "节点名称", - "name": "nodeName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/node/getNodeMetrics8h": { - "get": { - "description": "获取集群节点8h监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "node" - ], - "summary": "获取集群节点8h监控", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "节点名称", - "name": "nodeName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/node/list/{clusterName}": { - "get": { - "description": "查询节点列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "node" - ], - "summary": "查询节点列表", - "parameters": [ - { - "type": "string", - "description": "集群名", - "name": "clusterName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/node/metrics/{clusterName}": { - "get": { - "description": "查询边缘节点指标", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "node" - ], - "summary": "查询边缘节点指标", - "parameters": [ - { - "type": "string", - "description": "集群名", - "name": "clusterName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/overridePolicy/list": { - "get": { - "description": "查询重写策略列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "overridePolicy" - ], - "summary": "查询重写策略列表", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.OverridePolicy" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/overview/getApiServerMetrics": { - "get": { - "description": "获取ApiServer请求数和请求延迟", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "overview" - ], - "summary": "获取ApiServer请求数和请求延迟", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/overview/getClusterMetrics": { - "get": { - "description": "获取容器集群资源监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "overview" - ], - "summary": "获取容器集群资源监控", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/overview/getNodeMetrics": { - "get": { - "description": "获取容器节点资源监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "overview" - ], - "summary": "获取容器节点资源监控", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/overview/getScheduleMetrics": { - "get": { - "description": "获取容器集群调度器监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "overview" - ], - "summary": "获取容器集群调度器监控", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/pod/all": { - "get": { - "description": "根据指定集群查询Pod列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "根据指定集群查询Pod列表", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "pageNum", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "pageSize", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/pod/create": { - "post": { - "description": "创建容器组", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "创建容器组", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Pod" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/pod/delete/{namespace}/{name}": { - "delete": { - "description": "删除容器组", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "删除容器组", - "parameters": [ - { - "type": "string", - "description": "命名空间名", - "name": "namespace", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Pod名", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/pod/detail": { - "put": { - "description": "获取容器组详情", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "获取容器组详情", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Pod" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/pod/detail/{clusterName}/{namespace}/{name}": { - "get": { - "description": "根据指定集群查询Pod详情", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "根据指定集群查询Pod详情", - "parameters": [ - { - "type": "string", - "description": "集群名", - "name": "clusterName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间名 ", - "name": "namespace", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "pod名", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/pod/list": { - "get": { - "description": "根据指定集群查询Pod列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "根据指定集群查询Pod列表", - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/pod/metrics": { - "get": { - "description": "获取容器组监控", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "获取容器组监控", - "parameters": [ - { - "type": "string", - "description": "集群名称", - "name": "clusterName", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "容器组名称", - "name": "podName", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/pod/metrics/{clusterName}/{namespace}/{name}": { - "get": { - "description": "根据集群名称、命名空间和pod名称查询pod使用率", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "根据集群名称、命名空间和pod名称查询pod使用率", - "parameters": [ - { - "type": "string", - "description": "项目名称", - "name": "namespace", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "集群 ", - "name": "clusterName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "名称", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/pod/updatePod": { - "put": { - "description": "更新容器组", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "pod" - ], - "summary": "更新容器组", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.Pod" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/propagationPolicy/list": { - "get": { - "description": "查询分发策略模板", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "propagationPolicy" - ], - "summary": "查询分发策略模板", - "parameters": [ - { - "type": "string", - "description": "标签Key", - "name": "label_key", - "in": "query" - }, - { - "type": "string", - "description": "标签Value", - "name": "label_value", - "in": "query" - }, - { - "type": "string", - "description": "policy_name", - "name": "policy_name", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/propagationPolicyTemplate/create": { - "post": { - "description": "创建策略模板", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "propagationPolicyTemplate" - ], - "summary": "创建策略模板", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.PropagationPolicyTemplate" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/propagationPolicyTemplate/delete": { - "post": { - "description": "删除策略模板", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "propagationPolicyTemplate" - ], - "summary": "删除策略模板", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.PropagationPolicyTemplate" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/propagationPolicyTemplate/list": { - "get": { - "description": "查询分发策略模板", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "propagationPolicyTemplate" - ], - "summary": "查询分发策略模板", - "parameters": [ - { - "type": "string", - "description": "模板名称", - "name": "template_name", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "pageNum", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "每页数量", - "name": "pageSize", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/propagationPolicyTemplate/update": { - "post": { - "description": "更新策略模板", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "propagationPolicyTemplate" - ], - "summary": "更新策略模板", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.PropagationPolicyTemplate" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/service/create": { - "post": { - "description": "创建服务", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "service" - ], - "summary": "创建服务", - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/sphere/getOverallMetrics": { - "get": { - "description": "获取大球监控数据", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "namespace" - ], - "summary": "获取大球监控数据", - "responses": { - "200": { - "description": "OK" - }, - "400": { - "description": "Bad Request" - } - } - } - }, - "/api/v1/storage/pv": { - "post": { - "description": "创建PV", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "storage" - ], - "summary": "创建PV", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.PersistentVolume1" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/storage/pv/{clusterName}": { - "get": { - "description": "查询PV列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "storage" - ], - "summary": "查询PV列表", - "parameters": [ - { - "type": "string", - "description": "集群", - "name": "clusterName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - }, - "/api/v1/storage/pvc": { - "get": { - "description": "查询PVC列表", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "storage" - ], - "summary": "查询PVC列表", - "parameters": [ - { - "type": "string", - "description": "集群", - "name": "clusterName", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "命名空间", - "name": "namespace", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - }, - "post": { - "description": "创建PVC", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "storage" - ], - "summary": "创建PVC", - "parameters": [ - { - "description": "json", - "name": "param", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/app.PersistentVolumeClaim1" - } - } - ], - "responses": { - "200": { - "description": "OK" - }, - "500": { - "description": "Internal Server Error" - } - } - } - } - }, - "definitions": { - "app.Cluster": { - "type": "object", - "properties": { - "cluster_name": { - "type": "string" - }, - "create_time": { - "type": "string" - }, - "description": { - "type": "string" - }, - "domain_id": { - "type": "integer" - }, - "domain_name": { - "type": "string" - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mode": { - "type": "string" - }, - "node_num": { - "type": "integer" - }, - "state": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "app.ClusterParam": { - "type": "object", - "properties": { - "clusterName": { - "type": "string" - }, - "masterNodes": { - "type": "array", - "items": { - "type": "string" - } - }, - "memberNodes": { - "type": "array", - "items": { - "type": "string" - } - }, - "userName": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "app.Domain": { - "type": "object", - "properties": { - "clusters": { - "type": "array", - "items": { - "type": "string" - } - }, - "cpu_rate": { - "type": "number" - }, - "deployments": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "domain_id": { - "type": "integer" - }, - "domain_name": { - "type": "string" - }, - "labelId": { - "type": "array", - "items": { - "type": "integer" - } - }, - "label_type": { - "type": "string" - }, - "labels": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "location": { - "type": "array", - "items": { - "type": "number" - } - }, - "memory_rate": { - "type": "number" - } - } - }, - "app.HPAParam": { - "type": "object", - "properties": { - "HPAName": { - "type": "string" - }, - "clusterName": { - "type": "string" - }, - "cpuTargetUtilization": { - "type": "string" - }, - "maxReplicas": { - "type": "integer" - }, - "memoryTargetValue": { - "type": "string" - }, - "minReplicas": { - "type": "integer" - }, - "namespace": { - "type": "string" - } - } - }, - "app.JSONData": { - "type": "object", - "properties": { - "apiVersion": { - "type": "string" - }, - "kind": { - "type": "string" - }, - "metadata": { - "type": "object", - "properties": { - "annotations": { - "type": "object", - "properties": { - "kubesphere.io/creator": { - "type": "string" - } - } - }, - "labels": { - "type": "object" - }, - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - } - } - }, - "spec": { - "type": "object", - "properties": { - "accessModes": { - "type": "array", - "items": { - "type": "string" - } - }, - "resources": { - "type": "object", - "properties": { - "requests": { - "type": "object", - "properties": { - "storage": { - "type": "string" - } - } - } - } - }, - "storageClassName": { - "type": "string" - } - } - } - } - }, - "app.JSONData1": { - "type": "object", - "properties": { - "apiVersion": { - "type": "string" - }, - "kind": { - "type": "string" - }, - "metadata": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - }, - "spec": { - "type": "object", - "properties": { - "accessModes": { - "type": "array", - "items": { - "type": "string" - } - }, - "capacity": { - "type": "object", - "properties": { - "storage": { - "type": "string" - } - } - }, - "nfs": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "server": { - "type": "string" - } - } - }, - "volumeMode": { - "type": "string" - } - } - } - } - }, - "app.Label": { - "type": "object", - "properties": { - "create_time": { - "type": "string" - }, - "label_id": { - "type": "integer" - }, - "label_name": { - "type": "string" - }, - "label_type": { - "type": "string" - }, - "label_type_id": { - "type": "integer" - }, - "update_time": { - "type": "string" - } - } - }, - "app.LabelType": { - "type": "object", - "properties": { - "label_type": { - "type": "string" - }, - "label_type_id": { - "type": "integer" - }, - "multi_check": { - "type": "boolean" - } - } - }, - "app.Namespace": { - "type": "object", - "properties": { - "age": { - "type": "string" - }, - "alias": { - "type": "string" - }, - "available_pod_num": { - "type": "integer" - }, - "clusters": { - "type": "array", - "items": { - "type": "string" - } - }, - "cross_domain": { - "type": "boolean" - }, - "deployments": { - "type": "array", - "items": { - "type": "string" - } - }, - "describe": { - "type": "string" - }, - "domains": { - "type": "array", - "items": { - "$ref": "#/definitions/app.Domain" - } - }, - "ns_name": { - "type": "string" - }, - "require_pod_num": { - "type": "integer" - }, - "state": { - "type": "string" - }, - "templateId": { - "type": "string" - } - } - }, - "app.OverridePolicy": { - "type": "object", - "properties": { - "kind": { - "type": "string" - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "replica_division_preference": { - "type": "string" - }, - "replica_scheduling_type": { - "type": "string" - }, - "resource_name": { - "type": "string" - } - } - }, - "app.PersistentVolume1": { - "type": "object", - "properties": { - "clusterName": { - "type": "array", - "items": { - "type": "string" - } - }, - "persistentVolume": { - "$ref": "#/definitions/app.JSONData1" - }, - "templateId": { - "type": "string" - } - } - }, - "app.PersistentVolumeClaim1": { - "type": "object", - "properties": { - "clusterName": { - "type": "array", - "items": { - "type": "string" - } - }, - "persistentVolumeClaim": { - "$ref": "#/definitions/app.JSONData" - }, - "templateId": { - "type": "string" - } - } - }, - "app.Pod": { - "type": "object", - "properties": { - "IP": { - "type": "string" - }, - "age": { - "type": "string" - }, - "alias_name": { - "type": "string" - }, - "cluster_name": { - "type": "string" - }, - "container_image": { - "type": "string" - }, - "container_name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "domain_name": { - "type": "string" - }, - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "node": { - "type": "string" - }, - "page_num": { - "type": "string" - }, - "page_size": { - "type": "string" - }, - "ready": { - "type": "string" - }, - "restarts": { - "type": "integer" - }, - "status": { - "type": "string" - }, - "template_id": { - "type": "string" - } - } - }, - "app.PropagationPolicyTemplate": { - "type": "object", - "properties": { - "cluster_preference": { - "type": "string" - }, - "division_preference": { - "type": "string" - }, - "labels": { - "type": "string" - }, - "schedule_type": { - "type": "string" - }, - "template_id": { - "type": "integer" - }, - "template_name": { - "type": "string" - } - } - }, - "app.ProxyCluster": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "domain_id": { - "type": "string" - }, - "memberClusterIp": { - "type": "string" - }, - "member_name": { - "type": "string" - } - } - }, - "app.RedeployParam": { - "type": "object", - "properties": { - "clusterName": { - "type": "string" - }, - "deploymentName": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "num": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - } -} \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/swagger.yaml deleted file mode 100644 index 4967998..0000000 --- a/docs/swagger.yaml +++ /dev/null @@ -1,2010 +0,0 @@ -definitions: - app.Cluster: - properties: - cluster_name: - type: string - create_time: - type: string - description: - type: string - domain_id: - type: integer - domain_name: - type: string - labels: - additionalProperties: - type: string - type: object - mode: - type: string - node_num: - type: integer - state: - type: string - version: - type: string - type: object - app.ClusterParam: - properties: - clusterName: - type: string - masterNodes: - items: - type: string - type: array - memberNodes: - items: - type: string - type: array - userName: - type: string - version: - type: string - type: object - app.Domain: - properties: - clusters: - items: - type: string - type: array - cpu_rate: - type: number - deployments: - items: - type: string - type: array - description: - type: string - domain_id: - type: integer - domain_name: - type: string - label_type: - type: string - labelId: - items: - type: integer - type: array - labels: - items: - additionalProperties: - type: string - type: object - type: array - location: - items: - type: number - type: array - memory_rate: - type: number - type: object - app.HPAParam: - properties: - HPAName: - type: string - clusterName: - type: string - cpuTargetUtilization: - type: string - maxReplicas: - type: integer - memoryTargetValue: - type: string - minReplicas: - type: integer - namespace: - type: string - type: object - app.JSONData: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - properties: - annotations: - properties: - kubesphere.io/creator: - type: string - type: object - labels: - type: object - name: - type: string - namespace: - type: string - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - resources: - properties: - requests: - properties: - storage: - type: string - type: object - type: object - storageClassName: - type: string - type: object - type: object - app.JSONData1: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - properties: - name: - type: string - type: object - spec: - properties: - accessModes: - items: - type: string - type: array - capacity: - properties: - storage: - type: string - type: object - nfs: - properties: - path: - type: string - server: - type: string - type: object - volumeMode: - type: string - type: object - type: object - app.Label: - properties: - create_time: - type: string - label_id: - type: integer - label_name: - type: string - label_type: - type: string - label_type_id: - type: integer - update_time: - type: string - type: object - app.LabelType: - properties: - label_type: - type: string - label_type_id: - type: integer - multi_check: - type: boolean - type: object - app.Namespace: - properties: - age: - type: string - alias: - type: string - available_pod_num: - type: integer - clusters: - items: - type: string - type: array - cross_domain: - type: boolean - deployments: - items: - type: string - type: array - describe: - type: string - domains: - items: - $ref: '#/definitions/app.Domain' - type: array - ns_name: - type: string - require_pod_num: - type: integer - state: - type: string - templateId: - type: string - type: object - app.OverridePolicy: - properties: - kind: - type: string - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - replica_division_preference: - type: string - replica_scheduling_type: - type: string - resource_name: - type: string - type: object - app.PersistentVolume1: - properties: - clusterName: - items: - type: string - type: array - persistentVolume: - $ref: '#/definitions/app.JSONData1' - templateId: - type: string - type: object - app.PersistentVolumeClaim1: - properties: - clusterName: - items: - type: string - type: array - persistentVolumeClaim: - $ref: '#/definitions/app.JSONData' - templateId: - type: string - type: object - app.Pod: - properties: - IP: - type: string - age: - type: string - alias_name: - type: string - cluster_name: - type: string - container_image: - type: string - container_name: - type: string - description: - type: string - domain_name: - type: string - name: - type: string - namespace: - type: string - node: - type: string - page_num: - type: string - page_size: - type: string - ready: - type: string - restarts: - type: integer - status: - type: string - template_id: - type: string - type: object - app.PropagationPolicyTemplate: - properties: - cluster_preference: - type: string - division_preference: - type: string - labels: - type: string - schedule_type: - type: string - template_id: - type: integer - template_name: - type: string - type: object - app.ProxyCluster: - properties: - description: - type: string - domain_id: - type: string - member_name: - type: string - memberClusterIp: - type: string - type: object - app.RedeployParam: - properties: - clusterName: - type: string - deploymentName: - type: string - namespace: - type: string - num: - type: string - type: - type: string - type: object -info: - contact: {} - description: jcc - title: jcc调度中心 - version: "1.0" -paths: - /api/v1/OverridePolicy/create: - post: - consumes: - - application/json - description: 创建override策略列表 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.OverridePolicy' - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 创建override策略列表 - tags: - - overridePolicy - /api/v1/cluster/{clusterName}: - get: - consumes: - - application/json - description: 查询集群是否存在 - parameters: - - description: 集群名称 - in: path - name: clusterName - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 查询集群是否存在 - tags: - - cluster - /api/v1/cluster/createCluster: - post: - consumes: - - application/json - description: 集群注册 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.ClusterParam' - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 集群注册 - tags: - - cluster - /api/v1/cluster/join: - post: - consumes: - - application/json - description: 新集群加入联邦 - parameters: - - description: 集群名称 - in: query - name: member_name - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 新集群加入联邦 - tags: - - cluster - /api/v1/cluster/list: - get: - consumes: - - application/json - description: 查询集群列表 - parameters: - - description: 页码 - in: query - name: pageNum - required: true - type: integer - - description: 每页数量 - in: query - name: pageSize - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 查询集群列表 - tags: - - cluster - /api/v1/cluster/listByDomain: - post: - consumes: - - application/json - description: 根据项目名称、工作负载、域id查询集群 - parameters: - - description: 项目名称 - in: path - name: namespace - required: true - type: string - - description: 工作负载 - in: path - name: deployment_name - required: true - type: string - - description: 域id - in: path - name: domain_id - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 根据项目名称、工作负载、域id查询集群 - tags: - - cluster - /api/v1/cluster/listFree: - get: - consumes: - - application/json - description: 查询自建集群列表 - parameters: - - description: 页码 - in: path - name: pageNum - required: true - type: string - - description: 每页数量 - in: path - name: pageSize - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 查询自建集群列表 - tags: - - cluster - /api/v1/cluster/listWithLabel: - get: - consumes: - - application/json - description: 查询有标签的集群列表 - parameters: - - description: 集群名称 - in: query - name: cluster_name - required: true - type: string - - description: 页码 - in: query - name: pageNum - required: true - type: integer - - description: 每页数量 - in: query - name: pageSize - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 查询有标签的集群列表 - tags: - - cluster - /api/v1/cluster/proxyJoinCluster: - post: - consumes: - - application/json - description: 代理模式加入集群 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.ProxyCluster' - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 代理模式加入集群 - tags: - - cluster - /api/v1/cluster/tag: - post: - consumes: - - application/json - description: 集群打标签 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.Cluster' - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 集群打标签 - tags: - - cluster - /api/v1/cluster/unJoin: - delete: - consumes: - - application/json - description: 刪除集群 - parameters: - - description: 集群名称 - in: query - name: cluster_name - required: true - type: string - - description: 域id - in: query - name: domain_id - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 刪除集群 - tags: - - cluster - /api/v1/cluster/unTag: - post: - consumes: - - application/json - description: 集群删除标签 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.Cluster' - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 集群删除标签 - tags: - - cluster - /api/v1/deployment/autoScaling: - post: - consumes: - - application/json - description: 弹性伸缩 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.HPAParam' - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 弹性伸缩 - tags: - - deployment - /api/v1/deployment/create: - post: - consumes: - - application/json - description: 创建工作负载 - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 创建工作负载 - tags: - - deployment - /api/v1/deployment/delete/{namespace}/{name}: - delete: - consumes: - - application/json - description: 删除工作负载 - parameters: - - description: 项目名称 - in: path - name: namespace - required: true - type: string - - description: 负载名称 - in: path - name: name - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 删除工作负载 - tags: - - deployment - /api/v1/deployment/deployments/redeploy: - patch: - consumes: - - application/json - description: 重新部署 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.RedeployParam' - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 重新部署 - tags: - - deployment - /api/v1/deployment/describe: - get: - consumes: - - application/json - description: 查询工作负载列表(所有集群) - parameters: - - description: 项目名称 - in: query - name: namespace - required: true - type: string - - description: 负载名称 - in: query - name: deploy_name - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 查询工作负载列表(所有集群) - tags: - - deployment - /api/v1/deployment/getMetrics: - get: - consumes: - - application/json - description: 获取部署监控 - parameters: - - description: 集群名称 - in: query - name: clusterName - required: true - type: string - - description: namespace - in: query - name: namespace - required: true - type: string - - description: 部署名称 - in: query - name: deployment - required: true - type: string - - description: 类型 - in: query - name: queryType - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 获取部署监控 - tags: - - deployment - /api/v1/deployment/hpa: - get: - consumes: - - application/json - description: 获取弹性伸缩信息 - parameters: - - description: 集群名称 - in: query - name: clusterName - required: true - type: string - - description: 命名空间 - in: query - name: namespace - required: true - type: string - - description: deployName - in: query - name: deployName - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 获取弹性伸缩信息 - tags: - - deployment - /api/v1/deployment/list: - get: - consumes: - - application/json - description: 根据查询工作负载列表 - parameters: - - description: 项目名称 - in: query - name: namespace - required: true - type: string - - description: '页码 ' - in: query - name: pageNum - required: true - type: string - - description: 每页数量 - in: query - name: pageSize - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 根据查询工作负载列表 - tags: - - deployment - /api/v1/domain/create: - post: - consumes: - - application/json - description: 创建域 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.Domain' - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 创建域 - tags: - - domain - /api/v1/domain/describe: - get: - consumes: - - application/json - description: 获取域的详细信息 - parameters: - - description: domainId - in: query - name: domain_id - required: true - type: string - - description: 命名空间 - in: query - name: namespace - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 获取域的详细信息 - tags: - - domain - /api/v1/domain/list: - get: - consumes: - - application/json - description: 查询Domain列表 - parameters: - - description: domain名称 - in: query - name: domain_name - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 查询Domain列表 - tags: - - domain - /api/v1/domain/listByDeployment: - get: - consumes: - - application/json - description: 根据项目名称和工作负载查询域列表 - parameters: - - description: 工作负载 - in: query - name: deployment_name - required: true - type: string - - description: 命名空间 - in: query - name: namespace - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 根据项目名称和工作负载查询域列表 - tags: - - domain - /api/v1/label/create: - post: - consumes: - - application/json - description: 创建域标 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.Label' - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 创建域标 - tags: - - label - /api/v1/label/delete: - delete: - consumes: - - application/json - description: 删除域标 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.Label' - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 删除域标 - tags: - - label - /api/v1/label/list: - post: - consumes: - - application/json - description: 查询域标列表 - parameters: - - description: 标签名 - in: query - name: label_name - type: string - - description: '页码 ' - in: query - name: pageNum - required: true - type: string - - description: 每页数量 - in: query - name: pageSize - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 查询域标列表 - tags: - - label - /api/v1/label/update: - post: - consumes: - - application/json - description: 更新域标 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.Label' - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 更新域标 - tags: - - label - /api/v1/labelType/create: - post: - consumes: - - application/json - description: 创建域标类型 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.LabelType' - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 创建域标类型 - tags: - - labelType - /api/v1/labelType/delete: - delete: - consumes: - - application/json - description: 创建域标类型 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.LabelType' - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 删除域标类型 - tags: - - labelType - /api/v1/labelType/list: - get: - consumes: - - application/json - description: 查询域标类型 - parameters: - - description: 标签类型 - in: query - name: label_type - type: string - - description: '页码 ' - in: query - name: pageNum - required: true - type: string - - description: 每页数量 - in: query - name: pageSize - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 查询域标类型 - tags: - - labelType - /api/v1/labelType/update: - post: - consumes: - - application/json - description: 更新域标类型 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.LabelType' - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 更新域标类型 - tags: - - labelType - /api/v1/namespace/create: - post: - consumes: - - application/json - description: 创建命名空间(项目) - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.Namespace' - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 创建命名空间(项目) - tags: - - namespace - /api/v1/namespace/describe: - get: - consumes: - - application/json - description: 查询Namespace详情 - parameters: - - description: 命名空间 - in: query - name: namespace - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 查询Namespace详情 - tags: - - namespace - /api/v1/namespace/getBatchMetrics: - get: - consumes: - - application/json - description: 批量获取namespace监控 - parameters: - - description: 集群名 - in: query - name: clusterName - required: true - type: string - - description: 逗号分隔多个命名空间名称 - in: query - name: namespaces - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 批量获取namespace监控 - tags: - - namespace - /api/v1/namespace/getMetrics: - get: - consumes: - - application/json - description: namespace监控 - parameters: - - description: 集群名 - in: query - name: clusterName - required: true - type: string - - description: 命名空间名称 - in: query - name: namespace - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: namespace监控 - tags: - - namespace - /api/v1/namespace/list: - get: - consumes: - - application/json - description: 查询Namespace列表 - parameters: - - description: '页码 ' - in: query - name: pageNum - required: true - type: string - - description: 每页数量 - in: query - name: pageSize - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 查询Namespace列表 - tags: - - namespace - /api/v1/namespace/update: - post: - consumes: - - application/json - description: 更新命名空间(项目) - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.Namespace' - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 更新命名空间(项目) - tags: - - namespace - /api/v1/node/detail/{clusterName}/{namespace}/{podName}: - get: - consumes: - - application/json - description: 根据集群名称 命名空间 pod名称查询节点信息 - parameters: - - description: 集群名 - in: path - name: clusterName - required: true - type: string - - description: 命名空间名 - in: path - name: namespace - required: true - type: string - - description: Pod名 - in: path - name: podName - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 根据集群名称 命名空间 pod名称查询节点信息 - tags: - - node - /api/v1/node/edge/{clusterName}: - get: - consumes: - - application/json - description: 查询边缘节点列表 - parameters: - - description: 集群名 - in: path - name: clusterName - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 查询边缘节点列表 - tags: - - node - /api/v1/node/getNodeMetrics1h: - get: - consumes: - - application/json - description: 获取集群节点1h监控 - parameters: - - description: 集群名称 - in: query - name: clusterName - required: true - type: string - - description: 节点名称 - in: query - name: nodeName - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 获取集群节点1h监控 - tags: - - node - /api/v1/node/getNodeMetrics8h: - get: - consumes: - - application/json - description: 获取集群节点8h监控 - parameters: - - description: 集群名称 - in: query - name: clusterName - required: true - type: string - - description: 节点名称 - in: query - name: nodeName - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 获取集群节点8h监控 - tags: - - node - /api/v1/node/list/{clusterName}: - get: - consumes: - - application/json - description: 查询节点列表 - parameters: - - description: 集群名 - in: path - name: clusterName - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 查询节点列表 - tags: - - node - /api/v1/node/metrics/{clusterName}: - get: - consumes: - - application/json - description: 查询边缘节点指标 - parameters: - - description: 集群名 - in: path - name: clusterName - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 查询边缘节点指标 - tags: - - node - /api/v1/overridePolicy/list: - get: - consumes: - - application/json - description: 查询重写策略列表 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.OverridePolicy' - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 查询重写策略列表 - tags: - - overridePolicy - /api/v1/overview/getApiServerMetrics: - get: - consumes: - - application/json - description: 获取ApiServer请求数和请求延迟 - parameters: - - description: 集群名称 - in: query - name: clusterName - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 获取ApiServer请求数和请求延迟 - tags: - - overview - /api/v1/overview/getClusterMetrics: - get: - consumes: - - application/json - description: 获取容器集群资源监控 - parameters: - - description: 集群名称 - in: query - name: clusterName - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 获取容器集群资源监控 - tags: - - overview - /api/v1/overview/getNodeMetrics: - get: - consumes: - - application/json - description: 获取容器节点资源监控 - parameters: - - description: 集群名称 - in: query - name: clusterName - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 获取容器节点资源监控 - tags: - - overview - /api/v1/overview/getScheduleMetrics: - get: - consumes: - - application/json - description: 获取容器集群调度器监控 - parameters: - - description: 集群名称 - in: query - name: clusterName - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 获取容器集群调度器监控 - tags: - - overview - /api/v1/pod/all: - get: - consumes: - - application/json - description: 根据指定集群查询Pod列表 - parameters: - - description: 集群名称 - in: query - name: clusterName - required: true - type: string - - description: pageNum - in: query - name: pageNum - required: true - type: integer - - description: pageSize - in: query - name: pageSize - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 根据指定集群查询Pod列表 - tags: - - pod - /api/v1/pod/create: - post: - consumes: - - application/json - description: 创建容器组 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.Pod' - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 创建容器组 - tags: - - pod - /api/v1/pod/delete/{namespace}/{name}: - delete: - consumes: - - application/json - description: 删除容器组 - parameters: - - description: 命名空间名 - in: path - name: namespace - required: true - type: string - - description: Pod名 - in: path - name: name - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 删除容器组 - tags: - - pod - /api/v1/pod/detail: - put: - consumes: - - application/json - description: 获取容器组详情 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.Pod' - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 获取容器组详情 - tags: - - pod - /api/v1/pod/detail/{clusterName}/{namespace}/{name}: - get: - consumes: - - application/json - description: 根据指定集群查询Pod详情 - parameters: - - description: 集群名 - in: path - name: clusterName - required: true - type: string - - description: '命名空间名 ' - in: path - name: namespace - required: true - type: string - - description: pod名 - in: path - name: name - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 根据指定集群查询Pod详情 - tags: - - pod - /api/v1/pod/list: - get: - consumes: - - application/json - description: 根据指定集群查询Pod列表 - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 根据指定集群查询Pod列表 - tags: - - pod - /api/v1/pod/metrics: - get: - consumes: - - application/json - description: 获取容器组监控 - parameters: - - description: 集群名称 - in: query - name: clusterName - required: true - type: string - - description: 容器组名称 - in: query - name: podName - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 获取容器组监控 - tags: - - pod - /api/v1/pod/metrics/{clusterName}/{namespace}/{name}: - get: - consumes: - - application/json - description: 根据集群名称、命名空间和pod名称查询pod使用率 - parameters: - - description: 项目名称 - in: path - name: namespace - required: true - type: string - - description: '集群 ' - in: path - name: clusterName - required: true - type: string - - description: 名称 - in: path - name: name - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 根据集群名称、命名空间和pod名称查询pod使用率 - tags: - - pod - /api/v1/pod/updatePod: - put: - consumes: - - application/json - description: 更新容器组 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.Pod' - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 更新容器组 - tags: - - pod - /api/v1/propagationPolicy/list: - get: - consumes: - - application/json - description: 查询分发策略模板 - parameters: - - description: 标签Key - in: query - name: label_key - type: string - - description: 标签Value - in: query - name: label_value - type: string - - description: policy_name - in: query - name: policy_name - type: string - - description: 页码 - in: query - name: pageNum - required: true - type: integer - - description: 每页数量 - in: query - name: pageSize - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 查询分发策略模板 - tags: - - propagationPolicy - /api/v1/propagationPolicyTemplate/create: - post: - consumes: - - application/json - description: 创建策略模板 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.PropagationPolicyTemplate' - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 创建策略模板 - tags: - - propagationPolicyTemplate - /api/v1/propagationPolicyTemplate/delete: - post: - consumes: - - application/json - description: 删除策略模板 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.PropagationPolicyTemplate' - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 删除策略模板 - tags: - - propagationPolicyTemplate - /api/v1/propagationPolicyTemplate/list: - get: - consumes: - - application/json - description: 查询分发策略模板 - parameters: - - description: 模板名称 - in: query - name: template_name - type: string - - description: 页码 - in: query - name: pageNum - required: true - type: integer - - description: 每页数量 - in: query - name: pageSize - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 查询分发策略模板 - tags: - - propagationPolicyTemplate - /api/v1/propagationPolicyTemplate/update: - post: - consumes: - - application/json - description: 更新策略模板 - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.PropagationPolicyTemplate' - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 更新策略模板 - tags: - - propagationPolicyTemplate - /api/v1/service/create: - post: - consumes: - - application/json - description: 创建服务 - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 创建服务 - tags: - - service - /api/v1/sphere/getOverallMetrics: - get: - consumes: - - application/json - description: 获取大球监控数据 - produces: - - application/json - responses: - "200": - description: OK - "400": - description: Bad Request - summary: 获取大球监控数据 - tags: - - namespace - /api/v1/storage/pv: - post: - consumes: - - application/json - description: 创建PV - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.PersistentVolume1' - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 创建PV - tags: - - storage - /api/v1/storage/pv/{clusterName}: - get: - consumes: - - application/json - description: 查询PV列表 - parameters: - - description: 集群 - in: path - name: clusterName - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 查询PV列表 - tags: - - storage - /api/v1/storage/pvc: - get: - consumes: - - application/json - description: 查询PVC列表 - parameters: - - description: 集群 - in: path - name: clusterName - required: true - type: string - - description: 命名空间 - in: path - name: namespace - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 查询PVC列表 - tags: - - storage - post: - consumes: - - application/json - description: 创建PVC - parameters: - - description: json - in: body - name: param - required: true - schema: - $ref: '#/definitions/app.PersistentVolumeClaim1' - produces: - - application/json - responses: - "200": - description: OK - "500": - description: Internal Server Error - summary: 创建PVC - tags: - - storage -swagger: "2.0" diff --git a/etc/config/config.go b/etc/config/config.go new file mode 100644 index 0000000..f07701c --- /dev/null +++ b/etc/config/config.go @@ -0,0 +1,29 @@ +package config + +import ( + "github.com/spf13/viper" +) + +type ServerConfig struct { + Name string `mapstructure:"name"` + Port int `mapstructure:"port"` + Core Core `mapstructure:"core"` +} + +type Core struct { + url string `mapstructure:"url"` +} + +var ServerConf *ServerConfig + +func InitConfig() { + v := viper.New() + v.SetConfigFile("etc/config/config.yaml") + if err := v.ReadInConfig(); err != nil { + panic(err) + } + //serverConfig := ServerConfig{} + if err := v.Unmarshal(&ServerConf); err != nil { + panic(err) + } +} diff --git a/etc/config/config.yaml b/etc/config/config.yaml new file mode 100644 index 0000000..eb4bd6e --- /dev/null +++ b/etc/config/config.yaml @@ -0,0 +1,5 @@ +name: pcm-kubernetes +port: 8022 + +core: + url: localhost:8080 \ No newline at end of file diff --git a/go.mod b/go.mod index 7f8accd..d0ef6da 100644 --- a/go.mod +++ b/go.mod @@ -1,156 +1,83 @@ module jcc-schedule -go 1.18 +go 1.21 require ( - github.com/bitly/go-simplejson v0.5.0 github.com/gin-gonic/gin v1.8.1 - github.com/go-redis/redis/v8 v8.11.5 - github.com/go-sql-driver/mysql v1.7.0 - github.com/golang/glog v1.0.0 - github.com/jmoiron/sqlx v1.3.5 - github.com/karmada-io/karmada v1.3.0 - github.com/nacos-group/nacos-sdk-go v1.1.2 - github.com/opensearch-project/opensearch-go/v2 v2.1.0 + github.com/go-resty/resty/v2 v2.10.0 + github.com/golang/glog v1.1.2 + github.com/json-iterator/go v1.1.12 + github.com/prometheus/client_golang v1.18.0 + github.com/prometheus/common v0.45.0 github.com/robfig/cron/v3 v3.0.1 - github.com/shopspring/decimal v1.3.1 - github.com/sirupsen/logrus v1.8.1 - github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a - github.com/swaggo/gin-swagger v1.5.3 - github.com/swaggo/swag v1.8.5 - golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd - golang.org/x/exp v0.0.0-20221126150942-6ab00d035af9 - gopkg.in/yaml.v3 v3.0.1 - gorm.io/driver/mysql v1.5.1 - gorm.io/gorm v1.25.2-0.20230530020048-26663ab9bf55 - k8s.io/api v0.25.0 - k8s.io/apiextensions-apiserver v0.25.0 - k8s.io/apimachinery v0.25.0 - k8s.io/client-go v0.25.0 - k8s.io/metrics v0.24.2 - sigs.k8s.io/yaml v1.3.0 + github.com/spf13/viper v1.10.1 + github.com/zeromicro/go-zero v1.6.2 + golang.org/x/crypto v0.18.0 + k8s.io/api v0.29.1 + k8s.io/apimachinery v0.29.1 + k8s.io/client-go v0.29.1 + gitlink.org.cn/JointCloud/pcm-coordinator v0.0.0-20240302013624-9de512ee32ab ) require ( - github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect - github.com/KyleBanks/depth v1.2.1 // indirect - github.com/MakeNowJust/heredoc v1.0.0 // indirect - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect - github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/blang/semver v3.5.1+incompatible // indirect - github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect - github.com/buger/jsonparser v1.1.1 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/emicklei/go-restful/v3 v3.8.0 // indirect - github.com/evanphx/json-patch v4.12.0+incompatible // indirect - github.com/evanphx/json-patch/v5 v5.6.0 // indirect - github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect - github.com/fatih/camelcase v1.0.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect - github.com/fvbommel/sortorder v1.0.1 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-errors/errors v1.0.1 // indirect - github.com/go-logr/logr v1.2.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.6 // indirect - github.com/go-openapi/spec v0.20.4 // indirect - github.com/go-openapi/swag v0.19.15 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-openapi/jsonpointer v0.20.0 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.22.4 // indirect github.com/go-playground/locales v0.14.0 // indirect github.com/go-playground/universal-translator v0.18.0 // indirect github.com/go-playground/validator/v10 v10.10.0 // indirect github.com/goccy/go-json v0.9.7 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.2 // indirect - github.com/google/btree v1.0.1 // indirect - github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-cmp v0.5.8 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/google/uuid v1.1.2 // indirect - github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect - github.com/imdario/mergo v0.3.12 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/jinzhu/inflection v1.0.0 // indirect - github.com/jinzhu/now v1.1.5 // indirect - github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/jonboulle/clockwork v0.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/kr/pretty v0.3.0 // indirect - github.com/kr/text v0.2.0 // indirect github.com/leodido/go-urn v1.2.1 // indirect - github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect - github.com/mailru/easyjson v0.7.6 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect - github.com/mattn/go-runewidth v0.0.13 // indirect - github.com/mattn/go-sqlite3 v1.14.17 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/mitchellh/go-wordwrap v1.0.0 // indirect - github.com/moby/spdystream v0.2.0 // indirect - github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect + github.com/magiconair/properties v1.8.5 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mitchellh/mapstructure v1.4.3 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/olekukonko/tablewriter v0.0.4 // indirect - github.com/pelletier/go-toml/v2 v2.0.1 // indirect - github.com/peterbourgon/diskv v2.0.1+incompatible // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.12.1 // indirect - github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.32.1 // indirect - github.com/prometheus/procfs v0.7.3 // indirect - github.com/rivo/uniseg v0.2.0 // indirect - github.com/rogpeppe/go-internal v1.8.0 // indirect - github.com/russross/blackfriday v1.5.2 // indirect - github.com/spf13/cobra v1.4.0 // indirect + github.com/pelletier/go-toml v1.9.4 // indirect + github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/spaolacci/murmur3 v1.1.0 // indirect + github.com/spf13/afero v1.8.0 // indirect + github.com/spf13/cast v1.4.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.8.0 // indirect + github.com/subosito/gotenv v1.2.0 // indirect github.com/ugorji/go/codec v1.2.7 // indirect - github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca // indirect - go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.19.1 // indirect - golang.org/x/net v0.1.0 // indirect - golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect - golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect - golang.org/x/sys v0.1.0 // indirect - golang.org/x/term v0.1.0 // indirect - golang.org/x/text v0.4.0 // indirect - golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect - golang.org/x/tools v0.2.0 // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 // indirect - google.golang.org/grpc v1.47.0 // indirect - google.golang.org/protobuf v1.28.0 // indirect + go.opentelemetry.io/otel v1.21.0 // indirect + go.opentelemetry.io/otel/sdk v1.21.0 // indirect + go.opentelemetry.io/otel/trace v1.21.0 // indirect + go.uber.org/automaxprocs v1.5.3 // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/oauth2 v0.15.0 // indirect + golang.org/x/sys v0.16.0 // indirect + golang.org/x/term v0.16.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/time v0.5.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/protobuf v1.32.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.66.3 // indirect - gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect - gopkg.in/square/go-jose.v2 v2.2.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/apiserver v0.25.0 // indirect - k8s.io/cli-runtime v0.24.2 // indirect - k8s.io/cluster-bootstrap v0.24.2 // indirect - k8s.io/component-base v0.25.0 // indirect - k8s.io/klog/v2 v2.70.1 // indirect - k8s.io/kube-aggregator v0.24.2 // indirect - k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect - k8s.io/kubectl v0.24.2 // indirect - k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect - sigs.k8s.io/cluster-api v1.0.1 // indirect - sigs.k8s.io/controller-runtime v0.12.2 // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect - sigs.k8s.io/kustomize/api v0.11.4 // indirect - sigs.k8s.io/kustomize/kyaml v0.13.6 // indirect - sigs.k8s.io/mcs-api v0.1.0 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/klog/v2 v2.110.1 // indirect + k8s.io/kube-openapi v0.0.0-20231206194836-bf4651e18aa8 // indirect + k8s.io/utils v0.0.0-20231127182322-b307cd553661 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index c3a89ca..36995f7 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,7 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -15,14 +16,7 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -31,8 +25,6 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/firestore v1.6.0/go.mod h1:afJwI0vaXwAG54kI7A//lP/lSPDkQORQuMkv56TxEPU= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -42,105 +34,15 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.0.0 h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= -github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= -github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= -github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= -github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/agiledragon/gomonkey/v2 v2.3.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY= -github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alessio/shellescape v1.2.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= -github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 h1:zOVTBdCKFd9JbCKz9/nt+FovbjPFmb7mUnp8nH9fQBA= -github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.44.45/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go-v2 v1.16.6/go.mod h1:6CpKuLXg2w7If3ABZCl/qZ6rEgwtjZTn4eAf4RcEyuw= -github.com/aws/aws-sdk-go-v2/config v1.15.12/go.mod h1:oxRNnH11J580bxDEXyfTqfB3Auo2fxzhV052LD4HnyA= -github.com/aws/aws-sdk-go-v2/credentials v1.12.7/go.mod h1:8b1nSHdDaKLho9VEK+K8WivifA/2K5pPm4sfI21NlQ8= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.7/go.mod h1:81k6q0UUZj6AdQZ1E/VQ27cLrTUpJGraZR6/hVHRxjE= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.13/go.mod h1:wLLesU+LdMZDM3U0PP9vZXJW39zmD/7L4nY2pSrYZ/g= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.7/go.mod h1:93Uot80ddyVzSl//xEJreNKMhxntr71WtR3v/A1cRYk= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.14/go.mod h1:R1HF8ZDdcRFfAGF+13En4LSHi2IrrNuPQCaxgWCeGyY= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.7/go.mod h1:HvVdEh/x4jsPBsjNvDy+MH3CDCPy4gTZEzFe2r4uJY8= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.10/go.mod h1:UHxA35uPrCykRySBV5iSPZhZRlYnWSS2c/aaZVsoU94= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.8/go.mod h1:50YdFq1WIuxA0AGrygvYGucnNYrG24WYzu5fNp7lMgY= -github.com/aws/smithy-go v1.12.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= -github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 h1:7aWHqerlJ41y6FOsEUvknqgXnGmJyJSbjhAWq5pO4F8= -github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -148,183 +50,42 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= -github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/coredns/caddy v1.1.0/go.mod h1:A6ntJQlAWuQfFlsd9hvigKbo2WS0VUs2l1e2F+BawD4= -github.com/coredns/corefile-migration v1.0.13/go.mod h1:XnhgULOEouimnzgn0t4WPuFDN2/PJQcTxdWKC5eXNGE= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/drone/envsubst/v2 v2.0.0-20210615175204-7bf45dbf5372/go.mod h1:esf2rsHFNlZlxsqsZDojNBcnNs5REqIvRrWRHqX0vEU= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= -github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= -github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.0.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= -github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM= -github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= -github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= -github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= -github.com/fvbommel/sortorder v1.0.1 h1:dSnXLt4mJYH25uDDGa3biZNQsozaUWDSWeKJ0qqFfzE= -github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= -github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= -github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4= -github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= -github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= -github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= -github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= +github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= @@ -333,35 +94,20 @@ github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/j github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= -github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= -github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= -github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= -github.com/gobuffalo/flect v0.2.3 h1:f/ZukRnSNA/DUpSNDadko7Qc0PhGvsew35p/2tu+CRY= -github.com/gobuffalo/flect v0.2.3/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= +github.com/go-resty/resty/v2 v2.10.0 h1:Qla4W/+TMmv0fOeeRqzEpXPLfTUnR5HZ1+lGs+CkiCo= +github.com/go-resty/resty/v2 v2.10.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= +github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -369,10 +115,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -388,17 +130,13 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= -github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= +github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 h1:0VpGH+cDhbDtdcweoyCVsF3fhN8kejK6rFe/2FFX2nU= +github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49/go.mod h1:BkkQ4L1KS1xMt2aWSPStnn55ChGC0DPOn2FQYj+f25M= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -407,22 +145,17 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v33 v33.0.0/go.mod h1:GMdDnVZY/2TsWgp/lkYnpSAh6TrzhANBBwm6k6TTEXg= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -432,357 +165,112 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= -github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= -github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= -github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/karmada-io/karmada v1.3.0 h1:V06YFZ8QCYnefZnIrsuEEl9GGUNfOn4TGiv+tlDN9y0= -github.com/karmada-io/karmada v1.3.0/go.mod h1:EVysygMH4nlShE+3FHpdJX2/ogtyExK/AvsVNmt2s0Q= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= -github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= -github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= -github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= +github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= -github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nacos-group/nacos-sdk-go v1.1.2 h1:lWTpf5SXLetQetS7p31eGic/ncqsnn0Zbau1i3eC25Y= -github.com/nacos-group/nacos-sdk-go v1.1.2/go.mod h1:I8Vj4M8ZLpBk7EY2A8RXQE1SbfCA7b56TJBPIFTrUYE= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn+Ejf/w8= -github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opensearch-project/opensearch-go/v2 v2.1.0 h1:a2wQiSQQ3c9nXRCW28751ByCLIL6h8KHvV0LUxfw1SI= -github.com/opensearch-project/opensearch-go/v2 v2.1.0/go.mod h1:pAxdJshAIO69ugn8PCMXClyTetS3GVe/SgUYLvx8bE8= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U= -github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= -github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= -github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= +github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= +github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= +github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sagikazarmark/crypt v0.1.0/go.mod h1:B/mN0msZuINBtQ1zZLEQcegFJJf9vnYIR88KRMEuODE= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= -github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= +github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.8.0 h1:5MmtuhAgYeU6qpa7w7bP0dv6MBYuup0vekhSpSkoq60= +github.com/spf13/afero v1.8.0/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= -github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= +github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk= +github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -790,119 +278,51 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a h1:kAe4YSu0O0UFn1DowNo2MY5p6xzqtJ/wQ7LZynSvGaY= -github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w= -github.com/swaggo/gin-swagger v1.5.3 h1:8mWmHLolIbrhJJTflsaFoZzRBYVmEE7JZGIq08EiC0Q= -github.com/swaggo/gin-swagger v1.5.3/go.mod h1:3XJKSfHjDMB5dBo/0rrTXidPmgLeqsX89Yp4uA50HpI= -github.com/swaggo/swag v1.8.1/go.mod h1:ugemnJsPZm/kRwFUnzBlbHRd0JY9zE1M4F+uy2pAaPQ= -github.com/swaggo/swag v1.8.5 h1:7NgtfXsXE+jrcOwRyiftGKW7Ppydj7tZiVenuRf1fE4= -github.com/swaggo/swag v1.8.5/go.mod h1:jMLeXOOmYyjk8PvHTsXBdrubsNd9gUJTTCzL5iBnseg= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca h1:1CFlNzQhALwjS9mBAUkycX616GzgsuYUOCHA5+HSlXI= -github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= -go.etcd.io/etcd/client/v3 v3.5.1/go.mod h1:OnjH4M8OnAotwaB2l9bVgZzRFKru7/ZMoS46OtKyd3Q= -go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= -go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= -go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zeromicro/go-zero v1.6.2 h1:c1gXp6JTO0e+dtfwNZRE7OZgzjipfW8i1iBMoBnDwBI= +github.com/zeromicro/go-zero v1.6.2/go.mod h1:mQKK/c/er/sbIAo7DWyFBZX8oa0eOkc7QJdG15b2GBw= +gitlink.org.cn/JointCloud/pcm-coordinator v0.0.0-20240302013624-9de512ee32ab/go.mod h1:JDp5tWVskac81zhZQA8Ia6NxlUls2DVyke2ufT32aC0= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= -go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= -go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= -go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= -go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc= -go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= -go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= +go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= +go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= +go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= +go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= +go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= +go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= +go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd h1:XcWmESyNjXJMLahc3mqVQJcgSTDxFxhETVlfk9uGc38= -golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -913,8 +333,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20221126150942-6ab00d035af9 h1:yZNXmy+j/JpX19vZkVktWqAo7Gny4PBWYYK3zskGpx4= -golang.org/x/exp v0.0.0-20221126150942-6ab00d035af9/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -928,7 +346,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -939,35 +356,20 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -978,32 +380,21 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1013,15 +404,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= +golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1032,49 +416,22 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1084,101 +441,70 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= -golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1198,7 +524,6 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -1210,26 +535,18 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= -golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= -gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= -gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1249,23 +566,15 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1287,10 +596,8 @@ google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= @@ -1298,37 +605,16 @@ google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 h1:hrbNEivu7Zn1pxvHk6MBrq9iE22woVILTHqexqBxe6I= -google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -1338,22 +624,9 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1366,61 +639,25 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.3 h1:jRskFVxYaMGAMUbN0UZ7niA9gzL9B49DOqE78vg0k3w= gopkg.in/ini.v1 v1.66.3/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2 h1:orlkJ3myw8CN1nVQHBFfloD+L3egixIa4FvUP6RosSA= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw= -gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o= -gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= -gorm.io/gorm v1.25.2-0.20230530020048-26663ab9bf55 h1:sC1Xj4TYrLqg1n3AN10w871An7wJM0gzgcm8jkIkECQ= -gorm.io/gorm v1.25.2-0.20230530020048-26663ab9bf55/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1428,127 +665,24 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= -k8s.io/api v0.18.4/go.mod h1:lOIQAKYgai1+vz9J7YcDZwC26Z0zQewYOGWdyIPUUQ4= -k8s.io/api v0.22.2/go.mod h1:y3ydYpLJAaDI+BbSe2xmGcqxiWHmWjkEeIbiwHvnPR8= -k8s.io/api v0.24.2/go.mod h1:AHqbSkTm6YrQ0ObxjO3Pmp/ubFF/KuM7jU+3khoBsOg= -k8s.io/api v0.25.0 h1:H+Q4ma2U/ww0iGB78ijZx6DRByPz6/733jIuFpX70e0= -k8s.io/api v0.25.0/go.mod h1:ttceV1GyV1i1rnmvzT3BST08N6nGt+dudGrquzVQWPk= -k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= -k8s.io/apiextensions-apiserver v0.18.4/go.mod h1:NYeyeYq4SIpFlPxSAB6jHPIdvu3hL0pc36wuRChybio= -k8s.io/apiextensions-apiserver v0.22.2/go.mod h1:2E0Ve/isxNl7tWLSUDgi6+cmwHi5fQRdwGVCxbC+KFA= -k8s.io/apiextensions-apiserver v0.25.0 h1:CJ9zlyXAbq0FIW8CD7HHyozCMBpDSiH7EdrSTCZcZFY= -k8s.io/apiextensions-apiserver v0.25.0/go.mod h1:3pAjZiN4zw7R8aZC5gR0y3/vCkGlAjCazcg1me8iB/E= -k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= -k8s.io/apimachinery v0.18.4/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= -k8s.io/apimachinery v0.22.2/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.24.2/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= -k8s.io/apimachinery v0.25.0 h1:MlP0r6+3XbkUG2itd6vp3oxbtdQLQI94fD5gCS+gnoU= -k8s.io/apimachinery v0.25.0/go.mod h1:qMx9eAk0sZQGsXGu86fab8tZdffHbwUfsvzqKn4mfB0= -k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= -k8s.io/apiserver v0.18.4/go.mod h1:q+zoFct5ABNnYkGIaGQ3bcbUNdmPyOCoEBcg51LChY8= -k8s.io/apiserver v0.22.2/go.mod h1:vrpMmbyjWrgdyOvZTSpsusQq5iigKNWv9o9KlDAbBHI= -k8s.io/apiserver v0.24.2/go.mod h1:pSuKzr3zV+L+MWqsEo0kHHYwCo77AT5qXbFXP2jbvFI= -k8s.io/apiserver v0.25.0 h1:8kl2ifbNffD440MyvHtPaIz1mw4mGKVgWqM0nL+oyu4= -k8s.io/apiserver v0.25.0/go.mod h1:BKwsE+PTC+aZK+6OJQDPr0v6uS91/HWxX7evElAH6xo= -k8s.io/cli-runtime v0.22.2/go.mod h1:tkm2YeORFpbgQHEK/igqttvPTRIHFRz5kATlw53zlMI= -k8s.io/cli-runtime v0.24.2 h1:KxY6tSgPGsahA6c1/dmR3uF5jOxXPx2QQY6C5ZrLmtE= -k8s.io/cli-runtime v0.24.2/go.mod h1:1LIhKL2RblkhfG4v5lZEt7FtgFG5mVb8wqv5lE9m5qY= -k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= -k8s.io/client-go v0.18.4/go.mod h1:f5sXwL4yAZRkAtzOxRWUhA/N8XzGCb+nPZI8PfobZ9g= -k8s.io/client-go v0.22.2/go.mod h1:sAlhrkVDf50ZHx6z4K0S40wISNTarf1r800F+RlCF6U= -k8s.io/client-go v0.24.2/go.mod h1:zg4Xaoo+umDsfCWr4fCnmLEtQXyCNXCvJuSsglNcV30= -k8s.io/client-go v0.25.0 h1:CVWIaCETLMBNiTUta3d5nzRbXvY5Hy9Dpl+VvREpu5E= -k8s.io/client-go v0.25.0/go.mod h1:lxykvypVfKilxhTklov0wz1FoaUZ8X4EwbhS6rpRfN8= -k8s.io/cluster-bootstrap v0.22.2/go.mod h1:ZkmQKprEqvrUccMnbRHISsMscA1dsQ8SffM9nHq6CgE= -k8s.io/cluster-bootstrap v0.24.2 h1:p177dIhDst4INUWBZgTnqSad8oJiUdKo0cLLVU24AzE= -k8s.io/cluster-bootstrap v0.24.2/go.mod h1:eIHV338K03vBm3u/ROZiNXxWJ4AJRoTR9PEUhcTvYkg= -k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= -k8s.io/code-generator v0.18.4/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= -k8s.io/code-generator v0.22.2/go.mod h1:eV77Y09IopzeXOJzndrDyCI88UBok2h6WxAlBwpxa+o= -k8s.io/code-generator v0.24.2/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= -k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= -k8s.io/component-base v0.18.4/go.mod h1:7jr/Ef5PGmKwQhyAz/pjByxJbC58mhKAhiaDu0vXfPk= -k8s.io/component-base v0.22.2/go.mod h1:5Br2QhI9OTe79p+TzPe9JKNQYvEKbq9rTJDWllunGug= -k8s.io/component-base v0.24.2/go.mod h1:ucHwW76dajvQ9B7+zecZAP3BVqvrHoOxm8olHEg0nmM= -k8s.io/component-base v0.25.0 h1:haVKlLkPCFZhkcqB6WCvpVxftrg6+FK5x1ZuaIDaQ5Y= -k8s.io/component-base v0.25.0/go.mod h1:F2Sumv9CnbBlqrpdf7rKZTmmd2meJq0HizeyY/yAFxk= -k8s.io/component-helpers v0.22.2/go.mod h1:+N61JAR9aKYSWbnLA88YcFr9K/6ISYvRNybX7QW7Rs8= -k8s.io/component-helpers v0.24.2/go.mod h1:TRQPBQKfmqkmV6c0HAmUs8cXVNYYYLsXy4zu8eODi9g= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ= -k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-aggregator v0.24.2 h1:vaKw45vFA5fIT0wdSehPIL7idjVxgLqz6iedOHedLG4= -k8s.io/kube-aggregator v0.24.2/go.mod h1:Ju2jNDixn+vqeeKEBfjfpc204bO1pbdXX0N9knCxeMQ= -k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= -k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= -k8s.io/kubectl v0.22.2/go.mod h1:BApg2j0edxLArCOfO0ievI27EeTQqBDMNU9VQH734iQ= -k8s.io/kubectl v0.24.2 h1:+RfQVhth8akUmIc2Ge8krMl/pt66V7210ka3RE/p0J4= -k8s.io/kubectl v0.24.2/go.mod h1:+HIFJc0bA6Tzu5O/YcuUt45APAxnNL8LeMuXwoiGsPg= -k8s.io/metrics v0.22.2/go.mod h1:GUcsBtpsqQD1tKFS/2wCKu4ZBowwRncLOJH1rgWs3uw= -k8s.io/metrics v0.24.2 h1:3lgEq973VGPWAEaT9VI/p0XmI0R5kJgb/r9Ufr5fz8k= -k8s.io/metrics v0.24.2/go.mod h1:5NWURxZ6Lz5gj8TFU83+vdWIVASx7W8lwPpHYCqopMo= -k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed h1:jAne/RjBTyawwAy0utX5eqigAwz/lQhTmy+Hr/Cpue4= -k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/api v0.29.1 h1:DAjwWX/9YT7NQD4INu49ROJuZAAAP/Ijki48GUPzxqw= +k8s.io/api v0.29.1/go.mod h1:7Kl10vBRUXhnQQI8YR/R327zXC8eJ7887/+Ybta+RoQ= +k8s.io/apimachinery v0.29.1 h1:KY4/E6km/wLBguvCZv8cKTeOwwOBqFNjwJIdMkMbbRc= +k8s.io/apimachinery v0.29.1/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= +k8s.io/client-go v0.29.1 h1:19B/+2NGEwnFLzt0uB5kNJnfTsbV8w6TgQRz9l7ti7A= +k8s.io/client-go v0.29.1/go.mod h1:TDG/psL9hdet0TI9mGyHJSgRkW3H9JZk2dNEUS7bRks= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/kube-openapi v0.0.0-20231206194836-bf4651e18aa8 h1:vzKzxN5uyJZLY8HL1/OovW7BJefnsBIWt8T7Gjh2boQ= +k8s.io/kube-openapi v0.0.0-20231206194836-bf4651e18aa8/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI= +k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= -sigs.k8s.io/cluster-api v1.0.1 h1:0YXQoemI4WnZF8RzT9T2vCtnXAi22rD4Fx1Tj2hhCEM= -sigs.k8s.io/cluster-api v1.0.1/go.mod h1:/LkJXtsvhxTV4U0z1Y2Y1Gr2xebJ0/ce09Ab2M0XU/U= -sigs.k8s.io/controller-runtime v0.6.1/go.mod h1:XRYBPdbf5XJu9kpS84VJiZ7h/u1hF3gEORz0efEja7A= -sigs.k8s.io/controller-runtime v0.10.3/go.mod h1:CQp8eyUQZ/Q7PJvnIrB6/hgfTC1kBkGylwsLgOQi1WY= -sigs.k8s.io/controller-runtime v0.12.2 h1:nqV02cvhbAj7tbt21bpPpTByrXGn2INHRsi39lXy9sE= -sigs.k8s.io/controller-runtime v0.12.2/go.mod h1:qKsk4WE6zW2Hfj0G4v10EnNB2jMG1C+NTb8h+DwCoU0= -sigs.k8s.io/controller-tools v0.3.0/go.mod h1:enhtKGfxZD1GFEoMgP8Fdbu+uKQ/cq1/WGJhdVChfvI= -sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/kind v0.8.1/go.mod h1:oNKTxUVPYkV9lWzY6CVMNluVq8cBsyq+UgPJdvA3uu4= -sigs.k8s.io/kustomize/api v0.8.11/go.mod h1:a77Ls36JdfCWojpUqR6m60pdGY1AYFix4AH83nJtY1g= -sigs.k8s.io/kustomize/api v0.11.4 h1:/0Mr3kfBBNcNPOW5Qwk/3eb8zkswCwnqQxxKtmrTkRo= -sigs.k8s.io/kustomize/api v0.11.4/go.mod h1:k+8RsqYbgpkIrJ4p9jcdPqe8DprLxFUUO0yNOq8C+xI= -sigs.k8s.io/kustomize/cmd/config v0.9.13/go.mod h1:7547FLF8W/lTaDf0BDqFTbZxM9zqwEJqCKN9sSR0xSs= -sigs.k8s.io/kustomize/cmd/config v0.10.6/go.mod h1:/S4A4nUANUa4bZJ/Edt7ZQTyKOY9WCER0uBS1SW2Rco= -sigs.k8s.io/kustomize/kustomize/v4 v4.2.0/go.mod h1:MOkR6fmhwG7hEDRXBYELTi5GSFcLwfqwzTRHW3kv5go= -sigs.k8s.io/kustomize/kustomize/v4 v4.5.4/go.mod h1:Zo/Xc5FKD6sHl0lilbrieeGeZHVYCA4BzxeAaLI05Bg= -sigs.k8s.io/kustomize/kyaml v0.11.0/go.mod h1:GNMwjim4Ypgp/MueD3zXHLRJEjz7RvtPae0AwlvEMFM= -sigs.k8s.io/kustomize/kyaml v0.13.6 h1:eF+wsn4J7GOAXlvajv6OknSunxpcOBQQqsnPxObtkGs= -sigs.k8s.io/kustomize/kyaml v0.13.6/go.mod h1:yHP031rn1QX1lr/Xd934Ri/xdVNG8BE2ECa78Ht/kEg= -sigs.k8s.io/mcs-api v0.1.0 h1:edDbg0oRGfXw8TmZjKYep06LcJLv/qcYLidejnUp0PM= -sigs.k8s.io/mcs-api v0.1.0/go.mod h1:gGiAryeFNB4GBsq2LBmVqSgKoobLxt+p7ii/WG5QYYw= -sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= -sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/main.go b/main.go index f8ea460..2524ac6 100644 --- a/main.go +++ b/main.go @@ -2,18 +2,18 @@ package main import ( "github.com/robfig/cron/v3" - "jcc-schedule/app" + "jcc-schedule/pkg/apiserver" + "jcc-schedule/routers" ) // @title jcc调度中心 // @version 1.0 // @description jcc func main() { - router := app.InitRouter() + router := routers.InitRouter() + apiserver.NewAPIServer() c := cron.New() - app.QueryNodeEdgeInfo(c) //app.SyncMonitor(c) c.Start() - go app.Watch() _ = router.Run(":8082") } diff --git a/model/Cluster.go b/model/Cluster.go deleted file mode 100644 index 8248be4..0000000 --- a/model/Cluster.go +++ /dev/null @@ -1,12 +0,0 @@ -package model - -import "time" - -type Cluster struct { - Id int `json:"id" db:"id"` - ClusterName string `json:"clusterName" db:"cluster_name"` - Version string `json:"version" db:"version"` - UserName string `json:"userName" db:"user_name"` - CreateTime time.Time `json:"createTime" db:"create_time"` - ClusterIp string `json:"clusterIp" db:"cluster_ip"` -} diff --git a/model/Resource.go b/model/Resource.go deleted file mode 100644 index 4823ba2..0000000 --- a/model/Resource.go +++ /dev/null @@ -1,20 +0,0 @@ -package model - -type Resources struct { - Name string `db:"name" json:"name"` - Ip *string `db:"ip" json:"ip"` - PublicIp *string `db:"public_ip" json:"publicIp"` - HpcPartition *string `db:"hpc_partition" json:"hpcPartition"` - CpuName string `db:"cpu_name" json:"cpuName"` - CpuGHz string `db:"cpu_GHz" json:"cpuGHz"` - CpuCores string `db:"cpu_cores" json:"cpuCores"` - TotalThreads string `db:"total_threads" json:"totalThreads"` - Memory *string `db:"memory" json:"memory"` - GpuDcu *string `db:"gpu_dcu" json:"gpuDcu"` - CpuSingleCycle *string `db:"cpu_single_cycle" json:"cpuSingleCycle"` - Num string `db:"num" json:"num"` - CpuGFlops *float64 `db:"cpu_GFlops" json:"cpuGFlops"` - GpuGFlops *float64 `db:"gpu_GFlops" json:"gpuGFlops"` - Region string `db:"region" json:"region"` - Flops float64 `db:"flops" json:"flops"` -} diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go new file mode 100644 index 0000000..cfb48f3 --- /dev/null +++ b/pkg/apiserver/apiserver.go @@ -0,0 +1,81 @@ +package apiserver + +import ( + "github.com/go-resty/resty/v2" + "jcc-schedule/pkg/monitoring" + "jcc-schedule/pkg/monitoring/prometheus" + "k8s.io/client-go/dynamic" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" + "k8s.io/client-go/util/flowcontrol" +) + +type APIServer struct { + MonitoringClientMap map[string]monitoring.Interface + ClientSetMap map[string]*kubernetes.Clientset + DynamicClientMap map[string]*dynamic.DynamicClient + Clusters []*Cluster +} + +var ApiServer APIServer + +func NewAPIServer() { + apiServer := &APIServer{} + apiServer.installClusters() + apiServer.installK8sClient() + apiServer.installMonitoring() +} + +type Cluster struct { + Name string `json:"name"` + Server string `json:"server"` + BearerToken string `json:"bearerToken"` + MonitorServer string `json:"monitorServer"` +} + +func (s *APIServer) installClusters() { + + client := resty.New() + resp, err := client.R(). + SetQueryParams(map[string]string{ + "adapterId": "1752857389213683712", + }). + SetResult(&s.Clusters). + ForceContentType("application/json"). + Get("http://localhost:8999/pcm/v1/adapter/cluster/list") + println(resp.Status()) + if err != nil { + return + } +} + +func (s *APIServer) installK8sClient() { + for _, cluster := range s.Clusters { + if len(cluster.Server) != 0 && len(cluster.BearerToken) != 0 { + restConfig := &rest.Config{ + Host: cluster.Server, + RateLimiter: flowcontrol.NewTokenBucketRateLimiter(1000, 1000), + BearerToken: cluster.BearerToken, + TLSClientConfig: rest.TLSClientConfig{ + Insecure: true, + }, + } + dynamicClient, _ := dynamic.NewForConfig(restConfig) + s.DynamicClientMap[cluster.Name] = dynamicClient + clientSet, _ := kubernetes.NewForConfig(restConfig) + s.ClientSetMap[cluster.Name] = clientSet + } + } +} + +func (s *APIServer) installMonitoring() { + for _, cluster := range s.Clusters { + if len(cluster.MonitorServer) != 0 { + prometheusClient, err := prometheus.NewPrometheus(cluster.MonitorServer) + if err != nil { + return + } + s.MonitoringClientMap[cluster.Name] = prometheusClient + } + } +} diff --git a/pkg/monitoring/interface.go b/pkg/monitoring/interface.go new file mode 100644 index 0000000..b6ef64a --- /dev/null +++ b/pkg/monitoring/interface.go @@ -0,0 +1,8 @@ +package monitoring + +import "time" + +type Interface interface { + GetNamedMetrics(metrics []string, time time.Time, opt QueryOption) []Metric + GetNamedMetricsByTime(metrics []string, start, end string, step time.Duration, opt QueryOption) []Metric +} diff --git a/pkg/monitoring/prometheus/prometheus.go b/pkg/monitoring/prometheus/prometheus.go new file mode 100644 index 0000000..561104a --- /dev/null +++ b/pkg/monitoring/prometheus/prometheus.go @@ -0,0 +1,189 @@ +package prometheus + +import ( + "context" + "github.com/prometheus/client_golang/api" + v1 "github.com/prometheus/client_golang/api/prometheus/v1" + "github.com/prometheus/common/model" + "jcc-schedule/pkg/monitoring" + "strconv" + "strings" + "sync" + "time" +) + +type Prometheus struct { + prometheus monitoring.Interface + client v1.API +} + +// NewPrometheus Initialize the Prometheus client +func NewPrometheus(address string) (Prometheus, error) { + cfg := api.Config{ + Address: address, + } + + client, err := api.NewClient(cfg) + return Prometheus{client: v1.NewAPI(client)}, err +} + +func ParseTime(timestamp string) (time.Time, error) { + // Parse time params + startInt, err := strconv.ParseInt(timestamp, 10, 64) + if err != nil { + return time.Now(), err + } + return time.Unix(startInt, 0), nil + +} + +func (p Prometheus) GetNamedMetricsByTime(metrics []string, start, end string, step time.Duration, o monitoring.QueryOption) []monitoring.Metric { + var res []monitoring.Metric + var mtx sync.Mutex + var wg sync.WaitGroup + opts := monitoring.NewQueryOptions() + o.Apply(opts) + + for _, metric := range metrics { + wg.Add(1) + go func(metric string) { + parsedResp := monitoring.Metric{MetricName: metric} + startTimestamp, err := ParseTime(start) + if err != nil { + return + } + endTimestamp, err := ParseTime(end) + if err != nil { + return + } + timeRange := v1.Range{ + Start: startTimestamp, + End: endTimestamp, + Step: step, + } + value, _, err := p.client.QueryRange(context.Background(), makeExpr(metric, *opts), timeRange) + if err != nil { + parsedResp.Error = err.Error() + } else { + parsedResp.MetricData = parseQueryRangeResp(value, genMetricFilter(o)) + } + + mtx.Lock() + res = append(res, parsedResp) + mtx.Unlock() + + wg.Done() + }(metric) + } + + wg.Wait() + + return res +} + +func parseQueryRangeResp(value model.Value, metricFilter func(metric model.Metric) bool) monitoring.MetricData { + res := monitoring.MetricData{MetricType: monitoring.MetricTypeMatrix} + + data, _ := value.(model.Matrix) + + for _, v := range data { + if metricFilter != nil && !metricFilter(v.Metric) { + continue + } + mv := monitoring.MetricValue{ + Metadata: make(map[string]string), + } + + for k, v := range v.Metric { + mv.Metadata[string(k)] = string(v) + } + + for _, k := range v.Values { + mv.Series = append(mv.Series, monitoring.Point{float64(k.Timestamp) / 1000, float64(k.Value)}) + } + + res.MetricValues = append(res.MetricValues, mv) + } + + return res +} + +func (p Prometheus) GetNamedMetrics(metrics []string, ts time.Time, o monitoring.QueryOption) []monitoring.Metric { + var res []monitoring.Metric + var mtx sync.Mutex + var wg sync.WaitGroup + + opts := monitoring.NewQueryOptions() + o.Apply(opts) + + for _, metric := range metrics { + wg.Add(1) + go func(metric string) { + parsedResp := monitoring.Metric{MetricName: metric} + + value, _, err := p.client.Query(context.Background(), makeExpr(metric, *opts), ts) + if err != nil { + parsedResp.Error = err.Error() + } else { + parsedResp.MetricData = parseQueryResp(value, genMetricFilter(o)) + } + + mtx.Lock() + res = append(res, parsedResp) + mtx.Unlock() + + wg.Done() + }(metric) + } + + wg.Wait() + + return res +} +func parseQueryResp(value model.Value, metricFilter func(metric model.Metric) bool) monitoring.MetricData { + res := monitoring.MetricData{MetricType: monitoring.MetricTypeVector} + + data, _ := value.(model.Vector) + + for _, v := range data { + if metricFilter != nil && !metricFilter(v.Metric) { + continue + } + mv := monitoring.MetricValue{ + Metadata: make(map[string]string), + } + + for k, v := range v.Metric { + mv.Metadata[string(k)] = string(v) + } + + mv.Sample = &monitoring.Point{float64(v.Timestamp) / 1000, float64(v.Value)} + + res.MetricValues = append(res.MetricValues, mv) + } + + return res +} + +func genMetricFilter(o monitoring.QueryOption) func(metric model.Metric) bool { + if o != nil { + if po, ok := o.(monitoring.PodOption); ok { + if po.NamespacedResourcesFilter != "" { + namespacedPodsMap := make(map[string]struct{}) + for _, s := range strings.Split(po.NamespacedResourcesFilter, "|") { + namespacedPodsMap[s] = struct{}{} + } + return func(metric model.Metric) bool { + if len(metric) == 0 { + return false + } + _, ok := namespacedPodsMap[string(metric["namespace"])+"/"+string(metric["pod"])] + return ok + } + } + } + } + return func(metric model.Metric) bool { + return true + } +} diff --git a/pkg/monitoring/prometheus/promql.go b/pkg/monitoring/prometheus/promql.go new file mode 100644 index 0000000..0026033 --- /dev/null +++ b/pkg/monitoring/prometheus/promql.go @@ -0,0 +1,167 @@ +/* +Copyright (c) [2023] [pcm] +[pcm-coordinator] is licensed under Mulan PSL v2. +You can use this software according to the terms and conditions of the Mulan PSL v2. +You may obtain a copy of Mulan PSL v2 at: + + http://license.coscl.org.cn/MulanPSL2 + +THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +See the Mulan PSL v2 for more details. +*/ +package prometheus + +import ( + "fmt" + "jcc-schedule/pkg/monitoring" + "strings" +) + +const ( + StatefulSet = "StatefulSet" + DaemonSet = "DaemonSet" + Deployment = "Deployment" +) + +var promQLTemplates = map[string]string{ + + //namespace + "namespace_cpu_usage": `round(namespace:container_cpu_usage_seconds_total:sum_rate{namespace!="", $1}, 0.001)`, + "namespace_memory_usage": `namespace:container_memory_usage_bytes:sum{namespace!="", $1}`, + "namespace_memory_usage_wo_cache": `namespace:container_memory_usage_bytes_wo_cache:sum{namespace!="", $1}`, + "namespace_net_bytes_transmitted": `sum by (namespace) (irate(container_network_transmit_bytes_total{namespace!="", pod!="", interface!~"^(cali.+|tunl.+|dummy.+|kube.+|flannel.+|cni.+|docker.+|veth.+|lo.*)", job="kubelet"}[5m]) * on (namespace) group_left(workspace) kube_namespace_labels{$1}) or on(namespace) max by(namespace) (kube_namespace_labels{$1} * 0)`, + "namespace_net_bytes_received": `sum by (namespace) (irate(container_network_receive_bytes_total{namespace!="", pod!="", interface!~"^(cali.+|tunl.+|dummy.+|kube.+|flannel.+|cni.+|docker.+|veth.+|lo.*)", job="kubelet"}[5m]) * on (namespace) group_left(workspace) kube_namespace_labels{$1}) or on(namespace) max by(namespace) (kube_namespace_labels{$1} * 0)`, + "namespace_pod_count": `sum by (namespace) (kube_pod_status_phase{phase!~"Failed|Succeeded", namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1}) or on(namespace) max by(namespace) (kube_namespace_labels{$1} * 0)`, + "namespace_pod_running_count": `sum by (namespace) (kube_pod_status_phase{phase="Running", namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1}) or on(namespace) max by(namespace) (kube_namespace_labels{$1} * 0)`, + "namespace_pod_succeeded_count": `sum by (namespace) (kube_pod_status_phase{phase="Succeeded", namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1}) or on(namespace) max by(namespace) (kube_namespace_labels{$1} * 0)`, + "namespace_pod_abnormal_count": `namespace:pod_abnormal:count{namespace!="", $1}`, + "namespace_pod_abnormal_ratio": `namespace:pod_abnormal:ratio{namespace!="", $1}`, + "namespace_memory_limit_hard": `min by (namespace) (kube_resourcequota{resourcequota!="quota", type="hard", namespace!="", resource="limits.memory"} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_cpu_limit_hard": `min by (namespace) (kube_resourcequota{resourcequota!="quota", type="hard", namespace!="", resource="limits.cpu"} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_pod_count_hard": `min by (namespace) (kube_resourcequota{resourcequota!="quota", type="hard", namespace!="", resource="count/pods"} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_cronjob_count": `sum by (namespace) (kube_cronjob_labels{namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_pvc_count": `sum by (namespace) (kube_persistentvolumeclaim_info{namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_daemonset_count": `sum by (namespace) (kube_daemonset_labels{namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_deployment_count": `sum by (namespace) (kube_deployment_labels{namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_endpoint_count": `sum by (namespace) (kube_endpoint_labels{namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_hpa_count": `sum by (namespace) (kube_horizontalpodautoscaler_labels{namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_job_count": `sum by (namespace) (kube_job_labels{namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_statefulset_count": `sum by (namespace) (kube_statefulset_labels{namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_replicaset_count": `count by (namespace) (kube_replicaset_labels{namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_service_count": `sum by (namespace) (kube_service_info{namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_secret_count": `sum by (namespace) (kube_secret_info{namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_configmap_count": `sum by (namespace) (kube_configmap_info{namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_ingresses_extensions_count": `sum by (namespace) (kube_ingress_labels{namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + "namespace_s2ibuilder_count": `sum by (namespace) (s2i_s2ibuilder_created{namespace!=""} * on (namespace) group_left(workspace) kube_namespace_labels{$1})`, + + "controller_cpu_usage_rate": `sum( node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{}* on(namespace,pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel{$1}) by (workload)/sum( kube_pod_container_resource_limits{job="kube-state-metrics", resource="cpu"}* on(namespace,pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel{ }) by (workload)`, + "controller_memory_usage_rate": `sum( container_memory_working_set_bytes{job="kubelet", metrics_path="/metrics/cadvisor", container!="", image!=""} * on(namespace,pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel{$1}) by (workload)/sum( kube_pod_container_resource_limits{job="kube-state-metrics", resource="memory"}* on(namespace,pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel{ }) by (workload)`, + // pod + "pod_cpu_usage": `round(sum by (namespace, pod) (irate(container_cpu_usage_seconds_total{job="kubelet", pod!="", image!=""}[5m])) * on (namespace, pod) group_left(owner_kind,owner_name) kube_pod_owner{$1} * on (namespace, pod) group_left(node) kube_pod_info{$2}, 0.001)`, + "pod_cpu_usage_rate": `sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{ $1}) by (pod) / sum(kube_pod_container_resource_limits{ $1,unit="core"}) by (pod)`, + "pod_memory_usage_rate": `sum(container_memory_working_set_bytes{job="kubelet", $1, container!="", image!=""}) by (pod) / sum(kube_pod_container_resource_limits{ $1,unit="byte"}) by (pod)`, + "pod_memory_usage": `sum by (namespace, pod) (container_memory_usage_bytes{job="kubelet", pod!="", image!=""}) * on (namespace, pod) group_left(owner_kind, owner_name) kube_pod_owner{$1} * on (namespace, pod) group_left(node) kube_pod_info{$2}`, + "pod_memory_usage_wo_cache": `sum by (namespace, pod) (container_memory_working_set_bytes{job="kubelet", pod!="", image!=""}) * on (namespace, pod) group_left(owner_kind, owner_name) kube_pod_owner{$1} * on (namespace, pod) group_left(node) kube_pod_info{$2}`, + "pod_net_bytes_transmitted": `sum by (namespace, pod) (irate(container_network_transmit_bytes_total{pod!="", interface!~"^(cali.+|tunl.+|dummy.+|kube.+|flannel.+|cni.+|docker.+|veth.+|lo.*)", job="kubelet"}[5m])) * on (namespace, pod) group_left(owner_kind, owner_name) kube_pod_owner{$1} * on (namespace, pod) group_left(node) kube_pod_info{$2}`, + "pod_net_bytes_received": `sum by (namespace, pod) (irate(container_network_receive_bytes_total{pod!="", interface!~"^(cali.+|tunl.+|dummy.+|kube.+|flannel.+|cni.+|docker.+|veth.+|lo.*)", job="kubelet"}[5m])) * on (namespace, pod) group_left(owner_kind, owner_name) kube_pod_owner{$1} * on (namespace, pod) group_left(node) kube_pod_info{$2}`, + "pod_cpu_resource_limits": `sum by (namespace, pod) (kube_pod_container_resource_limits{origin_prometheus=~"",resource="cpu",unit="core"}) * on (namespace, pod) group_left(owner_kind, owner_name) kube_pod_owner{$1} * on (namespace, pod) group_left(node) kube_pod_info{$2}`, + "pod_memory_resource_limits": `sum by (namespace, pod) (kube_pod_container_resource_limits{origin_prometheus=~"",resource="memory",unit="byte"}) * on (namespace, pod) group_left(owner_kind, owner_name) kube_pod_owner{$1} * on (namespace, pod) group_left(node) kube_pod_info{$2}`, + + // container + "container_cpu_usage": `round(sum by (namespace, pod, container) (irate(container_cpu_usage_seconds_total{job="kubelet", container!="POD", container!="", image!="", $1}[5m])), 0.001)`, + "container_memory_usage": `sum by (namespace, pod, container) (container_memory_usage_bytes{job="kubelet", container!="POD", container!="", image!="", $1})`, + "container_memory_usage_wo_cache": `sum by (namespace, pod, container) (container_memory_working_set_bytes{job="kubelet", container!="POD", container!="", image!="", $1})`, + "container_processes_usage": `sum by (namespace, pod, container) (container_processes{job="kubelet", container!="POD", container!="", image!="", $1})`, + "container_threads_usage": `sum by (namespace, pod, container) (container_threads {job="kubelet", container!="POD", container!="", image!="", $1})`, +} + +func makeExpr(metric string, opts monitoring.QueryOptions) string { + tmpl := promQLTemplates[metric] + switch opts.Level { + case monitoring.LevelCluster: + return tmpl + case monitoring.LevelNode: + return makeNodeMetricExpr(tmpl, opts) + case monitoring.LevelWorkspace: + return makeWorkspaceMetricExpr(tmpl, opts) + case monitoring.LevelNamespace: + return makeNamespaceMetricExpr(tmpl, opts) + case monitoring.LevelController: + return makeControllerMetricExpr(tmpl, opts) + case monitoring.LevelPod: + return makePodMetricExpr(tmpl, opts) + case monitoring.LevelContainer: + return makeContainerMetricExpr(tmpl, opts) + case monitoring.LevelComponent: + return tmpl + default: + return tmpl + } +} + +func makeNodeMetricExpr(tmpl string, o monitoring.QueryOptions) string { + var nodeSelector string + if o.NodeName != "" { + nodeSelector = fmt.Sprintf(`node="%s"`, o.NodeName) + } else { + nodeSelector = fmt.Sprintf(`node=~"%s"`, o.ResourceFilter) + } + return strings.Replace(tmpl, "$1", nodeSelector, -1) +} + +func makeWorkspaceMetricExpr(tmpl string, o monitoring.QueryOptions) string { + var workspaceSelector string + if o.WorkspaceName != "" { + workspaceSelector = fmt.Sprintf(`workspace="%s"`, o.WorkspaceName) + } else { + workspaceSelector = fmt.Sprintf(`workspace=~"%s", workspace!=""`, o.ResourceFilter) + } + return strings.Replace(tmpl, "$1", workspaceSelector, -1) +} + +func makeNamespaceMetricExpr(tmpl string, o monitoring.QueryOptions) string { + var namespaceSelector string + + // For monitoring namespaces in the specific workspace + // GET /workspaces/{workspace}/namespaces + if o.WorkspaceName != "" { + namespaceSelector = fmt.Sprintf(`workspace="%s", namespace=~"%s"`, o.WorkspaceName, o.ResourceFilter) + return strings.Replace(tmpl, "$1", namespaceSelector, -1) + } + + // For monitoring the specific namespaces + // GET /namespaces/{namespace} or + // GET /namespaces + if o.Namespace != "" { + namespaceSelector = fmt.Sprintf(`namespace="%s"`, o.Namespace) + } else { + namespaceSelector = fmt.Sprintf(`namespace=~"%s"`, o.ResourceFilter) + } + return strings.Replace(tmpl, "$1", namespaceSelector, -1) +} + +func makeControllerMetricExpr(tmpl string, o monitoring.QueryOptions) string { + var workload string + + workload = fmt.Sprintf(`workload="%s"`, o.WorkloadName) + return strings.NewReplacer("$1", workload).Replace(tmpl) +} + +func makePodMetricExpr(tmpl string, o monitoring.QueryOptions) string { + var podName string + + podName = fmt.Sprintf(`pod="%s"`, o.PodName) + return strings.NewReplacer("$1", podName).Replace(tmpl) +} + +func makeContainerMetricExpr(tmpl string, o monitoring.QueryOptions) string { + var containerSelector string + if o.ContainerName != "" { + containerSelector = fmt.Sprintf(`pod="%s", namespace="%s", container="%s"`, o.PodName, o.Namespace, o.ContainerName) + } else { + containerSelector = fmt.Sprintf(`pod="%s", namespace="%s", container=~"%s"`, o.PodName, o.Namespace, o.ResourceFilter) + } + return strings.Replace(tmpl, "$1", containerSelector, -1) +} diff --git a/pkg/monitoring/queryoptions.go b/pkg/monitoring/queryoptions.go new file mode 100644 index 0000000..e256759 --- /dev/null +++ b/pkg/monitoring/queryoptions.go @@ -0,0 +1,348 @@ +/* + + Copyright (c) [2023] [pcm] + [pcm-coordinator] is licensed under Mulan PSL v2. + You can use this software according to the terms and conditions of the Mulan PSL v2. + You may obtain a copy of Mulan PSL v2 at: + http://license.coscl.org.cn/MulanPSL2 + THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + See the Mulan PSL v2 for more details. + +*/ + +package monitoring + +import ( + "fmt" + "strings" + "time" +) + +type Level int + +const ( + LevelCluster = 1 << iota + LevelNode + LevelWorkspace + LevelNamespace + LevelApplication + LevelOpenpitrix + LevelController + LevelService + LevelPod + LevelContainer + LevelPVC + LevelComponent + LevelIngress +) + +var MeteringLevelMap = map[string]int{ + "LevelCluster": LevelCluster, + "LevelNode": LevelNode, + "LevelWorkspace": LevelWorkspace, + "LevelNamespace": LevelNamespace, + "LevelApplication": LevelApplication, + "LevelController": LevelController, + "LevelService": LevelService, + "LevelPod": LevelPod, + "LevelContainer": LevelContainer, + "LevelPVC": LevelPVC, + "LevelComponent": LevelComponent, +} + +type QueryOption interface { + Apply(*QueryOptions) +} + +type Meteroptions struct { + Start time.Time + End time.Time + Step time.Duration +} + +type QueryOptions struct { + Level Level + + NamespacedResourcesFilter string + QueryType string + ResourceFilter string + NodeName string + WorkspaceName string + Namespace string + WorkloadKind string + WorkloadName string + OwnerName string + PodName string + PodsName string + ContainerName string + StorageClassName string + PersistentVolumeClaimName string + PVCFilter string + ApplicationName string + ServiceName string + Ingress string + Job string + Duration *time.Duration + MeterOptions *Meteroptions +} +type ClusterOption struct{} + +func (_ ClusterOption) Apply(o *QueryOptions) { + o.Level = LevelCluster +} + +type NodeOption struct { + ResourceFilter string + NodeName string + PVCFilter string + StorageClassName string + QueryType string +} + +func (no NodeOption) Apply(o *QueryOptions) { + o.Level = LevelNode + o.ResourceFilter = no.ResourceFilter + o.NodeName = no.NodeName + o.PVCFilter = no.PVCFilter + o.StorageClassName = no.StorageClassName + o.QueryType = no.QueryType +} + +type WorkspaceOption struct { + ResourceFilter string + WorkspaceName string + PVCFilter string + StorageClassName string +} + +func (wo WorkspaceOption) Apply(o *QueryOptions) { + o.Level = LevelWorkspace + o.ResourceFilter = wo.ResourceFilter + o.WorkspaceName = wo.WorkspaceName + o.PVCFilter = wo.PVCFilter + o.StorageClassName = wo.StorageClassName +} + +type NamespaceOption struct { + ResourceFilter string + WorkspaceName string + NamespaceName string + PVCFilter string + StorageClassName string +} + +func (no NamespaceOption) Apply(o *QueryOptions) { + o.Level = LevelNamespace + o.ResourceFilter = no.ResourceFilter + o.WorkspaceName = no.WorkspaceName + o.Namespace = no.NamespaceName + o.PVCFilter = no.PVCFilter + o.StorageClassName = no.StorageClassName +} + +type ApplicationsOption struct { + NamespaceName string + Applications []string + StorageClassName string +} + +func (aso ApplicationsOption) Apply(o *QueryOptions) { + // nothing should be done + //nolint:gosimple + return +} + +type OpenpitrixsOption struct { + Cluster string + NamespaceName string + Openpitrixs []string + StorageClassName string +} + +func NewQueryOptions() *QueryOptions { + return &QueryOptions{} +} + +func (oso OpenpitrixsOption) Apply(o *QueryOptions) { + // nothing should be done + //nolint:gosimple + return +} + +// ApplicationsOption & OpenpitrixsOption share the same ApplicationOption struct +type ApplicationOption struct { + NamespaceName string + Application string + ApplicationComponents []string + StorageClassName string +} + +func (ao ApplicationOption) Apply(o *QueryOptions) { + o.Level = LevelApplication + o.Namespace = ao.NamespaceName + o.ApplicationName = ao.Application + o.StorageClassName = ao.StorageClassName + + app_components := strings.Join(ao.ApplicationComponents[:], "|") + + if len(app_components) > 0 { + o.ResourceFilter = fmt.Sprintf(`namespace="%s", workload=~"%s"`, o.Namespace, app_components) + } else { + o.ResourceFilter = fmt.Sprintf(`namespace="%s", workload=~"%s"`, o.Namespace, ".*") + } +} + +type WorkloadOption struct { + ResourceFilter string + NamespaceName string + WorkloadKind string +} + +func (wo WorkloadOption) Apply(o *QueryOptions) { + o.Level = LevelController + o.ResourceFilter = wo.ResourceFilter + o.Namespace = wo.NamespaceName + o.WorkloadKind = wo.WorkloadKind +} + +type ServicesOption struct { + NamespaceName string + Services []string +} + +func (sso ServicesOption) Apply(o *QueryOptions) { + // nothing should be done + //nolint:gosimple + return +} + +type ServiceOption struct { + ResourceFilter string + NamespaceName string + ServiceName string + PodNames []string +} + +func (so ServiceOption) Apply(o *QueryOptions) { + o.Level = LevelService + o.Namespace = so.NamespaceName + o.ServiceName = so.ServiceName + + pod_names := strings.Join(so.PodNames, "|") + + if len(pod_names) > 0 { + o.ResourceFilter = fmt.Sprintf(`pod=~"%s", namespace="%s"`, pod_names, o.Namespace) + } else { + o.ResourceFilter = fmt.Sprintf(`pod=~"%s", namespace="%s"`, ".*", o.Namespace) + } +} + +type PodOption struct { + NamespacedResourcesFilter string + ResourceFilter string + NodeName string + NamespaceName string + WorkloadKind string + WorkloadName string + PodName string +} + +type ControllerOption struct { + Namespace string + Kind string + WorkloadName string + Level string +} + +func (po PodOption) Apply(o *QueryOptions) { + o.Level = LevelPod + o.NamespacedResourcesFilter = po.NamespacedResourcesFilter + o.ResourceFilter = po.ResourceFilter + o.NodeName = po.NodeName + o.Namespace = po.NamespaceName + o.WorkloadKind = po.WorkloadKind + o.OwnerName = po.WorkloadName + o.PodName = po.PodName +} + +func (co ControllerOption) Apply(o *QueryOptions) { + o.Level = LevelController + o.Namespace = co.Namespace + o.WorkloadKind = co.Kind + o.WorkloadName = co.WorkloadName + +} + +type ContainerOption struct { + ResourceFilter string + NamespaceName string + PodName string + ContainerName string +} + +func (co ContainerOption) Apply(o *QueryOptions) { + o.Level = LevelContainer + o.ResourceFilter = co.ResourceFilter + o.Namespace = co.NamespaceName + o.PodName = co.PodName + o.ContainerName = co.ContainerName +} + +type PVCOption struct { + ResourceFilter string + NamespaceName string + StorageClassName string + PersistentVolumeClaimName string +} + +func (po PVCOption) Apply(o *QueryOptions) { + o.Level = LevelPVC + o.ResourceFilter = po.ResourceFilter + o.Namespace = po.NamespaceName + o.StorageClassName = po.StorageClassName + o.PersistentVolumeClaimName = po.PersistentVolumeClaimName + + // for meter + o.PVCFilter = po.PersistentVolumeClaimName +} + +type IngressOption struct { + ResourceFilter string + NamespaceName string + Ingress string + Job string + Pod string + Duration *time.Duration +} + +func (no IngressOption) Apply(o *QueryOptions) { + o.Level = LevelIngress + o.ResourceFilter = no.ResourceFilter + o.Namespace = no.NamespaceName + o.Ingress = no.Ingress + o.Job = no.Job + o.PodName = no.Pod + o.Duration = no.Duration +} + +type ComponentOption struct{} + +func (_ ComponentOption) Apply(o *QueryOptions) { + o.Level = LevelComponent +} + +type MeterOption struct { + Start time.Time + End time.Time + Step time.Duration +} + +func (mo MeterOption) Apply(o *QueryOptions) { + o.MeterOptions = &Meteroptions{ + Start: mo.Start, + End: mo.End, + Step: mo.Step, + } +} diff --git a/pkg/monitoring/types.go b/pkg/monitoring/types.go new file mode 100644 index 0000000..9436d0b --- /dev/null +++ b/pkg/monitoring/types.go @@ -0,0 +1,120 @@ +package monitoring + +import ( + "fmt" + jsoniter "github.com/json-iterator/go" + "strconv" + "time" +) + +/* + + Copyright (c) [2023] [pcm] + [pcm-coordinator] is licensed under Mulan PSL v2. + You can use this software according to the terms and conditions of the Mulan PSL v2. + You may obtain a copy of Mulan PSL v2 at: + http://license.coscl.org.cn/MulanPSL2 + THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + See the Mulan PSL v2 for more details. + +*/ + +const ( + MetricTypeMatrix = "matrix" + MetricTypeVector = "vector" +) + +type Metadata struct { + Metric string `json:"metric,omitempty" description:"metric name"` + Type string `json:"type,omitempty" description:"metric type"` + Help string `json:"help,omitempty" description:"metric description"` +} + +type Metric struct { + MetricName string `json:"metric_name,omitempty" description:"metric name, eg. scheduler_up_sum" csv:"metric_name"` + MetricData `json:"data,omitempty" description:"actual metric result"` + Error string `json:"error,omitempty" csv:"-"` +} + +type MetricValues []MetricValue + +type MetricData struct { + MetricType string `json:"resultType,omitempty" description:"result type, one of matrix, vector" csv:"metric_type"` + MetricValues `json:"result,omitempty" description:"metric data including labels, time series and values" csv:"metric_values"` +} + +type DashboardEntity struct { + GrafanaDashboardUrl string `json:"grafanaDashboardUrl,omitempty"` + GrafanaDashboardContent string `json:"grafanaDashboardContent,omitempty"` + Description string `json:"description,omitempty"` + Namespace string `json:"namespace,omitempty"` +} + +// The first element is the timestamp, the second is the metric value. +// eg, [1585658599.195, 0.528] +type Point [2]float64 + +type MetricValue struct { + Metadata map[string]string `json:"metric,omitempty" description:"time series labels"` + // The type of Point is a float64 array with fixed length of 2. + // So Point will always be initialized as [0, 0], rather than nil. + // To allow empty Sample, we should declare Sample to type *Point + Sample *Point `json:"value,omitempty" description:"time series, values of vector type"` + Series []Point `json:"values,omitempty" description:"time series, values of matrix type"` + ExportSample *ExportPoint `json:"exported_value,omitempty" description:"exported time series, values of vector type"` + ExportedSeries []ExportPoint `json:"exported_values,omitempty" description:"exported time series, values of matrix type"` + + MinValue string `json:"min_value" description:"minimum value from monitor points"` + MaxValue string `json:"max_value" description:"maximum value from monitor points"` + AvgValue string `json:"avg_value" description:"average value from monitor points"` + SumValue string `json:"sum_value" description:"sum value from monitor points"` + Fee string `json:"fee" description:"resource fee"` + ResourceUnit string `json:"resource_unit"` + CurrencyUnit string `json:"currency_unit"` +} + +func (p Point) Timestamp() float64 { + return p[0] +} + +func (p Point) Value() float64 { + return p[1] +} + +func (p Point) transferToExported() ExportPoint { + return ExportPoint{p[0], p[1]} +} + +func (p Point) Add(other Point) Point { + return Point{p[0], p[1] + other[1]} +} + +// MarshalJSON implements json.Marshaler. It will be called when writing JSON to HTTP response +// Inspired by prometheus/client_golang +func (p Point) MarshalJSON() ([]byte, error) { + t, err := jsoniter.Marshal(p.Timestamp()) + if err != nil { + return nil, err + } + v, err := jsoniter.Marshal(strconv.FormatFloat(p.Value(), 'f', -1, 64)) + if err != nil { + return nil, err + } + return []byte(fmt.Sprintf("[%s,%s]", t, v)), nil +} + +type ExportPoint [2]float64 + +func (p ExportPoint) Timestamp() string { + return time.Unix(int64(p[0]), 0).Format("2006-01-02 03:04:05 PM") +} + +func (p ExportPoint) Value() float64 { + return p[1] +} + +func (p ExportPoint) Format() string { + return p.Timestamp() + " " + strconv.FormatFloat(p.Value(), 'f', -1, 64) +} diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go new file mode 100644 index 0000000..85d4a38 --- /dev/null +++ b/pkg/setting/setting.go @@ -0,0 +1 @@ +package setting diff --git a/routers/api/v1/app.go b/routers/api/v1/app.go new file mode 100644 index 0000000..18787d6 --- /dev/null +++ b/routers/api/v1/app.go @@ -0,0 +1,210 @@ +package v1 + +import ( + "context" + "fmt" + "github.com/gin-gonic/gin" + "github.com/zeromicro/go-zero/core/logx" + "jcc-schedule/pkg/apiserver" + "jcc-schedule/tool" + v12 "k8s.io/api/apps/v1" + v2 "k8s.io/api/autoscaling/v2" + v13 "k8s.io/api/batch/v1" + v1 "k8s.io/api/core/v1" + "k8s.io/api/extensions/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "net/http" + "sync" +) + +type param struct { + Name string + Namespace string +} + +type PodDetail struct { + clusterName string + podList []*v1.Pod + storeAmount float64 +} + +type AppDetail struct { + ClusterName string + Service *v1.Service + Deployment *v12.Deployment + Job *v13.Job + StatefulSet *v12.StatefulSet + IngressList *v1beta1.IngressList + ConfigMap *v1.ConfigMap + Secret *v1.Secret + HorizontalPodAutoscaler *v2.HorizontalPodAutoscaler +} + +type App struct { + Deployment *v12.Deployment + StatefulSet *v12.StatefulSet +} + +func GetAppDetail(c *gin.Context) { + clusterName := c.Param("clusterName") + var p = ¶m{} + if err := c.BindJSON(&p); err != nil { + Response(c, http.StatusBadRequest, "invalid request params.", "") + return + } + + details := make([]*AppDetail, 0) + var wg sync.WaitGroup + wg.Add(len(apiserver.ApiServer.ClientSetMap)) + //查询指定集群下指定命名空间下和名字的deployment详情 + for k := range apiserver.ApiServer.ClientSetMap { + cli := k + go func() { + defer wg.Done() + //转换赋值 + var ( + kDeployment v12.Deployment + kStatefulSets v12.StatefulSet + kIngresses v1beta1.IngressList + kService v1.Service + kConfigMap v1.ConfigMap + kHpa v2.HorizontalPodAutoscaler + kSecret v1.Secret + ) + appDetail := AppDetail{ + ClusterName: cli, + } + //获取指定命名空间下的deployment + deployment, err := apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().Deployments(p.Namespace).Get(context.Background(), p.Name, metav1.GetOptions{}) + if err == nil { + tool.Convert(deployment, &kDeployment) + appDetail.Deployment = &kDeployment + } + + //查询指定集群下指定命名空间下和名字的statefulSets详情 + statefulSets, err := apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().StatefulSets(p.Namespace).Get(context.Background(), p.Name, metav1.GetOptions{}) + if err == nil { + tool.Convert(statefulSets, &kStatefulSets) + appDetail.StatefulSet = &kStatefulSets + } + + // 查询 Ingress 资源 + labelSelector := fmt.Sprintf("cloud.sealos.io/app-deploy-manager=%s", p.Name) + // 执行查询操作,获取匹配标签的 Ingress 资源列表 + ingresses, err := apiserver.ApiServer.ClientSetMap[clusterName].NetworkingV1().Ingresses(p.Namespace).List(context.Background(), metav1.ListOptions{LabelSelector: labelSelector}) + if err == nil { + tool.Convert(ingresses, &kIngresses) + appDetail.IngressList = &kIngresses + } + + //查询 Service 资源 + service, err := apiserver.ApiServer.ClientSetMap[clusterName].CoreV1().Services(p.Namespace).Get(context.Background(), p.Name, metav1.GetOptions{}) + if err == nil { + tool.Convert(service, &kService) + appDetail.Service = &kService + } + //查询configmap + configmap, err := apiserver.ApiServer.ClientSetMap[clusterName].CoreV1().ConfigMaps(p.Namespace).Get(context.Background(), p.Name, metav1.GetOptions{}) + if err == nil { + tool.Convert(configmap, &kConfigMap) + appDetail.ConfigMap = &kConfigMap + } + //查询hpa + hpa, err := apiserver.ApiServer.ClientSetMap[clusterName].AutoscalingV1().HorizontalPodAutoscalers(p.Namespace).Get(context.Background(), p.Name, metav1.GetOptions{}) + if err == nil { + tool.Convert(hpa, &kHpa) + appDetail.HorizontalPodAutoscaler = &kHpa + } + secret, err := apiserver.ApiServer.ClientSetMap[clusterName].CoreV1().Secrets(p.Namespace).Get(context.Background(), p.Name, metav1.GetOptions{}) + if err == nil { + tool.Convert(secret, &kSecret) + appDetail.Secret = &kSecret + } + details = append(details, &appDetail) + }() + + } + wg.Wait() + logx.Infof("查询app详情成功") + Response(c, http.StatusOK, "success", details) +} + +func GetAppByAppName(c *gin.Context) { + var p = ¶m{} + if err := c.BindJSON(&p); err != nil { + Response(c, http.StatusBadRequest, "invalid request params.", "") + return + } + + app := App{} + var kDeployment v12.Deployment + var kStatefulSet v12.StatefulSet + for k, _ := range apiserver.ApiServer.ClientSetMap { + // 获取指定Deployment + deployment, err := apiserver.ApiServer.ClientSetMap[k].AppsV1().Deployments(p.Namespace).Get(c, p.Name, metav1.GetOptions{}) + if err == nil { + tool.Convert(deployment, &kDeployment) + app.Deployment = &kDeployment + } + // 获取指定StatefulSet + statefulSet, err := apiserver.ApiServer.ClientSetMap[k].AppsV1().StatefulSets(p.Namespace).Get(c, p.Name, metav1.GetOptions{}) + if err == nil { + tool.Convert(statefulSet, &kStatefulSet) + app.StatefulSet = &kStatefulSet + } + } + Response(c, http.StatusOK, "success", app) +} + +func DelApp(c *gin.Context) { + +} + +func GetAppPodsByAppName(c *gin.Context) { + clusterName := c.Param("clusterName") + var p = ¶m{} + if err := c.BindJSON(&p); err != nil { + Response(c, http.StatusBadRequest, "invalid request params.", "") + return + } + + details := make([]*PodDetail, 0) + var wg sync.WaitGroup + wg.Add(len(apiserver.ApiServer.ClientSetMap)) + //查询指定集群下指定命名空间下和名字的deployment详情 + for k, _ := range apiserver.ApiServer.ClientSetMap { + cli := k + go func() { + defer wg.Done() + appDetail := PodDetail{} + var store int64 = 0 + appSelector := fmt.Sprintf("app=%s", p.Name) + var KPodList []*v1.Pod + //查询pods + pods, err := apiserver.ApiServer.ClientSetMap[clusterName].CoreV1().Pods(p.Namespace).List(context.Background(), metav1.ListOptions{LabelSelector: appSelector}) + if err != nil { + logx.Error(err.Error()) + } + //查询指定集群下指定命名空间下和名字的statefulSets详情 + statefulSets, _ := apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().StatefulSets(p.Namespace).Get(context.Background(), p.Name, metav1.GetOptions{}) + //计算存储卷大小 + if statefulSets.Spec.VolumeClaimTemplates != nil { + //存储卷大小求和 + for _, v := range statefulSets.Spec.VolumeClaimTemplates { + store += v.Spec.Resources.Requests.Storage().Value() + } + appDetail.storeAmount = float64(store) / 1024 / 1024 / 1024 + } + + if len(pods.Items) > 0 { + tool.Convert(pods.Items, &KPodList) + appDetail.podList = KPodList + appDetail.clusterName = cli + details = append(details, &appDetail) + } + }() + + } + wg.Wait() + Response(c, http.StatusOK, "success", details) +} diff --git a/routers/api/v1/deployment.go b/routers/api/v1/deployment.go new file mode 100644 index 0000000..94eef0f --- /dev/null +++ b/routers/api/v1/deployment.go @@ -0,0 +1,150 @@ +package v1 + +import ( + "fmt" + "github.com/gin-gonic/gin" + "jcc-schedule/pkg/apiserver" + "jcc-schedule/tool" + v1 "k8s.io/api/apps/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "net/http" + "sync" + "time" +) + +var deployMutex sync.Mutex + +type Deployment struct { + Name string `json:"name"` + Namespace string `json:"namespace"` + Labels map[string]string `json:"labels"` + Port int32 `json:"port"` + ContainerImage string `json:"container_image"` + ContainerName string `json:"container_name"` + Replicas int32 `json:"replicas"` + Cluster string `json:"cluster"` + Domain string `json:"domain"` +} + +func DeleteDeployment(c *gin.Context) { + clusterName := c.Param("clusterName") + name := c.Param("name") + namespace := c.Param("namespace") + err := apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().Deployments(namespace).Delete(c, name, metav1.DeleteOptions{}) + if err != nil { + Response(c, http.StatusInternalServerError, "failed", err) + } + Response(c, http.StatusOK, "success", nil) +} + +func PauseDeployment(c *gin.Context) { + clusterName := c.Param("clusterName") + name := c.Param("name") + namespace := c.Param("namespace") + // 缩放副本数量为0 + rs := int32(0) + // 获取Deployment对象 + deployment, err := apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().Deployments(namespace).Get(c, name, metav1.GetOptions{}) + if err == nil { + deployment.Spec.Replicas = &rs + annotations := deployment.GetAnnotations() + annotations["deploy.cloud.sealos.io/pause"] = `{"target":"","value":""}` + _, err = apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().Deployments(namespace).Update(c, deployment, metav1.UpdateOptions{}) + } + sts, stsErr := apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().StatefulSets(namespace).Get(c, name, metav1.GetOptions{}) + if stsErr == nil { + sts.Spec.Replicas = &rs + annotations := sts.GetAnnotations() + annotations["deploy.cloud.sealos.io/pause"] = `{"target":"","value":""}` + _, err = apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().StatefulSets(namespace).Update(c, sts, metav1.UpdateOptions{}) + } + Response(c, http.StatusOK, "success", nil) +} +func DeploymentList(c *gin.Context) { + clusterName := c.Param("clusterName") + namespace := c.Param("namespace") + deployments, err := apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().Deployments(namespace).List(c, metav1.ListOptions{}) + if err != nil { + Response(c, http.StatusInternalServerError, "failed", err) + } + Response(c, http.StatusOK, "success", deployments) +} + +func DeploymentDetail(c *gin.Context) { + clusterName := c.Param("clusterName") + name := c.Param("name") + namespace := c.Param("namespace") + deployment, err := apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().Deployments(namespace).Get(c, name, metav1.GetOptions{}) + if err != nil { + Response(c, http.StatusInternalServerError, "failed", err) + } + Response(c, http.StatusOK, "success", deployment) +} +func StartDeployment(c *gin.Context) { + clusterName := c.Param("clusterName") + name := c.Param("name") + namespace := c.Param("namespace") + deployment, err := apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().Deployments(namespace).Get(c, name, metav1.GetOptions{}) + //TODO 获取原始replicas数量,即metadata下annotations.deploy.cloud.sealos.io/minReplicas数量 + minReplicas := deployment.Annotations["deploy.cloud.sealos.io/minReplicas"] + if minReplicas != "" { + rs := tool.StringToInt32(minReplicas) + deployment.Spec.Replicas = &rs + } + annotations := deployment.GetAnnotations() + delete(annotations, "deploy.cloud.sealos.io/pause") + deployment, err = apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().Deployments(namespace).Update(c, deployment, metav1.UpdateOptions{}) + if err != nil { + Response(c, http.StatusInternalServerError, "failed", err) + } + Response(c, http.StatusOK, "success", nil) +} + +func RestartDeployment(c *gin.Context) { + clusterName := c.Param("clusterName") + name := c.Param("name") + namespace := c.Param("namespace") + patchOpt := metav1.PatchOptions{FieldManager: "kubectl-rollout"} + + dt := time.Now() + + patchInfo := fmt.Sprintf(`{"spec":{"template":{"metadata":{"annotations":{"kubectl.kubernetes.io/restartedAt":"%s"}}}}}`, dt.String()) + + _, err := apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().Deployments(namespace).Patch(c, name, types.StrategicMergePatchType, []byte(patchInfo), patchOpt) + if err != nil { + Response(c, http.StatusInternalServerError, "failed", err) + } + Response(c, http.StatusOK, "success", nil) +} + +func UpdateDeploymentReplica(c *gin.Context) { + clusterName := c.Param("clusterName") + name := c.Param("name") + namespace := c.Param("namespace") + replica := c.Param("replica") + // 获取Deployment对象 + deployment, err := apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().Deployments(namespace).Get(c, name, metav1.GetOptions{}) + if err != nil { + Response(c, http.StatusInternalServerError, "failed", err) + } + // 缩放Deployment对象副本数量 + rs := tool.StringToInt32(replica) + deployment.Spec.Replicas = &rs + annotations := deployment.GetAnnotations() + + if rs == 0 { + annotations["deploy.cloud.sealos.io/pause"] = `{"target":"","value":""}` + } else { + delete(annotations, "deploy.cloud.sealos.io/pause") + annotations["deploy.cloud.sealos.io/maxReplicas"] = replica + annotations["deploy.cloud.sealos.io/minReplicas"] = replica + } + deployment, err = apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().Deployments(namespace).Update(c, deployment, metav1.UpdateOptions{}) + if err != nil { + Response(c, http.StatusInternalServerError, "failed", err) + } + var kDeployment v1.Deployment + tool.Convert(deployment, &kDeployment) + Response(c, http.StatusOK, "success", kDeployment) +} diff --git a/routers/api/v1/job.go b/routers/api/v1/job.go new file mode 100644 index 0000000..8f450d7 --- /dev/null +++ b/routers/api/v1/job.go @@ -0,0 +1,19 @@ +package v1 + +import ( + "github.com/gin-gonic/gin" + "jcc-schedule/pkg/apiserver" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "net/http" +) + +func JobDetail(c *gin.Context) { + clusterName := c.Param("clusterName") + name := c.Param("name") + namespace := c.Param("namespace") + job, err := apiserver.ApiServer.ClientSetMap[clusterName].BatchV1().Jobs(namespace).Get(c, name, v1.GetOptions{}) + if err != nil { + Response(c, http.StatusInternalServerError, "failed", err) + } + Response(c, http.StatusOK, "success", job) +} diff --git a/routers/api/v1/namespace.go b/routers/api/v1/namespace.go new file mode 100644 index 0000000..3b5d0b2 --- /dev/null +++ b/routers/api/v1/namespace.go @@ -0,0 +1,34 @@ +package v1 + +import ( + "context" + "github.com/gin-gonic/gin" + "jcc-schedule/pkg/apiserver" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "net/http" + "strings" +) + +// ListNamespace 查询Namespace列表 +func ListNamespace(ctx *gin.Context) { + m := make(map[string]string) + for k, _ := range apiserver.ApiServer.ClientSetMap { + // 获取所有的命名空间 + namespaces, err := apiserver.ApiServer.ClientSetMap[k].CoreV1().Namespaces().List(context.Background(), metav1.ListOptions{}) + if err != nil { + Response(ctx, http.StatusBadRequest, "failed", err) + } + // 遍历命名空间并查找以 "ns-" 开头的命名空间 + for _, ns := range namespaces.Items { + if strings.HasPrefix(ns.Name, "ns-") { + if m[ns.Name] != "" { + m[ns.Name] = m[ns.Name] + "," + k + } else { + m[ns.Name] = k + } + } + } + } + Response(ctx, http.StatusOK, "success", m) + +} diff --git a/routers/api/v1/pod.go b/routers/api/v1/pod.go new file mode 100644 index 0000000..9ff04ad --- /dev/null +++ b/routers/api/v1/pod.go @@ -0,0 +1,34 @@ +package v1 + +import ( + "github.com/gin-gonic/gin" + "jcc-schedule/pkg/apiserver" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "net/http" +) + +type Pod struct { + Name string `json:"name"` + ClusterName string `json:"cluster_name"` + DomainName string `json:"domain_name"` + Ready string `json:"ready"` + Status string `json:"status"` + Restarts int64 `json:"restarts"` + Age string `json:"age"` + IP string `json:"IP"` + Node string `json:"node"` + Namespace string `json:"namespace"` + ContainerImage string `json:"container_image"` + ContainerName string `json:"container_name"` +} + +// ListPod 查询Pod列表 +func PodList(c *gin.Context) { + clusterName := c.Param("clusterName") + podList, err := apiserver.ApiServer.ClientSetMap[clusterName].CoreV1().Pods("").List(c, metav1.ListOptions{}) + if err != nil { + Response(c, http.StatusInternalServerError, "failed", err) + } + Response(c, http.StatusOK, "success", podList) + +} diff --git a/app/response.go b/routers/api/v1/response.go similarity index 95% rename from app/response.go rename to routers/api/v1/response.go index 1ef1b60..389fd8c 100644 --- a/app/response.go +++ b/routers/api/v1/response.go @@ -1,4 +1,4 @@ -package app +package v1 import ( "github.com/gin-gonic/gin" diff --git a/routers/api/v1/statefulSet.go b/routers/api/v1/statefulSet.go new file mode 100644 index 0000000..bc3f5f7 --- /dev/null +++ b/routers/api/v1/statefulSet.go @@ -0,0 +1,37 @@ +package v1 + +import ( + "context" + "fmt" + "github.com/gin-gonic/gin" + "jcc-schedule/pkg/apiserver" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "net/http" + "time" +) + +type StatefulSet struct { + name string + namespace string +} + +func RestartStatefulSet(c *gin.Context) { + clusterName := c.Param("clusterName") + var sts = &StatefulSet{} + if err := c.BindJSON(&sts); err != nil { + Response(c, http.StatusBadRequest, "invalid request params.", "") + return + } + //实现kubectl rollout restart StatefulSets功能 + patchOpt := metav1.PatchOptions{FieldManager: "kubectl-rollout"} + + dt := time.Now() + + patchInfo := fmt.Sprintf(`{"spec":{"template":{"metadata":{"annotations":{"kubectl.kubernetes.io/restartedAt":"%s"}}}}}`, dt.String()) + _, err := apiserver.ApiServer.ClientSetMap[clusterName].AppsV1().StatefulSets(sts.namespace).Patch(context.TODO(), sts.name, types.StrategicMergePatchType, []byte(patchInfo), patchOpt) + if err != nil { + Response(c, http.StatusBadRequest, "failed", nil) + } + Response(c, http.StatusOK, "success", nil) +} diff --git a/routers/router.go b/routers/router.go new file mode 100644 index 0000000..c7640b4 --- /dev/null +++ b/routers/router.go @@ -0,0 +1,52 @@ +package routers + +import ( + "github.com/gin-gonic/gin" + "jcc-schedule/routers/api/v1" +) + +func InitRouter() *gin.Engine { + r := gin.New() + r.Use(gin.Logger()) + r.Use(gin.Recovery()) + + //api分组 + apiv1 := r.Group("/api/v1") + + { + + //Namespace + namespace := apiv1.Group("namespace") + namespace.GET("/list", v1.ListNamespace) + + //Pod + pod := apiv1.Group("pod") + pod.GET("/list", v1.PodList) + + //Deployment + deployment := apiv1.Group("deployment") + deployment.GET("/list", v1.DeploymentList) + deployment.GET("/detail", v1.DeploymentDetail) + deployment.DELETE("", v1.DeleteDeployment) + deployment.PUT("/replica", v1.UpdateDeploymentReplica) + deployment.PUT("/restart", v1.RestartDeployment) + deployment.PUT("/start", v1.StartDeployment) + deployment.PUT("/pause", v1.PauseDeployment) + + // job + job := apiv1.Group("job") + job.GET("/detail", v1.JobDetail) + //app + app := apiv1.Group("app") + app.GET("/detail", v1.GetAppDetail) + app.GET("/pods", v1.GetAppPodsByAppName) + app.GET("/info", v1.GetAppByAppName) + app.DELETE("", v1.DelApp) + //sts + statefulSet := apiv1.Group("statefulSet") + statefulSet.PUT("/restart", v1.RestartStatefulSet) + + } + + return r +} diff --git a/tool/convert.go b/tool/convert.go new file mode 100644 index 0000000..a26440e --- /dev/null +++ b/tool/convert.go @@ -0,0 +1,16 @@ +package tool + +import ( + "encoding/json" + "strconv" +) + +func Convert(source interface{}, target interface{}) { + jsonByte, _ := json.Marshal(source) + json.Unmarshal(jsonByte, &target) +} + +func StringToInt32(str string) int32 { + j, _ := strconv.ParseInt(str, 10, 32) + return int32(j) +} diff --git a/tool/decimal.go b/tool/decimal.go deleted file mode 100644 index 281e091..0000000 --- a/tool/decimal.go +++ /dev/null @@ -1,11 +0,0 @@ -package tool - -import ( - "fmt" - "strconv" -) - -func FloatConv(num float64) float64 { - num, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", num), 64) - return num -} diff --git a/tool/resty.go b/tool/resty.go new file mode 100644 index 0000000..f3619ec --- /dev/null +++ b/tool/resty.go @@ -0,0 +1,5 @@ +package tool + +func Get() { + +}