diff --git a/filebeat/input/v2/loader.go b/filebeat/input/v2/loader.go index c4b446ff8baf..4ac3c1124040 100644 --- a/filebeat/input/v2/loader.go +++ b/filebeat/input/v2/loader.go @@ -20,8 +20,8 @@ package v2 import ( "fmt" - "github.com/elastic/beats/v7/libbeat/common" "github.com/elastic/beats/v7/libbeat/feature" + "github.com/elastic/beats/v7/libbeat/version" conf "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/go-concert/unison" @@ -97,7 +97,7 @@ func (l *Loader) Configure(cfg *conf.C) (Input, error) { log.Warnf("DEPRECATED: The %v input is deprecated", name) } - if common.FIPSMode && p.ExcludeFromFIPS { + if version.FIPSDistribution && p.ExcludeFromFIPS { return nil, fmt.Errorf("running a FIPS-capable distribution but input [%s] is not FIPS capable", name) } diff --git a/filebeat/input/v2/loader_test.go b/filebeat/input/v2/loader_test.go index 72e60f27bbfe..3ca762c5c9fc 100644 --- a/filebeat/input/v2/loader_test.go +++ b/filebeat/input/v2/loader_test.go @@ -23,8 +23,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/elastic/beats/v7/libbeat/common" "github.com/elastic/beats/v7/libbeat/feature" + "github.com/elastic/beats/v7/libbeat/version" conf "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/elastic-agent-libs/logp" ) @@ -202,12 +202,12 @@ func TestLoader_ConfigureFIPS(t *testing.T) { input, err := loader.Configure(conf.MustNewConfigFrom(map[string]any{"type": "a"})) require.Nil(t, input) - if common.FIPSMode { + if version.FIPSDistribution { require.Error(t, err) } else { require.NoError(t, err) } - t.Logf("FIPS mode = %v; err = %v", common.FIPSMode, err) + t.Logf("FIPS distribution = %v; err = %v", version.FIPSDistribution, err) } func (b loaderConfig) MustNewLoader() *Loader { diff --git a/libbeat/common/mode_fips.go b/libbeat/common/mode_fips.go deleted file mode 100644 index 3823f04a5d41..000000000000 --- a/libbeat/common/mode_fips.go +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -//go:build requirefips - -package common - -// FIPSMode = true indicates that this is a FIPS-capable distribution. -const FIPSMode = true diff --git a/libbeat/common/mode_nofips.go b/libbeat/common/mode_nofips.go deleted file mode 100644 index 506bfd8721a7..000000000000 --- a/libbeat/common/mode_nofips.go +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -//go:build !requirefips - -package common - -// FIPSMode = false indicates that this is not a FIPS-capable distribution. -const FIPSMode = false