Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
amogh09 committed Oct 25, 2023
1 parent c5b6385 commit a56ea61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 5 additions & 4 deletions agent/app/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,22 +760,23 @@ func (agent *ecsAgent) loadManagedDaemonImagesAsync(imageManager engine.ImageMan

// Loads Managed Daemon image and adds it to image cleanup exclusion list upon success.
func (agent *ecsAgent) loadManagedDaemonImage(dm dm.DaemonManager, imageManager engine.ImageManager) {
imageRef := dm.GetManagedDaemon().GetImageRef()
logger.Info("Starting to load Managed Daemon image", logger.Fields{
field.ImageRef: dm.GetManagedDaemon().GetImageRef(),
field.ImageRef: imageRef,
})
image, err := dm.LoadImage(agent.ctx, agent.dockerClient)
if err != nil {
logger.Error("Failed to load Managed Daemon image", logger.Fields{
field.ImageRef: dm.GetManagedDaemon().GetImageRef(),
field.ImageRef: imageRef,
field.Error: err,
})
return
}
logger.Info("Successfully loaded Managed Daemon image", logger.Fields{
field.ImageRef: dm.GetManagedDaemon().GetImageRef(),
field.ImageRef: imageRef,
field.ImageID: image.ID,
})
imageManager.AddImageToCleanUpExclusionList(dm.GetManagedDaemon().GetImageRef())
imageManager.AddImageToCleanUpExclusionList(imageRef)
}

// registerContainerInstance registers the container instance ID for the ECS Agent
Expand Down
4 changes: 1 addition & 3 deletions agent/ebs/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,8 @@ func (w *EBSWatcher) daemonRunning() bool {
return false
}

// Task is not running or about to run, we need to start a new one.
// Task is neither running nor about to run. We need to start a new one.

// Log some information.
if csiTask == nil {
logger.Info("EBS Managed Daemon task has not been initialized. Will start a new one.")
} else {
Expand Down Expand Up @@ -196,7 +195,6 @@ func (w *EBSWatcher) HandleResourceAttachment(ebs *apiebs.ResourceAttachment) {

// HandleResourceAttachment processes the resource attachment message. It will:
// 1. Check whether we already have this attachment in state and if so it's a noop.
// 2. Start the EBS CSI driver if it's not already running
// 3. Otherwise add the attachment to state, start its ack timer, and save to the agent state.
func (w *EBSWatcher) HandleEBSResourceAttachment(ebs *apiebs.ResourceAttachment) error {
attachmentType := ebs.GetAttachmentType()
Expand Down

0 comments on commit a56ea61

Please sign in to comment.