Skip to content

Commit 2126815

Browse files
committed
chore: Remove debug logging from stop/start operations
Removed temporary debug logging added during troubleshooting: - Removed DEBUG print statements from StopContainerGroup - Removed DEBUG/ERROR logging from stopWithACI - Removed DEBUG/ERROR logging from stopWithACA - Updated stopWithACA comment to reflect native Stop API usage The stop/start functionality is now working correctly with: - ACI: Using native client.Stop() API - ACA: Using native client.BeginStop() API Code is cleaner and production-ready without verbose debug output.
1 parent 3a66428 commit 2126815

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

apps/agent/internal/azure/client.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,11 @@ func (c *Client) StopContainerGroup(ctx context.Context, region, resourceGroup,
330330
return fmt.Errorf("failed to get ACI client for region %s: %w", region, err)
331331
}
332332

333-
fmt.Printf("DEBUG: Attempting to stop container group: %s in resource group: %s, region: %s\n", name, resourceGroup, region)
334-
335333
_, err = client.Stop(ctx, resourceGroup, name, nil)
336334
if err != nil {
337335
return fmt.Errorf("failed to stop container group %s in resource group %s: %w", name, resourceGroup, err)
338336
}
339337

340-
fmt.Printf("DEBUG: Successfully called Stop API for container group: %s\n", name)
341338
return nil
342339
}
343340

apps/agent/internal/services/deployment_strategy.go

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -296,27 +296,13 @@ func (d *DeploymentStrategy) deleteWithACA(ctx context.Context, workspaceID, res
296296
// stopWithACI stops a container using ACI (keeps it in stopped state)
297297
func (d *DeploymentStrategy) stopWithACI(ctx context.Context, workspaceID, region, resourceGroup string) error {
298298
containerGroupName := fmt.Sprintf("aci-%s", workspaceID)
299-
log.Printf("DEBUG: stopWithACI called for workspace %s, container group: %s", workspaceID, containerGroupName)
300-
err := d.azureClient.StopContainerGroup(ctx, region, resourceGroup, containerGroupName)
301-
if err != nil {
302-
log.Printf("ERROR: stopWithACI failed for %s: %v", containerGroupName, err)
303-
} else {
304-
log.Printf("DEBUG: stopWithACI succeeded for %s", containerGroupName)
305-
}
306-
return err
299+
return d.azureClient.StopContainerGroup(ctx, region, resourceGroup, containerGroupName)
307300
}
308301

309-
// stopWithACA stops a container using ACA (scales to zero)
302+
// stopWithACA stops a container using ACA (uses native Stop API)
310303
func (d *DeploymentStrategy) stopWithACA(ctx context.Context, workspaceID, resourceGroup string) error {
311304
containerAppName := fmt.Sprintf("aca-%s", workspaceID)
312-
log.Printf("DEBUG: stopWithACA called for workspace %s, container app: %s", workspaceID, containerAppName)
313-
err := d.azureClient.StopContainerApp(ctx, resourceGroup, containerAppName)
314-
if err != nil {
315-
log.Printf("ERROR: stopWithACA failed for %s: %v", containerAppName, err)
316-
} else {
317-
log.Printf("DEBUG: stopWithACA succeeded for %s (scaled to minReplicas=0, will stop when no traffic)", containerAppName)
318-
}
319-
return err
305+
return d.azureClient.StopContainerApp(ctx, resourceGroup, containerAppName)
320306
}
321307

322308
// startWithACI starts a container using ACI (starts stopped container or creates new one)

0 commit comments

Comments
 (0)