示例#1
0
// 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
}
示例#2
0
// 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
}
示例#3
0
// updateRoot returns the platform specific path to update artifacts
func updateRoot(detail *processor.UpdateDetail) error {
	detail.UpdateRoot = appconfig.UpdaterArtifactsRoot
	return nil
}