Skip to content

Commit

Permalink
Update log message for SSM-Setup-CLI regarding latest checksum valida…
Browse files Browse the repository at this point in the history
  • Loading branch information
VishnuKarthikRavindran authored and adchalla committed May 29, 2024
1 parent 0117b6e commit eda6065
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion agent/setupcli/managers/downloadmanager/downloadmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (d *downloadManager) DownloadLatestSSMSetupCLI(artifactsStorePath string, e
}

if downloadedCLICheckSum != expectedSetupCLICheckSum {
return fmt.Errorf("checksum validation for ssm-setup-cli fail: %v", err)
return fmt.Errorf("checksum mismatch with latest ssm-setup-cli. Please retry after downloading latest ssm-setup-cli")
}

logger.Infof("Downloaded SSM-Setup-CLI successfully")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func (suite *DownloadManagerTestSuite) TestDownloadManager_DownloadLatestSSMSetu
expectedLatestSSMSetupCLIURL := "https://s3.us-east-1.amazonaws.com/amazon-ssm-us-east-1/latest/linux_amd64/ssm-setup-cli"
err := downloadMgr.DownloadLatestSSMSetupCLI("temp1", checkSum)

assert.Contains(suite.T(), err.Error(), "checksum validation for ssm-setup-cli fail", "should throw error")
assert.Contains(suite.T(), err.Error(), "checksum mismatch with latest ssm-setup-cli", "should throw error")
assert.Contains(suite.T(), actualSSMSetupCLIURL, expectedLatestSSMSetupCLIURL, "mismatched version URL")
}

Expand Down
2 changes: 1 addition & 1 deletion agent/setupcli/setupcli.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func performOnpremSteps(log log.T, packageManager packagemanagers.IPackageManage
}
err = downloadManager.DownloadLatestSSMSetupCLI(setupCLIArtifactsPath, latestExecutableCheckSum)
if err != nil {
return fmt.Errorf("error downloading latest SSM-Setup-CLI executable: %v", err)
return fmt.Errorf("error while verifying installed ssm-setup-cli checksum: %v", err)
}

err = installAndVerifyAgent(log, packageManager, verificationManager, serviceManager, downloadManager, setupCLIArtifactsPath, isNano)
Expand Down

0 comments on commit eda6065

Please sign in to comment.