-
Notifications
You must be signed in to change notification settings - Fork 172
ROX-13034: fix gRPC scanner #3469
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
Changes from all commits
64a9cc9
d1e26ed
ae4918b
f496113
66a486a
a188490
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,12 +44,16 @@ const ( | |
| var ( | ||
| _ scannerTypes.Scanner = (*clairify)(nil) | ||
| _ scannerTypes.ImageVulnerabilityGetter = (*clairify)(nil) | ||
| ) | ||
|
|
||
| var ( | ||
| log = logging.LoggerForModule() | ||
| log = logging.LoggerForModule() | ||
| scannerEndpoint = fmt.Sprintf("scanner.%s.svc", env.Namespace.Setting()) | ||
| ) | ||
|
|
||
| // GetScannerEndpoint returns the scanner endpoint with a configured namespace. env.ScannerGRPCEndpoint is only used by Sensor. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default for the scanner endpoint is set by Helm in Sensor's deployment spec. The We can align this behaviour but would prefer to do it in a different PR to merge this one first. |
||
| func GetScannerEndpoint() string { | ||
| return scannerEndpoint | ||
| } | ||
|
|
||
| // Creator provides the type scanners.Creator to add to the scanners Registry. | ||
| func Creator(set registries.Set) (string, func(integration *storage.ImageIntegration) (scannerTypes.Scanner, error)) { | ||
| return TypeString, func(integration *storage.ImageIntegration) (scannerTypes.Scanner, error) { | ||
|
|
@@ -144,9 +148,11 @@ func createGRPCConnectionToScanner(conf *storage.ClairifyConfig) (*grpc.ClientCo | |
| return nil, err | ||
| } | ||
|
|
||
| // Checking for an empty endpoint can't be removed because of backward-compatibility. Existing image | ||
| // integrations are configured in the database on Central's startup and are not updated dynamically. | ||
| endpoint := conf.GetGrpcEndpoint() | ||
| if endpoint == "" { | ||
| endpoint = fmt.Sprintf("scanner.%s:8443", env.Namespace.Setting()) | ||
| endpoint = fmt.Sprintf("%s:8443", GetScannerEndpoint()) | ||
| } | ||
|
|
||
| // Note: it is possible we call `grpc.Dial` multiple times per endpoint, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make sure this gets enough visibility for customers, as this one has impact on existing proxy settings and requires updates for them (e.g. imagine people having
scanner.<namespace>in theirNO_PROXY).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. Just be sure to add the training and docs labels to the Jira
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question.
I assume the changelog is published to customers and is sufficient.
+1 on the training label that support is aware.
What exactly does the docs label do?
I think mentioning it in the docs is overkill, if it adds to changelog sure, this must be there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gaurav-nelson can you share your opinion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can mention it in the release notes and also add a note in the proxy configuration section.
@SimonBaeumer related to @dhaus67's comment, if someone have
scanner.<namespace>in theirNO_PROXYsettings:NO_PROXYsettings, so how to update those settings?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gaurav-nelson
NO_PROXYwas configured to use all stackrox routes explicitly, and not configured to*.svc, scanner is not be reachable because the traffic will be routed through the proxy.*.svcorscanner.<namespace>.svcto theNO_PROXYsettingThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gaurav-nelson Are there any action items I should follow up with?