diff --git a/pkg/releasetesting/test_suite_test.go b/pkg/releasetesting/test_suite_test.go index e6cc8bcf59ffa371cad2e4ed5e243b60c10d6d10..e3ca6570239f680daca383db1187790a9b9f1723 100644 --- a/pkg/releasetesting/test_suite_test.go +++ b/pkg/releasetesting/test_suite_test.go @@ -28,7 +28,6 @@ import ( "google.golang.org/grpc/metadata" "k8s.io/kubernetes/pkg/apis/core" - "k8s.io/helm/pkg/helm" "k8s.io/helm/pkg/proto/hapi/chart" "k8s.io/helm/pkg/proto/hapi/release" "k8s.io/helm/pkg/proto/hapi/services" @@ -312,7 +311,7 @@ func (rs mockStream) SendHeader(m metadata.MD) error { return nil } func (rs mockStream) SetTrailer(m metadata.MD) {} func (rs mockStream) SendMsg(v interface{}) error { return nil } func (rs mockStream) RecvMsg(v interface{}) error { return nil } -func (rs mockStream) Context() context.Context { return helm.NewContext() } +func (rs mockStream) Context() context.Context { return context.TODO() } type podSucceededKubeClient struct { tillerEnv.PrintingKubeClient diff --git a/pkg/tiller/release_content_test.go b/pkg/tiller/release_content_test.go index 7c003f709116c5aca921d2a4bf9f5909c3d990dd..c190c703e7ab13bdb3438f3ad71f8c14047a49d8 100644 --- a/pkg/tiller/release_content_test.go +++ b/pkg/tiller/release_content_test.go @@ -17,14 +17,14 @@ limitations under the License. package tiller import ( + "context" "testing" - "k8s.io/helm/pkg/helm" "k8s.io/helm/pkg/proto/hapi/services" ) func TestGetReleaseContent(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := releaseStub() if err := rs.env.Releases.Create(rel); err != nil { diff --git a/pkg/tiller/release_history_test.go b/pkg/tiller/release_history_test.go index 5df98410f5e6507cb841088e8f6008ce1b7027f3..a4453dfd7a0975abf1925c689afc56ca0e973a04 100644 --- a/pkg/tiller/release_history_test.go +++ b/pkg/tiller/release_history_test.go @@ -20,7 +20,8 @@ import ( "reflect" "testing" - "k8s.io/helm/pkg/helm" + "golang.org/x/net/context" + rpb "k8s.io/helm/pkg/proto/hapi/release" tpb "k8s.io/helm/pkg/proto/hapi/services" ) @@ -77,7 +78,7 @@ func TestGetHistory_WithRevisions(t *testing.T) { // run tests for _, tt := range tests { - res, err := srv.GetHistory(helm.NewContext(), tt.req) + res, err := srv.GetHistory(context.TODO(), tt.req) if err != nil { t.Fatalf("%s:\nFailed to get History of %q: %s", tt.desc, tt.req.Name, err) } @@ -104,7 +105,7 @@ func TestGetHistory_WithNoRevisions(t *testing.T) { srv.env.Releases.Create(rls) for _, tt := range tests { - res, err := srv.GetHistory(helm.NewContext(), tt.req) + res, err := srv.GetHistory(context.TODO(), tt.req) if err != nil { t.Fatalf("%s:\nFailed to get History of %q: %s", tt.desc, tt.req.Name, err) } diff --git a/pkg/tiller/release_install_test.go b/pkg/tiller/release_install_test.go index 2f21dc46b5239fb2e511f1f052077d876ad790bd..701433a0cf121d7380d440fd4d522a945662f4c8 100644 --- a/pkg/tiller/release_install_test.go +++ b/pkg/tiller/release_install_test.go @@ -21,14 +21,15 @@ import ( "strings" "testing" - "k8s.io/helm/pkg/helm" + "golang.org/x/net/context" + "k8s.io/helm/pkg/proto/hapi/release" "k8s.io/helm/pkg/proto/hapi/services" "k8s.io/helm/pkg/version" ) func TestInstallRelease(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() req := installRequest() @@ -82,7 +83,7 @@ func TestInstallRelease(t *testing.T) { } func TestInstallRelease_WithNotes(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() req := installRequest( @@ -142,7 +143,7 @@ func TestInstallRelease_WithNotes(t *testing.T) { } func TestInstallRelease_WithNotesRendered(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() req := installRequest( @@ -204,7 +205,7 @@ func TestInstallRelease_WithNotesRendered(t *testing.T) { func TestInstallRelease_TillerVersion(t *testing.T) { version.Version = "2.2.0" - c := helm.NewContext() + c := context.TODO() rs := rsFixture() req := installRequest( @@ -218,7 +219,7 @@ func TestInstallRelease_TillerVersion(t *testing.T) { func TestInstallRelease_WrongTillerVersion(t *testing.T) { version.Version = "2.2.0" - c := helm.NewContext() + c := context.TODO() rs := rsFixture() req := installRequest( @@ -236,7 +237,7 @@ func TestInstallRelease_WrongTillerVersion(t *testing.T) { } func TestInstallRelease_WithChartAndDependencyNotes(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() req := installRequest(withChart( @@ -268,7 +269,7 @@ func TestInstallRelease_WithChartAndDependencyNotes(t *testing.T) { } func TestInstallRelease_DryRun(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() req := installRequest(withDryRun(), @@ -320,7 +321,7 @@ func TestInstallRelease_DryRun(t *testing.T) { } func TestInstallRelease_NoHooks(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rs.env.Releases.Create(releaseStub()) @@ -336,7 +337,7 @@ func TestInstallRelease_NoHooks(t *testing.T) { } func TestInstallRelease_FailedHooks(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rs.env.Releases.Create(releaseStub()) rs.env.KubeClient = newHookFailingKubeClient() @@ -353,7 +354,7 @@ func TestInstallRelease_FailedHooks(t *testing.T) { } func TestInstallRelease_ReuseName(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := releaseStub() rel.Info.Status.Code = release.Status_DELETED @@ -383,7 +384,7 @@ func TestInstallRelease_ReuseName(t *testing.T) { } func TestInstallRelease_KubeVersion(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() req := installRequest( @@ -396,7 +397,7 @@ func TestInstallRelease_KubeVersion(t *testing.T) { } func TestInstallRelease_WrongKubeVersion(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() req := installRequest( diff --git a/pkg/tiller/release_rollback_test.go b/pkg/tiller/release_rollback_test.go index b73501a3685b2603419c2ebf3854fe1d1cea7121..c3ed9faaf089fd04223e837ef6b77e9fda45d769 100644 --- a/pkg/tiller/release_rollback_test.go +++ b/pkg/tiller/release_rollback_test.go @@ -20,13 +20,14 @@ import ( "strings" "testing" - "k8s.io/helm/pkg/helm" + "golang.org/x/net/context" + "k8s.io/helm/pkg/proto/hapi/release" "k8s.io/helm/pkg/proto/hapi/services" ) func TestRollbackRelease(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := releaseStub() rs.env.Releases.Create(rel) @@ -137,7 +138,7 @@ func TestRollbackRelease(t *testing.T) { } func TestRollbackWithReleaseVersion(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rs.Log = t.Logf rs.env.Releases.Log = t.Logf @@ -185,7 +186,7 @@ func TestRollbackWithReleaseVersion(t *testing.T) { } func TestRollbackReleaseNoHooks(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := releaseStub() rel.Hooks = []*release.Hook{ @@ -221,7 +222,7 @@ func TestRollbackReleaseNoHooks(t *testing.T) { } func TestRollbackReleaseFailure(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := releaseStub() rs.env.Releases.Create(rel) diff --git a/pkg/tiller/release_server_test.go b/pkg/tiller/release_server_test.go index 73ba08f67ba53e5231f318d0a03058156e0bc8d5..4a56bc0862373f60a44bfd68d9020d48eb962f60 100644 --- a/pkg/tiller/release_server_test.go +++ b/pkg/tiller/release_server_test.go @@ -34,7 +34,6 @@ import ( "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/fake" "k8s.io/kubernetes/pkg/kubectl/resource" - "k8s.io/helm/pkg/helm" "k8s.io/helm/pkg/hooks" "k8s.io/helm/pkg/kube" "k8s.io/helm/pkg/proto/hapi/chart" @@ -439,7 +438,7 @@ func (l *mockListServer) Send(res *services.ListReleasesResponse) error { return nil } -func (l *mockListServer) Context() context.Context { return helm.NewContext() } +func (l *mockListServer) Context() context.Context { return context.TODO() } func (l *mockListServer) SendMsg(v interface{}) error { return nil } func (l *mockListServer) RecvMsg(v interface{}) error { return nil } func (l *mockListServer) SendHeader(m metadata.MD) error { return nil } @@ -456,7 +455,7 @@ func (rs mockRunReleaseTestServer) SendHeader(m metadata.MD) error { return nil func (rs mockRunReleaseTestServer) SetTrailer(m metadata.MD) {} func (rs mockRunReleaseTestServer) SendMsg(v interface{}) error { return nil } func (rs mockRunReleaseTestServer) RecvMsg(v interface{}) error { return nil } -func (rs mockRunReleaseTestServer) Context() context.Context { return helm.NewContext() } +func (rs mockRunReleaseTestServer) Context() context.Context { return context.TODO() } type mockHooksManifest struct { Metadata struct { diff --git a/pkg/tiller/release_status_test.go b/pkg/tiller/release_status_test.go index 4ba0f6cd50f081bf4898ad9006c07b5d288cddab..e992da768e70e52adcb0440ea4cb7a60afa28b48 100644 --- a/pkg/tiller/release_status_test.go +++ b/pkg/tiller/release_status_test.go @@ -19,13 +19,14 @@ package tiller import ( "testing" - "k8s.io/helm/pkg/helm" + "golang.org/x/net/context" + "k8s.io/helm/pkg/proto/hapi/release" "k8s.io/helm/pkg/proto/hapi/services" ) func TestGetReleaseStatus(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := releaseStub() if err := rs.env.Releases.Create(rel); err != nil { @@ -46,7 +47,7 @@ func TestGetReleaseStatus(t *testing.T) { } func TestGetReleaseStatusDeleted(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := releaseStub() rel.Info.Status.Code = release.Status_DELETED diff --git a/pkg/tiller/release_uninstall_test.go b/pkg/tiller/release_uninstall_test.go index 20bfd24860df1a261c4e2d6b5a07097eeabe57d8..5b05859e93f2f844ac28faed5af4f6b0a826c3de 100644 --- a/pkg/tiller/release_uninstall_test.go +++ b/pkg/tiller/release_uninstall_test.go @@ -20,13 +20,14 @@ import ( "strings" "testing" - "k8s.io/helm/pkg/helm" + "golang.org/x/net/context" + "k8s.io/helm/pkg/proto/hapi/release" "k8s.io/helm/pkg/proto/hapi/services" ) func TestUninstallRelease(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rs.env.Releases.Create(releaseStub()) @@ -61,7 +62,7 @@ func TestUninstallRelease(t *testing.T) { } func TestUninstallPurgeRelease(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := releaseStub() rs.env.Releases.Create(rel) @@ -90,7 +91,7 @@ func TestUninstallPurgeRelease(t *testing.T) { if res.Release.Info.Deleted.Seconds <= 0 { t.Errorf("Expected valid UNIX date, got %d", res.Release.Info.Deleted.Seconds) } - rels, err := rs.GetHistory(helm.NewContext(), &services.GetHistoryRequest{Name: "angry-panda"}) + rels, err := rs.GetHistory(context.TODO(), &services.GetHistoryRequest{Name: "angry-panda"}) if err != nil { t.Fatal(err) } @@ -100,7 +101,7 @@ func TestUninstallPurgeRelease(t *testing.T) { } func TestUninstallPurgeDeleteRelease(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rs.env.Releases.Create(releaseStub()) @@ -125,7 +126,7 @@ func TestUninstallPurgeDeleteRelease(t *testing.T) { } func TestUninstallReleaseWithKeepPolicy(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() name := "angry-bunny" rs.env.Releases.Create(releaseWithKeepStub(name)) @@ -157,7 +158,7 @@ func TestUninstallReleaseWithKeepPolicy(t *testing.T) { } func TestUninstallReleaseNoHooks(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rs.env.Releases.Create(releaseStub()) diff --git a/pkg/tiller/release_update_test.go b/pkg/tiller/release_update_test.go index a1b9a4bff1b33d31a39e16aa4b31c44e46dbd106..84315942c4eeb6b98e93465ba859e206c432ff44 100644 --- a/pkg/tiller/release_update_test.go +++ b/pkg/tiller/release_update_test.go @@ -22,15 +22,15 @@ import ( "testing" "github.com/golang/protobuf/proto" + "golang.org/x/net/context" - "k8s.io/helm/pkg/helm" "k8s.io/helm/pkg/proto/hapi/chart" "k8s.io/helm/pkg/proto/hapi/release" "k8s.io/helm/pkg/proto/hapi/services" ) func TestUpdateRelease(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := releaseStub() rs.env.Releases.Create(rel) @@ -103,7 +103,7 @@ func TestUpdateRelease(t *testing.T) { } } func TestUpdateRelease_ResetValues(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := releaseStub() rs.env.Releases.Create(rel) @@ -131,7 +131,7 @@ func TestUpdateRelease_ResetValues(t *testing.T) { // This is a regression test for bug found in issue #3655 func TestUpdateRelease_ComplexReuseValues(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() installReq := &services.InstallReleaseRequest{ @@ -231,7 +231,7 @@ func TestUpdateRelease_ComplexReuseValues(t *testing.T) { } func TestUpdateRelease_ReuseValues(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := releaseStub() rs.env.Releases.Create(rel) @@ -269,7 +269,7 @@ func TestUpdateRelease_ReuseValues(t *testing.T) { func TestUpdateRelease_ResetReuseValues(t *testing.T) { // This verifies that when both reset and reuse are set, reset wins. - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := releaseStub() rs.env.Releases.Create(rel) @@ -298,7 +298,7 @@ func TestUpdateRelease_ResetReuseValues(t *testing.T) { } func TestUpdateReleaseFailure(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := releaseStub() rs.env.Releases.Create(rel) @@ -342,7 +342,7 @@ func TestUpdateReleaseFailure(t *testing.T) { } func TestUpdateReleaseFailure_Force(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := namedReleaseStub("forceful-luke", release.Status_FAILED) rs.env.Releases.Create(rel) @@ -386,7 +386,7 @@ func TestUpdateReleaseFailure_Force(t *testing.T) { } func TestUpdateReleaseNoHooks(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := releaseStub() rs.env.Releases.Create(rel) @@ -415,7 +415,7 @@ func TestUpdateReleaseNoHooks(t *testing.T) { } func TestUpdateReleaseNoChanges(t *testing.T) { - c := helm.NewContext() + c := context.TODO() rs := rsFixture() rel := releaseStub() rs.env.Releases.Create(rel)