示例#1
0
func getGitRegistry() *registry.GithubRegistry {
	s := strings.Split(*type_registry, "/")
	if len(s) != 2 {
		log.Fatalf("invalid type registry: %s", type_registry)
	}

	return registry.NewGithubRegistry(s[0], s[1])
}
示例#2
0
func getGitRegistry() *registry.GithubRegistry {
	s := strings.Split(*template_registry, "/")
	if len(s) < 2 {
		log.Fatalf("invalid template registry: %s", *template_registry)
	}

	var path = ""
	if len(s) > 2 {
		path = strings.Join(s[2:], "/")
	}

	return registry.NewGithubRegistry(s[0], s[1], path)
}
示例#3
0
func getGitRegistry() registry.Registry {
	s := strings.Split(*template_registry, "/")
	if len(s) < 2 {
		panic(fmt.Errorf("invalid template registry: %s", *template_registry))
	}

	var path = ""
	if len(s) > 2 {
		path = strings.Join(s[2:], "/")
	}

	if s[0] == "helm" {
		return registry.NewGithubPackageRegistry(s[0], s[1])
	} else {
		return registry.NewGithubRegistry(s[0], s[1], path)
	}
}