Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
水淹萌龙
kubesphere
提交
74325fa8
K
kubesphere
项目概览
水淹萌龙
/
kubesphere
与 Fork 源项目一致
Fork自
KubeSphere / kubesphere
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kubesphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
74325fa8
编写于
3月 26, 2019
作者:
H
huanggze
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use configmap to store log output configs
Signed-off-by:
N
huanggze
<
loganhuang@yunify.com
>
上级
8edf1ca7
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
167 addition
and
143 deletion
+167
-143
cmd/ks-apiserver/app/server.go
cmd/ks-apiserver/app/server.go
+7
-22
pkg/apis/logging/v1alpha2/register.go
pkg/apis/logging/v1alpha2/register.go
+1
-1
pkg/apiserver/logging/logging.go
pkg/apiserver/logging/logging.go
+5
-13
pkg/db/schema/V0__Logging_output_configs.sql
pkg/db/schema/V0__Logging_output_configs.sql
+0
-14
pkg/models/log/constants.go
pkg/models/log/constants.go
+1
-1
pkg/models/log/logcrd.go
pkg/models/log/logcrd.go
+147
-76
pkg/models/log/types.go
pkg/models/log/types.go
+0
-11
pkg/simple/client/elasticsearch/esclient.go
pkg/simple/client/elasticsearch/esclient.go
+4
-3
pkg/simple/client/fluentbit/fluentbitcrdclient.go
pkg/simple/client/fluentbit/fluentbitcrdclient.go
+2
-2
未找到文件。
cmd/ks-apiserver/app/server.go
浏览文件 @
74325fa8
...
...
@@ -31,9 +31,6 @@ import (
"kubesphere.io/kubesphere/pkg/informers"
logging
"kubesphere.io/kubesphere/pkg/models/log"
"kubesphere.io/kubesphere/pkg/signals"
es
"kubesphere.io/kubesphere/pkg/simple/client/elasticsearch"
fb
"kubesphere.io/kubesphere/pkg/simple/client/fluentbit"
"kubesphere.io/kubesphere/pkg/simple/client/mysql"
"log"
"net/http"
)
...
...
@@ -116,30 +113,18 @@ func initializeKialiConfig(s *options.ServerRunOptions) {
func
initializeESClientConfig
()
{
var
outputs
[]
logging
.
OutputDBBinding
var
configs
*
es
.
ESConfigs
db
:=
mysql
.
Client
()
if
!
db
.
HasTable
(
&
logging
.
OutputDBBinding
{})
{
// Panic
log
.
Print
(
"Flyway migration is not completed"
)
}
err
:=
db
.
Find
(
&
outputs
)
.
Error
// List all outputs
outputs
,
err
:=
logging
.
GetFluentbitOutputFromConfigMap
()
if
err
!=
nil
{
log
.
Printf
(
"get logging config failed. Error: %v"
,
err
)
glog
.
Errorln
(
err
)
return
}
// Retrieve es-type output from db
var
params
[]
fb
.
Parameter
// Iterate the outputs to get elasticsearch configs
for
_
,
output
:=
range
outputs
{
err
:=
jsonIter
.
UnmarshalFromString
(
output
.
Parameters
,
&
params
)
if
err
==
nil
{
if
configs
=
logging
.
ParseEsOutputParams
(
params
);
configs
!=
nil
{
configs
.
WriteESConfigs
()
return
}
if
configs
:=
logging
.
ParseEsOutputParams
(
output
.
Parameters
);
configs
!=
nil
{
configs
.
WriteESConfigs
()
return
}
}
}
...
...
pkg/apis/logging/v1alpha2/register.go
浏览文件 @
74325fa8
...
...
@@ -214,4 +214,4 @@ func addWebService(c *restful.Container) error {
c
.
Add
(
ws
)
return
nil
}
}
\ No newline at end of file
pkg/apiserver/logging/logging.go
浏览文件 @
74325fa8
...
...
@@ -91,6 +91,7 @@ func LoggingInsertFluentbitOutput(request *restful.Request, response *restful.Re
err
:=
request
.
ReadEntity
(
&
output
)
if
err
!=
nil
{
glog
.
Errorln
(
err
)
res
=
&
log
.
FluentbitOutputsResult
{
Status
:
http
.
StatusBadRequest
}
}
else
{
res
=
log
.
FluentbitOutputInsert
(
output
)
...
...
@@ -104,14 +105,10 @@ func LoggingUpdateFluentbitOutput(request *restful.Request, response *restful.Re
var
output
fb
.
OutputPlugin
id
:=
request
.
PathParameter
(
"output"
)
_
,
err
:=
strconv
.
ParseUint
(
id
,
10
,
64
)
if
err
!=
nil
{
res
:=
&
log
.
FluentbitOutputsResult
{
Status
:
http
.
StatusBadRequest
}
response
.
WriteAsJson
(
res
)
return
}
err
=
request
.
ReadEntity
(
&
output
)
err
:=
request
.
ReadEntity
(
&
output
)
if
err
!=
nil
{
glog
.
Errorln
(
err
)
res
:=
&
log
.
FluentbitOutputsResult
{
Status
:
http
.
StatusBadRequest
}
response
.
WriteAsJson
(
res
)
return
...
...
@@ -126,12 +123,7 @@ func LoggingDeleteFluentbitOutput(request *restful.Request, response *restful.Re
var
res
*
log
.
FluentbitOutputsResult
id
:=
request
.
PathParameter
(
"output"
)
_
,
err
:=
strconv
.
ParseUint
(
id
,
10
,
64
)
if
err
!=
nil
{
res
=
&
log
.
FluentbitOutputsResult
{
Status
:
http
.
StatusBadRequest
}
}
else
{
res
=
log
.
FluentbitOutputDelete
(
id
)
}
res
=
log
.
FluentbitOutputDelete
(
id
)
response
.
WriteAsJson
(
res
)
}
...
...
pkg/db/schema/V0__Logging_output_configs.sql
已删除
100644 → 0
浏览文件 @
8edf1ca7
CREATE
TABLE
output_db_bindings
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
type
TEXT
NOT
NULL
,
name
TEXT
NOT
NULL
,
parameters
TEXT
NOT
NULL
,
internal
BOOLEAN
,
enable
BOOLEAN
NOT
NULL
,
updatetime
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
PRIMARY
KEY
(
id
),
UNIQUE
(
id
)
);
INSERT
INTO
output_db_bindings
(
type
,
name
,
parameters
,
enable
)
VALUES
(
'fluentbit_output'
,
'fluentbit-output'
,
'[{"name": "Name", "value": "es"}, {"name": "Match", "value": "kube.*"}, {"name": "Host", "value": "elasticsearch-logging-data.kubesphere-logging-system.svc"}, {"name": "Port", "value": "9200"}, {"name": "Logstash_Format", "value": "On"}, {"name": "Replace_Dots", "value": "on"}, {"name": "Retry_Limit", "value": "False"}, {"name": "Type", "value": "flb_type"}, {"name": "Time_Key", "value": "@timestamp"}, {"name": "Logstash_Prefix", "value": "logstash"} ]'
,
'1'
);
\ No newline at end of file
pkg/models/log/constants.go
浏览文件 @
74325fa8
...
...
@@ -27,4 +27,4 @@ const (
QueryLevelWorkload
QueryLevelPod
QueryLevelContainer
)
)
\ No newline at end of file
pkg/models/log/logcrd.go
浏览文件 @
74325fa8
...
...
@@ -17,22 +17,31 @@ limitations under the License.
package
log
import
(
"github.com/jinzhu/gorm"
_
"github.com/go-sql-driver/mysql"
"github.com/golang/glog"
"github.com/google/uuid"
"github.com/json-iterator/go"
corev1
"k8s.io/api/core/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"kubesphere.io/kubesphere/pkg/informers"
es
"kubesphere.io/kubesphere/pkg/simple/client/elasticsearch"
fb
"kubesphere.io/kubesphere/pkg/simple/client/fluentbit"
"kubesphere.io/kubesphere/pkg/simple/client/mysql"
"net/http"
"strings"
"time"
_
"github.com/go-sql-driver/mysql"
)
var
jsonIter
=
jsoniter
.
ConfigCompatibleWithStandardLibrary
const
(
ConfigMapName
=
"fluent-bit-output-config"
ConfigMapData
=
"outputs"
LoggingNamespace
=
"kubesphere-logging-system"
)
func
createCRDClientSet
()
(
*
rest
.
RESTClient
,
*
runtime
.
Scheme
,
error
)
{
config
,
err
:=
fb
.
GetClientConfig
(
""
)
if
err
!=
nil
{
...
...
@@ -84,7 +93,7 @@ func FluentbitFiltersQuery() *FluentbitFiltersResult {
}
// Create a CRD client interface
crdclient
:=
fb
.
CrdClient
(
crdcs
,
scheme
,
"kubesphere-logging-system"
)
crdclient
:=
fb
.
CrdClient
(
crdcs
,
scheme
,
LoggingNamespace
)
item
,
err
:=
crdclient
.
Get
(
"fluent-bit"
)
if
err
!=
nil
{
...
...
@@ -193,7 +202,7 @@ func FluentbitFiltersUpdate(filters *[]FluentbitFilter) *FluentbitFiltersResult
}
// Create a CRD client interface
crdclient
:=
fb
.
CrdClient
(
crdcs
,
scheme
,
"kubesphere-logging-system"
)
crdclient
:=
fb
.
CrdClient
(
crdcs
,
scheme
,
LoggingNamespace
)
var
item
*
fb
.
FluentBit
var
err_read
error
...
...
@@ -221,34 +230,13 @@ func FluentbitFiltersUpdate(filters *[]FluentbitFilter) *FluentbitFiltersResult
func
FluentbitOutputsQuery
()
*
FluentbitOutputsResult
{
var
result
FluentbitOutputsResult
// Retrieve outputs from DB
db
:=
mysql
.
Client
()
var
outputs
[]
OutputDBBinding
err
:=
db
.
Find
(
&
outputs
)
.
Error
outputs
,
err
:=
GetFluentbitOutputFromConfigMap
()
if
err
!=
nil
{
result
.
Status
=
http
.
Status
InternalServerError
result
.
Status
=
http
.
Status
NotFound
return
&
result
}
var
unmarshaledOutputs
[]
fb
.
OutputPlugin
for
_
,
output
:=
range
outputs
{
var
params
[]
fb
.
Parameter
err
=
jsonIter
.
UnmarshalFromString
(
output
.
Parameters
,
&
params
)
if
err
!=
nil
{
result
.
Status
=
http
.
StatusInternalServerError
return
&
result
}
unmarshaledOutputs
=
append
(
unmarshaledOutputs
,
fb
.
OutputPlugin
{
Plugin
:
fb
.
Plugin
{
Type
:
output
.
Type
,
Name
:
output
.
Name
,
Parameters
:
params
},
Id
:
output
.
Id
,
Enable
:
output
.
Enable
,
Updatetime
:
output
.
Updatetime
})
}
result
.
Outputs
=
unmarshaledOutputs
result
.
Outputs
=
outputs
result
.
Status
=
http
.
StatusOK
return
&
result
...
...
@@ -257,25 +245,29 @@ func FluentbitOutputsQuery() *FluentbitOutputsResult {
func
FluentbitOutputInsert
(
output
fb
.
OutputPlugin
)
*
FluentbitOutputsResult
{
var
result
FluentbitOutputsResult
params
,
err
:=
jsoniter
.
MarshalToString
(
output
.
Parameters
)
if
err
!=
nil
{
result
.
Status
=
http
.
StatusBadRequest
return
&
result
// 1. Update ConfigMap
var
outputs
[]
fb
.
OutputPlugin
outputs
,
err
:=
GetFluentbitOutputFromConfigMap
()
if
err
!=
nil
{
// If the ConfigMap doesn't exist, a new one will be created later
glog
.
Errorln
(
err
)
}
// 1. Update DB
db
:=
mysql
.
Client
()
// When adding a new output for the first time, one should always set it disabled
output
.
Enable
=
false
output
.
Id
=
uuid
.
New
()
.
String
()
output
.
Updatetime
=
time
.
Now
()
marshaledOutput
:=
OutputDBBinding
{
Type
:
output
.
Type
,
Name
:
output
.
Name
,
Parameters
:
params
,
Enable
:
output
.
Enable
,
Updatetime
:
time
.
Now
()}
err
=
db
.
Create
(
&
marshaledOutput
)
.
Error
outputs
=
append
(
outputs
,
output
)
err
=
updateFluentbitOutputConfigMap
(
outputs
)
if
err
!=
nil
{
result
.
Status
=
http
.
StatusInternalServerError
return
&
result
}
// 2. Keep CRD in inline with
DB
err
=
syncFluentbitCRDOutputWith
DB
(
db
)
// 2. Keep CRD in inline with
ConfigMap
err
=
syncFluentbitCRDOutputWith
ConfigMap
(
outputs
)
if
err
!=
nil
{
result
.
Status
=
http
.
StatusInternalServerError
return
&
result
...
...
@@ -294,37 +286,40 @@ func FluentbitOutputInsert(output fb.OutputPlugin) *FluentbitOutputsResult {
func
FluentbitOutputUpdate
(
output
fb
.
OutputPlugin
,
id
string
)
*
FluentbitOutputsResult
{
var
result
FluentbitOutputsResult
// 1. Update DB
db
:=
mysql
.
Client
()
params
,
err
:=
jsoniter
.
MarshalToString
(
output
.
Parameters
)
// 1. Update ConfigMap
var
outputs
[]
fb
.
OutputPlugin
outputs
,
err
:=
GetFluentbitOutputFromConfigMap
()
if
err
!=
nil
{
result
.
Status
=
http
.
StatusBadRequest
return
&
result
// If the ConfigMap doesn't exist, a new one will be created later
glog
.
Errorln
(
err
)
}
var
marshaledOutput
OutputDBBinding
err
=
db
.
Where
(
"id = ?"
,
id
)
.
First
(
&
marshaledOutput
)
.
Error
if
err
!=
nil
{
result
.
Status
=
http
.
StatusInternalServerError
index
:=
0
for
_
,
output
:=
range
outputs
{
if
output
.
Id
==
id
{
break
}
index
++
}
if
index
>=
len
(
outputs
)
{
result
.
Status
=
http
.
StatusNotFound
return
&
result
}
marshaledOutput
.
Name
=
output
.
Name
marshaledOutput
.
Type
=
output
.
Type
marshaledOutput
.
Parameters
=
params
marshaledOutput
.
Enable
=
output
.
Enable
output
.
Updatetime
=
time
.
Now
()
outputs
=
append
(
append
(
outputs
[
:
index
],
outputs
[
index
+
1
:
]
...
),
output
)
err
=
db
.
Save
(
&
marshaledOutput
)
.
Error
err
=
updateFluentbitOutputConfigMap
(
outputs
)
if
err
!=
nil
{
result
.
Status
=
http
.
StatusInternalServerError
return
&
result
}
// 2. Keep CRD in inline with
DB
err
=
syncFluentbitCRDOutputWith
DB
(
db
)
// 2. Keep CRD in inline with
ConfigMap
err
=
syncFluentbitCRDOutputWith
ConfigMap
(
outputs
)
if
err
!=
nil
{
result
.
Status
=
http
.
Status
BadRequest
result
.
Status
=
http
.
Status
InternalServerError
return
&
result
}
...
...
@@ -341,19 +336,35 @@ func FluentbitOutputUpdate(output fb.OutputPlugin, id string) *FluentbitOutputsR
func
FluentbitOutputDelete
(
id
string
)
*
FluentbitOutputsResult
{
var
result
FluentbitOutputsResult
// 1. Remove the record from DB
db
:=
mysql
.
Client
()
// 1. Update ConfigMap
// If the ConfigMap doesn't exist, a new one will be created
outputs
,
_
:=
GetFluentbitOutputFromConfigMap
()
index
:=
0
for
_
,
output
:=
range
outputs
{
if
output
.
Id
==
id
{
break
}
index
++
}
if
index
>=
len
(
outputs
)
{
result
.
Status
=
http
.
StatusNotFound
return
&
result
}
outputs
=
append
(
outputs
[
:
index
],
outputs
[
index
+
1
:
]
...
)
err
:=
db
.
Where
(
"id = ?"
,
id
)
.
Delete
(
&
OutputDBBinding
{})
.
Error
err
:=
updateFluentbitOutputConfigMap
(
outputs
)
if
err
!=
nil
{
result
.
Status
=
http
.
StatusInternalServerError
return
&
result
}
// 2. Keep CRD in inline with DB
err
=
syncFluentbitCRDOutputWith
DB
(
db
)
err
=
syncFluentbitCRDOutputWith
ConfigMap
(
outputs
)
if
err
!=
nil
{
result
.
Status
=
http
.
Status
BadRequest
result
.
Status
=
http
.
Status
InternalServerError
return
&
result
}
...
...
@@ -361,29 +372,89 @@ func FluentbitOutputDelete(id string) *FluentbitOutputsResult {
return
&
result
}
func
syncFluentbitCRDOutputWithDB
(
db
*
gorm
.
DB
)
error
{
var
outputs
[]
OutputDBBinding
func
GetFluentbitOutputFromConfigMap
()
([]
fb
.
OutputPlugin
,
error
)
{
configMap
,
err
:=
informers
.
SharedInformerFactory
()
.
Core
()
.
V1
()
.
ConfigMaps
()
.
Lister
()
.
ConfigMaps
(
LoggingNamespace
)
.
Get
(
ConfigMapName
)
if
err
!=
nil
{
return
nil
,
err
}
data
:=
configMap
.
Data
[
ConfigMapData
]
var
outputs
[]
fb
.
OutputPlugin
if
err
=
jsonIter
.
UnmarshalFromString
(
data
,
&
outputs
);
err
!=
nil
{
return
nil
,
err
}
return
outputs
,
nil
}
func
updateFluentbitOutputConfigMap
(
outputs
[]
fb
.
OutputPlugin
)
error
{
err
:=
db
.
Where
(
"enable is true"
)
.
Find
(
&
outputs
)
.
Error
var
data
string
data
,
err
:=
jsonIter
.
MarshalToString
(
outputs
)
if
err
!=
nil
{
glog
.
Errorln
(
err
)
return
err
}
var
unmarshaledOutputs
[]
fb
.
Plugin
// Update the ConfigMap
config
,
err
:=
rest
.
InClusterConfig
()
if
err
!=
nil
{
glog
.
Errorln
(
err
)
return
err
}
for
_
,
output
:=
range
outputs
{
var
params
[]
fb
.
Parameter
// Creates the clientset
clientset
,
err
:=
kubernetes
.
NewForConfig
(
config
)
if
err
!=
nil
{
glog
.
Errorln
(
err
)
return
err
}
err
=
jsonIter
.
UnmarshalFromString
(
output
.
Parameters
,
&
params
)
configMapClient
:=
clientset
.
CoreV1
()
.
ConfigMaps
(
LoggingNamespace
)
configMap
,
err
:=
configMapClient
.
Get
(
ConfigMapName
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
// If the ConfigMap doesn't exist, create a new one
newConfigMap
:=
&
corev1
.
ConfigMap
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
ConfigMapName
,
},
Data
:
map
[
string
]
string
{
ConfigMapData
:
data
},
}
_
,
err
=
configMapClient
.
Create
(
newConfigMap
)
if
err
!=
nil
{
glog
.
Errorln
(
err
)
return
err
}
}
else
{
// update
configMap
.
Data
=
map
[
string
]
string
{
ConfigMapData
:
data
}
_
,
err
=
configMapClient
.
Update
(
configMap
)
if
err
!=
nil
{
glog
.
Errorln
(
err
)
return
err
}
}
return
nil
}
unmarshaledOutputs
=
append
(
unmarshaledOutputs
,
fb
.
Plugin
{
Type
:
output
.
Type
,
Name
:
output
.
Name
,
Parameters
:
params
})
func
syncFluentbitCRDOutputWithConfigMap
(
outputs
[]
fb
.
OutputPlugin
)
error
{
var
enabledOutputs
[]
fb
.
Plugin
for
_
,
output
:=
range
outputs
{
if
output
.
Enable
{
enabledOutputs
=
append
(
enabledOutputs
,
fb
.
Plugin
{
Type
:
output
.
Type
,
Name
:
output
.
Name
,
Parameters
:
output
.
Parameters
})
}
}
// Empty output is not allowed, must specify a null-type output
if
len
(
unmarsha
ledOutputs
)
==
0
{
unmarsha
ledOutputs
=
[]
fb
.
Plugin
{
if
len
(
enab
ledOutputs
)
==
0
{
enab
ledOutputs
=
[]
fb
.
Plugin
{
{
Type
:
"fluentbit_output"
,
Name
:
"fluentbit-output-null"
,
...
...
@@ -407,14 +478,14 @@ func syncFluentbitCRDOutputWithDB(db *gorm.DB) error {
}
// Create a CRD client interface
crdclient
:=
fb
.
CrdClient
(
crdcs
,
scheme
,
"kubesphere-logging-system"
)
crdclient
:=
fb
.
CrdClient
(
crdcs
,
scheme
,
LoggingNamespace
)
fluentbit
,
err
:=
crdclient
.
Get
(
"fluent-bit"
)
if
err
!=
nil
{
return
err
}
fluentbit
.
Spec
.
Output
=
unmarsha
ledOutputs
fluentbit
.
Spec
.
Output
=
enab
ledOutputs
_
,
err
=
crdclient
.
Update
(
"fluent-bit"
,
fluentbit
)
if
err
!=
nil
{
return
err
...
...
pkg/models/log/types.go
浏览文件 @
74325fa8
...
...
@@ -20,7 +20,6 @@ package log
import
(
fb
"kubesphere.io/kubesphere/pkg/simple/client/fluentbit"
"time"
)
type
FluentbitCRDResult
struct
{
...
...
@@ -52,13 +51,3 @@ type FluentbitOutputsResult struct {
Status
int
`json:"status"`
Outputs
[]
fb
.
OutputPlugin
`json:"outputs,omitempty"`
}
type
OutputDBBinding
struct
{
Id
uint
`gorm:"primary_key;auto_increment;unique"`
Type
string
`gorm:"not null"`
Name
string
`gorm:"not null"`
Parameters
string
`gorm:"not null"`
Internal
bool
Enable
bool
`gorm:"not null"`
Updatetime
time
.
Time
`gorm:"not null"`
}
pkg/simple/client/elasticsearch/esclient.go
浏览文件 @
74325fa8
...
...
@@ -16,6 +16,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/golang/glog"
"io/ioutil"
"net/http"
"strconv"
...
...
@@ -608,7 +609,7 @@ func Query(param QueryParameters) *QueryResult {
url
:=
fmt
.
Sprintf
(
"http://%s:%s/%s*/_search"
,
es
.
Host
,
es
.
Port
,
es
.
Index
)
request
,
err
:=
http
.
NewRequest
(
"GET"
,
url
,
bytes
.
NewBuffer
(
query
))
if
err
!=
nil
{
//fmt.Println("Create request error ", err.Error()
)
glog
.
Errorln
(
err
)
queryResult
=
new
(
QueryResult
)
queryResult
.
Status
=
http
.
StatusNotFound
return
queryResult
...
...
@@ -617,7 +618,7 @@ func Query(param QueryParameters) *QueryResult {
response
,
err
:=
client
.
Do
(
request
)
if
err
!=
nil
{
//fmt.Println("Send request error ", err.Error()
)
glog
.
Errorln
(
err
)
queryResult
=
new
(
QueryResult
)
queryResult
.
Status
=
http
.
StatusNotFound
return
queryResult
...
...
@@ -626,7 +627,7 @@ func Query(param QueryParameters) *QueryResult {
body
,
err
:=
ioutil
.
ReadAll
(
response
.
Body
)
if
err
!=
nil
{
//fmt.Println("Read response error ", err.Error()
)
glog
.
Errorln
(
err
)
queryResult
=
new
(
QueryResult
)
queryResult
.
Status
=
http
.
StatusNotFound
return
queryResult
...
...
pkg/simple/client/fluentbit/fluentbitcrdclient.go
浏览文件 @
74325fa8
...
...
@@ -72,9 +72,9 @@ type Plugin struct {
// Fluent-bit output plugins
type
OutputPlugin
struct
{
Plugin
Id
uint
`json:"id"`
Id
string
`json:"id"`
Enable
bool
`json:"enable"`
Updatetime
time
.
Time
`json:"updatetime"`
Updatetime
time
.
Time
`json:"updatetime
,omitempty
"`
}
// Parameter generic parameter type to handle values from different sources
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录