Skip to content
Closed
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
359 changes: 359 additions & 0 deletions central/graphql/resolvers/generated.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,11 @@ func (s *nodeDatastoreSACSuite) TestGetNode() {
s.True(found)
s.NotNil(fetchedNode)

// Priority can have updated value, and we want to ignore it.
fetchedNode.Priority = s.testNodes[nodeID].Priority
s.Equal(*s.testNodes[nodeID], *fetchedNode)
if fetchedNode != nil {
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.

This prevents potential panic if fetchedNode is nil.

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.

Good catch, thanks.
I suppose an alternative is to have s.Require().NotNil(fetchedNode) two lines above, but I prefer this variant.

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.

For me to understand: s.NotNil() will not stop execution of the test when the subject is nil, correct?

Copy link
Copy Markdown
Contributor Author

@vikin91 vikin91 Jan 9, 2023

Choose a reason for hiding this comment

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

Correct, NotNil will do the assertion, print a message and then continue. The continuation in this case would lead to a panic.
It is not so bad as this is only a test code that would panic, but in this case it was an clear bug.

// Priority can have updated value, and we want to ignore it.
fetchedNode.Priority = s.testNodes[nodeID].Priority
s.Equal(*s.testNodes[nodeID], *fetchedNode)
}
} else {
s.False(found)
s.Nil(fetchedNode)
Expand Down
4 changes: 0 additions & 4 deletions central/sensor/service/pipeline/all/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/stackrox/rox/central/sensor/service/pipeline/networkflowupdate"
"github.com/stackrox/rox/central/sensor/service/pipeline/networkpolicies"
"github.com/stackrox/rox/central/sensor/service/pipeline/nodes"
"github.com/stackrox/rox/central/sensor/service/pipeline/nodescansv2"
"github.com/stackrox/rox/central/sensor/service/pipeline/podevents"
"github.com/stackrox/rox/central/sensor/service/pipeline/processindicators"
"github.com/stackrox/rox/central/sensor/service/pipeline/reprocessing"
Expand Down Expand Up @@ -65,9 +64,6 @@ func (s *factoryImpl) PipelineForCluster(ctx context.Context, clusterID string)
alerts.GetPipeline(),
auditlogstateupdate.GetPipeline(),
}
if features.RHCOSNodeScanning.Enabled() {
pipelines = append(pipelines, nodescansv2.GetPipeline())
}
if features.ComplianceOperatorCheckResults.Enabled() {
pipelines = append(pipelines,
complianceoperatorresults.GetPipeline(),
Expand Down
57 changes: 0 additions & 57 deletions central/sensor/service/pipeline/nodescansv2/pipeline.go

This file was deleted.

3 changes: 3 additions & 0 deletions compliance/collection/nodeinventorizer/nodeinventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ func convertAndDedupRHELComponents(rc *database.RHELv2Components) []*storage.Nod
}

func convertExecutables(exe []*scannerV1.Executable) []*storage.NodeInventory_Components_RHELComponent_Executable {
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.

Make sure to use getters here to avoid nils

if exe == nil {
return nil
}
arr := make([]*storage.NodeInventory_Components_RHELComponent_Executable, len(exe))
for i, executable := range exe {
arr[i] = &storage.NodeInventory_Components_RHELComponent_Executable{
Expand Down
117 changes: 116 additions & 1 deletion generated/api/v1/node_service.swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading