// checkForUpdate determines if there is an updatePackage for the cluster's application
// and returns a reference to it if available.
// updatePackage specifies an optional (potentially incomplete) package name of the update package.
// If unspecified, the currently installed application package is used.
// Returns the reference to the update application
checkForUpdate determines if there is an updatePackage for the cluster's application
and returns a reference to it if available.
updatePackage specifies an optional (potentially incomplete) package name of the update package.
If unspecified, the currently installed application package is used.
Returns the reference to the update application
// checkForUpdate determines if there is an updatePackage for the cluster ' s application // and returns a reference to it if available . // updatePackage specifies an optional ( potentially incomplete ) package name of the update package . // If unspecified the currently installed application package is used . // Returns the reference to the update application
func checkForUpdate(
	env *localenv.LocalEnvironment,
	operator ops.Operator,
	installedPackage loc.Locator,
	updatePackage string,
) (updateApp *app.Application, err error) {
	if updatePackage == "" {
		updatePackage = installedPackage.Name
	}
	updateLoc, err := loc.MakeLocator(updatePackage)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	apps, err := env.AppServiceCluster()
	if err != nil {
		return nil, trace.Wrap(err)
	}
	updateApp, err = apps.GetApp(*updateLoc)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	err = pack.CheckUpdatePackage(installedPackage, updateApp.Package)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	env.PrintStep("Upgrading cluster from %v to %v", installedPackage.Version,
		updateApp.Package.Version)
	return updateApp, nil
}
func checkForUpdate ( env * localenv . LocalEnvironment , operator ops . Operator , installedPackage loc . Locator , updatePackage string , ) ( updateApp * app . Application , err error ) { if updatePackage == " " { updatePackage = installedPackage . Name } updateLoc , err := loc . MakeLocator ( updatePackage ) if err != nil { return nil , trace . Wrap ( err ) } apps , err := env . AppServiceCluster ( ) if err != nil { return nil , trace . Wrap ( err ) } updateApp , err = apps . GetApp ( * updateLoc ) if err != nil { return nil , trace . Wrap ( err ) } err = pack . CheckUpdatePackage ( installedPackage , updateApp . Package ) if err != nil { return nil , trace . Wrap ( err ) } env . PrintStep ( " " , installedPackage . Version , updateApp . Package . Version ) return updateApp , nil }
checkForUpdate determines if there is an updatePackage for the cluster's application
and returns a reference to it if available.
checkForUpdate determines if there is an updatePackage for the cluster ' s application and returns a reference to it if available .
// if app package was not provided, default to the latest version of // the currently installed app