Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
This commit is contained in:
Matthias Bertschy
2025-09-02 13:51:45 +02:00
parent db30020c95
commit 182162d521
3 changed files with 12 additions and 12 deletions

View File

@@ -55,10 +55,10 @@ func getImageCmd(ks meta.IKubescape, scanInfo *cautils.ScanInfo) *cobra.Command
}
imgScanInfo := &metav1.ImageScanInfo{
Image: args[0],
Username: imgCredentials.Username,
Password: imgCredentials.Password,
Exceptions: exceptions,
Image: args[0],
Username: imgCredentials.Username,
Password: imgCredentials.Password,
Exceptions: exceptions,
UseDefaultMatchers: useDefaultMatchers,
}

View File

@@ -1,9 +1,9 @@
package v1
type ImageScanInfo struct {
Username string
Password string
Image string
Exceptions string
Username string
Password string
Image string
Exceptions string
UseDefaultMatchers bool
}

View File

@@ -350,7 +350,7 @@ func TestNewScanService(t *testing.T) {
func TestNewScanServiceWithDefaultMatchers(t *testing.T) {
// Test the Service struct creation with different useDefaultMatchers values
// This test doesn't require a real database
// Test with default matchers enabled
svcWithDefault := &Service{
useDefaultMatchers: true,
@@ -475,7 +475,7 @@ func TestGetMatchers(t *testing.T) {
func TestNewScanServiceWithMatchers(t *testing.T) {
// Test the Service struct creation with different useDefaultMatchers values
// This test doesn't require a real database
// Test with default matchers enabled
svcWithDefault := &Service{
useDefaultMatchers: true,
@@ -492,13 +492,13 @@ func TestNewScanServiceWithMatchers(t *testing.T) {
func TestNewScanServiceWithMatchersIntegration(t *testing.T) {
// Test the actual NewScanServiceWithMatchers function
defaultConfig, _ := NewDefaultDBConfig()
// Test with default matchers enabled
svcWithDefault, err := NewScanServiceWithMatchers(defaultConfig, true)
require.NoError(t, err)
defer svcWithDefault.Close()
assert.True(t, svcWithDefault.useDefaultMatchers)
// Test with default matchers disabled
svcWithoutDefault, err := NewScanServiceWithMatchers(defaultConfig, false)
require.NoError(t, err)