func ComputedSeries(c charm.CharmMeta) (seriesSlice []string, _ error) {
	format := charm.MetaFormat(c)
	isKubernetes := IsKubernetes(c)
	meta := c.Meta()
	defer func(s *[]string) {
		logger.Debugf("series %q for charm %q with format %v, Kubernetes %v", strings.Join(*s, ", "), meta.Name, format, isKubernetes)
	}(&seriesSlice)

	if format < charm.FormatV2 {
		return meta.Series, nil
	}

	// We use a set to ensure uniqueness and a slice to ensure that we
	// preserve the order of elements as they appear in the manifest.
	seriesSet := set.NewStrings()

	manifest := c.Manifest()
	if manifest != nil {
		for _, base := range manifest.Bases {
			version := base.Channel.Track
			series, err := coreseries.VersionSeries(version)
			if err != nil {
				return []string{}, errors.Trace(err)
			}
			if !seriesSet.Contains(series) {
				seriesSet.Add(series)
				seriesSlice = append(seriesSlice, series)
			}
		}
	}
	if isKubernetes && !seriesSet.Contains(coreseries.Kubernetes.String()) {
		seriesSlice = append(seriesSlice, coreseries.Kubernetes.String())
	}

	return seriesSlice, nil
}
// ComputedSeries of a charm, preserving legacy behavior.  If the charm has
// no manifest, return series from the metadata. Otherwise return the series
// listed in the manifest Bases as channels.
ComputedSeries of a charm, preserving legacy behavior.  If the charm has
no manifest, return series from the metadata. Otherwise return the series
listed in the manifest Bases as channels.
// ComputedSeries of a charm preserving legacy behavior . If the charm has // no manifest return series from the metadata . Otherwise return the series // listed in the manifest Bases as channels .
func ComputedSeries(c charm.CharmMeta) (seriesSlice []string, _ error) {
	format := charm.MetaFormat(c)
	isKubernetes := IsKubernetes(c)
	meta := c.Meta()
	defer func(s *[]string) {
		logger.Debugf("series %q for charm %q with format %v, Kubernetes %v", strings.Join(*s, ", "), meta.Name, format, isKubernetes)
	}(&seriesSlice)
	if format < charm.FormatV2 {
		return meta.Series, nil
	}
	seriesSet := set.NewStrings()
	manifest := c.Manifest()
	if manifest != nil {
		for _, base := range manifest.Bases {
			version := base.Channel.Track
			series, err := coreseries.VersionSeries(version)
			if err != nil {
				return []string{}, errors.Trace(err)
			}
			if !seriesSet.Contains(series) {
				seriesSet.Add(series)
				seriesSlice = append(seriesSlice, series)
			}
		}
	}
	if isKubernetes && !seriesSet.Contains(coreseries.Kubernetes.String()) {
		seriesSlice = append(seriesSlice, coreseries.Kubernetes.String())
	}
	return seriesSlice, nil
}
func ComputedSeries ( c charm . CharmMeta ) ( seriesSlice [ ] string , _ error ) { format := charm . MetaFormat ( c ) isKubernetes := IsKubernetes ( c ) meta := c . Meta ( ) defer func ( s * [ ] string ) { logger . Debugf ( " " , strings . Join ( * s , " " ) , meta . Name , format , isKubernetes ) } ( & seriesSlice ) if format < charm . FormatV2 { return meta . Series , nil } seriesSet := set . NewStrings ( ) manifest := c . Manifest ( ) if manifest != nil { for _ , base := range manifest . Bases { version := base . Channel . Track series , err := coreseries . VersionSeries ( version ) if err != nil { return [ ] string { } , errors . Trace ( err ) } if ! seriesSet . Contains ( series ) { seriesSet . Add ( series ) seriesSlice = append ( seriesSlice , series ) } } } if isKubernetes && ! seriesSet . Contains ( coreseries . Kubernetes . String ( ) ) { seriesSlice = append ( seriesSlice , coreseries . Kubernetes . String ( ) ) } return seriesSlice , nil }
ComputedSeries of a charm, preserving legacy behavior.
ComputedSeries of a charm preserving legacy behavior .
// We use a set to ensure uniqueness and a slice to ensure that we // preserve the order of elements as they appear in the manifest.