diff --git a/cmd/tiller/environment/environment.go b/cmd/tiller/environment/environment.go index f651800c0..61305e6f7 100644 --- a/cmd/tiller/environment/environment.go +++ b/cmd/tiller/environment/environment.go @@ -57,7 +57,13 @@ type ReleaseStorage interface { // // A KubeClient must be concurrency safe. type KubeClient interface { - Install(manifest []byte) error + // Install takes a map where the key is a "file name" (read: unique relational + // id) and the value is a Kubernetes manifest containing one or more resource + // definitions. + // + // TODO: Can these be in YAML or JSON, or must they be in one particular + // format? + Install(manifests map[string]string) error } // Environment provides the context for executing a client request. diff --git a/cmd/tiller/environment/environment_test.go b/cmd/tiller/environment/environment_test.go index e42376f6e..e13f4def1 100644 --- a/cmd/tiller/environment/environment_test.go +++ b/cmd/tiller/environment/environment_test.go @@ -30,7 +30,7 @@ func (r *mockReleaseStorage) Set(k string, v *hapi.Release) error { type mockKubeClient struct { } -func (k *mockKubeClient) Install(manifest []byte) error { +func (k *mockKubeClient) Install(manifests map[string]string) error { return nil } @@ -76,7 +76,9 @@ func TestKubeClient(t *testing.T) { env := New() env.KubeClient = kc - if err := env.KubeClient.Install([]byte("apiVersion: v1\n")); err != nil { + manifests := map[string]string{} + + if err := env.KubeClient.Install(manifests); err != nil { t.Errorf("Kubeclient failed: %s", err) } }