// updateRoot returns the platform specific path to update artifacts func updateRoot(detail *processor.UpdateDetail) error { compareResult, err := updateutil.VersionCompare(detail.SourceVersion, firstAgentWithNewUpdaterPath) if err != nil { return err } // New versions that with new binary locations if compareResult >= 0 { detail.UpdateRoot = appconfig.UpdaterArtifactsRoot } else { detail.UpdateRoot = legacyUpdaterArtifactsRoot } return nil }
// resolveUpdateDetail decides which UpdaterRoot to use and if uninstall is required for the agent func resolveUpdateDetail(detail *processor.UpdateDetail) error { compareResult, err := updateutil.VersionCompare(detail.SourceVersion, detail.TargetVersion) if err != nil { return err } // if performing a downgrade if compareResult > 0 { detail.RequiresUninstall = true } if err := updateRoot(detail); err != nil { return err } return nil }
// updateRoot returns the platform specific path to update artifacts func updateRoot(detail *processor.UpdateDetail) error { detail.UpdateRoot = appconfig.UpdaterArtifactsRoot return nil }