Skip to content

Commit

Permalink
change field "PluginsTracing.Enable" to "PluginsTracing.Enabled" (#43)
Browse files Browse the repository at this point in the history
Signed-off-by: laminar <[email protected]>
  • Loading branch information
tpiperatgod authored Mar 17, 2022
1 parent cd256da commit 465c554
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ type FunctionOut struct {
}

type PluginsTracing struct {
Enable bool `json:"enable" yaml:"enable"`
Enabled bool `json:"enabled" yaml:"enabled"`
Provider *TracingProvider `json:"provider" yaml:"provider"`
Tags map[string]string `json:"tags,omitempty" yaml:"tags,omitempty"`
Baggage map[string]string `json:"baggage" yaml:"baggage"`
Expand Down Expand Up @@ -622,7 +622,7 @@ func (o *FunctionOut) WithData(data []byte) *FunctionOut {
}

func (tracing *PluginsTracing) IsEnabled() bool {
return tracing.Enable
return tracing.Enabled
}

func (tracing *PluginsTracing) ProviderName() string {
Expand Down Expand Up @@ -752,7 +752,7 @@ func parseContext() (*FunctionContext, error) {
ctx.podNamespace = podNamespace
}

if ctx.PluginsTracing != nil && ctx.PluginsTracing.Enable {
if ctx.PluginsTracing != nil && ctx.PluginsTracing.IsEnabled() {
if ctx.PluginsTracing.Provider != nil && ctx.PluginsTracing.Provider.Name != "" {
switch ctx.PluginsTracing.Provider.Name {
case TracingProviderSkywalking, TracingProviderOpentelemetry:
Expand Down
6 changes: 3 additions & 3 deletions context/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var (
"prePlugins": ["plgA", "plgB", "plgC"],
"postPlugins": ["plgC", "plgA", "plgB"],
"pluginsTracing": {
"enable": true,
"enabled": true,
"provider": {
"name": "skywalking",
"oapServer": "localhost:xxx"
Expand All @@ -79,7 +79,7 @@ var (
"prePlugins": ["plgA", "plgB", "plgC"],
"postPlugins": ["plgC", "plgA", "plgB"],
"pluginsTracing": {
"enable": true,
"enabled": true,
"provider": {
"name": "",
"oapServer": "localhost:xxx"
Expand All @@ -94,7 +94,7 @@ var (
"prePlugins": ["plgA", "plgB", "plgC"],
"postPlugins": ["plgC", "plgA", "plgB"],
"pluginsTracing": {
"enable": true,
"enabled": true,
"provider": {
"name": "wrongProvider",
"oapServer": "localhost:xxx"
Expand Down
4 changes: 2 additions & 2 deletions plugin/skywalking/test/binding-event/manifests/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ spec:
}
},
"pluginsTracing": {
"enable": true,
"enabled": true,
"provider": {
"name": "skywalking",
"oapServer": "collector.default.svc:19876"
Expand Down Expand Up @@ -161,7 +161,7 @@ spec:
}
},
"pluginsTracing": {
"enable": true,
"enabled": true,
"provider": {
"name": "skywalking",
"oapServer": "collector.default.svc:19876"
Expand Down
2 changes: 1 addition & 1 deletion plugin/skywalking/test/sync-request/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ services:
"prePlugins": [],
"postPlugins": [],
"pluginsTracing": {
"enable": true,
"enabled": true,
"provider": {
"name": "skywalking",
"oapServer": "mockoap:19876"
Expand Down
4 changes: 2 additions & 2 deletions plugin/skywalking/test/topic-event/manifests/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ spec:
}
},
"pluginsTracing": {
"enable": true,
"enabled": true,
"provider": {
"name": "skywalking",
"oapServer": "collector.default.svc:19876"
Expand Down Expand Up @@ -156,7 +156,7 @@ spec:
}
},
"pluginsTracing": {
"enable": true,
"enabled": true,
"provider": {
"name": "skywalking",
"oapServer": "collector.default.svc:19876"
Expand Down

0 comments on commit 465c554

Please sign in to comment.