mirror of
https://github.com/kubescape/kubescape.git
synced 2026-04-15 06:58:11 +00:00
Also: * declared scanner resources as an enum type * replaced stdlib json, added uit tests for skipped resources * unexported worker pool * more unexported methods (i.e. everything that is not part of the interface) * refact(core): clarified mock injection logic and added a few unit tests at the caller's (CLI init utils) Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
34 lines
858 B
Go
34 lines
858 B
Go
package hostsensorutils
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/kubescape/opa-utils/objectsenvelopes/hostsensor"
|
|
"github.com/kubescape/opa-utils/reporthandling/apis"
|
|
)
|
|
|
|
// HostSensorHandlerMock is a noop sensor when the host scanner is disabled.
|
|
type HostSensorHandlerMock struct {
|
|
}
|
|
|
|
// NewHostSensorHandlerMock yields a dummy host sensor.
|
|
func NewHostSensorHandlerMock() *HostSensorHandlerMock {
|
|
return &HostSensorHandlerMock{}
|
|
}
|
|
|
|
func (hshm *HostSensorHandlerMock) Init(_ context.Context) error {
|
|
return nil
|
|
}
|
|
|
|
func (hshm *HostSensorHandlerMock) TearDown() error {
|
|
return nil
|
|
}
|
|
|
|
func (hshm *HostSensorHandlerMock) CollectResources(_ context.Context) ([]hostsensor.HostSensorDataEnvelope, map[string]apis.StatusInfo, error) {
|
|
return []hostsensor.HostSensorDataEnvelope{}, nil, nil
|
|
}
|
|
|
|
func (hshm *HostSensorHandlerMock) GetNamespace() string {
|
|
return ""
|
|
}
|