Skip to content
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
4 changes: 2 additions & 2 deletions pkg/env/sensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ var (
// SensorEndpoint is used to communicate the sensor endpoint to other services in the same cluster.
SensorEndpoint = RegisterSetting("ROX_SENSOR_ENDPOINT", WithDefault("sensor.stackrox.svc:443"))

// ScannerGRPCEndpoint is used to communicate the scanner endpoint to other services in the same cluster.
// ScannerSlimGRPCEndpoint is used to communicate the scanner endpoint to other services in the same cluster.
// This is typically used for Sensor to communicate with a local Scanner-slim's gRPC server.
ScannerGRPCEndpoint = RegisterSetting("ROX_SCANNER_GRPC_ENDPOINT", WithDefault("scanner.stackrox.svc:8443"))
ScannerSlimGRPCEndpoint = RegisterSetting("ROX_SCANNER_GRPC_ENDPOINT", WithDefault("scanner.stackrox.svc:8443"))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically used for this, but it's possible Sensor communicates with a full-Scanner (when this is the Central cluster). I'll check the other PR because I'm curious where the confusion came from

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The confusion was there because I search for scanner endpoints and found this env variable. Without looking at the concrete package path you can't see whether the variable belongs to sensor or central.

Renaming the variable to slim helps distinguishing when the env var is read. I do agree that it is not 100% technically correct in that case.


// LocalImageScanningEnabled is used to specify if Sensor should attempt to scan images via a local Scanner.
LocalImageScanningEnabled = RegisterBooleanSetting("ROX_LOCAL_IMAGE_SCANNING_ENABLED", false)
Expand Down
2 changes: 1 addition & 1 deletion sensor/common/scannerclient/singleton.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func GRPCClientSingleton() *Client {
}

var err error
scannerClient, err = dial(env.ScannerGRPCEndpoint.Setting())
scannerClient, err = dial(env.ScannerSlimGRPCEndpoint.Setting())
// If err is not nil, then there was a configuration error.
_ = utils.Should(err)
})
Expand Down