Skip to content

Commit f292ea7

Browse files
committed
remove not necessary comments
1 parent 83ee7ff commit f292ea7

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

agent/backend/pktvisor/pktvisor.go

-6
Original file line numberDiff line numberDiff line change
@@ -267,34 +267,28 @@ func (p *pktvisorBackend) Configure(logger *zap.Logger, repo policies.PolicyRepo
267267
}
268268
}
269269

270-
// Only add config section if it's not empty
271270
if len(configSection) > 0 {
272271
visorConfig["config"] = configSection
273272
}
274273

275-
// Create the full config structure
276274
fullConfig := map[string]any{
277275
"visor": visorConfig,
278276
}
279277

280-
// Convert config to YAML
281278
yamlData, err := yaml.Marshal(fullConfig)
282279
if err != nil {
283280
if rerr := os.Remove(tmpFile.Name()); rerr != nil {
284281
p.logger.Error("failed to remove temp config file", zap.String("file", tmpFile.Name()), zap.Error(rerr))
285282
}
286283
return fmt.Errorf("failed to marshal config: %w", err)
287284
}
288-
289-
// Write config to temp file
290285
if err := os.WriteFile(tmpFile.Name(), yamlData, 0o644); err != nil {
291286
if rerr := os.Remove(tmpFile.Name()); rerr != nil {
292287
p.logger.Error("failed to remove temp config file", zap.String("file", tmpFile.Name()), zap.Error(rerr))
293288
}
294289
return fmt.Errorf("failed to write config file: %w", err)
295290
}
296291

297-
// Update config file path to use the temp file
298292
p.configFile = tmpFile.Name()
299293

300294
if common.Otel.Host != "" && common.Otel.Port != 0 {

0 commit comments

Comments
 (0)