Skip to content

Commit b5808f4

Browse files
Use existing constants (#45053) (#45103)
(cherry picked from commit 6798fe5) Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>
1 parent d6492d5 commit b5808f4

File tree

4 files changed

+5
-51
lines changed

4 files changed

+5
-51
lines changed

filebeat/input/v2/loader.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ package v2
2020
import (
2121
"fmt"
2222

23-
"github.com/elastic/beats/v7/libbeat/common"
2423
"github.com/elastic/beats/v7/libbeat/feature"
24+
"github.com/elastic/beats/v7/libbeat/version"
2525
conf "github.com/elastic/elastic-agent-libs/config"
2626
"github.com/elastic/elastic-agent-libs/logp"
2727
"github.com/elastic/go-concert/unison"
@@ -97,7 +97,7 @@ func (l *Loader) Configure(cfg *conf.C) (Input, error) {
9797
log.Warnf("DEPRECATED: The %v input is deprecated", name)
9898
}
9999

100-
if common.FIPSMode && p.ExcludeFromFIPS {
100+
if version.FIPSDistribution && p.ExcludeFromFIPS {
101101
return nil, fmt.Errorf("running a FIPS-capable distribution but input [%s] is not FIPS capable", name)
102102
}
103103

filebeat/input/v2/loader_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import (
2323

2424
"github.com/stretchr/testify/require"
2525

26-
"github.com/elastic/beats/v7/libbeat/common"
2726
"github.com/elastic/beats/v7/libbeat/feature"
27+
"github.com/elastic/beats/v7/libbeat/version"
2828
conf "github.com/elastic/elastic-agent-libs/config"
2929
"github.com/elastic/elastic-agent-libs/logp"
3030
)
@@ -202,12 +202,12 @@ func TestLoader_ConfigureFIPS(t *testing.T) {
202202
input, err := loader.Configure(conf.MustNewConfigFrom(map[string]any{"type": "a"}))
203203
require.Nil(t, input)
204204

205-
if common.FIPSMode {
205+
if version.FIPSDistribution {
206206
require.Error(t, err)
207207
} else {
208208
require.NoError(t, err)
209209
}
210-
t.Logf("FIPS mode = %v; err = %v", common.FIPSMode, err)
210+
t.Logf("FIPS distribution = %v; err = %v", version.FIPSDistribution, err)
211211
}
212212

213213
func (b loaderConfig) MustNewLoader() *Loader {

libbeat/common/mode_fips.go

Lines changed: 0 additions & 23 deletions
This file was deleted.

libbeat/common/mode_nofips.go

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)