diff --git a/cmd/benchmark.go b/cmd/benchmark.go index 7849f25a60..b9fe48acb4 100644 --- a/cmd/benchmark.go +++ b/cmd/benchmark.go @@ -29,9 +29,9 @@ import ( "github.com/elastic/elastic-package/internal/benchrunner/runners/system" "github.com/elastic/elastic-package/internal/cobraext" "github.com/elastic/elastic-package/internal/common" - "github.com/elastic/elastic-package/internal/packages" "github.com/elastic/elastic-package/internal/signal" "github.com/elastic/elastic-package/internal/testrunner" + "github.com/elastic/elastic-package/pkg/packages" ) const generateLongDescription = ` diff --git a/cmd/build.go b/cmd/build.go index 00d86d329f..d489e7910a 100644 --- a/cmd/build.go +++ b/cmd/build.go @@ -16,7 +16,7 @@ import ( "github.com/elastic/elastic-package/internal/docs" "github.com/elastic/elastic-package/internal/files" "github.com/elastic/elastic-package/internal/logger" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) const buildLongDescription = `Use this command to build a package. Currently it supports only the "integration" package type. diff --git a/cmd/changelog.go b/cmd/changelog.go index bfdf5599b6..cfa7297232 100644 --- a/cmd/changelog.go +++ b/cmd/changelog.go @@ -14,8 +14,8 @@ import ( "github.com/spf13/cobra" "github.com/elastic/elastic-package/internal/cobraext" - "github.com/elastic/elastic-package/internal/packages" - "github.com/elastic/elastic-package/internal/packages/changelog" + "github.com/elastic/elastic-package/pkg/packages" + "github.com/elastic/elastic-package/pkg/packages/changelog" ) const changelogLongDescription = `Use this command to work with the changelog of the package. diff --git a/cmd/create_data_stream.go b/cmd/create_data_stream.go index bdb389b6b1..72d5952ce6 100644 --- a/cmd/create_data_stream.go +++ b/cmd/create_data_stream.go @@ -12,9 +12,9 @@ import ( "github.com/spf13/cobra" - "github.com/elastic/elastic-package/internal/packages" - "github.com/elastic/elastic-package/internal/packages/archetype" "github.com/elastic/elastic-package/internal/surveyext" + "github.com/elastic/elastic-package/pkg/packages" + "github.com/elastic/elastic-package/pkg/packages/archetype" ) const createDataStreamLongDescription = `Use this command to create a new data stream. diff --git a/cmd/create_package.go b/cmd/create_package.go index 3f02530023..884bffdf47 100644 --- a/cmd/create_package.go +++ b/cmd/create_package.go @@ -11,9 +11,9 @@ import ( "github.com/spf13/cobra" "github.com/elastic/elastic-package/internal/licenses" - "github.com/elastic/elastic-package/internal/packages" - "github.com/elastic/elastic-package/internal/packages/archetype" "github.com/elastic/elastic-package/internal/surveyext" + "github.com/elastic/elastic-package/pkg/packages" + "github.com/elastic/elastic-package/pkg/packages/archetype" ) const createPackageLongDescription = `Use this command to create a new package. diff --git a/cmd/format.go b/cmd/format.go index 8a654f790f..39361a1490 100644 --- a/cmd/format.go +++ b/cmd/format.go @@ -12,7 +12,7 @@ import ( "github.com/elastic/elastic-package/internal/cobraext" "github.com/elastic/elastic-package/internal/formatter" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) const formatLongDescription = `Use this command to format the package files. diff --git a/cmd/install.go b/cmd/install.go index 7dc781560d..7072d9bd61 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -12,9 +12,9 @@ import ( "github.com/elastic/elastic-package/internal/cobraext" "github.com/elastic/elastic-package/internal/install" - "github.com/elastic/elastic-package/internal/packages" - "github.com/elastic/elastic-package/internal/packages/installer" "github.com/elastic/elastic-package/internal/stack" + "github.com/elastic/elastic-package/pkg/packages" + "github.com/elastic/elastic-package/pkg/packages/installer" ) const installLongDescription = `Use this command to install the package in Kibana. diff --git a/cmd/lint.go b/cmd/lint.go index 81344609d5..91213c3e6e 100644 --- a/cmd/lint.go +++ b/cmd/lint.go @@ -14,7 +14,7 @@ import ( "github.com/elastic/elastic-package/internal/cobraext" "github.com/elastic/elastic-package/internal/docs" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) const lintLongDescription = `Use this command to validate the contents of a package using the package specification (see: https://github.com/elastic/package-spec). diff --git a/cmd/service.go b/cmd/service.go index 05c8d41a4e..62d4979d52 100644 --- a/cmd/service.go +++ b/cmd/service.go @@ -13,10 +13,10 @@ import ( "github.com/elastic/elastic-package/internal/cobraext" "github.com/elastic/elastic-package/internal/install" - "github.com/elastic/elastic-package/internal/packages" "github.com/elastic/elastic-package/internal/service" "github.com/elastic/elastic-package/internal/stack" "github.com/elastic/elastic-package/internal/testrunner/runners/system" + "github.com/elastic/elastic-package/pkg/packages" ) const serviceLongDescription = `Use this command to boot up the service stack that can be observed with the package. diff --git a/cmd/status.go b/cmd/status.go index a626a8b601..5a645a5548 100644 --- a/cmd/status.go +++ b/cmd/status.go @@ -18,10 +18,10 @@ import ( "github.com/spf13/cobra" "github.com/elastic/elastic-package/internal/cobraext" - "github.com/elastic/elastic-package/internal/packages" - "github.com/elastic/elastic-package/internal/packages/changelog" - "github.com/elastic/elastic-package/internal/packages/status" "github.com/elastic/elastic-package/internal/registry" + "github.com/elastic/elastic-package/pkg/packages" + "github.com/elastic/elastic-package/pkg/packages/changelog" + "github.com/elastic/elastic-package/pkg/packages/status" ) const statusLongDescription = `Use this command to display the current deployment status of a package. diff --git a/cmd/status_test.go b/cmd/status_test.go index 985e416bb5..567071e8bc 100644 --- a/cmd/status_test.go +++ b/cmd/status_test.go @@ -13,9 +13,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/elastic/elastic-package/internal/packages" - "github.com/elastic/elastic-package/internal/packages/changelog" - "github.com/elastic/elastic-package/internal/packages/status" + "github.com/elastic/elastic-package/pkg/packages" + "github.com/elastic/elastic-package/pkg/packages/changelog" + "github.com/elastic/elastic-package/pkg/packages/status" ) var generateFlag = flag.Bool("generate", false, "Write golden files") diff --git a/cmd/testrunner.go b/cmd/testrunner.go index c11f790e78..a35b76cb42 100644 --- a/cmd/testrunner.go +++ b/cmd/testrunner.go @@ -16,13 +16,13 @@ import ( "github.com/elastic/elastic-package/internal/cobraext" "github.com/elastic/elastic-package/internal/common" "github.com/elastic/elastic-package/internal/install" - "github.com/elastic/elastic-package/internal/packages" "github.com/elastic/elastic-package/internal/signal" "github.com/elastic/elastic-package/internal/stack" "github.com/elastic/elastic-package/internal/testrunner" "github.com/elastic/elastic-package/internal/testrunner/reporters/formats" "github.com/elastic/elastic-package/internal/testrunner/reporters/outputs" _ "github.com/elastic/elastic-package/internal/testrunner/runners" // register all test runners + "github.com/elastic/elastic-package/pkg/packages" ) const testLongDescription = `Use this command to run tests on a package. Currently, the following types of tests are available: diff --git a/cmd/uninstall.go b/cmd/uninstall.go index 7e44522fd2..928a65b5ab 100644 --- a/cmd/uninstall.go +++ b/cmd/uninstall.go @@ -12,9 +12,9 @@ import ( "github.com/elastic/elastic-package/internal/cobraext" "github.com/elastic/elastic-package/internal/install" - "github.com/elastic/elastic-package/internal/packages" - "github.com/elastic/elastic-package/internal/packages/installer" "github.com/elastic/elastic-package/internal/stack" + "github.com/elastic/elastic-package/pkg/packages" + "github.com/elastic/elastic-package/pkg/packages/installer" ) const uninstallLongDescription = `Use this command to uninstall the package in Kibana. diff --git a/go.mod b/go.mod index 6f16309426..3f9b681886 100644 --- a/go.mod +++ b/go.mod @@ -28,14 +28,11 @@ require ( github.com/hashicorp/go-plugin v1.5.0 github.com/jedib0t/go-pretty v4.3.0+incompatible github.com/magefile/mage v1.15.0 - github.com/mattn/go-sqlite3 v1.14.17 github.com/mholt/archiver/v3 v3.5.1 - github.com/mikefarah/yq/v4 v4.35.1 github.com/olekukonko/tablewriter v0.0.5 github.com/pmezard/go-difflib v1.0.0 github.com/shirou/gopsutil/v3 v3.23.8 github.com/spf13/cobra v1.7.0 - github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.4 golang.org/x/tools v0.13.0 gopkg.in/yaml.v3 v3.0.1 @@ -60,9 +57,7 @@ require ( github.com/Pallinder/go-randomdata v1.2.0 // indirect github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f // indirect - github.com/a8m/envsubst v1.4.2 // indirect github.com/acomagu/bufpipe v1.0.4 // indirect - github.com/alecthomas/participle/v2 v2.0.0 // indirect github.com/andybalholm/brotli v1.0.4 // indirect github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect github.com/c-bata/go-prompt v0.2.6 // indirect @@ -71,11 +66,9 @@ require ( github.com/creasty/defaults v1.7.0 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dimchansky/utfbom v1.1.1 // indirect github.com/dnephin/pflag v1.0.7 // indirect github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect github.com/elastic/gojsonschema v1.2.1 // indirect - github.com/elliotchance/orderedmap v1.5.0 // indirect github.com/emicklei/go-restful/v3 v3.10.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect @@ -91,8 +84,6 @@ require ( github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/strfmt v0.21.3 // indirect github.com/go-openapi/swag v0.22.3 // indirect - github.com/goccy/go-json v0.10.2 // indirect - github.com/goccy/go-yaml v1.11.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect @@ -110,7 +101,6 @@ require ( github.com/imdario/mergo v0.3.15 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/jinzhu/copier v0.3.5 // indirect github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -121,7 +111,6 @@ require ( github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/lithammer/shortuuid/v3 v3.0.7 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect - github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.17 // indirect @@ -142,7 +131,6 @@ require ( github.com/nwaples/rardecode v1.1.3 // indirect github.com/oklog/run v1.0.0 // indirect github.com/oklog/ulid v1.3.1 // indirect - github.com/pelletier/go-toml/v2 v2.0.9 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pierrec/lz4/v4 v4.1.17 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect @@ -156,6 +144,7 @@ require ( github.com/shopspring/decimal v1.3.1 // indirect github.com/skeema/knownhosts v1.2.0 // indirect github.com/spf13/cast v1.5.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/ulikunitz/xz v0.5.11 // indirect @@ -177,13 +166,11 @@ require ( golang.org/x/term v0.12.0 // indirect golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect google.golang.org/grpc v1.54.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/api v0.28.2 // indirect diff --git a/go.sum b/go.sum index a6af499851..10333acd67 100644 --- a/go.sum +++ b/go.sum @@ -37,16 +37,8 @@ github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f h1:tCbYj7/299ek github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f/go.mod h1:gcr0kNtGBqin9zDW9GOHcVntrwnjrK+qdJ06mWYBybw= github.com/ProtonMail/gopenpgp/v2 v2.7.3 h1:AJu1OI/1UWVYZl6QcCLKGu9OTngS2r52618uGlje84I= github.com/ProtonMail/gopenpgp/v2 v2.7.3/go.mod h1:IhkNEDaxec6NyzSI0PlxapinnwPVIESk8/76da3Ct3g= -github.com/a8m/envsubst v1.4.2 h1:4yWIHXOLEJHQEFd4UjrWDrYeYlV7ncFWJOCBRLOZHQg= -github.com/a8m/envsubst v1.4.2/go.mod h1:MVUTQNGQ3tsjOOtKCNd+fl8RzhsXcDvvAEzkhGtlsbY= github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= -github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= -github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= -github.com/alecthomas/participle/v2 v2.0.0 h1:Fgrq+MbuSsJwIkw3fEj9h75vDP0Er5JzepJ0/HNHv0g= -github.com/alecthomas/participle/v2 v2.0.0/go.mod h1:rAKZdJldHu8084ojcWevWAL8KmEU+AT+Olodb+WoN2Y= -github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= -github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= @@ -93,8 +85,6 @@ github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= -github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 h1:iFaUwBSo5Svw6L7HYpRu/0lE3e0BaElwnNO1qkNQxBY= @@ -118,8 +108,6 @@ github.com/elastic/package-spec/v2 v2.11.0 h1:lnK9pU1PA8YP22SxB7AVEqC57C4dUOnk85 github.com/elastic/package-spec/v2 v2.11.0/go.mod h1:kpyMzRsaoFTSzV5C1clD0U/ek0FZ7imALGCYEZU8z24= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= -github.com/elliotchance/orderedmap v1.5.0 h1:1IsExUsjv5XNBD3ZdC7jkAAqLWOOKdbPTmkHx63OsBg= -github.com/elliotchance/orderedmap v1.5.0/go.mod h1:wsDwEaX5jEoyhbs7x93zk2H/qv0zwuhg4inXhDkYqys= github.com/emicklei/go-restful/v3 v3.10.1 h1:rc42Y5YTp7Am7CS630D7JmhRjq4UlEUuEKfrDac4bSQ= github.com/emicklei/go-restful/v3 v3.10.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= @@ -171,10 +159,6 @@ github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/ github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/goccy/go-yaml v1.11.0 h1:n7Z+zx8S9f9KgzG6KtQKf+kwqXZlLNR2F6018Dgau54= -github.com/goccy/go-yaml v1.11.0/go.mod h1:H+mJrWtjPTJAHvRbV09MCK9xYwODM+wRTVFFTWckfng= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -243,8 +227,6 @@ github.com/hashicorp/go-plugin v1.5.0 h1:g6Lj3USwF5LaB8HlvCxPjN2X4nFE08ko2BJNVpl github.com/hashicorp/go-plugin v1.5.0/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= -github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -261,8 +243,6 @@ github.com/jedib0t/go-pretty v4.3.0+incompatible h1:CGs8AVhEKg/n9YbUenWmNStRW2PH github.com/jedib0t/go-pretty v4.3.0+incompatible/go.mod h1:XemHduiw8R651AF9Pt4FwCTKeG3oo7hrHJAoznj9nag= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= -github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= -github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 h1:rp+c0RAYOWj8l6qbCUTSiRLG/iKnW3K3/QfPPuSsBt4= github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -299,8 +279,6 @@ github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= -github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= -github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= @@ -323,8 +301,6 @@ github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= -github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mattn/go-tty v0.0.3 h1:5OfyWorkyO7xP52Mq7tB36ajHDG5OHrmBGIS/DtakQI= github.com/mattn/go-tty v0.0.3/go.mod h1:ihxohKRERHTVzN+aSVRwACLCeqIoZAWpoICkkvrWyR0= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= @@ -332,8 +308,6 @@ github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQ github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mholt/archiver/v3 v3.5.1 h1:rDjOBX9JSF5BvoJGvjqK479aL70qh9DIpZCl+k7Clwo= github.com/mholt/archiver/v3 v3.5.1/go.mod h1:e3dqJ7H78uzsRSEACH1joayhuSyhnonssnDhppzS1L4= -github.com/mikefarah/yq/v4 v4.35.1 h1:NTQ6CECE+9fjxPhBojdsmUvQM8YCmaZITz0+/nbWkbc= -github.com/mikefarah/yq/v4 v4.35.1/go.mod h1:KdjcC3wn+Dm9qp6A2WAKMXY6YQ3wxPvh3mj8A7NPK1E= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= @@ -377,8 +351,6 @@ github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/otiai10/copy v1.12.0 h1:cLMgSQnXBs1eehF0Wy/FAGsgDTDmAqFR7rQylBb1nDY= github.com/otiai10/copy v1.12.0/go.mod h1:rSaLseMUsZFFbsFGc7wCJnnkTAvdc5L6VWxPE4308Ww= -github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= -github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pierrec/lz4/v4 v4.1.2/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= @@ -386,8 +358,6 @@ github.com/pierrec/lz4/v4 v4.1.17 h1:kV4Ip+/hUBC+8T6+2EgburRtkE9ef4nbY3f4dFhGjMc github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/term v1.2.0-beta.2 h1:L3y/h2jkuBVFdWiJvNfYfKmzcCnILw7mJWm2JQuMppw= @@ -617,8 +587,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= @@ -654,8 +622,6 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/hjson/hjson-go.v3 v3.0.1/go.mod h1:X6zrTSVeImfwfZLfgQdInl9mWjqPqgH90jom9nym/lw= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 h1:6D+BvnJ/j6e222UW8s2qTSe3wGBtvo0MbVQG/c5k8RE= -gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473/go.mod h1:N1eN2tsCx0Ydtgjl4cqmbRCsY4/+z4cYDeqwZTk6zog= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/internal/benchrunner/runners/pipeline/runner.go b/internal/benchrunner/runners/pipeline/runner.go index e55f293e87..52eb1a4ac9 100644 --- a/internal/benchrunner/runners/pipeline/runner.go +++ b/internal/benchrunner/runners/pipeline/runner.go @@ -16,8 +16,8 @@ import ( "github.com/elastic/elastic-package/internal/benchrunner" "github.com/elastic/elastic-package/internal/benchrunner/reporters" "github.com/elastic/elastic-package/internal/elasticsearch/ingest" - "github.com/elastic/elastic-package/internal/packages" "github.com/elastic/elastic-package/internal/testrunner" + "github.com/elastic/elastic-package/pkg/packages" ) const ( diff --git a/internal/benchrunner/runners/system/runner.go b/internal/benchrunner/runners/system/runner.go index 2004083e59..49addbd68c 100644 --- a/internal/benchrunner/runners/system/runner.go +++ b/internal/benchrunner/runners/system/runner.go @@ -31,9 +31,9 @@ import ( "github.com/elastic/elastic-package/internal/kibana" "github.com/elastic/elastic-package/internal/logger" "github.com/elastic/elastic-package/internal/multierror" - "github.com/elastic/elastic-package/internal/packages" "github.com/elastic/elastic-package/internal/servicedeployer" "github.com/elastic/elastic-package/internal/signal" + "github.com/elastic/elastic-package/pkg/packages" ) const ( diff --git a/internal/builder/dynamic_mappings.go b/internal/builder/dynamic_mappings.go index 7f0c458f80..818f59257f 100644 --- a/internal/builder/dynamic_mappings.go +++ b/internal/builder/dynamic_mappings.go @@ -18,8 +18,8 @@ import ( "github.com/elastic/elastic-package/internal/formatter" "github.com/elastic/elastic-package/internal/logger" - "github.com/elastic/elastic-package/internal/packages" - "github.com/elastic/elastic-package/internal/packages/buildmanifest" + "github.com/elastic/elastic-package/pkg/packages" + "github.com/elastic/elastic-package/pkg/packages/buildmanifest" ) //go:embed _static/ecs_mappings.yaml diff --git a/internal/builder/external_fields.go b/internal/builder/external_fields.go index 6e505daee8..e133231e3d 100644 --- a/internal/builder/external_fields.go +++ b/internal/builder/external_fields.go @@ -16,8 +16,8 @@ import ( "github.com/elastic/elastic-package/internal/common" "github.com/elastic/elastic-package/internal/fields" "github.com/elastic/elastic-package/internal/logger" - "github.com/elastic/elastic-package/internal/packages" - "github.com/elastic/elastic-package/internal/packages/buildmanifest" + "github.com/elastic/elastic-package/pkg/packages" + "github.com/elastic/elastic-package/pkg/packages/buildmanifest" ) var semver3_0_0 = semver.MustParse("3.0.0") diff --git a/internal/builder/packages.go b/internal/builder/packages.go index 45725be74f..77f463cd39 100644 --- a/internal/builder/packages.go +++ b/internal/builder/packages.go @@ -17,7 +17,7 @@ import ( "github.com/elastic/elastic-package/internal/environment" "github.com/elastic/elastic-package/internal/files" "github.com/elastic/elastic-package/internal/logger" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) const builtPackagesFolder = "packages" diff --git a/internal/cleanup/build.go b/internal/cleanup/build.go index 8a55642a9e..e3c7032f19 100644 --- a/internal/cleanup/build.go +++ b/internal/cleanup/build.go @@ -12,7 +12,7 @@ import ( "github.com/elastic/elastic-package/internal/builder" "github.com/elastic/elastic-package/internal/logger" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) // Build function removes package resources from build/. diff --git a/internal/cleanup/stack.go b/internal/cleanup/stack.go index f4844f71cd..dc5c766b02 100644 --- a/internal/cleanup/stack.go +++ b/internal/cleanup/stack.go @@ -11,7 +11,7 @@ import ( "path/filepath" "github.com/elastic/elastic-package/internal/configuration/locations" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" "github.com/elastic/elastic-package/internal/logger" ) diff --git a/internal/docs/readme.go b/internal/docs/readme.go index 3b60a7197e..06f6f30fec 100644 --- a/internal/docs/readme.go +++ b/internal/docs/readme.go @@ -16,7 +16,7 @@ import ( "github.com/elastic/elastic-package/internal/builder" "github.com/elastic/elastic-package/internal/logger" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) // ReadmeFile contains file name and status of each readme file. diff --git a/internal/elasticsearch/ingest/datastream.go b/internal/elasticsearch/ingest/datastream.go index 732f496b34..8e02322e69 100644 --- a/internal/elasticsearch/ingest/datastream.go +++ b/internal/elasticsearch/ingest/datastream.go @@ -18,7 +18,7 @@ import ( "gopkg.in/yaml.v3" "github.com/elastic/elastic-package/internal/elasticsearch" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) var ( diff --git a/internal/export/dashboards.go b/internal/export/dashboards.go index 9cca9b2164..87ac476f98 100644 --- a/internal/export/dashboards.go +++ b/internal/export/dashboards.go @@ -15,7 +15,7 @@ import ( "github.com/elastic/elastic-package/internal/common" "github.com/elastic/elastic-package/internal/kibana" "github.com/elastic/elastic-package/internal/logger" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) // Dashboards method exports selected dashboards with references objects. All Kibana objects are saved to local files diff --git a/internal/fields/dependency_manager.go b/internal/fields/dependency_manager.go index f0b6f05b9c..009f4ca2b8 100644 --- a/internal/fields/dependency_manager.go +++ b/internal/fields/dependency_manager.go @@ -18,7 +18,7 @@ import ( "github.com/elastic/elastic-package/internal/common" "github.com/elastic/elastic-package/internal/configuration/locations" "github.com/elastic/elastic-package/internal/logger" - "github.com/elastic/elastic-package/internal/packages/buildmanifest" + "github.com/elastic/elastic-package/pkg/packages/buildmanifest" ) const ( diff --git a/internal/fields/validate.go b/internal/fields/validate.go index 60cde3248c..30dbb57f60 100644 --- a/internal/fields/validate.go +++ b/internal/fields/validate.go @@ -25,8 +25,8 @@ import ( "github.com/elastic/elastic-package/internal/common" "github.com/elastic/elastic-package/internal/logger" "github.com/elastic/elastic-package/internal/multierror" - "github.com/elastic/elastic-package/internal/packages" - "github.com/elastic/elastic-package/internal/packages/buildmanifest" + "github.com/elastic/elastic-package/pkg/packages" + "github.com/elastic/elastic-package/pkg/packages/buildmanifest" ) var ( diff --git a/internal/kibana/packages.go b/internal/kibana/packages.go index e19574249d..2efdc42908 100644 --- a/internal/kibana/packages.go +++ b/internal/kibana/packages.go @@ -10,7 +10,7 @@ import ( "net/http" "os" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) // InstallPackage installs the given package in Fleet. diff --git a/internal/kibana/policies.go b/internal/kibana/policies.go index 8ed3c37029..1349c04add 100644 --- a/internal/kibana/policies.go +++ b/internal/kibana/policies.go @@ -9,7 +9,7 @@ import ( "fmt" "net/http" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) // Policy represents an Agent Policy in Fleet. diff --git a/internal/registry/revisions.go b/internal/registry/revisions.go index 83b83bcc18..249f9128a1 100644 --- a/internal/registry/revisions.go +++ b/internal/registry/revisions.go @@ -13,7 +13,7 @@ import ( "github.com/Masterminds/semver/v3" "github.com/google/go-querystring/query" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) // SearchOptions specify the query parameters without the package name for the search API diff --git a/internal/testrunner/runners/asset/runner.go b/internal/testrunner/runners/asset/runner.go index 27ca61c03c..15ac436f6b 100644 --- a/internal/testrunner/runners/asset/runner.go +++ b/internal/testrunner/runners/asset/runner.go @@ -10,9 +10,9 @@ import ( "github.com/elastic/elastic-package/internal/kibana" "github.com/elastic/elastic-package/internal/logger" - "github.com/elastic/elastic-package/internal/packages" - "github.com/elastic/elastic-package/internal/packages/installer" "github.com/elastic/elastic-package/internal/testrunner" + "github.com/elastic/elastic-package/pkg/packages" + "github.com/elastic/elastic-package/pkg/packages/installer" ) func init() { diff --git a/internal/testrunner/runners/pipeline/coverage.go b/internal/testrunner/runners/pipeline/coverage.go index 8735f96b3a..90a01b3eee 100644 --- a/internal/testrunner/runners/pipeline/coverage.go +++ b/internal/testrunner/runners/pipeline/coverage.go @@ -12,8 +12,8 @@ import ( "time" "github.com/elastic/elastic-package/internal/elasticsearch/ingest" - "github.com/elastic/elastic-package/internal/packages" "github.com/elastic/elastic-package/internal/testrunner" + "github.com/elastic/elastic-package/pkg/packages" ) // GetPipelineCoverage returns a coverage report for the provided set of ingest pipelines. diff --git a/internal/testrunner/runners/pipeline/runner.go b/internal/testrunner/runners/pipeline/runner.go index 3c3e721779..d0a6d1ad2f 100644 --- a/internal/testrunner/runners/pipeline/runner.go +++ b/internal/testrunner/runners/pipeline/runner.go @@ -21,10 +21,10 @@ import ( "github.com/elastic/elastic-package/internal/fields" "github.com/elastic/elastic-package/internal/logger" "github.com/elastic/elastic-package/internal/multierror" - "github.com/elastic/elastic-package/internal/packages" "github.com/elastic/elastic-package/internal/signal" "github.com/elastic/elastic-package/internal/stack" "github.com/elastic/elastic-package/internal/testrunner" + "github.com/elastic/elastic-package/pkg/packages" ) const ( diff --git a/internal/testrunner/runners/static/runner.go b/internal/testrunner/runners/static/runner.go index e0bd881d36..2530033898 100644 --- a/internal/testrunner/runners/static/runner.go +++ b/internal/testrunner/runners/static/runner.go @@ -12,8 +12,8 @@ import ( "github.com/elastic/elastic-package/internal/fields" "github.com/elastic/elastic-package/internal/logger" - "github.com/elastic/elastic-package/internal/packages" "github.com/elastic/elastic-package/internal/testrunner" + "github.com/elastic/elastic-package/pkg/packages" ) const sampleEventJSON = "sample_event.json" diff --git a/internal/testrunner/runners/system/runner.go b/internal/testrunner/runners/system/runner.go index e9eaf11e6b..4666889410 100644 --- a/internal/testrunner/runners/system/runner.go +++ b/internal/testrunner/runners/system/runner.go @@ -26,12 +26,12 @@ import ( "github.com/elastic/elastic-package/internal/kibana" "github.com/elastic/elastic-package/internal/logger" "github.com/elastic/elastic-package/internal/multierror" - "github.com/elastic/elastic-package/internal/packages" - "github.com/elastic/elastic-package/internal/packages/installer" "github.com/elastic/elastic-package/internal/servicedeployer" "github.com/elastic/elastic-package/internal/signal" "github.com/elastic/elastic-package/internal/stack" "github.com/elastic/elastic-package/internal/testrunner" + "github.com/elastic/elastic-package/pkg/packages" + "github.com/elastic/elastic-package/pkg/packages/installer" ) const ( diff --git a/internal/testrunner/runners/system/runner_test.go b/internal/testrunner/runners/system/runner_test.go index bbc0e1f31b..79999b6f6d 100644 --- a/internal/testrunner/runners/system/runner_test.go +++ b/internal/testrunner/runners/system/runner_test.go @@ -16,9 +16,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/elastic/elastic-package/internal/packages" "github.com/elastic/elastic-package/internal/stack" "github.com/elastic/elastic-package/internal/testrunner" + "github.com/elastic/elastic-package/pkg/packages" ) func TestFindPolicyTemplateForInput(t *testing.T) { diff --git a/internal/packages/archetype/_static/dataStream-agent-stream.yml.tmpl b/pkg/packages/archetype/_static/dataStream-agent-stream.yml.tmpl similarity index 100% rename from internal/packages/archetype/_static/dataStream-agent-stream.yml.tmpl rename to pkg/packages/archetype/_static/dataStream-agent-stream.yml.tmpl diff --git a/internal/packages/archetype/_static/dataStream-elasticsearch-ingest-pipeline.yml.tmpl b/pkg/packages/archetype/_static/dataStream-elasticsearch-ingest-pipeline.yml.tmpl similarity index 100% rename from internal/packages/archetype/_static/dataStream-elasticsearch-ingest-pipeline.yml.tmpl rename to pkg/packages/archetype/_static/dataStream-elasticsearch-ingest-pipeline.yml.tmpl diff --git a/internal/packages/archetype/_static/dataStream-manifest.yml.tmpl b/pkg/packages/archetype/_static/dataStream-manifest.yml.tmpl similarity index 100% rename from internal/packages/archetype/_static/dataStream-manifest.yml.tmpl rename to pkg/packages/archetype/_static/dataStream-manifest.yml.tmpl diff --git a/internal/packages/archetype/_static/fields-base.yml.tmpl b/pkg/packages/archetype/_static/fields-base.yml.tmpl similarity index 100% rename from internal/packages/archetype/_static/fields-base.yml.tmpl rename to pkg/packages/archetype/_static/fields-base.yml.tmpl diff --git a/internal/packages/archetype/_static/input-package-agent-config.yml.tmpl b/pkg/packages/archetype/_static/input-package-agent-config.yml.tmpl similarity index 100% rename from internal/packages/archetype/_static/input-package-agent-config.yml.tmpl rename to pkg/packages/archetype/_static/input-package-agent-config.yml.tmpl diff --git a/internal/packages/archetype/_static/package-changelog.yml.tmpl b/pkg/packages/archetype/_static/package-changelog.yml.tmpl similarity index 100% rename from internal/packages/archetype/_static/package-changelog.yml.tmpl rename to pkg/packages/archetype/_static/package-changelog.yml.tmpl diff --git a/internal/packages/archetype/_static/package-docs-readme.md.tmpl b/pkg/packages/archetype/_static/package-docs-readme.md.tmpl similarity index 100% rename from internal/packages/archetype/_static/package-docs-readme.md.tmpl rename to pkg/packages/archetype/_static/package-docs-readme.md.tmpl diff --git a/internal/packages/archetype/_static/package-manifest.yml.tmpl b/pkg/packages/archetype/_static/package-manifest.yml.tmpl similarity index 100% rename from internal/packages/archetype/_static/package-manifest.yml.tmpl rename to pkg/packages/archetype/_static/package-manifest.yml.tmpl diff --git a/internal/packages/archetype/_static/sampleIcon.svg b/pkg/packages/archetype/_static/sampleIcon.svg similarity index 100% rename from internal/packages/archetype/_static/sampleIcon.svg rename to pkg/packages/archetype/_static/sampleIcon.svg diff --git a/internal/packages/archetype/_static/sampleScreenshot.png.b64 b/pkg/packages/archetype/_static/sampleScreenshot.png.b64 similarity index 100% rename from internal/packages/archetype/_static/sampleScreenshot.png.b64 rename to pkg/packages/archetype/_static/sampleScreenshot.png.b64 diff --git a/internal/packages/archetype/archetype.go b/pkg/packages/archetype/archetype.go similarity index 100% rename from internal/packages/archetype/archetype.go rename to pkg/packages/archetype/archetype.go diff --git a/internal/packages/archetype/data_stream.go b/pkg/packages/archetype/data_stream.go similarity index 97% rename from internal/packages/archetype/data_stream.go rename to pkg/packages/archetype/data_stream.go index b6b6c9434b..1501d6ed67 100644 --- a/internal/packages/archetype/data_stream.go +++ b/pkg/packages/archetype/data_stream.go @@ -11,7 +11,7 @@ import ( "github.com/elastic/elastic-package/internal/formatter" "github.com/elastic/elastic-package/internal/logger" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) // DataStreamDescriptor defines configurable properties of the data stream archetype diff --git a/internal/packages/archetype/data_stream_test.go b/pkg/packages/archetype/data_stream_test.go similarity index 97% rename from internal/packages/archetype/data_stream_test.go rename to pkg/packages/archetype/data_stream_test.go index c502a9a232..be42ab950d 100644 --- a/internal/packages/archetype/data_stream_test.go +++ b/pkg/packages/archetype/data_stream_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) func TestDataStream(t *testing.T) { diff --git a/internal/packages/archetype/package.go b/pkg/packages/archetype/package.go similarity index 98% rename from internal/packages/archetype/package.go rename to pkg/packages/archetype/package.go index 93c84b6017..3a081e0628 100644 --- a/internal/packages/archetype/package.go +++ b/pkg/packages/archetype/package.go @@ -12,7 +12,7 @@ import ( "github.com/elastic/elastic-package/internal/formatter" "github.com/elastic/elastic-package/internal/licenses" "github.com/elastic/elastic-package/internal/logger" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) // PackageDescriptor defines configurable properties of the package archetype diff --git a/internal/packages/archetype/package_test.go b/pkg/packages/archetype/package_test.go similarity index 97% rename from internal/packages/archetype/package_test.go rename to pkg/packages/archetype/package_test.go index 7982eac9c6..b4c0096134 100644 --- a/internal/packages/archetype/package_test.go +++ b/pkg/packages/archetype/package_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) func TestPackage(t *testing.T) { diff --git a/internal/packages/archetype/resources.go b/pkg/packages/archetype/resources.go similarity index 100% rename from internal/packages/archetype/resources.go rename to pkg/packages/archetype/resources.go diff --git a/internal/packages/archetype/spec.go b/pkg/packages/archetype/spec.go similarity index 100% rename from internal/packages/archetype/spec.go rename to pkg/packages/archetype/spec.go diff --git a/internal/packages/assets.go b/pkg/packages/assets.go similarity index 100% rename from internal/packages/assets.go rename to pkg/packages/assets.go diff --git a/internal/packages/buildmanifest/build_manifest.go b/pkg/packages/buildmanifest/build_manifest.go similarity index 100% rename from internal/packages/buildmanifest/build_manifest.go rename to pkg/packages/buildmanifest/build_manifest.go diff --git a/internal/packages/changelog/changelog.go b/pkg/packages/changelog/changelog.go similarity index 100% rename from internal/packages/changelog/changelog.go rename to pkg/packages/changelog/changelog.go diff --git a/internal/packages/changelog/testdata/changelog-one-patch-multiple.yml b/pkg/packages/changelog/testdata/changelog-one-patch-multiple.yml similarity index 100% rename from internal/packages/changelog/testdata/changelog-one-patch-multiple.yml rename to pkg/packages/changelog/testdata/changelog-one-patch-multiple.yml diff --git a/internal/packages/changelog/testdata/changelog-one-patch-next-major.yml b/pkg/packages/changelog/testdata/changelog-one-patch-next-major.yml similarity index 100% rename from internal/packages/changelog/testdata/changelog-one-patch-next-major.yml rename to pkg/packages/changelog/testdata/changelog-one-patch-next-major.yml diff --git a/internal/packages/changelog/testdata/changelog-one-patch-same-version.yml b/pkg/packages/changelog/testdata/changelog-one-patch-same-version.yml similarity index 100% rename from internal/packages/changelog/testdata/changelog-one-patch-same-version.yml rename to pkg/packages/changelog/testdata/changelog-one-patch-same-version.yml diff --git a/internal/packages/changelog/testdata/changelog-one.yml b/pkg/packages/changelog/testdata/changelog-one.yml similarity index 100% rename from internal/packages/changelog/testdata/changelog-one.yml rename to pkg/packages/changelog/testdata/changelog-one.yml diff --git a/internal/packages/changelog/yaml.go b/pkg/packages/changelog/yaml.go similarity index 100% rename from internal/packages/changelog/yaml.go rename to pkg/packages/changelog/yaml.go diff --git a/internal/packages/changelog/yaml_test.go b/pkg/packages/changelog/yaml_test.go similarity index 100% rename from internal/packages/changelog/yaml_test.go rename to pkg/packages/changelog/yaml_test.go diff --git a/internal/packages/conditions.go b/pkg/packages/conditions.go similarity index 100% rename from internal/packages/conditions.go rename to pkg/packages/conditions.go diff --git a/internal/packages/conditions_test.go b/pkg/packages/conditions_test.go similarity index 100% rename from internal/packages/conditions_test.go rename to pkg/packages/conditions_test.go diff --git a/internal/packages/installer/factory.go b/pkg/packages/installer/factory.go similarity index 98% rename from internal/packages/installer/factory.go rename to pkg/packages/installer/factory.go index 85d33a7c2b..2a74ac234d 100644 --- a/internal/packages/installer/factory.go +++ b/pkg/packages/installer/factory.go @@ -15,7 +15,7 @@ import ( "github.com/elastic/elastic-package/internal/builder" "github.com/elastic/elastic-package/internal/kibana" "github.com/elastic/elastic-package/internal/logger" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) var semver8_7_0 = semver.MustParse("8.7.0") diff --git a/internal/packages/installer/installer.go b/pkg/packages/installer/installer.go similarity index 97% rename from internal/packages/installer/installer.go rename to pkg/packages/installer/installer.go index dcf90ec736..52db73260d 100644 --- a/internal/packages/installer/installer.go +++ b/pkg/packages/installer/installer.go @@ -8,7 +8,7 @@ import ( "fmt" "github.com/elastic/elastic-package/internal/kibana" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) type manifestInstaller struct { diff --git a/internal/packages/installer/zip_installer.go b/pkg/packages/installer/zip_installer.go similarity index 96% rename from internal/packages/installer/zip_installer.go rename to pkg/packages/installer/zip_installer.go index df062bfcc9..723e1ca9d0 100644 --- a/internal/packages/installer/zip_installer.go +++ b/pkg/packages/installer/zip_installer.go @@ -8,7 +8,7 @@ import ( "fmt" "github.com/elastic/elastic-package/internal/kibana" - "github.com/elastic/elastic-package/internal/packages" + "github.com/elastic/elastic-package/pkg/packages" ) type zipInstaller struct { diff --git a/internal/packages/packages.go b/pkg/packages/packages.go similarity index 100% rename from internal/packages/packages.go rename to pkg/packages/packages.go diff --git a/internal/packages/packages_test.go b/pkg/packages/packages_test.go similarity index 100% rename from internal/packages/packages_test.go rename to pkg/packages/packages_test.go diff --git a/internal/packages/status/status.go b/pkg/packages/status/status.go similarity index 94% rename from internal/packages/status/status.go rename to pkg/packages/status/status.go index f676410754..bed87a9215 100644 --- a/internal/packages/status/status.go +++ b/pkg/packages/status/status.go @@ -9,9 +9,9 @@ import ( "github.com/Masterminds/semver/v3" - "github.com/elastic/elastic-package/internal/packages" - "github.com/elastic/elastic-package/internal/packages/changelog" "github.com/elastic/elastic-package/internal/registry" + "github.com/elastic/elastic-package/pkg/packages" + "github.com/elastic/elastic-package/pkg/packages/changelog" ) // PackageStatus holds version and deployment information about a package diff --git a/pkg/shell/commandrpc.go b/pkg/shell/commandrpc.go index fbe390aa41..4f60410eba 100644 --- a/pkg/shell/commandrpc.go +++ b/pkg/shell/commandrpc.go @@ -9,8 +9,9 @@ import ( "io" "net/rpc" - "github.com/elastic/elastic-package/internal/logger" "github.com/hashicorp/go-plugin" + + "github.com/elastic/elastic-package/internal/logger" ) type Command interface { diff --git a/pkg/shell/pluginrpc.go b/pkg/shell/pluginrpc.go index e77864be99..c757260729 100644 --- a/pkg/shell/pluginrpc.go +++ b/pkg/shell/pluginrpc.go @@ -7,8 +7,9 @@ package shell import ( "net/rpc" - "github.com/elastic/elastic-package/internal/logger" "github.com/hashicorp/go-plugin" + + "github.com/elastic/elastic-package/internal/logger" ) type Plugin interface { diff --git a/pkg/shell/plugins/yq.go b/pkg/shell/plugins/yq.go deleted file mode 100644 index 4d1a3aab07..0000000000 --- a/pkg/shell/plugins/yq.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -// or more contributor license agreements. Licensed under the Elastic License; -// you may not use this file except in compliance with the Elastic License. - -package main - -import ( - "errors" - "io" - "os" - "path/filepath" - - "github.com/elastic/elastic-package/pkg/shell" - - yqcmd "github.com/mikefarah/yq/v4/cmd" -) - -var _ shell.Command = &yqCmd{} - -type yqCmd struct { - p *Plugin - name, usage, desc string -} - -func registerYqCmd(p *Plugin) { - cmd := &yqCmd{ - p: p, - name: "yq", - usage: "yq is a lightweight and portable command-line YAML processor.", - desc: "Runs the yq command for each of the packages in context 'Shell.Packages'. See https://mikefarah.gitbook.io/yq/ for detailed documentation and examples.", - } - p.RegisterCommand(cmd) -} - -func (c *yqCmd) Name() string { return c.name } -func (c *yqCmd) Usage() string { return c.usage } -func (c *yqCmd) Desc() string { return c.desc } - -func (c *yqCmd) Exec(wd string, args []string, stdout, stderr io.Writer) error { - packages, ok := c.p.GetValueFromCtx(ctxKeyPackages).([]string) - if !ok { - return errors.New("no packages found in the context") - } - - cmd := yqcmd.New() - - cmd.SetErr(stderr) - cmd.SetOut(stdout) - cmd.SetArgs(args) - - wdbak, err := os.Getwd() - if err != nil { - return err - } - defer os.Chdir(wdbak) - - for _, pkg := range packages { - packageRoot := filepath.Join(wd, pkg) - // check if we are in packages folder - if _, err := os.Stat(packageRoot); err != nil { - // check if we are in integrations root folder - packageRoot = filepath.Join(wd, "packages", pkg) - if _, err := os.Stat(packageRoot); err != nil { - return errors.New("you need to be in integrations root folder or in the packages folder") - } - } - - if err := os.Chdir(packageRoot); err != nil { - return err - } - - if err := cmd.Execute(); err != nil { - // no need to return, yq will output to stderr - return nil - } - } - - return nil -} diff --git a/pkg/shell/shell.go b/pkg/shell/shell.go index 84c54e07d0..f09523a7cf 100644 --- a/pkg/shell/shell.go +++ b/pkg/shell/shell.go @@ -9,10 +9,11 @@ import ( "os/exec" "path/filepath" - "github.com/elastic/elastic-package/internal/configuration/locations" - "github.com/elastic/elastic-package/internal/logger" "github.com/hashicorp/go-plugin" "github.com/spf13/cobra" + + "github.com/elastic/elastic-package/internal/configuration/locations" + "github.com/elastic/elastic-package/internal/logger" ) func initCommands() (map[string]Command, error) { diff --git a/pkg/shell/writerrpc.go b/pkg/shell/writerrpc.go index 7e07ea981d..4d34a9b9f4 100644 --- a/pkg/shell/writerrpc.go +++ b/pkg/shell/writerrpc.go @@ -9,8 +9,9 @@ import ( "io" "net/rpc" - "github.com/elastic/elastic-package/internal/logger" "github.com/hashicorp/go-plugin" + + "github.com/elastic/elastic-package/internal/logger" ) type WriterRPCClient struct {