|
|
@ -22,6 +22,7 @@ import (
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
"testing"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/golang/protobuf/ptypes/any"
|
|
|
|
"k8s.io/helm/pkg/proto/hapi/chart"
|
|
|
|
"k8s.io/helm/pkg/proto/hapi/chart"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
@ -40,6 +41,9 @@ func TestSave(t *testing.T) {
|
|
|
|
Values: &chart.Config{
|
|
|
|
Values: &chart.Config{
|
|
|
|
Raw: "ship: Pequod",
|
|
|
|
Raw: "ship: Pequod",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
Files: []*any.Any{
|
|
|
|
|
|
|
|
{TypeUrl: "scheherazade/shahryar.txt", Value: []byte("1,001 Nights")},
|
|
|
|
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
where, err := Save(c, tmp)
|
|
|
|
where, err := Save(c, tmp)
|
|
|
@ -64,6 +68,9 @@ func TestSave(t *testing.T) {
|
|
|
|
if c2.Values.Raw != c.Values.Raw {
|
|
|
|
if c2.Values.Raw != c.Values.Raw {
|
|
|
|
t.Fatal("Values data did not match")
|
|
|
|
t.Fatal("Values data did not match")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(c2.Files) != 1 || c2.Files[0].TypeUrl != "scheherazade/shahryar.txt" {
|
|
|
|
|
|
|
|
t.Fatal("Files data did not match")
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestSaveDir(t *testing.T) {
|
|
|
|
func TestSaveDir(t *testing.T) {
|
|
|
@ -81,6 +88,9 @@ func TestSaveDir(t *testing.T) {
|
|
|
|
Values: &chart.Config{
|
|
|
|
Values: &chart.Config{
|
|
|
|
Raw: "ship: Pequod",
|
|
|
|
Raw: "ship: Pequod",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
Files: []*any.Any{
|
|
|
|
|
|
|
|
{TypeUrl: "scheherazade/shahryar.txt", Value: []byte("1,001 Nights")},
|
|
|
|
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if err := SaveDir(c, tmp); err != nil {
|
|
|
|
if err := SaveDir(c, tmp); err != nil {
|
|
|
@ -98,4 +108,7 @@ func TestSaveDir(t *testing.T) {
|
|
|
|
if c2.Values.Raw != c.Values.Raw {
|
|
|
|
if c2.Values.Raw != c.Values.Raw {
|
|
|
|
t.Fatal("Values data did not match")
|
|
|
|
t.Fatal("Values data did not match")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(c2.Files) != 1 || c2.Files[0].TypeUrl != "scheherazade/shahryar.txt" {
|
|
|
|
|
|
|
|
t.Fatal("Files data did not match")
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|