Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/admin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ func main() {
}
// Initialize service logger
initializeLoggers(*flagParams.Service)
// Analyze version and compare with the latest release
// Analyze version and compare with the latest release, runs in a separate goroutine to not delay the service startup
go checkLatestRelease()
// Service starts!
osctrlAdminService()
Expand Down
18 changes: 18 additions & 0 deletions cmd/tls/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,22 @@ func init() {
flags = config.InitTLSFlags(flagParams)
}

// Retrieve latest release information and compare
func checkLatestRelease() {
log.Info().Msg("Checking for the latest release...")
latest, err := version.RetrieveVersionData(version.VersionDataURL)
if err != nil {
Comment thread
javuto marked this conversation as resolved.
log.Err(err).Msg("Error retrieving latest release information")
return
}
if version.CheckSuggestedRelease(latest.SuggestedRelease) {
Comment thread
javuto marked this conversation as resolved.
log.Info().Msgf("%s (%s) is up to date with the suggested release (%s), latest %s", serviceName, buildVersion, latest.SuggestedRelease, latest.LatestRelease)
} else {
log.Info().Msgf("Please upgrade %s to at least %s. Latest version available: %s (current: %s)", serviceName, latest.SuggestedRelease, latest.LatestRelease, buildVersion)
log.Info().Msgf("Release notes: %s", latest.MoreInformation)
}
}

// Go go!
func osctrlService() {
// ////////////////////////////// Backend
Expand Down Expand Up @@ -476,6 +492,8 @@ func main() {
}
// Initialize service logger
initializeLoggers(*flagParams.Service)
// Analyze version and compare with the latest release, runs in a separate goroutine to not delay the service startup
go checkLatestRelease()
// Service starts!
osctrlService()
return nil
Expand Down
Loading