func validateManifest(log log.T, parsedManifest *Manifest, context *updateutil.InstanceContext, packageName string) error {
	if len(parsedManifest.URIFormat) == 0 {
		return fmt.Errorf("folder format cannot be null in the Manifest file")
	}
	fileName := context.FileName(packageName)
	foundPackage := false
	foundFile := false
	for _, p := range parsedManifest.Packages {
		if p.Name == packageName {
			log.Infof("found package %v", packageName)
			foundPackage = true
			for _, f := range p.Files {
				if f.Name == fileName {
					foundFile = true
					if len(f.AvailableVersions) == 0 {
						return fmt.Errorf("at least one available version is required for the %v", fileName)
					}

					log.Infof("found file %v", fileName)
					break
				}
			}
		}
	}

	if !foundPackage {
		return fmt.Errorf("cannot find the %v information in the Manifest file", packageName)
	}
	if !foundFile {
		return fmt.Errorf("cannot find the %v information in the Manifest file", fileName)
	}

	return nil
}
// validateManifest makes sure all the fields are provided.
validateManifest makes sure all the fields are provided.
// validateManifest makes sure all the fields are provided .
func validateManifest(log log.T, parsedManifest *Manifest, context *updateutil.InstanceContext, packageName string) error {
	if len(parsedManifest.URIFormat) == 0 {
		return fmt.Errorf("folder format cannot be null in the Manifest file")
	}
	fileName := context.FileName(packageName)
	foundPackage := false
	foundFile := false
	for _, p := range parsedManifest.Packages {
		if p.Name == packageName {
			log.Infof("found package %v", packageName)
			foundPackage = true
			for _, f := range p.Files {
				if f.Name == fileName {
					foundFile = true
					if len(f.AvailableVersions) == 0 {
						return fmt.Errorf("at least one available version is required for the %v", fileName)
					}
					log.Infof("found file %v", fileName)
					break
				}
			}
		}
	}
	if !foundPackage {
		return fmt.Errorf("cannot find the %v information in the Manifest file", packageName)
	}
	if !foundFile {
		return fmt.Errorf("cannot find the %v information in the Manifest file", fileName)
	}
	return nil
}
func validateManifest ( log log . T , parsedManifest * Manifest , context * updateutil . InstanceContext , packageName string ) error { if len ( parsedManifest . URIFormat ) == 0 { return fmt . Errorf ( " " ) } fileName := context . FileName ( packageName ) foundPackage := false foundFile := false for _ , p := range parsedManifest . Packages { if p . Name == packageName { log . Infof ( " " , packageName ) foundPackage = true for _ , f := range p . Files { if f . Name == fileName { foundFile = true if len ( f . AvailableVersions ) == 0 { return fmt . Errorf ( " " , fileName ) } log . Infof ( " " , fileName ) break } } } } if ! foundPackage { return fmt . Errorf ( " " , packageName ) } if ! foundFile { return fmt . Errorf ( " " , fileName ) } return nil }
validateManifest makes sure all the fields are provided.
validateManifest makes sure all the fields are provided .