diff --git a/updater/aws.go b/updater/aws.go index ad31b9d..88b1a37 100644 --- a/updater/aws.go +++ b/updater/aws.go @@ -19,6 +19,7 @@ const ( type instance struct { instanceID string containerInstanceID string + bottlerocketVersion string } type checkOutput struct { @@ -110,6 +111,7 @@ func (u *updater) filterAvailableUpdates(bottlerocketInstances []instance) ([]in log.Printf("failed to parse check command output %s: %v", string(commandOutput), err) } if output.UpdateState == "Available" { + inst.bottlerocketVersion = output.ActivePartition.Image.Version candidates = append(candidates, inst) } } @@ -261,16 +263,17 @@ func (u *updater) verifyUpdate(inst instance) error { } output, err := parseCommandOutput(updateResult) if err != nil { - return fmt.Errorf("failed to parse check command output %s, manual verification required: %v", string(updateResult), err) + return fmt.Errorf("failed to parse check command output '%s', manual verification required: %v", string(updateResult), err) } - if output.UpdateState == "Available" { - return fmt.Errorf(" instance did not update, manual update advised") - } - log.Printf("Instance %#q updated successfully", inst) - if output.ActivePartition.Image.Version != "" { - log.Printf("Instance %#q running Bottlerocket: %s", inst, output.ActivePartition.Image.Version) + updatedVersion := output.ActivePartition.Image.Version + if updatedVersion == inst.bottlerocketVersion { + log.Printf("Container instance %s did not update, its current "+ + "version %s and updated version %s are same", inst.containerInstanceID, inst.bottlerocketVersion, updatedVersion) + } else if output.UpdateState == "Available" { + log.Printf("Update for container instance %s was successful, however another newer version %s was released recently."+ + " Instance will be updated to newer version in next iteration.", inst.containerInstanceID, updatedVersion) } else { - log.Printf("Unable to verify active version. Manual verification of %#q required.", inst) + log.Printf("Instance %#q successfully updated to version %s", inst, updatedVersion) } return nil }