Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Register install for ship apps #797

Merged
merged 2 commits into from
Jan 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/ship/kustomize.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (s *Ship) Init(ctx context.Context) error {

if s.Viper.GetString("raw") != "" {
release := s.fakeKustomizeRawRelease()
return s.execute(ctx, release, nil, true)
return s.execute(ctx, release, nil)
}

if s.Viper.GetString("helm-values-file") != "" {
Expand Down Expand Up @@ -107,7 +107,7 @@ func (s *Ship) Init(ctx context.Context) error {
}

release.Spec.Lifecycle = s.IDPatcher.EnsureAllStepsHaveUniqueIDs(release.Spec.Lifecycle)
return s.execute(ctx, release, nil, true)
return s.execute(ctx, release, nil)
}

func (s *Ship) promptToRemoveState() error {
Expand Down
6 changes: 3 additions & 3 deletions pkg/ship/ship.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ func (s *Ship) Execute(ctx context.Context) error {
}
release.Spec.Lifecycle = s.IDPatcher.EnsureAllStepsHaveUniqueIDs(release.Spec.Lifecycle)

return s.execute(ctx, release, selector, false)
return s.execute(ctx, release, selector)
}

func (s *Ship) execute(ctx context.Context, release *api.Release, selector *replicatedapp.Selector, isKustomize bool) error {
func (s *Ship) execute(ctx context.Context, release *api.Release, selector *replicatedapp.Selector) error {
debug := level.Debug(log.With(s.Logger, "method", "execute"))
warn := level.Debug(log.With(s.Logger, "method", "execute"))
runResultCh := make(chan error)
Expand Down Expand Up @@ -211,7 +211,7 @@ func (s *Ship) execute(ctx context.Context, release *api.Release, selector *repl
return
}

if !isKustomize && selector != nil {
if selector != nil {
_ = s.AppResolver.RegisterInstall(ctx, *selector, release)
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/ship/ship_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ func TestExecute(t *testing.T) {
release *api.Release
selector *replicatedapp.Selector
uploadAssetsTo string
isKustomize bool
expectError error
}{
{
Expand Down Expand Up @@ -56,7 +55,7 @@ func TestExecute(t *testing.T) {
d.EXPECT().AwaitShutdown().Return(nil)
uploader.EXPECT().UploadAssets(test.uploadAssetsTo)

err := s.execute(ctx, test.release, test.selector, test.isKustomize)
err := s.execute(ctx, test.release, test.selector)

if test.expectError == nil {
req.NoError(err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/ship/unfork.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ func (s *Ship) Unfork(ctx context.Context) error {

release.Spec.Lifecycle = s.IDPatcher.EnsureAllStepsHaveUniqueIDs(release.Spec.Lifecycle)

return s.execute(ctx, release, nil, true)
return s.execute(ctx, release, nil)
}
2 changes: 1 addition & 1 deletion pkg/ship/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ func (s *Ship) Update(ctx context.Context) error {

release.Spec.Lifecycle = s.IDPatcher.EnsureAllStepsHaveUniqueIDs(release.Spec.Lifecycle)

return s.execute(ctx, release, nil, true)
return s.execute(ctx, release, nil)
}