func (s *supportedInfo) compile(now time.Time) error {
	if err := s.source.Refresh(); err != nil {
		return errors.Trace(err)
	}

	s.mutex.Lock()
	defer s.mutex.Unlock()

	// First thing here, is walk over the controller, workload maps to work out
	// if something was previously supported and is no longer or the reverse.
	for seriesName, version := range s.values {
		distroInfo, ok := s.source.SeriesInfo(seriesName.String())
		if !ok {
			// The series isn't found in the distro info, we should continue
			// onward as we don't know what to do here.
			continue
		}

		current := version.Supported
		supported := current

		// To prevent the distro info from overriding the supported flag and to
		// ensure that we keep the same Supported version as we have set as the
		// default (see below). Using the IgnoreDistroInfoUpdate flag states that
		// we want to keep the current value.
		// Example: adding a new LTS and setting it to be supported will become
		// false when reading in the distro information. Setting OverrideSupport
		// to true, will force it to be the same value as the default.
		if !version.IgnoreDistroInfoUpdate {
			supported = distroInfo.Supported(now)
		}

		s.values[seriesName] = seriesVersion{
			WorkloadType:             version.WorkloadType,
			Version:                  version.Version,
			LTS:                      version.LTS,
			Supported:                supported,
			ESMSupported:             version.ESMSupported,
			IgnoreDistroInfoUpdate:   version.IgnoreDistroInfoUpdate,
			UpdatedByLocalDistroInfo: current != supported,
		}
	}

	return nil
}
// compile compiles a list of supported info.
compile compiles a list of supported info.
// compile compiles a list of supported info .
func (s *supportedInfo) compile(now time.Time) error {
	if err := s.source.Refresh(); err != nil {
		return errors.Trace(err)
	}
	s.mutex.Lock()
	defer s.mutex.Unlock()
	for seriesName, version := range s.values {
		distroInfo, ok := s.source.SeriesInfo(seriesName.String())
		if !ok {
			continue
		}
		current := version.Supported
		supported := current
		if !version.IgnoreDistroInfoUpdate {
			supported = distroInfo.Supported(now)
		}
		s.values[seriesName] = seriesVersion{
			WorkloadType:             version.WorkloadType,
			Version:                  version.Version,
			LTS:                      version.LTS,
			Supported:                supported,
			ESMSupported:             version.ESMSupported,
			IgnoreDistroInfoUpdate:   version.IgnoreDistroInfoUpdate,
			UpdatedByLocalDistroInfo: current != supported,
		}
	}
	return nil
}
func ( s * supportedInfo ) compile ( now time . Time ) error { if err := s . source . Refresh ( ) ; err != nil { return errors . Trace ( err ) } s . mutex . Lock ( ) defer s . mutex . Unlock ( ) for seriesName , version := range s . values { distroInfo , ok := s . source . SeriesInfo ( seriesName . String ( ) ) if ! ok { continue } current := version . Supported supported := current if ! version . IgnoreDistroInfoUpdate { supported = distroInfo . Supported ( now ) } s . values [ seriesName ] = seriesVersion { WorkloadType : version . WorkloadType , Version : version . Version , LTS : version . LTS , Supported : supported , ESMSupported : version . ESMSupported , IgnoreDistroInfoUpdate : version . IgnoreDistroInfoUpdate , UpdatedByLocalDistroInfo : current != supported , } } return nil }
compile compiles a list of supported info.
compile compiles a list of supported info .
// First thing here, is walk over the controller, workload maps to work out // if something was previously supported and is no longer or the reverse. // The series isn't found in the distro info, we should continue // onward as we don't know what to do here. // To prevent the distro info from overriding the supported flag and to // ensure that we keep the same Supported version as we have set as the // default (see below). Using the IgnoreDistroInfoUpdate flag states that // we want to keep the current value. // Example: adding a new LTS and setting it to be supported will become // false when reading in the distro information. Setting OverrideSupport // to true, will force it to be the same value as the default.