Skip to content

Commit 929742f

Browse files
committed
chore: remove check based on offline scan
offline scan isn't to be included at the moment, this will be tackled as a different piece of work. tidied up the notices option to be more consistent with the flag it reflects Signed-off-by: Owen Rumney <owen.rumney@aquasec.com>
1 parent 8339c90 commit 929742f

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

pkg/commands/artifact/run.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,12 @@ func NewRunner(ctx context.Context, cliOptions flag.Options, opts ...RunnerOptio
118118
opt(r)
119119
}
120120

121-
// Initialize the version checker
122-
if !cliOptions.OfflineScan {
123-
// If the user has not disabled notices or is running in quiet mode
124-
r.versionChecker = notification.NewVersionChecker(
125-
notification.WithSkipUpdateCheck(cliOptions.SkipVersionCheck),
126-
notification.WithQuietMode(cliOptions.Quiet),
127-
notification.WithTelemetryDisabled(cliOptions.DisableTelemetry),
128-
)
129-
}
121+
// If the user has not disabled notices or is running in quiet mode
122+
r.versionChecker = notification.NewVersionChecker(
123+
notification.WithSkipVersionCheck(cliOptions.SkipVersionCheck),
124+
notification.WithQuietMode(cliOptions.Quiet),
125+
notification.WithTelemetryDisabled(cliOptions.DisableTelemetry),
126+
)
130127

131128
// Update the vulnerability database if needed.
132129
if err := r.initDB(ctx, cliOptions); err != nil {

pkg/notification/notice_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestPrintNotices(t *testing.T) {
4343
name: "new version available but --skip-update-check mode enabled",
4444
options: []Option{
4545
WithCurrentVersion("0.58.0"),
46-
WithSkipUpdateCheck(true),
46+
WithSkipVersionCheck(true),
4747
},
4848
latestVersion: "0.60.0",
4949
responseExpected: false,

pkg/notification/option.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ func WithCurrentVersion(version string) Option {
1616
}
1717
}
1818

19-
func WithSkipUpdateCheck(skipUpdateCheck bool) Option {
19+
func WithSkipVersionCheck(skipVersionCheck bool) Option {
2020
return func(v *VersionChecker) {
21-
v.skipUpdateCheck = skipUpdateCheck
21+
v.skipUpdateCheck = skipVersionCheck
2222
}
2323
}
2424

0 commit comments

Comments
 (0)