Skip to content

Commit

Permalink
fix: panic in datree kustomize test, also error printing was broken (d…
Browse files Browse the repository at this point in the history
…atreeio#696)

* fix: panic in datree kustomize test, dependency was missing

* fix: fix errors not printing in test and kustomize
  • Loading branch information
royhadad committed Jun 26, 2022
1 parent fa35ec9 commit 39d59f2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cmd/kustomize/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ func New(testCtx *test.TestCommandContext, kustomizeCtx *KustomizeContext) *cobr
}
defer os.Remove(tempFilename)

return test.TestWrapper(testCtx, []string{tempFilename}, testCommandFlags)
err = test.TestWrapper(testCtx, []string{tempFilename}, testCommandFlags)
if err != nil {
return err
}
return nil
},
}
testCommandFlags.AddFlags(kustomizeTestCommand)
Expand Down
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func NewRootCommand(app *App) *cobra.Command {
K8sValidator: app.Context.K8sValidator,
CliClient: app.Context.CliClient,
FilesExtractor: app.Context.FilesExtractor,
CiContext: app.Context.CiContext,
StartTime: startTime,
}, &kustomize.KustomizeContext{CommandRunner: app.Context.CommandRunner}))

Expand Down
6 changes: 5 additions & 1 deletion cmd/test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ func New(ctx *TestCommandContext) *cobra.Command {
}
}()

return TestWrapper(ctx, args, testCommandFlags)
err = TestWrapper(ctx, args, testCommandFlags)
if err != nil {
return err
}
return nil
},
}
testCommandFlags.AddFlags(testCommand)
Expand Down

0 comments on commit 39d59f2

Please sign in to comment.