Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve linting errors in CI pipeline #82

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion core/security/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import (
type EsRequest struct {
Doc string `json:"doc"`
Privilege string `json:"privilege"`
ClusterRequest
IndexRequest
}

Expand Down
2 changes: 1 addition & 1 deletion model/alerting/rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func TestCreateRule(t *testing.T) {

Metrics: Metric{
Metric: insight.Metric{
Groups: []insight.MetricGroupItem{{"metadata.labels.cluster_id", 10}, {"metadata.labels.node_id", 10}},
Groups: []insight.MetricGroupItem{{Field: "metadata.labels.cluster_id", Limit: 10}, {Field: "metadata.labels.node_id", Limit: 10}},
Items: []insight.MetricItem{
{Name: "a", Field: "payload.elasticsearch.node_stats.fs.total.free_in_bytes", Statistic: "min"},
{Name: "b", Field: "payload.elasticsearch.node_stats.fs.total.total_in_bytes", Statistic: "max"},
Expand Down
1 change: 0 additions & 1 deletion modules/agent/api/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ func (h *APIHandler) autoEnrollESNode(w http.ResponseWriter, req *http.Request,

if autoEnrollRunning.Load() {
panic(errors.New("auto_enroll is already running in background"))
return
}

autoEnrollRunning.Swap(true)
Expand Down
1 change: 0 additions & 1 deletion modules/elastic/api/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,6 @@ func (h *APIHandler) FetchHostInfo(w http.ResponseWriter, req *http.Request, ps
bucketSize, min, max, err := h.GetMetricRangeAndBucketSize(req, "", "", 15)
if err != nil {
panic(err)
return
}
networkInMetricItem := newMetricItem("network_in_rate", 1, SystemGroupKey)
networkInMetricItem.AddAxi("network_rate", "group1", common.PositionLeft, "bytes", "0.[0]", "0.[0]", 5, true)
Expand Down
1 change: 0 additions & 1 deletion modules/elastic/api/manage.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ func (h *APIHandler) HandleClusterMetricsAction(w http.ResponseWriter, req *http
bucketSize, min, max, err := h.GetMetricRangeAndBucketSize(req, id, metricType, 90)
if err != nil {
panic(err)
return
}
var metrics map[string]*common.MetricItem
if bucketSize <= 60 {
Expand Down
1 change: 0 additions & 1 deletion modules/elastic/api/v1/cluster_overview.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ func (h *APIHandler) FetchClusterInfo(w http.ResponseWriter, req *http.Request,
bucketSize, min, max, err := h.GetMetricRangeAndBucketSize(req, clusterIDs[0], MetricTypeIndexStats, 15)
if err != nil {
panic(err)
return
}

query := util.MapStr{}
Expand Down
1 change: 0 additions & 1 deletion modules/elastic/api/v1/manage.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ func (h *APIHandler) HandleClusterMetricsAction(w http.ResponseWriter, req *http
bucketSize, min, max, err := h.GetMetricRangeAndBucketSize(req, id, metricType, 90)
if err != nil {
panic(err)
return
}

timeout := h.GetParameterOrDefault(req, "timeout", "60s")
Expand Down
1 change: 0 additions & 1 deletion modules/elastic/api/v1/node_overview.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ func (h *APIHandler) FetchNodeInfo(w http.ResponseWriter, req *http.Request, ps
bucketSize, min, max, err := h.GetMetricRangeAndBucketSize(req, clusterID, MetricTypeNodeStats, 15)
if err != nil {
panic(err)
return
}
// 索引速率
indexMetric := newMetricItem("indexing", 1, OperationGroupKey)
Expand Down
2 changes: 1 addition & 1 deletion plugin/api/insight/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ func getMetadataByIndexPattern(clusterID, indexPattern, timeField string, filter
}}
if seriesType == "column" || seriesType == "pie" {
seriesItem.Metric.Groups = []insight.MetricGroupItem{
{aggField.Name, 10},
{Field: aggField.Name, Limit: 10},
}
}
fieldVis := insight.Visualization{
Expand Down
1 change: 0 additions & 1 deletion plugin/managed/server/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ func (h *APIHandler) createInstance(w http.ResponseWriter, req *http.Request, ps
obj.Name = res.Name
}
obj.Application = res.Application
res.Network = res.Network

exists, err := orm.Get(obj)
if err != nil && err != elastic.ErrNotFound {
Expand Down
Loading