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
2 changes: 1 addition & 1 deletion central/sensor/service/connection/connection_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ func (c *sensorConnection) Run(ctx context.Context, server central.SensorService

}

if features.SensorReconciliationOnReconnect.Enabled() && connectionCapabilities.Contains(centralsensor.SendDeduperStateOnReconnect) {
if connectionCapabilities.Contains(centralsensor.SendDeduperStateOnReconnect) {
// Sensor is capable of doing the reconciliation by itself if receives the hashes from central.
log.Infof("Sensor (%s) can do client reconciliation: sending deduper state", c.clusterID)

Expand Down
4 changes: 0 additions & 4 deletions central/sensor/service/connection/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,7 @@ func (s *testSuite) TestGetPolicySyncMsgFromPoliciesDoesntDowngradeBelowMinimumV
}

func (s *testSuite) TestSendDeduperStateIfSensorReconciliation() {
s.T().Setenv(features.SensorReconciliationOnReconnect.EnvVar(), "true")
s.T().Setenv(env.MaxDeduperEntriesPerMessage.EnvVar(), "2")
if !features.SensorReconciliationOnReconnect.Enabled() {
s.T().Skip("Test skipped if ROX_SENSOR_RECONCILIATION feature flag isn't set")
}
cases := map[string]struct {
givenSensorCapabilities []centralsensor.SensorCapability
givenSensorState central.SensorHello_SensorState
Expand Down
4 changes: 1 addition & 3 deletions central/sensor/service/service_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ func (s *serviceImpl) Communicate(server central.SensorService_CommunicateServer

capabilities := sliceutils.StringSlice(eventPipeline.Capabilities()...)
capabilities = append(capabilities, centralsensor.SecuredClusterCertificatesReissue)
if features.SensorReconciliationOnReconnect.Enabled() {
capabilities = append(capabilities, centralsensor.SendDeduperStateOnReconnect)
}
capabilities = append(capabilities, centralsensor.SendDeduperStateOnReconnect)
if features.ComplianceEnhancements.Enabled() {
capabilities = append(capabilities, centralsensor.ComplianceV2Integrations)
}
Expand Down
3 changes: 0 additions & 3 deletions pkg/features/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ var (
// ClusterAwareDeploymentCheck enables roxctl deployment check to check deployments on the cluster level.
ClusterAwareDeploymentCheck = registerFeature("Enables cluster level check for the 'roxctl deployment check' command.", "ROX_CLUSTER_AWARE_DEPLOYMENT_CHECK", enabled)

// SensorReconciliationOnReconnect enables sensors to support reconciliation when reconnecting
SensorReconciliationOnReconnect = registerFeature("Enable Sensors to support reconciliation on reconnect", "ROX_SENSOR_RECONCILIATION", enabled)

// PolicyCriteriaModal enables a modal for selecting policy criteria when editing a policy
PolicyCriteriaModal = registerFeature("Enable modal to select policy criteria when editing a policy", "ROX_POLICY_CRITERIA_MODAL")

Expand Down
3 changes: 0 additions & 3 deletions sensor/tests/connection/k8sreconciliation/reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/stackrox/rox/generated/internalapi/central"
"github.com/stackrox/rox/pkg/centralsensor"
"github.com/stackrox/rox/pkg/features"
"github.com/stackrox/rox/pkg/sensor/hash"
"github.com/stackrox/rox/sensor/tests/helper"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -44,8 +43,6 @@ type resourceDef struct {
}

func Test_SensorReconcilesKubernetesEvents(t *testing.T) {
t.Setenv(features.SensorReconciliationOnReconnect.EnvVar(), "true")

t.Setenv("ROX_SENSOR_CONNECTION_RETRY_INITIAL_INTERVAL", "1s")
t.Setenv("ROX_SENSOR_CONNECTION_RETRY_MAX_INTERVAL", "2s")

Expand Down
3 changes: 0 additions & 3 deletions sensor/tests/connection/runtime/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/stackrox/rox/generated/storage"
"github.com/stackrox/rox/pkg/concurrency"
"github.com/stackrox/rox/pkg/env"
"github.com/stackrox/rox/pkg/features"
"github.com/stackrox/rox/sensor/debugger/collector"
"github.com/stackrox/rox/sensor/tests/helper"
"github.com/stackrox/rox/sensor/testutils"
Expand All @@ -29,8 +28,6 @@ var (
)

func Test_SensorIntermediateRuntimeEvents(t *testing.T) {
t.Setenv(features.SensorReconciliationOnReconnect.EnvVar(), "true")

t.Setenv(env.ConnectionRetryInitialInterval.EnvVar(), "1s")
t.Setenv(env.ConnectionRetryMaxInterval.EnvVar(), "2s")

Expand Down
6 changes: 1 addition & 5 deletions tools/local-sensor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/stackrox/rox/pkg/clientconn"
"github.com/stackrox/rox/pkg/continuousprofiling"
"github.com/stackrox/rox/pkg/env"
"github.com/stackrox/rox/pkg/features"
"github.com/stackrox/rox/pkg/metrics"
"github.com/stackrox/rox/pkg/utils"
"github.com/stackrox/rox/sensor/common/centralclient"
Expand Down Expand Up @@ -490,10 +489,7 @@ func setupCentralWithFakeConnection(localConfig localSensorConfig) (centralclien
message.PolicySync(policies),
message.BaselineSync([]*storage.ProcessBaseline{}),
message.NetworkBaselineSync([]*storage.NetworkBaseline{}),
}

if features.SensorReconciliationOnReconnect.Enabled() {
initialMessages = append(initialMessages, message.DeduperState(nil, 1, 1))
message.DeduperState(nil, 1, 1),
}

fakeCentral := centralDebug.MakeFakeCentralWithInitialMessages(initialMessages...)
Expand Down
Loading