Skip to content

Commit

Permalink
Use constructor-style for NoopSubmitter
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrandon1 committed Oct 26, 2022
1 parent 7a7320f commit 4a07af1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/check_container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ certification_project_id: mycertid`
AfterEach(func() {
submit = origSubmitValue
})
It("should return a noopSubmitter ResultSubmitter", func() {
It("should return a NoopSubmitter ResultSubmitter", func() {
runner, err := lib.NewCheckContainerRunner(context.TODO(), cfg, false)
Expect(err).ToNot(HaveOccurred())
_, rsIsCorrectType := runner.Rs.(*lib.NoopSubmitter)
Expand Down
2 changes: 1 addition & 1 deletion internal/lib/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func ResolveSubmitter(pc PyxisClient, cfg certification.Config) ResultSubmitter
PreflightLogFile: cfg.LogFile(),
}
}
return NewNoopSubmitter(true, "", nil)
return NewNoopSubmitter(true, nil)
}

// GetContainerPolicyExceptions will query Pyxis to determine if
Expand Down
2 changes: 1 addition & 1 deletion internal/lib/lib_container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ var _ = Describe("Lib Container Functions", func() {
bf = bytes.NewBuffer([]byte{})
bufferLogger.SetOutput(bf)

noop = NewNoopSubmitter(false, "", bufferLogger)
noop = NewNoopSubmitter(false, bufferLogger)
})

Context("and enabling log emitting", func() {
Expand Down
2 changes: 1 addition & 1 deletion internal/lib/preflight_check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var _ = Describe("Preflight Check Func", func() {

fmttr, _ = formatters.NewByName(formatters.DefaultFormat)
rw = &runtime.ResultWriterFile{}
rs = NewNoopSubmitter(false, "", nil)
rs = NewNoopSubmitter(false, nil)

DeferCleanup(os.RemoveAll, localTempDir)
DeferCleanup(os.RemoveAll, localArtifactsDir)
Expand Down
3 changes: 1 addition & 2 deletions internal/lib/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,9 @@ type NoopSubmitter struct {
log *log.Logger
}

func NewNoopSubmitter(emitLog bool, reason string, log *log.Logger) *NoopSubmitter {
func NewNoopSubmitter(emitLog bool, log *log.Logger) *NoopSubmitter {
return &NoopSubmitter{
emitLog: emitLog,
reason: reason,
log: log,
}
}
Expand Down

0 comments on commit 4a07af1

Please sign in to comment.