コード例 #1
0
ファイル: aci.go プロジェクト: HimanshPal/cnt
func (aci *Aci) checkLatestVersions(checked *chan bool) {
	//	if aci.manifest.From != "" && aci.manifest.From.Version() != "" {
	//		version, _ := aci.manifest.From.LatestVersion()
	//		logs.WithField("version", aci.manifest.From.Name()+":"+version).Debug("Discovered from latest verion")
	//		if version != "" && utils.Version(aci.manifest.From.Version()).LessThan(utils.Version(version)) {
	//			logs.WithF(aci.fields.WithField("version", aci.manifest.From.Name()+":"+version)).Warn("Newer 'from' version")
	//		}
	//	}
	for _, dep := range aci.manifest.Aci.Dependencies {
		if dep.Version() == "" {
			continue
		}
		version, _ := dep.LatestVersion()
		if version != "" && utils.Version(dep.Version()).LessThan(utils.Version(version)) {
			logs.WithF(aci.fields.WithField("version", dep.Name()+":"+version)).Warn("Newer 'dependency' version")
		}
	}
	if checked != nil {
		*checked <- true
	}
}
コード例 #2
0
ファイル: aci.go プロジェクト: vcaputo/cnt
func (cnt *Img) checkLatestVersions(checked *chan bool) {
	if cnt.manifest.From != "" {
		version, _ := cnt.manifest.From.LatestVersion()
		log.Debug("latest version of from : " + cnt.manifest.NameAndVersion.Name() + ":" + version)
		if version != "" && utils.Version(cnt.manifest.From.Version()).LessThan(utils.Version(version)) {
			log.Warn("---------------------------------")
			log.Warn("From has newer version : " + cnt.manifest.From.Name() + ":" + version)
			log.Warn("---------------------------------")
		}
	}
	for _, dep := range cnt.manifest.Aci.Dependencies {
		version, _ := dep.LatestVersion()
		if version != "" && utils.Version(dep.Version()).LessThan(utils.Version(version)) {
			log.Warn("---------------------------------")
			log.Warn("Newer dependency version : " + dep.Name() + ":" + version)
			log.Warn("---------------------------------")
		}
	}
	if checked != nil {
		*checked <- true
	}
}