Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use constructor-style for NoopSubmitter #810

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
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