Skip to content

Commit

Permalink
Add major version to root import path (elastic#16331)
Browse files Browse the repository at this point in the history
##  What does this PR do?

This PR changes the import path of Beats from `github.com/elastic/beats` to `github.com/elastic/beats/v7`.

Some of the migration was done using this tool: https://github.com/marwan-at-work/mod
However, it is not perfect so I had to use `sed`, too.

## Why is it important?

Every go module which has a major version bigger than v1 has to include the major version in its import path:

> By definition, a new major version of a package is not backwards compatible with the previous version. This means a new major version of a module must have a different module path than the previous version. Starting with v2, the major version must appear at the end of the module path (declared in the module statement in the go.mod file).
  • Loading branch information
kvch authored Feb 20, 2020
1 parent 6e1b802 commit c325d11
Show file tree
Hide file tree
Showing 2,005 changed files with 5,822 additions and 5,822 deletions.
10 changes: 5 additions & 5 deletions auditbeat/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/pflag"

"github.com/elastic/beats/auditbeat/core"
"github.com/elastic/beats/libbeat/cmd"
"github.com/elastic/beats/libbeat/cmd/instance"
"github.com/elastic/beats/metricbeat/beater"
"github.com/elastic/beats/metricbeat/mb/module"
"github.com/elastic/beats/v7/auditbeat/core"
"github.com/elastic/beats/v7/libbeat/cmd"
"github.com/elastic/beats/v7/libbeat/cmd/instance"
"github.com/elastic/beats/v7/metricbeat/beater"
"github.com/elastic/beats/v7/metricbeat/mb/module"
)

// Name of the beat (auditbeat).
Expand Down
4 changes: 2 additions & 2 deletions auditbeat/core/eventmod.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
package core

import (
"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/metricbeat/mb"
"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/metricbeat/mb"
)

// AddDatasetToEvent adds dataset information to the event. In particular this
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/datastore/datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

bolt "github.com/coreos/bbolt"

"github.com/elastic/beats/libbeat/paths"
"github.com/elastic/beats/v7/libbeat/paths"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/helper/hasher/hasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
"golang.org/x/crypto/sha3"
"golang.org/x/time/rate"

"github.com/elastic/beats/libbeat/common/file"
"github.com/elastic/beats/v7/libbeat/common/file"
)

// HashType identifies a cryptographic algorithm.
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/include/fields.go

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

4 changes: 2 additions & 2 deletions auditbeat/include/list.go

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

8 changes: 4 additions & 4 deletions auditbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import (

"github.com/magefile/mage/mg"

auditbeat "github.com/elastic/beats/auditbeat/scripts/mage"
devtools "github.com/elastic/beats/dev-tools/mage"
auditbeat "github.com/elastic/beats/v7/auditbeat/scripts/mage"
devtools "github.com/elastic/beats/v7/dev-tools/mage"

// mage:import
"github.com/elastic/beats/dev-tools/mage/target/common"
"github.com/elastic/beats/v7/dev-tools/mage/target/common"
// mage:import
_ "github.com/elastic/beats/dev-tools/mage/target/integtest"
_ "github.com/elastic/beats/v7/dev-tools/mage/target/integtest"
)

func init() {
Expand Down
8 changes: 4 additions & 4 deletions auditbeat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ package main
import (
"os"

"github.com/elastic/beats/auditbeat/cmd"
"github.com/elastic/beats/v7/auditbeat/cmd"

// Register modules.
_ "github.com/elastic/beats/auditbeat/module/auditd"
_ "github.com/elastic/beats/auditbeat/module/file_integrity"
_ "github.com/elastic/beats/v7/auditbeat/module/auditd"
_ "github.com/elastic/beats/v7/auditbeat/module/file_integrity"

// Register includes.
_ "github.com/elastic/beats/auditbeat/include"
_ "github.com/elastic/beats/v7/auditbeat/include"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions auditbeat/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"flag"
"testing"

"github.com/elastic/beats/auditbeat/cmd"
"github.com/elastic/beats/libbeat/tests/system/template"
"github.com/elastic/beats/v7/auditbeat/cmd"
"github.com/elastic/beats/v7/libbeat/tests/system/template"
)

var systemTest *bool
Expand Down
10 changes: 5 additions & 5 deletions auditbeat/module/auditd/audit_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import (

"github.com/pkg/errors"

"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/logp"
"github.com/elastic/beats/libbeat/monitoring"
"github.com/elastic/beats/metricbeat/mb"
"github.com/elastic/beats/metricbeat/mb/parse"
"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/logp"
"github.com/elastic/beats/v7/libbeat/monitoring"
"github.com/elastic/beats/v7/metricbeat/mb"
"github.com/elastic/beats/v7/metricbeat/mb/parse"
"github.com/elastic/go-libaudit"
"github.com/elastic/go-libaudit/aucoalesce"
"github.com/elastic/go-libaudit/auparse"
Expand Down
12 changes: 6 additions & 6 deletions auditbeat/module/auditd/audit_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ import (

"github.com/prometheus/procfs"

"github.com/elastic/beats/auditbeat/core"
"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/logp"
"github.com/elastic/beats/libbeat/mapping"
"github.com/elastic/beats/metricbeat/mb"
mbtest "github.com/elastic/beats/metricbeat/mb/testing"
"github.com/elastic/beats/v7/auditbeat/core"
"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/logp"
"github.com/elastic/beats/v7/libbeat/mapping"
"github.com/elastic/beats/v7/metricbeat/mb"
mbtest "github.com/elastic/beats/v7/metricbeat/mb/testing"
"github.com/elastic/go-libaudit"
"github.com/elastic/go-libaudit/auparse"
)
Expand Down
4 changes: 2 additions & 2 deletions auditbeat/module/auditd/audit_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ package auditd
import (
"github.com/pkg/errors"

"github.com/elastic/beats/metricbeat/mb"
"github.com/elastic/beats/metricbeat/mb/parse"
"github.com/elastic/beats/v7/metricbeat/mb"
"github.com/elastic/beats/v7/metricbeat/mb/parse"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/module/auditd/config_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/v7/libbeat/common"
)

func TestConfigValidate(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/module/auditd/fields.go

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

2 changes: 1 addition & 1 deletion auditbeat/module/auditd/show_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/elastic/go-libaudit"
"github.com/elastic/go-libaudit/rule"

"github.com/elastic/beats/auditbeat/cmd"
"github.com/elastic/beats/v7/auditbeat/cmd"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/module/file_integrity/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/joeshaw/multierror"
"github.com/pkg/errors"

"github.com/elastic/beats/libbeat/common/match"
"github.com/elastic/beats/v7/libbeat/common/match"
)

// HashType identifies a cryptographic algorithm.
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/module/file_integrity/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/joeshaw/multierror"
"github.com/stretchr/testify/assert"

"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/go-ucfg"
)

Expand Down
6 changes: 3 additions & 3 deletions auditbeat/module/file_integrity/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ import (
"golang.org/x/crypto/blake2b"
"golang.org/x/crypto/sha3"

"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/common/file"
"github.com/elastic/beats/metricbeat/mb"
"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/common/file"
"github.com/elastic/beats/v7/metricbeat/mb"
)

// Source identifies the source of an event (i.e. what triggered it).
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/module/file_integrity/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/v7/libbeat/common"
)

var testEventTime = time.Now().UTC()
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/module/file_integrity/eventreader_fsevents.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/fsnotify/fsevents"
"github.com/pkg/errors"

"github.com/elastic/beats/libbeat/logp"
"github.com/elastic/beats/v7/libbeat/logp"
)

type fsreader struct {
Expand Down
4 changes: 2 additions & 2 deletions auditbeat/module/file_integrity/eventreader_fsnotify.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"github.com/fsnotify/fsnotify"
"github.com/pkg/errors"

"github.com/elastic/beats/auditbeat/module/file_integrity/monitor"
"github.com/elastic/beats/libbeat/logp"
"github.com/elastic/beats/v7/auditbeat/module/file_integrity/monitor"
"github.com/elastic/beats/v7/libbeat/logp"
)

type reader struct {
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/module/file_integrity/fields.go

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

2 changes: 1 addition & 1 deletion auditbeat/module/file_integrity/fileinfo_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/joeshaw/multierror"
"github.com/pkg/errors"

"github.com/elastic/beats/libbeat/common/file"
"github.com/elastic/beats/v7/libbeat/common/file"
)

// NewMetadata returns a new Metadata object. If an error is returned it is
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/module/file_integrity/flatbuffers.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
flatbuffers "github.com/google/flatbuffers/go"
"github.com/pkg/errors"

"github.com/elastic/beats/auditbeat/module/file_integrity/schema"
"github.com/elastic/beats/v7/auditbeat/module/file_integrity/schema"
)

// Requires the Google flatbuffer compiler.
Expand Down
8 changes: 4 additions & 4 deletions auditbeat/module/file_integrity/metricset.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (
bolt "github.com/coreos/bbolt"
"github.com/pkg/errors"

"github.com/elastic/beats/auditbeat/datastore"
"github.com/elastic/beats/libbeat/logp"
"github.com/elastic/beats/metricbeat/mb"
"github.com/elastic/beats/metricbeat/mb/parse"
"github.com/elastic/beats/v7/auditbeat/datastore"
"github.com/elastic/beats/v7/libbeat/logp"
"github.com/elastic/beats/v7/metricbeat/mb"
"github.com/elastic/beats/v7/metricbeat/mb/parse"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions auditbeat/module/file_integrity/metricset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (

"github.com/stretchr/testify/assert"

"github.com/elastic/beats/auditbeat/core"
"github.com/elastic/beats/auditbeat/datastore"
abtest "github.com/elastic/beats/auditbeat/testing"
mbtest "github.com/elastic/beats/metricbeat/mb/testing"
"github.com/elastic/beats/v7/auditbeat/core"
"github.com/elastic/beats/v7/auditbeat/datastore"
abtest "github.com/elastic/beats/v7/auditbeat/testing"
mbtest "github.com/elastic/beats/v7/metricbeat/mb/testing"
)

func TestData(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/module/file_integrity/monitor/recursive.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/joeshaw/multierror"
"github.com/pkg/errors"

"github.com/elastic/beats/libbeat/logp"
"github.com/elastic/beats/v7/libbeat/logp"
)

type recursiveWatcher struct {
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/module/file_integrity/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

"golang.org/x/time/rate"

"github.com/elastic/beats/libbeat/logp"
"github.com/elastic/beats/v7/libbeat/logp"
)

// scannerID is used as a global monotonically increasing counter for assigning
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/scripts/mage/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"github.com/pkg/errors"

devtools "github.com/elastic/beats/dev-tools/mage"
devtools "github.com/elastic/beats/v7/dev-tools/mage"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/scripts/mage/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/magefile/mage/sh"
"github.com/pkg/errors"

devtools "github.com/elastic/beats/dev-tools/mage"
devtools "github.com/elastic/beats/v7/dev-tools/mage"
)

// ModuleDocs collects documentation from modules (both OSS and X-Pack).
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/scripts/mage/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package mage
import (
"github.com/pkg/errors"

devtools "github.com/elastic/beats/dev-tools/mage"
devtools "github.com/elastic/beats/v7/dev-tools/mage"
)

// PackagingFlavor specifies the type of packaging (OSS vs X-Pack).
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/testing/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"os"
"testing"

"github.com/elastic/beats/libbeat/paths"
"github.com/elastic/beats/v7/libbeat/paths"
)

// SetupDataDir sets up a temporary data directory to use for testing.
Expand Down
4 changes: 2 additions & 2 deletions dev-tools/cmd/asset/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"io/ioutil"
"os"

"github.com/elastic/beats/libbeat/asset"
"github.com/elastic/beats/licenses"
"github.com/elastic/beats/v7/libbeat/asset"
"github.com/elastic/beats/v7/licenses"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions dev-tools/cmd/dashboards/export_dashboards.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (

"github.com/pkg/errors"

"github.com/elastic/beats/libbeat/dashboards"
"github.com/elastic/beats/libbeat/kibana"
"github.com/elastic/beats/v7/libbeat/dashboards"
"github.com/elastic/beats/v7/libbeat/kibana"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions dev-tools/cmd/module_fields/module_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"os"
"path/filepath"

"github.com/elastic/beats/libbeat/asset"
"github.com/elastic/beats/libbeat/generator/fields"
"github.com/elastic/beats/licenses"
"github.com/elastic/beats/v7/libbeat/asset"
"github.com/elastic/beats/v7/libbeat/generator/fields"
"github.com/elastic/beats/v7/licenses"
)

var usageText = `
Expand Down
Loading

0 comments on commit c325d11

Please sign in to comment.