diff --git a/pkg/helm/fake.go b/pkg/helm/fake.go index ffb5b40c9..ca0c3c8c1 100644 --- a/pkg/helm/fake.go +++ b/pkg/helm/fake.go @@ -19,6 +19,7 @@ package helm // import "k8s.io/helm/pkg/helm" import ( "bytes" "errors" + "fmt" "math/rand" "strings" "sync" @@ -31,7 +32,6 @@ import ( rls "k8s.io/helm/pkg/proto/hapi/services" "k8s.io/helm/pkg/proto/hapi/version" "k8s.io/helm/pkg/renderutil" - storage "k8s.io/helm/pkg/storage/driver" ) // FakeClient implements Interface @@ -138,7 +138,7 @@ func (c *FakeClient) DeleteRelease(rlsName string, opts ...DeleteOption) (*rls.U } } - return nil, storage.ErrReleaseNotFound(rlsName) + return nil, fmt.Errorf("release: %q not found", rlsName) } // GetVersion returns a fake version @@ -212,7 +212,7 @@ func (c *FakeClient) ReleaseStatus(rlsName string, opts ...StatusOption) (*rls.G }, nil } } - return nil, storage.ErrReleaseNotFound(rlsName) + return nil, fmt.Errorf("release: %q not found", rlsName) } // ReleaseContent returns the configuration for the matching release name in the fake release client. @@ -224,7 +224,7 @@ func (c *FakeClient) ReleaseContent(rlsName string, opts ...ContentOption) (resp }, nil } } - return resp, storage.ErrReleaseNotFound(rlsName) + return resp, fmt.Errorf("release: %q not found", rlsName) } // ReleaseHistory returns a release's revision history. diff --git a/pkg/helm/helm_test.go b/pkg/helm/helm_test.go index fe7150cc0..93d4256a5 100644 --- a/pkg/helm/helm_test.go +++ b/pkg/helm/helm_test.go @@ -18,8 +18,10 @@ package helm // import "k8s.io/helm/pkg/helm" import ( "errors" + "os/exec" "path/filepath" "reflect" + "strings" "testing" "github.com/golang/protobuf/proto" @@ -361,3 +363,15 @@ func loadChart(t *testing.T, name string) *cpb.Chart { } return c } + +func TestDoesNotImportKubernetes(t *testing.T) { + cmd := exec.Command("go", "list", "-f", "{{.Deps}}", ".") + output, err := cmd.CombinedOutput() + if err != nil { + t.Fatalf("Failed to execute %s %s: %s", cmd.Path, strings.Join(cmd.Args, " "), err) + } + + if strings.Contains(string(output), "k8s.io/kubernetes") { + t.Fatal("k8s.io/helm/pkg/helm contains a dependency on k8s.io/kubernetes") + } +}