Merge pull request #19 from wbc6080/sync-12.16
Synchronize changes from the kubeedge/staging directory on 2024.12.16
This commit is contained in:
commit
96009b7561
|
|
@ -0,0 +1,3 @@
|
|||
# KubeEdge Community Code of Conduct
|
||||
|
||||
Please refer to our [KubeEdge Community Code of Conduct](https://github.com/kubeedge/community/blob/master/CODE_OF_CONDUCT.md)
|
||||
|
|
@ -21,7 +21,6 @@ import (
|
|||
"time"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
"github.com/kubeedge/Template/driver"
|
||||
"github.com/kubeedge/mapper-framework/pkg/common"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ func dataHandler(ctx context.Context, dev *driver.CustomizedDev) {
|
|||
// pushHandler start data panel work
|
||||
func pushHandler(ctx context.Context, twin *common.Twin, client *driver.CustomizedClient, visitorConfig *driver.VisitorConfig, dataModel *common.DataModel) {
|
||||
if twin.Property.PushMethod.MethodName == common.PushMethodOTEL {
|
||||
otelMethod.DataHandler(ctx, &twin, dev.CustomizedClient, &visitorConfig, dataModel)
|
||||
otelMethod.DataHandler(ctx, twin, client, visitorConfig, dataModel)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -266,12 +266,18 @@ func setVisitor(visitorConfig *driver.VisitorConfig, twin *common.Twin, dev *dri
|
|||
return nil
|
||||
}
|
||||
klog.V(2).Infof("Convert type: %s, value: %s ", twin.Property.PProperty.DataType, twin.ObservedDesired.Value)
|
||||
value, err := common.Convert(twin.Property.PProperty.DataType, twin.ObservedDesired.Value)
|
||||
if err != nil {
|
||||
klog.Errorf("Failed to convert value as %s : %v", twin.Property.PProperty.DataType, err)
|
||||
return err
|
||||
var value interface{}
|
||||
if twin.ObservedDesired.Value != "" {
|
||||
convertedValue, err := common.Convert(twin.Property.PProperty.DataType, twin.ObservedDesired.Value)
|
||||
if err != nil {
|
||||
klog.Errorf("Failed to convert value as %s : %v", twin.Property.PProperty.DataType, err)
|
||||
return err
|
||||
}
|
||||
value = convertedValue
|
||||
} else {
|
||||
value = twin.ObservedDesired.Value
|
||||
}
|
||||
err = dev.CustomizedClient.SetDeviceData(value, visitorConfig)
|
||||
err := dev.CustomizedClient.SetDeviceData(value, visitorConfig)
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s set device data error: %v", twin.PropertyName, err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,13 +7,12 @@ require (
|
|||
github.com/go-redis/redis/v8 v8.11.5
|
||||
github.com/go-sql-driver/mysql v1.7.1
|
||||
github.com/influxdata/influxdb-client-go/v2 v2.13.0
|
||||
github.com/kubeedge/api v1.19.0
|
||||
github.com/kubeedge/mapper-framework v1.18.1-0.20241029114341-77b73b42c27d
|
||||
github.com/kubeedge/api v0.0.0
|
||||
github.com/kubeedge/mapper-framework v0.0.0
|
||||
github.com/sailorvii/goav v0.1.4
|
||||
github.com/taosdata/driver-go/v3 v3.5.1
|
||||
go.opentelemetry.io/otel v1.23.0
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.23.0
|
||||
go.opentelemetry.io/otel/metric v1.23.0
|
||||
go.opentelemetry.io/otel/sdk v1.23.0
|
||||
go.opentelemetry.io/otel/sdk/metric v1.23.0
|
||||
k8s.io/klog/v2 v2.110.1
|
||||
|
|
@ -38,6 +37,7 @@ require (
|
|||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/oapi-codegen/runtime v1.0.0 // indirect
|
||||
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace // indirect
|
||||
go.opentelemetry.io/otel/metric v1.23.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.23.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
|
||||
golang.org/x/net v0.30.0 // indirect
|
||||
|
|
@ -49,3 +49,8 @@ require (
|
|||
google.golang.org/protobuf v1.35.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
)
|
||||
|
||||
replace (
|
||||
github.com/kubeedge/api => ../api
|
||||
github.com/kubeedge/mapper-framework => ../mapper-framework
|
||||
)
|
||||
|
|
|
|||
|
|
@ -54,10 +54,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
|||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/kubeedge/api v1.19.0 h1:314XF6Ua5jeAOPG1UY6BotGozTHB23LRpSnxTdhRtWo=
|
||||
github.com/kubeedge/api v1.19.0/go.mod h1:Sn98nCN83P7nZt6JrgZd2y/qK21Z1mnePdFMQBC4VAw=
|
||||
github.com/kubeedge/mapper-framework v1.18.1-0.20241029114341-77b73b42c27d h1:xs3WNA5QUmX/7IMXdx0Jb55XsYs+sXXR5XMVSWs5UvU=
|
||||
github.com/kubeedge/mapper-framework v1.18.1-0.20241029114341-77b73b42c27d/go.mod h1:sn0Q7EEjWiEG1YNid1L6634iwCzl5jm67S6wH/qLw+s=
|
||||
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=
|
||||
|
|
|
|||
6
go.mod
6
go.mod
|
|
@ -1,12 +1,12 @@
|
|||
module github.com/kubeedge/mapper-framework
|
||||
|
||||
go 1.21
|
||||
go 1.22
|
||||
|
||||
require (
|
||||
github.com/avast/retry-go v3.0.0+incompatible
|
||||
github.com/golang/protobuf v1.5.4
|
||||
github.com/gorilla/mux v1.8.0
|
||||
github.com/kubeedge/api v1.19.0
|
||||
github.com/kubeedge/api v0.0.0
|
||||
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace
|
||||
golang.org/x/net v0.23.0 // indirect
|
||||
google.golang.org/grpc v1.63.0
|
||||
|
|
@ -24,3 +24,5 @@ require (
|
|||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
|
||||
)
|
||||
|
||||
replace github.com/kubeedge/api => ../api
|
||||
|
|
|
|||
2
go.sum
2
go.sum
|
|
@ -16,8 +16,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
|
|||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kubeedge/api v1.19.0 h1:314XF6Ua5jeAOPG1UY6BotGozTHB23LRpSnxTdhRtWo=
|
||||
github.com/kubeedge/api v1.19.0/go.mod h1:Sn98nCN83P7nZt6JrgZd2y/qK21Z1mnePdFMQBC4VAw=
|
||||
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/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace h1:9PNP1jnUjRhfmGMlkXHjYPishpcw4jpSt/V/xYY3FMA=
|
||||
|
|
|
|||
Loading…
Reference in New Issue