Exemple #1
0
func resolveCharm(ref *charm.Reference, repo charmrepo.Interface) (*charm.URL, error) {
	if ref.Schema != "cs" {
		return nil, fmt.Errorf("only charm store charm references are supported, with cs: schema")
	}

	// Resolve the charm location with the repository.
	curl, err := repo.Resolve(ref)
	if err != nil {
		return nil, err
	}
	return curl.WithRevision(ref.Revision), nil
}