Commit 878152d7 authored by Brendan Melville's avatar Brendan Melville

Porcelain type deployments deserve to be named too man.

parent 701f5945
...@@ -238,7 +238,7 @@ func loadTemplate(args []string) *expander.Template { ...@@ -238,7 +238,7 @@ func loadTemplate(args []string) *expander.Template {
if len(args) < 3 { if len(args) < 3 {
if t := getRegistryType(args[1]); t != nil { if t := getRegistryType(args[1]); t != nil {
template = buildTemplateFromType(args[1], *t) template = buildTemplateFromType(*t)
} else { } else {
template, err = expander.NewTemplateFromRootTemplate(args[1]) template, err = expander.NewTemplateFromRootTemplate(args[1])
} }
...@@ -266,7 +266,7 @@ func getRegistryType(fullType string) *registry.Type { ...@@ -266,7 +266,7 @@ func getRegistryType(fullType string) *registry.Type {
} }
} }
func buildTemplateFromType(name string, t registry.Type) *expander.Template { func buildTemplateFromType(t registry.Type) *expander.Template {
git := getGitRegistry() git := getGitRegistry()
downloadURL, err := git.GetURL(t) downloadURL, err := git.GetURL(t)
if err != nil { if err != nil {
...@@ -293,6 +293,7 @@ func buildTemplateFromType(name string, t registry.Type) *expander.Template { ...@@ -293,6 +293,7 @@ func buildTemplateFromType(name string, t registry.Type) *expander.Template {
} }
} }
name := fmt.Sprintf("%s-%s", t.Name, t.Version)
config := manager.Configuration{Resources: []*manager.Resource{&manager.Resource{ config := manager.Configuration{Resources: []*manager.Resource{&manager.Resource{
Name: name, Name: name,
Type: downloadURL, Type: downloadURL,
...@@ -305,7 +306,7 @@ func buildTemplateFromType(name string, t registry.Type) *expander.Template { ...@@ -305,7 +306,7 @@ func buildTemplateFromType(name string, t registry.Type) *expander.Template {
} }
return &expander.Template{ return &expander.Template{
// Name will be set later. Name: name,
Content: string(y), Content: string(y),
// No imports, as this is a single type from repository. // No imports, as this is a single type from repository.
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment