@@ -161,15 +161,28 @@ func (a *app) handleNwInstCfg(ctx context.Context, cfg *ndk.NetworkInstanceNotif
161161func (a * app ) handleGrpcTunnel (ctx context.Context , txCfg * ndk.ConfigNotification ) {
162162 switch txCfg .GetOp () {
163163 case ndk .SdkMgrOperation_Create :
164+ log .Infof ("Create: .system.grpc_tunnel: %+v" , txCfg )
164165 a .handleGrpcTunnelCreate (ctx , txCfg .GetData ())
165166 case ndk .SdkMgrOperation_Update :
167+ log .Infof ("Update: .system.grpc_tunnel: %+v" , txCfg )
166168 a .handleGrpcTunnelChange (ctx , txCfg .GetData ())
167169 case ndk .SdkMgrOperation_Delete :
170+ log .Infof ("Delete: .system.grpc_tunnel: %+v" , txCfg )
168171 a .handleGrpcTunnelDelete (ctx )
169172 }
170173}
171174
172- func (a * app ) handleGrpcTunnelCreate (ctx context.Context , cfgData * ndk.ConfigData ) {}
175+ func (a * app ) handleGrpcTunnelCreate (ctx context.Context , cfgData * ndk.ConfigData ) {
176+ newAppCfg := new (appConfig )
177+ err := json .Unmarshal ([]byte (cfgData .GetJson ()), newAppCfg )
178+ if err != nil {
179+ log .Errorf ("failed to unmarshal path %q config %+v" , grpcTunnelPath , cfgData )
180+ return
181+ }
182+ a .config .app = newAppCfg
183+ a .config .app .OperState = operDown
184+ a .updateRootLevelTelemetry (a .config .app )
185+ }
173186
174187func (a * app ) handleGrpcTunnelChange (ctx context.Context , cfgData * ndk.ConfigData ) {
175188 // unmarshal changed config
@@ -185,7 +198,6 @@ func (a *app) handleGrpcTunnelChange(ctx context.Context, cfgData *ndk.ConfigDat
185198 case a .config .app .AdminState == adminDisable && a .config .app .OperState == operUp :
186199 // stop all tunnels
187200 a .stopAll (ctx )
188- // TODO: update all telemetry
189201 a .config .app .OperState = operDown
190202 case a .config .app .AdminState == adminEnable && a .config .app .OperState != operUp :
191203 // start all tunnels
0 commit comments