diff --git a/pkg/api/spec.go b/pkg/api/spec.go index c3e9352b4..7fd9300c2 100644 --- a/pkg/api/spec.go +++ b/pkg/api/spec.go @@ -87,6 +87,7 @@ type ReleaseMetadata struct { GithubContents []GithubContent `json:"githubContents" yaml:"githubContents" hcl:"githubContents" meta:"githubContents"` ShipAppMetadata ShipAppMetadata `json:"shipAppMetadata" yaml:"shipAppMetadata" hcl:"shipAppMetadata" meta:"shipAppMetadata"` Entitlements Entitlements `json:"entitlements" yaml:"entitlements" hcl:"entitlements" meta:"entitlements"` + Type string `json:"type" yaml:"type" hcl:"type" meta:"type"` } func (r ReleaseMetadata) ReleaseName() string { diff --git a/pkg/lifecycle/daemon/daemon_channel_test.go b/pkg/lifecycle/daemon/daemon_channel_test.go index 8f1d2c7a6..f802eef3a 100644 --- a/pkg/lifecycle/daemon/daemon_channel_test.go +++ b/pkg/lifecycle/daemon/daemon_channel_test.go @@ -34,6 +34,7 @@ func TestDaemonChannel(t *testing.T) { name: "test_channel_noicon", release: &api.Release{ Metadata: api.ReleaseMetadata{ + Type: "replicated.app", ChannelName: "Application", ChannelIcon: "", }, @@ -45,6 +46,7 @@ func TestDaemonChannel(t *testing.T) { name: "test_channel_withicon", release: &api.Release{ Metadata: api.ReleaseMetadata{ + Type: "replicated.app", ChannelName: "Clubhouse Enterprise", ChannelIcon: "https://frontend-production-cdn.clubhouse.io/v0.5.20180509155736/images/logos/clubhouse_mascot_180x180.png", }, @@ -93,7 +95,7 @@ func TestDaemonChannel(t *testing.T) { // sigh. Give the server a second to start up time.Sleep(500 * time.Millisecond) - resp, err := http.Get(fmt.Sprintf("http://localhost:%d/api/v1/channel", port)) + resp, err := http.Get(fmt.Sprintf("http://localhost:%d/api/v1/metadata", port)) require.NoError(t, err) body, err := ioutil.ReadAll(resp.Body) @@ -104,8 +106,8 @@ func TestDaemonChannel(t *testing.T) { err = json.Unmarshal(body, &unmarshalled) require.NoError(t, err) - require.Equal(t, test.expectName, unmarshalled["channelName"]) - require.Equal(t, test.expectIcon, unmarshalled["channelIcon"]) + require.Equal(t, test.expectName, unmarshalled["name"]) + require.Equal(t, test.expectIcon, unmarshalled["icon"]) }) } } diff --git a/pkg/lifecycle/daemon/routes_navcycle.go b/pkg/lifecycle/daemon/routes_navcycle.go index b130f105c..a1d50ce81 100644 --- a/pkg/lifecycle/daemon/routes_navcycle.go +++ b/pkg/lifecycle/daemon/routes_navcycle.go @@ -60,6 +60,7 @@ type NavcycleRoutes struct { func (d *NavcycleRoutes) Register(group *gin.RouterGroup, release *api.Release) { d.Release = release v1 := group.Group("/api/v1") + v1.GET("/metadata", d.getMetadata(release)) v1.GET("/navcycle", d.getNavcycle) v1.GET("/navcycle/step/:step", d.getStep) v1.POST("/navcycle/step/:step", d.completeStep) diff --git a/pkg/lifecycle/daemon/routes_navcycle_getmetadata.go b/pkg/lifecycle/daemon/routes_navcycle_getmetadata.go new file mode 100644 index 000000000..06ed8554e --- /dev/null +++ b/pkg/lifecycle/daemon/routes_navcycle_getmetadata.go @@ -0,0 +1,28 @@ +package daemon + +import ( + "github.com/gin-gonic/gin" + "github.com/replicatedhq/ship/pkg/api" +) + +func (d *NavcycleRoutes) getMetadata(release *api.Release) gin.HandlerFunc { + return func(c *gin.Context) { + switch release.Metadata.Type { + case "helm": + fallthrough + case "k8s": + c.JSON(200, release.Metadata.ShipAppMetadata) + return + case "runbook.replicated.app": + fallthrough + case "replicated.app": + fallthrough + case "inline.replicated.app": + c.JSON(200, map[string]interface{}{ + "name": release.Metadata.ChannelName, + "icon": release.Metadata.ChannelIcon, + }) + return + } + } +} diff --git a/pkg/lifecycle/daemon/routes_v1.go b/pkg/lifecycle/daemon/routes_v1.go index 4642598b1..6bba44920 100644 --- a/pkg/lifecycle/daemon/routes_v1.go +++ b/pkg/lifecycle/daemon/routes_v1.go @@ -71,9 +71,6 @@ func (d *V1Routes) Register(g *gin.RouterGroup, release *api.Release) { mesg.POST("confirm", d.postConfirmMessage) mesg.GET("get", d.getCurrentMessage) - v1.GET("/channel", d.getChannel(release)) - - v1.GET("/helm-metadata", d.getHelmMetadata(release)) v1.POST("/helm-values", d.saveHelmValues) } @@ -87,16 +84,6 @@ func (d *V1Routes) ClearProgress() { d.stepProgress = nil } -func (d *V1Routes) getHelmMetadata(release *api.Release) gin.HandlerFunc { - debug := level.Debug(log.With(d.Logger, "handler", "getHelmMetadata")) - debug.Log("event", "response.metadata") - return func(c *gin.Context) { - c.JSON(200, map[string]interface{}{ - "metadata": release.Metadata.ShipAppMetadata, - }) - } -} - type SaveValuesRequest struct { Values string `json:"values"` ReleaseName string `json:"releaseName"` @@ -188,16 +175,6 @@ func (d *V1Routes) validateValuesOrAbort(c *gin.Context, request SaveValuesReque return true } -func (d *V1Routes) getChannel(release *api.Release) gin.HandlerFunc { - return func(c *gin.Context) { - c.JSON(200, map[string]interface{}{ - "channelName": release.Metadata.ChannelName, - "channelIcon": release.Metadata.ChannelIcon, - }) - } - -} - func (d *V1Routes) getLoadingStep(c *gin.Context) { c.JSON(200, map[string]interface{}{ "currentStep": map[string]interface{}{ diff --git a/pkg/ship/ship.go b/pkg/ship/ship.go index 62f8fc3f2..54a9e3149 100644 --- a/pkg/ship/ship.go +++ b/pkg/ship/ship.go @@ -172,7 +172,9 @@ func (s *Ship) Execute(ctx context.Context) error { ReleaseSemver: s.ReleaseSemver, InstallationID: s.InstallationID, } - release, err := s.AppResolver.ResolveAppRelease(ctx, selector) + + localAppCopy := apptype.NewLocalAppCopy("replicated.app", "", "") + release, err := s.AppResolver.ResolveAppRelease(ctx, selector, localAppCopy) if err != nil { return errors.Wrap(err, "resolve specs") } diff --git a/pkg/specs/interface.go b/pkg/specs/interface.go index cb9e6432b..7d83e44c1 100644 --- a/pkg/specs/interface.go +++ b/pkg/specs/interface.go @@ -203,7 +203,7 @@ func (r *Resolver) ResolveRelease(ctx context.Context, upstream string) (*api.Re return nil, errors.Wrapf(err, "parse url %s", upstream) } selector := (&replicatedapp.Selector{}).UnmarshalFrom(parsed) - return r.AppResolver.ResolveAppRelease(ctx, selector) + return r.AppResolver.ResolveAppRelease(ctx, selector, app) case "inline.replicated.app": return r.resolveInlineShipYAMLRelease( @@ -451,6 +451,7 @@ func (r *Resolver) resolveRelease( release := &api.Release{ Metadata: api.ReleaseMetadata{ ShipAppMetadata: *metadata, + Type: app.GetType(), }, Spec: *spec, } @@ -523,6 +524,7 @@ func (r *Resolver) resolveInlineShipYAMLRelease( release := &api.Release{ Metadata: api.ReleaseMetadata{ ShipAppMetadata: *metadata, + Type: app.GetType(), }, Spec: *spec, } diff --git a/pkg/specs/interface_test.go b/pkg/specs/interface_test.go index 72ae435db..7dbdc32dd 100644 --- a/pkg/specs/interface_test.go +++ b/pkg/specs/interface_test.go @@ -107,6 +107,7 @@ icon: https://kfbr.392/x5.png expectRelease: &api.Release{ Spec: viperResolver.DefaultHelmRelease("fake-tmp", "github.com/helm/charts/stable/x5"), Metadata: api.ReleaseMetadata{ + Type: "helm", ShipAppMetadata: api.ShipAppMetadata{ Version: "0.1.0", URL: "github.com/helm/charts/stable/x5", @@ -148,7 +149,7 @@ icon: https://kfbr.392/x5.png mockAppResolver.EXPECT().ResolveAppRelease(ctx, &replicatedapp2.Selector{ CustomerID: "12345", InstallationID: "67890", - }).Return(&api.Release{ + }, localApp).Return(&api.Release{ Metadata: api.ReleaseMetadata{ ChannelName: "appgraph-coolci", }, @@ -206,6 +207,7 @@ icon: https://kfbr.392/x5.png expectRelease: &api.Release{ Spec: viperResolver.DefaultRawRelease("base"), Metadata: api.ReleaseMetadata{ + Type: "k8s", ShipAppMetadata: api.ShipAppMetadata{ URL: "github.com/replicatedhq/test-charts/plain-k8s", Readme: "its the readme", @@ -245,7 +247,7 @@ icon: https://kfbr.392/x5.png CustomerID: "123", InstallationID: "456", ReleaseSemver: "789", - }).Return(&api.Release{ + }, localApp).Return(&api.Release{ Metadata: api.ReleaseMetadata{ ChannelName: "appgraph-coolci", }, diff --git a/pkg/specs/replicatedapp/resolver.go b/pkg/specs/replicatedapp/resolver.go index f8d93cbea..3a5a4c42b 100644 --- a/pkg/specs/replicatedapp/resolver.go +++ b/pkg/specs/replicatedapp/resolver.go @@ -7,6 +7,8 @@ import ( "fmt" "path/filepath" + "github.com/replicatedhq/ship/pkg/specs/apptype" + "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" "github.com/pkg/errors" @@ -63,6 +65,7 @@ type Resolver interface { ResolveAppRelease( ctx context.Context, selector *Selector, + app apptype.LocalAppCopy, ) (*api.Release, error) FetchRelease( ctx context.Context, @@ -80,7 +83,7 @@ type Resolver interface { // ResolveAppRelease uses the passed config options to get specs from pg.replicated.com or // from a local runbook if so configured -func (r *resolver) ResolveAppRelease(ctx context.Context, selector *Selector) (*api.Release, error) { +func (r *resolver) ResolveAppRelease(ctx context.Context, selector *Selector, app apptype.LocalAppCopy) (*api.Release, error) { debug := level.Debug(log.With(r.Logger, "method", "ResolveAppRelease")) release, err := r.FetchRelease(ctx, selector) if err != nil { @@ -100,6 +103,8 @@ func (r *resolver) ResolveAppRelease(ctx context.Context, selector *Selector) (* return nil, errors.Wrap(err, "persist and deserialize release") } + result.Metadata.Type = app.GetType() + return result, nil } diff --git a/pkg/test-mocks/apptype/determine_type_mock.go b/pkg/test-mocks/apptype/determine_type_mock.go index 5c5b56850..ea9a4c88d 100644 --- a/pkg/test-mocks/apptype/determine_type_mock.go +++ b/pkg/test-mocks/apptype/determine_type_mock.go @@ -38,6 +38,7 @@ func (m *MockInspector) EXPECT() *MockInspectorMockRecorder { // DetermineApplicationType mocks base method func (m *MockInspector) DetermineApplicationType(arg0 context.Context, arg1 string) (apptype.LocalAppCopy, error) { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DetermineApplicationType", arg0, arg1) ret0, _ := ret[0].(apptype.LocalAppCopy) ret1, _ := ret[1].(error) @@ -46,6 +47,7 @@ func (m *MockInspector) DetermineApplicationType(arg0 context.Context, arg1 stri // DetermineApplicationType indicates an expected call of DetermineApplicationType func (mr *MockInspectorMockRecorder) DetermineApplicationType(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DetermineApplicationType", reflect.TypeOf((*MockInspector)(nil).DetermineApplicationType), arg0, arg1) } @@ -74,6 +76,7 @@ func (m *MockLocalAppCopy) EXPECT() *MockLocalAppCopyMockRecorder { // GetLocalPath mocks base method func (m *MockLocalAppCopy) GetLocalPath() string { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetLocalPath") ret0, _ := ret[0].(string) return ret0 @@ -81,11 +84,13 @@ func (m *MockLocalAppCopy) GetLocalPath() string { // GetLocalPath indicates an expected call of GetLocalPath func (mr *MockLocalAppCopyMockRecorder) GetLocalPath() *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLocalPath", reflect.TypeOf((*MockLocalAppCopy)(nil).GetLocalPath)) } // GetType mocks base method func (m *MockLocalAppCopy) GetType() string { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetType") ret0, _ := ret[0].(string) return ret0 @@ -93,11 +98,13 @@ func (m *MockLocalAppCopy) GetType() string { // GetType indicates an expected call of GetType func (mr *MockLocalAppCopyMockRecorder) GetType() *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetType", reflect.TypeOf((*MockLocalAppCopy)(nil).GetType)) } // Remove mocks base method func (m *MockLocalAppCopy) Remove(arg0 afero.Afero) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Remove", arg0) ret0, _ := ret[0].(error) return ret0 @@ -105,5 +112,6 @@ func (m *MockLocalAppCopy) Remove(arg0 afero.Afero) error { // Remove indicates an expected call of Remove func (mr *MockLocalAppCopyMockRecorder) Remove(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Remove", reflect.TypeOf((*MockLocalAppCopy)(nil).Remove), arg0) } diff --git a/pkg/test-mocks/config/resolver.go b/pkg/test-mocks/config/resolver.go index 55a9d463e..329761e4d 100644 --- a/pkg/test-mocks/config/resolver.go +++ b/pkg/test-mocks/config/resolver.go @@ -37,6 +37,7 @@ func (m *MockResolver) EXPECT() *MockResolverMockRecorder { // ResolveConfig mocks base method func (m *MockResolver) ResolveConfig(arg0 context.Context, arg1 *api.Release, arg2 map[string]interface{}) (map[string]interface{}, error) { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ResolveConfig", arg0, arg1, arg2) ret0, _ := ret[0].(map[string]interface{}) ret1, _ := ret[1].(error) @@ -45,5 +46,6 @@ func (m *MockResolver) ResolveConfig(arg0 context.Context, arg1 *api.Release, ar // ResolveConfig indicates an expected call of ResolveConfig func (mr *MockResolverMockRecorder) ResolveConfig(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResolveConfig", reflect.TypeOf((*MockResolver)(nil).ResolveConfig), arg0, arg1, arg2) } diff --git a/pkg/test-mocks/daemon/daemon.go b/pkg/test-mocks/daemon/daemon.go index 03eb05cf0..3053f872c 100644 --- a/pkg/test-mocks/daemon/daemon.go +++ b/pkg/test-mocks/daemon/daemon.go @@ -38,16 +38,19 @@ func (m *MockDaemon) EXPECT() *MockDaemonMockRecorder { // AllStepsDone mocks base method func (m *MockDaemon) AllStepsDone(arg0 context.Context) { + m.ctrl.T.Helper() m.ctrl.Call(m, "AllStepsDone", arg0) } // AllStepsDone indicates an expected call of AllStepsDone func (mr *MockDaemonMockRecorder) AllStepsDone(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllStepsDone", reflect.TypeOf((*MockDaemon)(nil).AllStepsDone), arg0) } // AwaitShutdown mocks base method func (m *MockDaemon) AwaitShutdown() error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AwaitShutdown") ret0, _ := ret[0].(error) return ret0 @@ -55,31 +58,37 @@ func (m *MockDaemon) AwaitShutdown() error { // AwaitShutdown indicates an expected call of AwaitShutdown func (mr *MockDaemonMockRecorder) AwaitShutdown() *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AwaitShutdown", reflect.TypeOf((*MockDaemon)(nil).AwaitShutdown)) } // CleanPreviousStep mocks base method func (m *MockDaemon) CleanPreviousStep() { + m.ctrl.T.Helper() m.ctrl.Call(m, "CleanPreviousStep") } // CleanPreviousStep indicates an expected call of CleanPreviousStep func (mr *MockDaemonMockRecorder) CleanPreviousStep() *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CleanPreviousStep", reflect.TypeOf((*MockDaemon)(nil).CleanPreviousStep)) } // ClearProgress mocks base method func (m *MockDaemon) ClearProgress() { + m.ctrl.T.Helper() m.ctrl.Call(m, "ClearProgress") } // ClearProgress indicates an expected call of ClearProgress func (mr *MockDaemonMockRecorder) ClearProgress() *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClearProgress", reflect.TypeOf((*MockDaemon)(nil).ClearProgress)) } // ConfigSavedChan mocks base method func (m *MockDaemon) ConfigSavedChan() chan interface{} { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ConfigSavedChan") ret0, _ := ret[0].(chan interface{}) return ret0 @@ -87,11 +96,13 @@ func (m *MockDaemon) ConfigSavedChan() chan interface{} { // ConfigSavedChan indicates an expected call of ConfigSavedChan func (mr *MockDaemonMockRecorder) ConfigSavedChan() *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConfigSavedChan", reflect.TypeOf((*MockDaemon)(nil).ConfigSavedChan)) } // EnsureStarted mocks base method func (m *MockDaemon) EnsureStarted(arg0 context.Context, arg1 *api.Release) chan error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "EnsureStarted", arg0, arg1) ret0, _ := ret[0].(chan error) return ret0 @@ -99,11 +110,13 @@ func (m *MockDaemon) EnsureStarted(arg0 context.Context, arg1 *api.Release) chan // EnsureStarted indicates an expected call of EnsureStarted func (mr *MockDaemonMockRecorder) EnsureStarted(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureStarted", reflect.TypeOf((*MockDaemon)(nil).EnsureStarted), arg0, arg1) } // GetCurrentConfig mocks base method func (m *MockDaemon) GetCurrentConfig() map[string]interface{} { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetCurrentConfig") ret0, _ := ret[0].(map[string]interface{}) return ret0 @@ -111,11 +124,13 @@ func (m *MockDaemon) GetCurrentConfig() map[string]interface{} { // GetCurrentConfig indicates an expected call of GetCurrentConfig func (mr *MockDaemonMockRecorder) GetCurrentConfig() *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentConfig", reflect.TypeOf((*MockDaemon)(nil).GetCurrentConfig)) } // KustomizeSavedChan mocks base method func (m *MockDaemon) KustomizeSavedChan() chan interface{} { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "KustomizeSavedChan") ret0, _ := ret[0].(chan interface{}) return ret0 @@ -123,11 +138,13 @@ func (m *MockDaemon) KustomizeSavedChan() chan interface{} { // KustomizeSavedChan indicates an expected call of KustomizeSavedChan func (mr *MockDaemonMockRecorder) KustomizeSavedChan() *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "KustomizeSavedChan", reflect.TypeOf((*MockDaemon)(nil).KustomizeSavedChan)) } // MessageConfirmedChan mocks base method func (m *MockDaemon) MessageConfirmedChan() chan string { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "MessageConfirmedChan") ret0, _ := ret[0].(chan string) return ret0 @@ -135,91 +152,109 @@ func (m *MockDaemon) MessageConfirmedChan() chan string { // MessageConfirmedChan indicates an expected call of MessageConfirmedChan func (mr *MockDaemonMockRecorder) MessageConfirmedChan() *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MessageConfirmedChan", reflect.TypeOf((*MockDaemon)(nil).MessageConfirmedChan)) } // PushHelmIntroStep mocks base method func (m *MockDaemon) PushHelmIntroStep(arg0 context.Context, arg1 daemontypes.HelmIntro, arg2 []daemontypes.Action) { + m.ctrl.T.Helper() m.ctrl.Call(m, "PushHelmIntroStep", arg0, arg1, arg2) } // PushHelmIntroStep indicates an expected call of PushHelmIntroStep func (mr *MockDaemonMockRecorder) PushHelmIntroStep(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PushHelmIntroStep", reflect.TypeOf((*MockDaemon)(nil).PushHelmIntroStep), arg0, arg1, arg2) } // PushHelmValuesStep mocks base method func (m *MockDaemon) PushHelmValuesStep(arg0 context.Context, arg1 daemontypes.HelmValues, arg2 []daemontypes.Action) { + m.ctrl.T.Helper() m.ctrl.Call(m, "PushHelmValuesStep", arg0, arg1, arg2) } // PushHelmValuesStep indicates an expected call of PushHelmValuesStep func (mr *MockDaemonMockRecorder) PushHelmValuesStep(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PushHelmValuesStep", reflect.TypeOf((*MockDaemon)(nil).PushHelmValuesStep), arg0, arg1, arg2) } // PushKustomizeStep mocks base method func (m *MockDaemon) PushKustomizeStep(arg0 context.Context, arg1 daemontypes.Kustomize) { + m.ctrl.T.Helper() m.ctrl.Call(m, "PushKustomizeStep", arg0, arg1) } // PushKustomizeStep indicates an expected call of PushKustomizeStep func (mr *MockDaemonMockRecorder) PushKustomizeStep(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PushKustomizeStep", reflect.TypeOf((*MockDaemon)(nil).PushKustomizeStep), arg0, arg1) } // PushMessageStep mocks base method func (m *MockDaemon) PushMessageStep(arg0 context.Context, arg1 daemontypes.Message, arg2 []daemontypes.Action) { + m.ctrl.T.Helper() m.ctrl.Call(m, "PushMessageStep", arg0, arg1, arg2) } // PushMessageStep indicates an expected call of PushMessageStep func (mr *MockDaemonMockRecorder) PushMessageStep(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PushMessageStep", reflect.TypeOf((*MockDaemon)(nil).PushMessageStep), arg0, arg1, arg2) } // PushRenderStep mocks base method func (m *MockDaemon) PushRenderStep(arg0 context.Context, arg1 daemontypes.Render) { + m.ctrl.T.Helper() m.ctrl.Call(m, "PushRenderStep", arg0, arg1) } // PushRenderStep indicates an expected call of PushRenderStep func (mr *MockDaemonMockRecorder) PushRenderStep(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PushRenderStep", reflect.TypeOf((*MockDaemon)(nil).PushRenderStep), arg0, arg1) } // PushStreamStep mocks base method func (m *MockDaemon) PushStreamStep(arg0 context.Context, arg1 <-chan daemontypes.Message) { + m.ctrl.T.Helper() m.ctrl.Call(m, "PushStreamStep", arg0, arg1) } // PushStreamStep indicates an expected call of PushStreamStep func (mr *MockDaemonMockRecorder) PushStreamStep(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PushStreamStep", reflect.TypeOf((*MockDaemon)(nil).PushStreamStep), arg0, arg1) } // SetProgress mocks base method func (m *MockDaemon) SetProgress(arg0 daemontypes.Progress) { + m.ctrl.T.Helper() m.ctrl.Call(m, "SetProgress", arg0) } // SetProgress indicates an expected call of SetProgress func (mr *MockDaemonMockRecorder) SetProgress(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetProgress", reflect.TypeOf((*MockDaemon)(nil).SetProgress), arg0) } // SetStepName mocks base method func (m *MockDaemon) SetStepName(arg0 context.Context, arg1 string) { + m.ctrl.T.Helper() m.ctrl.Call(m, "SetStepName", arg0, arg1) } // SetStepName indicates an expected call of SetStepName func (mr *MockDaemonMockRecorder) SetStepName(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetStepName", reflect.TypeOf((*MockDaemon)(nil).SetStepName), arg0, arg1) } // TerraformConfirmedChan mocks base method func (m *MockDaemon) TerraformConfirmedChan() chan bool { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "TerraformConfirmedChan") ret0, _ := ret[0].(chan bool) return ret0 @@ -227,11 +262,13 @@ func (m *MockDaemon) TerraformConfirmedChan() chan bool { // TerraformConfirmedChan indicates an expected call of TerraformConfirmedChan func (mr *MockDaemonMockRecorder) TerraformConfirmedChan() *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TerraformConfirmedChan", reflect.TypeOf((*MockDaemon)(nil).TerraformConfirmedChan)) } // UnforkSavedChan mocks base method func (m *MockDaemon) UnforkSavedChan() chan interface{} { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UnforkSavedChan") ret0, _ := ret[0].(chan interface{}) return ret0 @@ -239,5 +276,6 @@ func (m *MockDaemon) UnforkSavedChan() chan interface{} { // UnforkSavedChan indicates an expected call of UnforkSavedChan func (mr *MockDaemonMockRecorder) UnforkSavedChan() *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnforkSavedChan", reflect.TypeOf((*MockDaemon)(nil).UnforkSavedChan)) } diff --git a/pkg/test-mocks/docker/renderer_mock.go b/pkg/test-mocks/docker/renderer_mock.go index b3269770a..13b218366 100644 --- a/pkg/test-mocks/docker/renderer_mock.go +++ b/pkg/test-mocks/docker/renderer_mock.go @@ -40,6 +40,7 @@ func (m *MockRenderer) EXPECT() *MockRendererMockRecorder { // Execute mocks base method func (m *MockRenderer) Execute(arg0 root.Fs, arg1 api.DockerAsset, arg2 api.ReleaseMetadata, arg3 func(chan interface{}, log.Logger) error, arg4 string, arg5 map[string]interface{}, arg6 []libyaml.ConfigGroup) func(context.Context) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Execute", arg0, arg1, arg2, arg3, arg4, arg5, arg6) ret0, _ := ret[0].(func(context.Context) error) return ret0 @@ -47,5 +48,6 @@ func (m *MockRenderer) Execute(arg0 root.Fs, arg1 api.DockerAsset, arg2 api.Rele // Execute indicates an expected call of Execute func (mr *MockRendererMockRecorder) Execute(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockRenderer)(nil).Execute), arg0, arg1, arg2, arg3, arg4, arg5, arg6) } diff --git a/pkg/test-mocks/dockerlayer/archive_mock.go b/pkg/test-mocks/dockerlayer/archive_mock.go index d11fea8aa..97e1e036c 100644 --- a/pkg/test-mocks/dockerlayer/archive_mock.go +++ b/pkg/test-mocks/dockerlayer/archive_mock.go @@ -36,6 +36,7 @@ func (m *MockArchiver) EXPECT() *MockArchiverMockRecorder { // Make mocks base method func (m *MockArchiver) Make(arg0 string, arg1 []string) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Make", arg0, arg1) ret0, _ := ret[0].(error) return ret0 @@ -43,11 +44,13 @@ func (m *MockArchiver) Make(arg0 string, arg1 []string) error { // Make indicates an expected call of Make func (mr *MockArchiverMockRecorder) Make(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Make", reflect.TypeOf((*MockArchiver)(nil).Make), arg0, arg1) } // Match mocks base method func (m *MockArchiver) Match(arg0 string) bool { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Match", arg0) ret0, _ := ret[0].(bool) return ret0 @@ -55,11 +58,13 @@ func (m *MockArchiver) Match(arg0 string) bool { // Match indicates an expected call of Match func (mr *MockArchiverMockRecorder) Match(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Match", reflect.TypeOf((*MockArchiver)(nil).Match), arg0) } // Open mocks base method func (m *MockArchiver) Open(arg0, arg1 string) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Open", arg0, arg1) ret0, _ := ret[0].(error) return ret0 @@ -67,11 +72,13 @@ func (m *MockArchiver) Open(arg0, arg1 string) error { // Open indicates an expected call of Open func (mr *MockArchiverMockRecorder) Open(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Open", reflect.TypeOf((*MockArchiver)(nil).Open), arg0, arg1) } // Read mocks base method func (m *MockArchiver) Read(arg0 io.Reader, arg1 string) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Read", arg0, arg1) ret0, _ := ret[0].(error) return ret0 @@ -79,11 +86,13 @@ func (m *MockArchiver) Read(arg0 io.Reader, arg1 string) error { // Read indicates an expected call of Read func (mr *MockArchiverMockRecorder) Read(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockArchiver)(nil).Read), arg0, arg1) } // Write mocks base method func (m *MockArchiver) Write(arg0 io.Writer, arg1 []string) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Write", arg0, arg1) ret0, _ := ret[0].(error) return ret0 @@ -91,5 +100,6 @@ func (m *MockArchiver) Write(arg0 io.Writer, arg1 []string) error { // Write indicates an expected call of Write func (mr *MockArchiverMockRecorder) Write(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Write", reflect.TypeOf((*MockArchiver)(nil).Write), arg0, arg1) } diff --git a/pkg/test-mocks/github/github_mock.go b/pkg/test-mocks/github/github_mock.go index f031ce9aa..55f8e669a 100644 --- a/pkg/test-mocks/github/github_mock.go +++ b/pkg/test-mocks/github/github_mock.go @@ -39,6 +39,7 @@ func (m *MockRenderer) EXPECT() *MockRendererMockRecorder { // Execute mocks base method func (m *MockRenderer) Execute(arg0 root.Fs, arg1 api.GitHubAsset, arg2 []libyaml.ConfigGroup, arg3 string, arg4 api.ReleaseMetadata, arg5 map[string]interface{}) func(context.Context) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Execute", arg0, arg1, arg2, arg3, arg4, arg5) ret0, _ := ret[0].(func(context.Context) error) return ret0 @@ -46,5 +47,6 @@ func (m *MockRenderer) Execute(arg0 root.Fs, arg1 api.GitHubAsset, arg2 []libyam // Execute indicates an expected call of Execute func (mr *MockRendererMockRecorder) Execute(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockRenderer)(nil).Execute), arg0, arg1, arg2, arg3, arg4, arg5) } diff --git a/pkg/test-mocks/githubclient/github_fetcher.go b/pkg/test-mocks/githubclient/github_fetcher.go index 29395fd62..dd62d7673 100644 --- a/pkg/test-mocks/githubclient/github_fetcher.go +++ b/pkg/test-mocks/githubclient/github_fetcher.go @@ -36,6 +36,7 @@ func (m *MockGitHubFetcher) EXPECT() *MockGitHubFetcherMockRecorder { // ResolveLatestRelease mocks base method func (m *MockGitHubFetcher) ResolveLatestRelease(arg0 context.Context, arg1 string) (string, error) { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ResolveLatestRelease", arg0, arg1) ret0, _ := ret[0].(string) ret1, _ := ret[1].(error) @@ -44,11 +45,13 @@ func (m *MockGitHubFetcher) ResolveLatestRelease(arg0 context.Context, arg1 stri // ResolveLatestRelease indicates an expected call of ResolveLatestRelease func (mr *MockGitHubFetcherMockRecorder) ResolveLatestRelease(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResolveLatestRelease", reflect.TypeOf((*MockGitHubFetcher)(nil).ResolveLatestRelease), arg0, arg1) } // ResolveReleaseNotes mocks base method func (m *MockGitHubFetcher) ResolveReleaseNotes(arg0 context.Context, arg1 string) (string, error) { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ResolveReleaseNotes", arg0, arg1) ret0, _ := ret[0].(string) ret1, _ := ret[1].(error) @@ -57,5 +60,6 @@ func (m *MockGitHubFetcher) ResolveReleaseNotes(arg0 context.Context, arg1 strin // ResolveReleaseNotes indicates an expected call of ResolveReleaseNotes func (mr *MockGitHubFetcherMockRecorder) ResolveReleaseNotes(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResolveReleaseNotes", reflect.TypeOf((*MockGitHubFetcher)(nil).ResolveReleaseNotes), arg0, arg1) } diff --git a/pkg/test-mocks/helm/chart_fetcher_mock.go b/pkg/test-mocks/helm/chart_fetcher_mock.go index 0d163f708..4c7411461 100644 --- a/pkg/test-mocks/helm/chart_fetcher_mock.go +++ b/pkg/test-mocks/helm/chart_fetcher_mock.go @@ -38,6 +38,7 @@ func (m *MockChartFetcher) EXPECT() *MockChartFetcherMockRecorder { // FetchChart mocks base method func (m *MockChartFetcher) FetchChart(arg0 context.Context, arg1 api.HelmAsset, arg2 string, arg3 api.ReleaseMetadata, arg4 []libyaml.ConfigGroup, arg5 map[string]interface{}) (string, error) { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "FetchChart", arg0, arg1, arg2, arg3, arg4, arg5) ret0, _ := ret[0].(string) ret1, _ := ret[1].(error) @@ -46,5 +47,6 @@ func (m *MockChartFetcher) FetchChart(arg0 context.Context, arg1 api.HelmAsset, // FetchChart indicates an expected call of FetchChart func (mr *MockChartFetcherMockRecorder) FetchChart(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchChart", reflect.TypeOf((*MockChartFetcher)(nil).FetchChart), arg0, arg1, arg2, arg3, arg4, arg5) } diff --git a/pkg/test-mocks/helm/commands_mock.go b/pkg/test-mocks/helm/commands_mock.go index 92081a151..840ad951b 100644 --- a/pkg/test-mocks/helm/commands_mock.go +++ b/pkg/test-mocks/helm/commands_mock.go @@ -36,6 +36,7 @@ func (m *MockCommands) EXPECT() *MockCommandsMockRecorder { // Fetch mocks base method func (m *MockCommands) Fetch(arg0, arg1, arg2, arg3, arg4 string) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Fetch", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(error) return ret0 @@ -43,11 +44,13 @@ func (m *MockCommands) Fetch(arg0, arg1, arg2, arg3, arg4 string) error { // Fetch indicates an expected call of Fetch func (mr *MockCommandsMockRecorder) Fetch(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Fetch", reflect.TypeOf((*MockCommands)(nil).Fetch), arg0, arg1, arg2, arg3, arg4) } // Init mocks base method func (m *MockCommands) Init() error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Init") ret0, _ := ret[0].(error) return ret0 @@ -55,11 +58,13 @@ func (m *MockCommands) Init() error { // Init indicates an expected call of Init func (mr *MockCommandsMockRecorder) Init() *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockCommands)(nil).Init)) } // MaybeDependencyUpdate mocks base method func (m *MockCommands) MaybeDependencyUpdate(arg0 string, arg1 chartutil.Requirements) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "MaybeDependencyUpdate", arg0, arg1) ret0, _ := ret[0].(error) return ret0 @@ -67,11 +72,13 @@ func (m *MockCommands) MaybeDependencyUpdate(arg0 string, arg1 chartutil.Require // MaybeDependencyUpdate indicates an expected call of MaybeDependencyUpdate func (mr *MockCommandsMockRecorder) MaybeDependencyUpdate(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MaybeDependencyUpdate", reflect.TypeOf((*MockCommands)(nil).MaybeDependencyUpdate), arg0, arg1) } // RepoAdd mocks base method func (m *MockCommands) RepoAdd(arg0, arg1, arg2 string) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RepoAdd", arg0, arg1, arg2) ret0, _ := ret[0].(error) return ret0 @@ -79,11 +86,13 @@ func (m *MockCommands) RepoAdd(arg0, arg1, arg2 string) error { // RepoAdd indicates an expected call of RepoAdd func (mr *MockCommandsMockRecorder) RepoAdd(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RepoAdd", reflect.TypeOf((*MockCommands)(nil).RepoAdd), arg0, arg1, arg2) } // Template mocks base method func (m *MockCommands) Template(arg0 string, arg1 []string) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Template", arg0, arg1) ret0, _ := ret[0].(error) return ret0 @@ -91,5 +100,6 @@ func (m *MockCommands) Template(arg0 string, arg1 []string) error { // Template indicates an expected call of Template func (mr *MockCommandsMockRecorder) Template(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Template", reflect.TypeOf((*MockCommands)(nil).Template), arg0, arg1) } diff --git a/pkg/test-mocks/helm/renderer_mock.go b/pkg/test-mocks/helm/renderer_mock.go index ee57fcade..1d6d7e5a0 100644 --- a/pkg/test-mocks/helm/renderer_mock.go +++ b/pkg/test-mocks/helm/renderer_mock.go @@ -39,6 +39,7 @@ func (m *MockRenderer) EXPECT() *MockRendererMockRecorder { // Execute mocks base method func (m *MockRenderer) Execute(arg0 root.Fs, arg1 api.HelmAsset, arg2 api.ReleaseMetadata, arg3 map[string]interface{}, arg4 []libyaml.ConfigGroup) func(context.Context) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Execute", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(func(context.Context) error) return ret0 @@ -46,5 +47,6 @@ func (m *MockRenderer) Execute(arg0 root.Fs, arg1 api.HelmAsset, arg2 api.Releas // Execute indicates an expected call of Execute func (mr *MockRendererMockRecorder) Execute(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockRenderer)(nil).Execute), arg0, arg1, arg2, arg3, arg4) } diff --git a/pkg/test-mocks/helm/templater_mock.go b/pkg/test-mocks/helm/templater_mock.go index c5e97a56d..17ab8023f 100644 --- a/pkg/test-mocks/helm/templater_mock.go +++ b/pkg/test-mocks/helm/templater_mock.go @@ -38,6 +38,7 @@ func (m *MockTemplater) EXPECT() *MockTemplaterMockRecorder { // Template mocks base method func (m *MockTemplater) Template(arg0 string, arg1 root.Fs, arg2 api.HelmAsset, arg3 api.ReleaseMetadata, arg4 []libyaml.ConfigGroup, arg5 map[string]interface{}) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Template", arg0, arg1, arg2, arg3, arg4, arg5) ret0, _ := ret[0].(error) return ret0 @@ -45,5 +46,6 @@ func (m *MockTemplater) Template(arg0 string, arg1 root.Fs, arg2 api.HelmAsset, // Template indicates an expected call of Template func (mr *MockTemplaterMockRecorder) Template(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Template", reflect.TypeOf((*MockTemplater)(nil).Template), arg0, arg1, arg2, arg3, arg4, arg5) } diff --git a/pkg/test-mocks/images/image_manager_mock.go b/pkg/test-mocks/images/image_manager_mock.go index 564995587..0766de116 100644 --- a/pkg/test-mocks/images/image_manager_mock.go +++ b/pkg/test-mocks/images/image_manager_mock.go @@ -38,6 +38,7 @@ func (m *MockImageManager) EXPECT() *MockImageManagerMockRecorder { // ImagePull mocks base method func (m *MockImageManager) ImagePull(arg0 context.Context, arg1 string, arg2 types.ImagePullOptions) (io.ReadCloser, error) { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ImagePull", arg0, arg1, arg2) ret0, _ := ret[0].(io.ReadCloser) ret1, _ := ret[1].(error) @@ -46,11 +47,13 @@ func (m *MockImageManager) ImagePull(arg0 context.Context, arg1 string, arg2 typ // ImagePull indicates an expected call of ImagePull func (mr *MockImageManagerMockRecorder) ImagePull(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImagePull", reflect.TypeOf((*MockImageManager)(nil).ImagePull), arg0, arg1, arg2) } // ImagePush mocks base method func (m *MockImageManager) ImagePush(arg0 context.Context, arg1 string, arg2 types.ImagePushOptions) (io.ReadCloser, error) { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ImagePush", arg0, arg1, arg2) ret0, _ := ret[0].(io.ReadCloser) ret1, _ := ret[1].(error) @@ -59,11 +62,13 @@ func (m *MockImageManager) ImagePush(arg0 context.Context, arg1 string, arg2 typ // ImagePush indicates an expected call of ImagePush func (mr *MockImageManagerMockRecorder) ImagePush(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImagePush", reflect.TypeOf((*MockImageManager)(nil).ImagePush), arg0, arg1, arg2) } // ImageSave mocks base method func (m *MockImageManager) ImageSave(arg0 context.Context, arg1 []string) (io.ReadCloser, error) { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ImageSave", arg0, arg1) ret0, _ := ret[0].(io.ReadCloser) ret1, _ := ret[1].(error) @@ -72,11 +77,13 @@ func (m *MockImageManager) ImageSave(arg0 context.Context, arg1 []string) (io.Re // ImageSave indicates an expected call of ImageSave func (mr *MockImageManagerMockRecorder) ImageSave(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageSave", reflect.TypeOf((*MockImageManager)(nil).ImageSave), arg0, arg1) } // ImageTag mocks base method func (m *MockImageManager) ImageTag(arg0 context.Context, arg1, arg2 string) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ImageTag", arg0, arg1, arg2) ret0, _ := ret[0].(error) return ret0 @@ -84,5 +91,6 @@ func (m *MockImageManager) ImageTag(arg0 context.Context, arg1, arg2 string) err // ImageTag indicates an expected call of ImageTag func (mr *MockImageManagerMockRecorder) ImageTag(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageTag", reflect.TypeOf((*MockImageManager)(nil).ImageTag), arg0, arg1, arg2) } diff --git a/pkg/test-mocks/images/pull_url_resovler_mock.go b/pkg/test-mocks/images/pull_url_resovler_mock.go index e5bb87f11..2c9898aa9 100644 --- a/pkg/test-mocks/images/pull_url_resovler_mock.go +++ b/pkg/test-mocks/images/pull_url_resovler_mock.go @@ -36,6 +36,7 @@ func (m *MockPullURLResolver) EXPECT() *MockPullURLResolverMockRecorder { // ResolvePullURL mocks base method func (m *MockPullURLResolver) ResolvePullURL(arg0 api.DockerAsset, arg1 api.ReleaseMetadata) (string, error) { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ResolvePullURL", arg0, arg1) ret0, _ := ret[0].(string) ret1, _ := ret[1].(error) @@ -44,5 +45,6 @@ func (m *MockPullURLResolver) ResolvePullURL(arg0 api.DockerAsset, arg1 api.Rele // ResolvePullURL indicates an expected call of ResolvePullURL func (mr *MockPullURLResolverMockRecorder) ResolvePullURL(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResolvePullURL", reflect.TypeOf((*MockPullURLResolver)(nil).ResolvePullURL), arg0, arg1) } diff --git a/pkg/test-mocks/images/saver/image_saver_mock.go b/pkg/test-mocks/images/saver/image_saver_mock.go index b2ca90f65..82f3dc53f 100644 --- a/pkg/test-mocks/images/saver/image_saver_mock.go +++ b/pkg/test-mocks/images/saver/image_saver_mock.go @@ -37,6 +37,7 @@ func (m *MockImageSaver) EXPECT() *MockImageSaverMockRecorder { // SaveImage mocks base method func (m *MockImageSaver) SaveImage(arg0 context.Context, arg1 images.SaveOpts) chan interface{} { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SaveImage", arg0, arg1) ret0, _ := ret[0].(chan interface{}) return ret0 @@ -44,5 +45,6 @@ func (m *MockImageSaver) SaveImage(arg0 context.Context, arg1 images.SaveOpts) c // SaveImage indicates an expected call of SaveImage func (mr *MockImageSaverMockRecorder) SaveImage(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveImage", reflect.TypeOf((*MockImageSaver)(nil).SaveImage), arg0, arg1) } diff --git a/pkg/test-mocks/inline/inline_mock.go b/pkg/test-mocks/inline/inline_mock.go index 9dec5f219..4a4385f9f 100644 --- a/pkg/test-mocks/inline/inline_mock.go +++ b/pkg/test-mocks/inline/inline_mock.go @@ -39,6 +39,7 @@ func (m *MockRenderer) EXPECT() *MockRendererMockRecorder { // Execute mocks base method func (m *MockRenderer) Execute(arg0 root.Fs, arg1 api.InlineAsset, arg2 api.ReleaseMetadata, arg3 map[string]interface{}, arg4 []libyaml.ConfigGroup) func(context.Context) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Execute", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(func(context.Context) error) return ret0 @@ -46,5 +47,6 @@ func (m *MockRenderer) Execute(arg0 root.Fs, arg1 api.InlineAsset, arg2 api.Rele // Execute indicates an expected call of Execute func (mr *MockRendererMockRecorder) Execute(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockRenderer)(nil).Execute), arg0, arg1, arg2, arg3, arg4) } diff --git a/pkg/test-mocks/lifecycle/messenger_mock.go b/pkg/test-mocks/lifecycle/messenger_mock.go index dedfc2308..8273d4e5f 100644 --- a/pkg/test-mocks/lifecycle/messenger_mock.go +++ b/pkg/test-mocks/lifecycle/messenger_mock.go @@ -37,6 +37,7 @@ func (m *MockMessenger) EXPECT() *MockMessengerMockRecorder { // Execute mocks base method func (m *MockMessenger) Execute(arg0 context.Context, arg1 *api.Release, arg2 *api.Message) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Execute", arg0, arg1, arg2) ret0, _ := ret[0].(error) return ret0 @@ -44,5 +45,6 @@ func (m *MockMessenger) Execute(arg0 context.Context, arg1 *api.Release, arg2 *a // Execute indicates an expected call of Execute func (mr *MockMessengerMockRecorder) Execute(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockMessenger)(nil).Execute), arg0, arg1, arg2) } diff --git a/pkg/test-mocks/lifecycle/renderer_mock.go b/pkg/test-mocks/lifecycle/renderer_mock.go index 67fdc9d68..43a2e1327 100644 --- a/pkg/test-mocks/lifecycle/renderer_mock.go +++ b/pkg/test-mocks/lifecycle/renderer_mock.go @@ -40,6 +40,7 @@ func (m *MockRenderer) EXPECT() *MockRendererMockRecorder { // Execute mocks base method func (m *MockRenderer) Execute(arg0 context.Context, arg1 *api.Release, arg2 *api.Render) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Execute", arg0, arg1, arg2) ret0, _ := ret[0].(error) return ret0 @@ -47,11 +48,13 @@ func (m *MockRenderer) Execute(arg0 context.Context, arg1 *api.Release, arg2 *ap // Execute indicates an expected call of Execute func (mr *MockRendererMockRecorder) Execute(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockRenderer)(nil).Execute), arg0, arg1, arg2) } // WithPlanner mocks base method func (m *MockRenderer) WithPlanner(arg0 planner.Planner) lifecycle.Renderer { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "WithPlanner", arg0) ret0, _ := ret[0].(lifecycle.Renderer) return ret0 @@ -59,11 +62,13 @@ func (m *MockRenderer) WithPlanner(arg0 planner.Planner) lifecycle.Renderer { // WithPlanner indicates an expected call of WithPlanner func (mr *MockRendererMockRecorder) WithPlanner(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithPlanner", reflect.TypeOf((*MockRenderer)(nil).WithPlanner), arg0) } // WithStatusReceiver mocks base method func (m *MockRenderer) WithStatusReceiver(arg0 daemontypes.StatusReceiver) lifecycle.Renderer { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "WithStatusReceiver", arg0) ret0, _ := ret[0].(lifecycle.Renderer) return ret0 @@ -71,5 +76,6 @@ func (m *MockRenderer) WithStatusReceiver(arg0 daemontypes.StatusReceiver) lifec // WithStatusReceiver indicates an expected call of WithStatusReceiver func (mr *MockRendererMockRecorder) WithStatusReceiver(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithStatusReceiver", reflect.TypeOf((*MockRenderer)(nil).WithStatusReceiver), arg0) } diff --git a/pkg/test-mocks/planner/planner_mock.go b/pkg/test-mocks/planner/planner_mock.go index 12a58d034..f0e2fba2c 100644 --- a/pkg/test-mocks/planner/planner_mock.go +++ b/pkg/test-mocks/planner/planner_mock.go @@ -40,6 +40,7 @@ func (m *MockPlanner) EXPECT() *MockPlannerMockRecorder { // Build mocks base method func (m *MockPlanner) Build(arg0 string, arg1 []api.Asset, arg2 []libyaml.ConfigGroup, arg3 api.ReleaseMetadata, arg4 map[string]interface{}) (planner.Plan, error) { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Build", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(planner.Plan) ret1, _ := ret[1].(error) @@ -48,11 +49,13 @@ func (m *MockPlanner) Build(arg0 string, arg1 []api.Asset, arg2 []libyaml.Config // Build indicates an expected call of Build func (mr *MockPlannerMockRecorder) Build(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Build", reflect.TypeOf((*MockPlanner)(nil).Build), arg0, arg1, arg2, arg3, arg4) } // Execute mocks base method func (m *MockPlanner) Execute(arg0 context.Context, arg1 planner.Plan) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Execute", arg0, arg1) ret0, _ := ret[0].(error) return ret0 @@ -60,11 +63,13 @@ func (m *MockPlanner) Execute(arg0 context.Context, arg1 planner.Plan) error { // Execute indicates an expected call of Execute func (mr *MockPlannerMockRecorder) Execute(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockPlanner)(nil).Execute), arg0, arg1) } // WithStatusReceiver mocks base method func (m *MockPlanner) WithStatusReceiver(arg0 daemontypes.StatusReceiver) planner.Planner { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "WithStatusReceiver", arg0) ret0, _ := ret[0].(planner.Planner) return ret0 @@ -72,5 +77,6 @@ func (m *MockPlanner) WithStatusReceiver(arg0 daemontypes.StatusReceiver) planne // WithStatusReceiver indicates an expected call of WithStatusReceiver func (mr *MockPlannerMockRecorder) WithStatusReceiver(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithStatusReceiver", reflect.TypeOf((*MockPlanner)(nil).WithStatusReceiver), arg0) } diff --git a/pkg/test-mocks/replicatedapp/resolve_replicated_app.go b/pkg/test-mocks/replicatedapp/resolve_replicated_app.go index 73cfbf550..54327779f 100644 --- a/pkg/test-mocks/replicatedapp/resolve_replicated_app.go +++ b/pkg/test-mocks/replicatedapp/resolve_replicated_app.go @@ -10,6 +10,7 @@ import ( gomock "github.com/golang/mock/gomock" api "github.com/replicatedhq/ship/pkg/api" + apptype "github.com/replicatedhq/ship/pkg/specs/apptype" replicatedapp "github.com/replicatedhq/ship/pkg/specs/replicatedapp" ) @@ -38,6 +39,7 @@ func (m *MockResolver) EXPECT() *MockResolverMockRecorder { // FetchRelease mocks base method func (m *MockResolver) FetchRelease(arg0 context.Context, arg1 *replicatedapp.Selector) (*replicatedapp.ShipRelease, error) { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "FetchRelease", arg0, arg1) ret0, _ := ret[0].(*replicatedapp.ShipRelease) ret1, _ := ret[1].(error) @@ -46,11 +48,13 @@ func (m *MockResolver) FetchRelease(arg0 context.Context, arg1 *replicatedapp.Se // FetchRelease indicates an expected call of FetchRelease func (mr *MockResolverMockRecorder) FetchRelease(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchRelease", reflect.TypeOf((*MockResolver)(nil).FetchRelease), arg0, arg1) } // RegisterInstall mocks base method func (m *MockResolver) RegisterInstall(arg0 context.Context, arg1 replicatedapp.Selector, arg2 *api.Release) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RegisterInstall", arg0, arg1, arg2) ret0, _ := ret[0].(error) return ret0 @@ -58,28 +62,33 @@ func (m *MockResolver) RegisterInstall(arg0 context.Context, arg1 replicatedapp. // RegisterInstall indicates an expected call of RegisterInstall func (mr *MockResolverMockRecorder) RegisterInstall(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInstall", reflect.TypeOf((*MockResolver)(nil).RegisterInstall), arg0, arg1, arg2) } // ResolveAppRelease mocks base method -func (m *MockResolver) ResolveAppRelease(arg0 context.Context, arg1 *replicatedapp.Selector) (*api.Release, error) { - ret := m.ctrl.Call(m, "ResolveAppRelease", arg0, arg1) +func (m *MockResolver) ResolveAppRelease(arg0 context.Context, arg1 *replicatedapp.Selector, arg2 apptype.LocalAppCopy) (*api.Release, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ResolveAppRelease", arg0, arg1, arg2) ret0, _ := ret[0].(*api.Release) ret1, _ := ret[1].(error) return ret0, ret1 } // ResolveAppRelease indicates an expected call of ResolveAppRelease -func (mr *MockResolverMockRecorder) ResolveAppRelease(arg0, arg1 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResolveAppRelease", reflect.TypeOf((*MockResolver)(nil).ResolveAppRelease), arg0, arg1) +func (mr *MockResolverMockRecorder) ResolveAppRelease(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResolveAppRelease", reflect.TypeOf((*MockResolver)(nil).ResolveAppRelease), arg0, arg1, arg2) } // SetRunbook mocks base method func (m *MockResolver) SetRunbook(arg0 string) { + m.ctrl.T.Helper() m.ctrl.Call(m, "SetRunbook", arg0) } // SetRunbook indicates an expected call of SetRunbook func (mr *MockResolverMockRecorder) SetRunbook(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetRunbook", reflect.TypeOf((*MockResolver)(nil).SetRunbook), arg0) } diff --git a/pkg/test-mocks/state/manager_mock.go b/pkg/test-mocks/state/manager_mock.go index 4ffda2c3f..8f6e79859 100644 --- a/pkg/test-mocks/state/manager_mock.go +++ b/pkg/test-mocks/state/manager_mock.go @@ -38,6 +38,7 @@ func (m *MockManager) EXPECT() *MockManagerMockRecorder { // AddCA mocks base method func (m *MockManager) AddCA(arg0 string, arg1 util.CAType) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AddCA", arg0, arg1) ret0, _ := ret[0].(error) return ret0 @@ -45,11 +46,13 @@ func (m *MockManager) AddCA(arg0 string, arg1 util.CAType) error { // AddCA indicates an expected call of AddCA func (mr *MockManagerMockRecorder) AddCA(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddCA", reflect.TypeOf((*MockManager)(nil).AddCA), arg0, arg1) } // AddCert mocks base method func (m *MockManager) AddCert(arg0 string, arg1 util.CertType) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AddCert", arg0, arg1) ret0, _ := ret[0].(error) return ret0 @@ -57,11 +60,13 @@ func (m *MockManager) AddCert(arg0 string, arg1 util.CertType) error { // AddCert indicates an expected call of AddCert func (mr *MockManagerMockRecorder) AddCert(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddCert", reflect.TypeOf((*MockManager)(nil).AddCert), arg0, arg1) } // RemoveStateFile mocks base method func (m *MockManager) RemoveStateFile() error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RemoveStateFile") ret0, _ := ret[0].(error) return ret0 @@ -69,11 +74,13 @@ func (m *MockManager) RemoveStateFile() error { // RemoveStateFile indicates an expected call of RemoveStateFile func (mr *MockManagerMockRecorder) RemoveStateFile() *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveStateFile", reflect.TypeOf((*MockManager)(nil).RemoveStateFile)) } // ResetLifecycle mocks base method func (m *MockManager) ResetLifecycle() error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ResetLifecycle") ret0, _ := ret[0].(error) return ret0 @@ -81,11 +88,13 @@ func (m *MockManager) ResetLifecycle() error { // ResetLifecycle indicates an expected call of ResetLifecycle func (mr *MockManagerMockRecorder) ResetLifecycle() *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResetLifecycle", reflect.TypeOf((*MockManager)(nil).ResetLifecycle)) } // Save mocks base method func (m *MockManager) Save(arg0 state.VersionedState) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Save", arg0) ret0, _ := ret[0].(error) return ret0 @@ -93,11 +102,13 @@ func (m *MockManager) Save(arg0 state.VersionedState) error { // Save indicates an expected call of Save func (mr *MockManagerMockRecorder) Save(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Save", reflect.TypeOf((*MockManager)(nil).Save), arg0) } // SaveKustomize mocks base method func (m *MockManager) SaveKustomize(arg0 *state.Kustomize) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SaveKustomize", arg0) ret0, _ := ret[0].(error) return ret0 @@ -105,11 +116,13 @@ func (m *MockManager) SaveKustomize(arg0 *state.Kustomize) error { // SaveKustomize indicates an expected call of SaveKustomize func (mr *MockManagerMockRecorder) SaveKustomize(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveKustomize", reflect.TypeOf((*MockManager)(nil).SaveKustomize), arg0) } // SerializeAppMetadata mocks base method func (m *MockManager) SerializeAppMetadata(arg0 api.ReleaseMetadata) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SerializeAppMetadata", arg0) ret0, _ := ret[0].(error) return ret0 @@ -117,11 +130,13 @@ func (m *MockManager) SerializeAppMetadata(arg0 api.ReleaseMetadata) error { // SerializeAppMetadata indicates an expected call of SerializeAppMetadata func (mr *MockManagerMockRecorder) SerializeAppMetadata(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SerializeAppMetadata", reflect.TypeOf((*MockManager)(nil).SerializeAppMetadata), arg0) } // SerializeConfig mocks base method func (m *MockManager) SerializeConfig(arg0 []api.Asset, arg1 api.ReleaseMetadata, arg2 map[string]interface{}) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SerializeConfig", arg0, arg1, arg2) ret0, _ := ret[0].(error) return ret0 @@ -129,11 +144,13 @@ func (m *MockManager) SerializeConfig(arg0 []api.Asset, arg1 api.ReleaseMetadata // SerializeConfig indicates an expected call of SerializeConfig func (mr *MockManagerMockRecorder) SerializeConfig(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SerializeConfig", reflect.TypeOf((*MockManager)(nil).SerializeConfig), arg0, arg1, arg2) } // SerializeContentSHA mocks base method func (m *MockManager) SerializeContentSHA(arg0 string) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SerializeContentSHA", arg0) ret0, _ := ret[0].(error) return ret0 @@ -141,11 +158,13 @@ func (m *MockManager) SerializeContentSHA(arg0 string) error { // SerializeContentSHA indicates an expected call of SerializeContentSHA func (mr *MockManagerMockRecorder) SerializeContentSHA(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SerializeContentSHA", reflect.TypeOf((*MockManager)(nil).SerializeContentSHA), arg0) } // SerializeHelmValues mocks base method func (m *MockManager) SerializeHelmValues(arg0, arg1 string) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SerializeHelmValues", arg0, arg1) ret0, _ := ret[0].(error) return ret0 @@ -153,11 +172,13 @@ func (m *MockManager) SerializeHelmValues(arg0, arg1 string) error { // SerializeHelmValues indicates an expected call of SerializeHelmValues func (mr *MockManagerMockRecorder) SerializeHelmValues(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SerializeHelmValues", reflect.TypeOf((*MockManager)(nil).SerializeHelmValues), arg0, arg1) } // SerializeListsMetadata mocks base method func (m *MockManager) SerializeListsMetadata(arg0 util.List) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SerializeListsMetadata", arg0) ret0, _ := ret[0].(error) return ret0 @@ -165,11 +186,13 @@ func (m *MockManager) SerializeListsMetadata(arg0 util.List) error { // SerializeListsMetadata indicates an expected call of SerializeListsMetadata func (mr *MockManagerMockRecorder) SerializeListsMetadata(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SerializeListsMetadata", reflect.TypeOf((*MockManager)(nil).SerializeListsMetadata), arg0) } // SerializeNamespace mocks base method func (m *MockManager) SerializeNamespace(arg0 string) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SerializeNamespace", arg0) ret0, _ := ret[0].(error) return ret0 @@ -177,11 +200,13 @@ func (m *MockManager) SerializeNamespace(arg0 string) error { // SerializeNamespace indicates an expected call of SerializeNamespace func (mr *MockManagerMockRecorder) SerializeNamespace(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SerializeNamespace", reflect.TypeOf((*MockManager)(nil).SerializeNamespace), arg0) } // SerializeReleaseName mocks base method func (m *MockManager) SerializeReleaseName(arg0 string) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SerializeReleaseName", arg0) ret0, _ := ret[0].(error) return ret0 @@ -189,11 +214,13 @@ func (m *MockManager) SerializeReleaseName(arg0 string) error { // SerializeReleaseName indicates an expected call of SerializeReleaseName func (mr *MockManagerMockRecorder) SerializeReleaseName(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SerializeReleaseName", reflect.TypeOf((*MockManager)(nil).SerializeReleaseName), arg0) } // SerializeShipMetadata mocks base method func (m *MockManager) SerializeShipMetadata(arg0 api.ShipAppMetadata, arg1 string) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SerializeShipMetadata", arg0, arg1) ret0, _ := ret[0].(error) return ret0 @@ -201,11 +228,13 @@ func (m *MockManager) SerializeShipMetadata(arg0 api.ShipAppMetadata, arg1 strin // SerializeShipMetadata indicates an expected call of SerializeShipMetadata func (mr *MockManagerMockRecorder) SerializeShipMetadata(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SerializeShipMetadata", reflect.TypeOf((*MockManager)(nil).SerializeShipMetadata), arg0, arg1) } // SerializeUpstream mocks base method func (m *MockManager) SerializeUpstream(arg0 string) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SerializeUpstream", arg0) ret0, _ := ret[0].(error) return ret0 @@ -213,11 +242,13 @@ func (m *MockManager) SerializeUpstream(arg0 string) error { // SerializeUpstream indicates an expected call of SerializeUpstream func (mr *MockManagerMockRecorder) SerializeUpstream(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SerializeUpstream", reflect.TypeOf((*MockManager)(nil).SerializeUpstream), arg0) } // TryLoad mocks base method func (m *MockManager) TryLoad() (state.State, error) { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "TryLoad") ret0, _ := ret[0].(state.State) ret1, _ := ret[1].(error) @@ -226,5 +257,6 @@ func (m *MockManager) TryLoad() (state.State, error) { // TryLoad indicates an expected call of TryLoad func (mr *MockManagerMockRecorder) TryLoad() *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TryLoad", reflect.TypeOf((*MockManager)(nil).TryLoad)) } diff --git a/pkg/test-mocks/tfplan/confirmer_mock.go b/pkg/test-mocks/tfplan/confirmer_mock.go index 8fd11129d..070f241ec 100644 --- a/pkg/test-mocks/tfplan/confirmer_mock.go +++ b/pkg/test-mocks/tfplan/confirmer_mock.go @@ -39,6 +39,7 @@ func (m *MockPlanConfirmer) EXPECT() *MockPlanConfirmerMockRecorder { // ConfirmPlan mocks base method func (m *MockPlanConfirmer) ConfirmPlan(arg0 context.Context, arg1 string, arg2 api.Release, arg3 chan bool) (bool, error) { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ConfirmPlan", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(bool) ret1, _ := ret[1].(error) @@ -47,11 +48,13 @@ func (m *MockPlanConfirmer) ConfirmPlan(arg0 context.Context, arg1 string, arg2 // ConfirmPlan indicates an expected call of ConfirmPlan func (mr *MockPlanConfirmerMockRecorder) ConfirmPlan(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConfirmPlan", reflect.TypeOf((*MockPlanConfirmer)(nil).ConfirmPlan), arg0, arg1, arg2, arg3) } // WithStatusReceiver mocks base method func (m *MockPlanConfirmer) WithStatusReceiver(arg0 daemontypes.StatusReceiver) tfplan.PlanConfirmer { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "WithStatusReceiver", arg0) ret0, _ := ret[0].(tfplan.PlanConfirmer) return ret0 @@ -59,5 +62,6 @@ func (m *MockPlanConfirmer) WithStatusReceiver(arg0 daemontypes.StatusReceiver) // WithStatusReceiver indicates an expected call of WithStatusReceiver func (mr *MockPlanConfirmerMockRecorder) WithStatusReceiver(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithStatusReceiver", reflect.TypeOf((*MockPlanConfirmer)(nil).WithStatusReceiver), arg0) } diff --git a/pkg/test-mocks/ui/ui.go b/pkg/test-mocks/ui/ui.go index 6f592a127..c8cf60ff4 100644 --- a/pkg/test-mocks/ui/ui.go +++ b/pkg/test-mocks/ui/ui.go @@ -35,6 +35,7 @@ func (m *MockUi) EXPECT() *MockUiMockRecorder { // Ask mocks base method func (m *MockUi) Ask(arg0 string) (string, error) { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Ask", arg0) ret0, _ := ret[0].(string) ret1, _ := ret[1].(error) @@ -43,11 +44,13 @@ func (m *MockUi) Ask(arg0 string) (string, error) { // Ask indicates an expected call of Ask func (mr *MockUiMockRecorder) Ask(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ask", reflect.TypeOf((*MockUi)(nil).Ask), arg0) } // AskSecret mocks base method func (m *MockUi) AskSecret(arg0 string) (string, error) { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AskSecret", arg0) ret0, _ := ret[0].(string) ret1, _ := ret[1].(error) @@ -56,45 +59,54 @@ func (m *MockUi) AskSecret(arg0 string) (string, error) { // AskSecret indicates an expected call of AskSecret func (mr *MockUiMockRecorder) AskSecret(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AskSecret", reflect.TypeOf((*MockUi)(nil).AskSecret), arg0) } // Error mocks base method func (m *MockUi) Error(arg0 string) { + m.ctrl.T.Helper() m.ctrl.Call(m, "Error", arg0) } // Error indicates an expected call of Error func (mr *MockUiMockRecorder) Error(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockUi)(nil).Error), arg0) } // Info mocks base method func (m *MockUi) Info(arg0 string) { + m.ctrl.T.Helper() m.ctrl.Call(m, "Info", arg0) } // Info indicates an expected call of Info func (mr *MockUiMockRecorder) Info(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockUi)(nil).Info), arg0) } // Output mocks base method func (m *MockUi) Output(arg0 string) { + m.ctrl.T.Helper() m.ctrl.Call(m, "Output", arg0) } // Output indicates an expected call of Output func (mr *MockUiMockRecorder) Output(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Output", reflect.TypeOf((*MockUi)(nil).Output), arg0) } // Warn mocks base method func (m *MockUi) Warn(arg0 string) { + m.ctrl.T.Helper() m.ctrl.Call(m, "Warn", arg0) } // Warn indicates an expected call of Warn func (mr *MockUiMockRecorder) Warn(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Warn", reflect.TypeOf((*MockUi)(nil).Warn), arg0) } diff --git a/pkg/test-mocks/util/asset_uploader.go b/pkg/test-mocks/util/asset_uploader.go index cfab13ac6..e30628c74 100644 --- a/pkg/test-mocks/util/asset_uploader.go +++ b/pkg/test-mocks/util/asset_uploader.go @@ -35,6 +35,7 @@ func (m *MockAssetUploader) EXPECT() *MockAssetUploaderMockRecorder { // UploadAssets mocks base method func (m *MockAssetUploader) UploadAssets(arg0 string) error { + m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UploadAssets", arg0) ret0, _ := ret[0].(error) return ret0 @@ -42,5 +43,6 @@ func (m *MockAssetUploader) UploadAssets(arg0 string) error { // UploadAssets indicates an expected call of UploadAssets func (mr *MockAssetUploaderMockRecorder) UploadAssets(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UploadAssets", reflect.TypeOf((*MockAssetUploader)(nil).UploadAssets), arg0) } diff --git a/web/app/src/App.tsx b/web/app/src/App.tsx index 0d640af5a..fe39bb49a 100644 --- a/web/app/src/App.tsx +++ b/web/app/src/App.tsx @@ -2,6 +2,9 @@ import { Ship } from "@replicatedhq/ship-init"; import * as React from "react"; +// This is a side effect import for including the exported image from +// `@replicatedhq/ship-init` to the `@replicatedhq/ship-app` bundle. +import "@replicatedhq/ship-init/dist/b3d517c0409239a363a3c18ce9a0eda2.png"; import "@replicatedhq/ship-init/dist/styles.css"; class App extends React.Component { diff --git a/web/init/src/components/shared/AppWrapper.jsx b/web/init/src/components/shared/AppWrapper.jsx index 6494c5651..9211baf2b 100644 --- a/web/init/src/components/shared/AppWrapper.jsx +++ b/web/init/src/components/shared/AppWrapper.jsx @@ -3,9 +3,8 @@ import DocumentTitle from "react-document-title"; export default class AppWrapper extends React.Component { render() { - const { channelDetails } = this.props; return ( - +
{this.props.children}
diff --git a/web/init/src/components/shared/DetermineComponentForRoute.jsx b/web/init/src/components/shared/DetermineComponentForRoute.jsx index a8adf29a9..a26658512 100644 --- a/web/init/src/components/shared/DetermineComponentForRoute.jsx +++ b/web/init/src/components/shared/DetermineComponentForRoute.jsx @@ -272,7 +272,7 @@ export class DetermineComponentForRoute extends React.Component {
- {(isLoadingStep || dataLoading.getHelmChartMetadataLoading) && !this.state.maxPollReached ? + {(isLoadingStep || dataLoading.getMetadataLoading) && !this.state.maxPollReached ?
diff --git a/web/init/src/components/shared/DetermineStep.jsx b/web/init/src/components/shared/DetermineStep.jsx index 9193bd658..f9c1c13c6 100644 --- a/web/init/src/components/shared/DetermineStep.jsx +++ b/web/init/src/components/shared/DetermineStep.jsx @@ -98,7 +98,7 @@ export default class DetermineStep extends React.Component { componentDidMount() { //this.props.getChannel(); - this.props.getHelmChartMetadata(); + this.props.getMetadata(); this.startPoll(); this.startMaxTimeout(); this.pollIfStream(); @@ -155,7 +155,7 @@ export default class DetermineStep extends React.Component {
- {(isLoadingStep || dataLoading.getCurrentStepLoading || dataLoading.getHelmChartMetadataLoading) && !this.state.maxPollReached ? + {(isLoadingStep || dataLoading.getCurrentStepLoading || dataLoading.getMetadataLoading) && !this.state.maxPollReached ?
diff --git a/web/init/src/components/shared/NavBar.jsx b/web/init/src/components/shared/NavBar.jsx index fc253cf66..0d4d9a9f4 100644 --- a/web/init/src/components/shared/NavBar.jsx +++ b/web/init/src/components/shared/NavBar.jsx @@ -3,8 +3,13 @@ import assign from "object-assign"; import { Link, withRouter } from "react-router-dom"; import upperFirst from "lodash/upperFirst"; import NavItem from "./NavItem"; -import { get, isEmpty } from "lodash"; - +// This is hardcoded for now as we're bundling it from `@replicatedhq/ship-init` +// and then re-bundling the svg as a part of the `@replicatedhq/ship-app` bundle +// for it to be served via the ship binary. As part of the bundling process the name +// is mutated to a data-uri twice. +// Do not remove the import. +import "../../assets/images/ship-logo.png"; +const shipLogo = "static/media/b3d517c0409239a363a3c18ce9a0eda2.b3d517c0.png"; export class NavBar extends React.Component { constructor() { @@ -12,7 +17,7 @@ export class NavBar extends React.Component { this.state = { navDetails: { name: "", - icon: "" + icon: "", }, imageLoaded: false, }; @@ -95,42 +100,27 @@ export class NavBar extends React.Component { ) componentDidUpdate() { - const { shipAppMetadata, channelDetails } = this.props; - const { navDetails } = this.state; - - let updatedState = {}; - if (shipAppMetadata.name && shipAppMetadata.name !== navDetails.name) { - updatedState = { - navDetails: { - name: shipAppMetadata.name, - icon: shipAppMetadata.icon, - }, - }; - } - - if (channelDetails.channelName && channelDetails.channelName !== navDetails.name) { - updatedState = { - navDetails: { - name: channelDetails.channelName, - icon: channelDetails.icon, - } - }; - } + const { shipAppMetadata } = this.props; + const { imageLoaded } = this.state; - const navIconUpdated = !isEmpty(get(updatedState, ["navDetails", "icon"], "")) - if (navIconUpdated) { - this.preloadNavIconImage(updatedState.navDetails.icon) + if (!imageLoaded && shipAppMetadata.loaded) { + this.preloadNavIconImage(shipAppMetadata.icon) .then(() => { this.setState({ - ...updatedState, + navDetails: { + name: shipAppMetadata.name, + icon: shipAppMetadata.icon, + }, imageLoaded: true, }) }) - .catch(() => this.setState({ ...updatedState, imageLoaded: true })) - } else { - if (!isEmpty(updatedState)) { - this.setState(updatedState); - } + .catch(() => this.setState({ + navDetails: { + name: shipAppMetadata.name, + icon: shipLogo, + }, + imageLoaded: true, + })); } } @@ -204,7 +194,7 @@ export class NavBar extends React.Component { {headerName} ) : - headerName + null } {this.props.hideLinks ? null :
diff --git a/web/init/src/components/shared/NavBar.spec.js b/web/init/src/components/shared/NavBar.spec.js index c4b7587bd..e627032c3 100644 --- a/web/init/src/components/shared/NavBar.spec.js +++ b/web/init/src/components/shared/NavBar.spec.js @@ -49,6 +49,7 @@ describe("NavBar", () => { shipAppMetadata: { name: "testHelm", icon: "testHelmIcon", + loaded: true, }, }, ), @@ -60,33 +61,4 @@ describe("NavBar", () => { expect(navDetails.icon).toEqual("testHelmIcon"); }); }); - describe("provided channelDetails", () => { - const wrapper = mount( - - - - ); - it("sets navDetails via channelDetails", async () => { - wrapper.setProps({ - children: React.cloneElement( - wrapper.props().children, - { - ...mockRouterProps, - channelDetails: { - channelName: "testChannelDetails", - icon: "testChannelDetailsIcon", - }, - }, - ), - }); - await wrapper.update(); - const navBar = wrapper.find(NavBar).instance(); - const navDetails = navBar.state.navDetails; - expect(navDetails.name).toEqual("testChannelDetails"); - expect(navDetails.icon).toEqual("testChannelDetailsIcon"); - }); - }); }); diff --git a/web/init/src/components/shared/RouteDecider.jsx b/web/init/src/components/shared/RouteDecider.jsx index 6b3fe5af5..c73c4d369 100644 --- a/web/init/src/components/shared/RouteDecider.jsx +++ b/web/init/src/components/shared/RouteDecider.jsx @@ -70,16 +70,9 @@ export default class RouteDecider extends React.Component { componentDidUpdate(lastProps) { const { routes, - getHelmChartMetadata, basePath } = this.props if (routes !== lastProps.routes && routes.length) { - for (let i = 0; i < routes.length; i++) { - if (routes[i].phase.includes("helm")) { - getHelmChartMetadata(); - break; - } - } if (isRootPath(basePath)) { const defaultRoute = `${basePath}/${routes[0].id}`; this.props.history.push(defaultRoute); @@ -88,9 +81,15 @@ export default class RouteDecider extends React.Component { } componentDidMount() { - if (isEmpty(this.props.routes)) { - this.props.getRoutes(); + const { + routes, + getRoutes, + getMetadata, + } = this.props; + if (isEmpty(routes)) { + getRoutes(); } + getMetadata(); } render() { diff --git a/web/init/src/containers/AppWrapper.js b/web/init/src/containers/AppWrapper.js index 313552f86..e0f6cb365 100644 --- a/web/init/src/containers/AppWrapper.js +++ b/web/init/src/containers/AppWrapper.js @@ -5,7 +5,6 @@ import { loadingData } from "../redux/ui/main/actions"; const AppWrapper = connect( state => ({ - channelDetails: state.data.channelSettings.channelSettingsData.channel, dataLoading: state.ui.main.loading, }), dispatch => ({ diff --git a/web/init/src/containers/ConfigOnly.js b/web/init/src/containers/ConfigOnly.js index 5debf2ec5..dd8430c75 100644 --- a/web/init/src/containers/ConfigOnly.js +++ b/web/init/src/containers/ConfigOnly.js @@ -7,7 +7,6 @@ import { finalizeApplicationSettings, setApplicationState } from "../redux/data/applicationSettings/actions"; -import { getChannel } from "../redux/data/channelSettings/actions"; import { getCurrentStep } from "../redux/data/determineSteps/actions"; const ConfigOnly = connect( @@ -19,7 +18,6 @@ const ConfigOnly = connect( dataLoading: state.ui.main.loading, }), dispatch => ({ - getChannel() { return dispatch(getChannel()); }, getCurrentStep() { return dispatch(getCurrentStep()); }, getApplicationSettings(payload, shouldLoad) { return dispatch(getApplicationSettings(payload, shouldLoad)); }, saveApplicationSettings(payload, validate) { return dispatch(saveApplicationSettings(payload, validate)); }, diff --git a/web/init/src/containers/DetermineComponentForRoute.js b/web/init/src/containers/DetermineComponentForRoute.js index ac1de2185..d3457f3f6 100644 --- a/web/init/src/containers/DetermineComponentForRoute.js +++ b/web/init/src/containers/DetermineComponentForRoute.js @@ -1,7 +1,6 @@ import { connect } from "react-redux"; import realDetermineComponentForRoute from "../components/shared/DetermineComponentForRoute"; -import { getChannel } from "../redux/data/channelSettings/actions"; import { getContentForStep, pollContentForStep, @@ -9,7 +8,7 @@ import { shutdownApp, initializeStep, } from "../redux/data/appRoutes/actions"; -import { getHelmChartMetadata, saveHelmChartValues } from "../redux/data/kustomizeSettings/actions"; +import { getMetadata, saveHelmChartValues } from "../redux/data/kustomizeSettings/actions"; const DetermineComponentForRoute = connect( state => ({ @@ -23,10 +22,9 @@ const DetermineComponentForRoute = connect( apiEndpoint: state.apiEndpoint, }), dispatch => ({ - getChannel() { return dispatch(getChannel()); }, getContentForStep(stepId) { return dispatch(getContentForStep(stepId)); }, pollContentForStep(stepId, cb) { return dispatch(pollContentForStep(stepId, cb)); }, - getHelmChartMetadata() { return dispatch(getHelmChartMetadata()) }, + getMetadata() { return dispatch(getMetadata()) }, saveHelmChartValues(payload) { return dispatch(saveHelmChartValues(payload)) }, finalizeStep(action) { return dispatch(finalizeStep(action)); }, shutdownApp() { return dispatch(shutdownApp()); }, diff --git a/web/init/src/containers/DetermineStep.js b/web/init/src/containers/DetermineStep.js index c9a4ba289..b5da25865 100644 --- a/web/init/src/containers/DetermineStep.js +++ b/web/init/src/containers/DetermineStep.js @@ -1,9 +1,8 @@ import { connect } from "react-redux"; import realDetermineStep from "../components/shared/DetermineStep"; -import { getChannel } from "../redux/data/channelSettings/actions"; import { getCurrentStep, submitAction } from "../redux/data/determineSteps/actions"; -import { getHelmChartMetadata, saveHelmChartValues } from "../redux/data/kustomizeSettings/actions"; +import { getMetadata, saveHelmChartValues } from "../redux/data/kustomizeSettings/actions"; const DetermineStep = connect( state => ({ @@ -15,9 +14,8 @@ const DetermineStep = connect( progress: state.data.determineSteps.stepsData.progress, }), dispatch => ({ - getChannel() { return dispatch(getChannel()); }, getCurrentStep(loaderType) { return dispatch(getCurrentStep(loaderType)); }, - getHelmChartMetadata() { return dispatch(getHelmChartMetadata()) }, + getMetadata() { return dispatch(getMetadata()) }, saveHelmChartValues(payload) { return dispatch(saveHelmChartValues(payload)) }, submitAction(action) { return dispatch(submitAction(action)); } }), diff --git a/web/init/src/containers/HelmChartInfo.js b/web/init/src/containers/HelmChartInfo.js index e13cf473b..60432d3a3 100644 --- a/web/init/src/containers/HelmChartInfo.js +++ b/web/init/src/containers/HelmChartInfo.js @@ -2,7 +2,7 @@ import { connect } from "react-redux"; import realHelmChartInfo from "../components/kustomize/HelmChartInfo"; import { submitAction } from "../redux/data/determineSteps/actions"; -import { getHelmChartMetadata } from "../redux/data/kustomizeSettings/actions"; +import { getMetadata } from "../redux/data/kustomizeSettings/actions"; const HelmChartInfo = connect( state => ({ @@ -11,7 +11,7 @@ const HelmChartInfo = connect( actions: state.data.determineSteps.stepsData.actions, }), dispatch => ({ - getHelmChartMetadata() { return dispatch(getHelmChartMetadata()) }, + getMetadata() { return dispatch(getMetadata()) }, submitAction(action) { return dispatch(submitAction(action)); } }), )(realHelmChartInfo); diff --git a/web/init/src/containers/KustomizeOverlay.js b/web/init/src/containers/KustomizeOverlay.js index 95e55ade9..4cb6191b5 100644 --- a/web/init/src/containers/KustomizeOverlay.js +++ b/web/init/src/containers/KustomizeOverlay.js @@ -3,7 +3,7 @@ import realKustomizeOverlay from "../components/kustomize/kustomize_overlay/Kust import { loadingData } from "../redux/ui/main/actions"; import { getContentForStep } from "../redux/data/appRoutes/actions"; -import { getHelmChartMetadata } from "../redux/data/kustomizeSettings/actions"; +import { getMetadata } from "../redux/data/kustomizeSettings/actions"; import { getFileContent, saveKustomizeOverlay, @@ -28,7 +28,7 @@ const KustomizeOverlay = connect( dispatch => ({ getFileContent(payload) { return dispatch(getFileContent(payload)); }, getContentForStep(stepId) { return dispatch(getContentForStep(stepId)); }, - getHelmChartMetadata() { return dispatch(getHelmChartMetadata()) }, + getMetadata() { return dispatch(getMetadata()) }, saveKustomizeOverlay(payload) { return dispatch(saveKustomizeOverlay(payload)); }, deleteOverlay(path, type) { return dispatch(deleteOverlay(path, type)); }, includeBase(path) { return dispatch(includeBase(path)); }, diff --git a/web/init/src/containers/Navbar.js b/web/init/src/containers/Navbar.js index b993d4db5..44bb845ac 100644 --- a/web/init/src/containers/Navbar.js +++ b/web/init/src/containers/Navbar.js @@ -5,7 +5,6 @@ import { loadingData } from "../redux/ui/main/actions"; const NavBar = connect( state => ({ - channelDetails: state.data.channelSettings.channelSettingsData.channel, shipAppMetadata: state.data.kustomizeSettings.shipAppMetadata, phase: state.data.determineSteps.stepsData.phase, isKustomizeFlow: state.data.appRoutes.routesData.isKustomizeFlow, diff --git a/web/init/src/containers/RouteDecider.js b/web/init/src/containers/RouteDecider.js index 4f9d9dc1e..da6f72565 100644 --- a/web/init/src/containers/RouteDecider.js +++ b/web/init/src/containers/RouteDecider.js @@ -2,7 +2,7 @@ import { connect } from "react-redux"; import realRouteDecider from "../components/shared/RouteDecider"; import { getRoutes } from "../redux/data/appRoutes/actions"; -import { getHelmChartMetadata } from "../redux/data/kustomizeSettings/actions"; +import { getMetadata } from "../redux/data/kustomizeSettings/actions"; const RouteDecider = connect( state => ({ @@ -12,7 +12,7 @@ const RouteDecider = connect( }), dispatch => ({ getRoutes() { return dispatch(getRoutes()); }, - getHelmChartMetadata() { return dispatch(getHelmChartMetadata()) }, + getMetadata() { return dispatch(getMetadata()) }, }), )(realRouteDecider); diff --git a/web/init/src/redux/data/channelSettings/actions.js b/web/init/src/redux/data/channelSettings/actions.js deleted file mode 100644 index c1407fb12..000000000 --- a/web/init/src/redux/data/channelSettings/actions.js +++ /dev/null @@ -1,40 +0,0 @@ -import "isomorphic-fetch"; -import { loadingData } from "../../ui/main/actions"; - -export const constants = { - RECEIVE_CHANNEL_DETAILS: "RECEIVE_CHANNEL_DETAILS" -}; - -export function receiveChannelSettings(message) { - return { - type: constants.RECEIVE_CHANNEL_DETAILS, - payload: message - } -} - -export function getChannel() { - return async (dispatch, getState) => { - const { apiEndpoint } = getState(); - let response; - dispatch(loadingData("getChannel", true)); - try { - const url = `${apiEndpoint}/channel`; - response = await fetch(url, { - method: "GET", - headers: { - "Accept": "application/json", - }, - }); - if (!response.ok) { - dispatch(loadingData("getChannel", false)); - return; - } - const body = await response.json(); - dispatch(loadingData("getChannel", false)); - dispatch(receiveChannelSettings(body)); - } catch (error) { - dispatch(loadingData("getChannel", false)); - return; - } - }; -} diff --git a/web/init/src/redux/data/channelSettings/index.js b/web/init/src/redux/data/channelSettings/index.js deleted file mode 100644 index 9f3e1e67e..000000000 --- a/web/init/src/redux/data/channelSettings/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import { combineReducers } from "redux"; -import { channelSettingsData } from "./reducer"; - -export default combineReducers({ - channelSettingsData, -}); diff --git a/web/init/src/redux/data/channelSettings/reducer.js b/web/init/src/redux/data/channelSettings/reducer.js deleted file mode 100644 index 7a33d5669..000000000 --- a/web/init/src/redux/data/channelSettings/reducer.js +++ /dev/null @@ -1,16 +0,0 @@ -import { constants } from "./actions"; - -const channelSettingsState = { - channel: {}, -}; - -export function channelSettingsData(state = channelSettingsState, action) { - switch (action.type) { - case constants.RECEIVE_CHANNEL_DETAILS: - return Object.assign({}, state, { - channel: action.payload, - }); - default: - return state; - } -} diff --git a/web/init/src/redux/data/index.js b/web/init/src/redux/data/index.js index c3fccb885..46f47b5e7 100644 --- a/web/init/src/redux/data/index.js +++ b/web/init/src/redux/data/index.js @@ -2,7 +2,6 @@ import { combineReducers } from "redux"; import appRoutes from "./appRoutes"; import applicationSettings from "./applicationSettings"; import determineSteps from "./determineSteps"; -import channelSettings from "./channelSettings"; import kustomizeOverlay from "./kustomizeOverlay"; import kustomizeSettings from "./kustomizeSettings"; @@ -10,7 +9,6 @@ export default combineReducers({ appRoutes, applicationSettings, determineSteps, - channelSettings, kustomizeOverlay, kustomizeSettings }); diff --git a/web/init/src/redux/data/kustomizeSettings/actions.js b/web/init/src/redux/data/kustomizeSettings/actions.js index 1cb948206..76a6872a2 100644 --- a/web/init/src/redux/data/kustomizeSettings/actions.js +++ b/web/init/src/redux/data/kustomizeSettings/actions.js @@ -3,13 +3,13 @@ import { loadingData } from "../../ui/main/actions"; //import { Utilities } from "../../../utilities/utilities"; export const constants = { - RECEIVE_HELM_CHART_METADATA: "RECEIVE_HELM_CHART_METADATA", + RECEIVE_METADATA: "RECEIVE_METADATA", SET_HELM_CHART_ERROR: "SET_HELM_CHART_ERROR" }; -export function receiveHelmChartMetadata(payload) { +export function receiveMetadata(payload) { return { - type: constants.RECEIVE_HELM_CHART_METADATA, + type: constants.RECEIVE_METADATA, payload }; } @@ -21,13 +21,13 @@ export function setHelmChartError(error) { } } -export function getHelmChartMetadata(loaderType = "getHelmChartMetadata") { +export function getMetadata(loaderType = "getMetadata") { return async (dispatch, getState) => { const { apiEndpoint } = getState(); let response; dispatch(loadingData(loaderType, true)); try { - const url = `${apiEndpoint}/helm-metadata`; + const url = `${apiEndpoint}/metadata`; response = await fetch(url, { method: "GET", headers: { @@ -40,7 +40,7 @@ export function getHelmChartMetadata(loaderType = "getHelmChartMetadata") { } const body = await response.json(); dispatch(loadingData(loaderType, false)); - dispatch(receiveHelmChartMetadata(body)); + dispatch(receiveMetadata(body)); } catch (error) { console.log(error); // if (Utilities.isFailedToFetchErr(error.message)) { diff --git a/web/init/src/redux/data/kustomizeSettings/reducer.js b/web/init/src/redux/data/kustomizeSettings/reducer.js index cc18e4a8a..4454c7947 100644 --- a/web/init/src/redux/data/kustomizeSettings/reducer.js +++ b/web/init/src/redux/data/kustomizeSettings/reducer.js @@ -9,20 +9,16 @@ const shipAppMetadataState = { readme: "", values: "", error: false, - errorMessage: "" + errorMessage: "", + loaded: false, }; export function shipAppMetadata(state = shipAppMetadataState, action) { switch (action.type) { - case constants.RECEIVE_HELM_CHART_METADATA: + case constants.RECEIVE_METADATA: return Object.assign({}, state, { - name: action.payload.metadata.name, - version: action.payload.metadata.version, - release: action.payload.metadata.release, - icon: action.payload.metadata.icon, - description: action.payload.metadata.description, - readme: action.payload.metadata.readme, - values: action.payload.metadata.values, + ...action.payload, + loaded: true, }); case constants.SET_HELM_CHART_ERROR: return Object.assign({}, state, {