Skip to content

Commit

Permalink
Move internal/packages to pkg/packages so it can be imported
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-gr committed Sep 4, 2023
1 parent de86fba commit 9bd70c6
Show file tree
Hide file tree
Showing 69 changed files with 56 additions and 135 deletions.
2 changes: 1 addition & 1 deletion cmd/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `
Expand Down
2 changes: 1 addition & 1 deletion cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions cmd/changelog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions cmd/create_data_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions cmd/create_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmd/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmd/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion cmd/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions cmd/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion cmd/testrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions cmd/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion internal/benchrunner/runners/pipeline/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion internal/benchrunner/runners/system/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
4 changes: 2 additions & 2 deletions internal/builder/dynamic_mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/builder/external_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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/buildmanifest"
"github.com/elastic/elastic-package/pkg/packages/buildmanifest"
)

func resolveExternalFields(packageRoot, destinationDir string) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/builder/packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion internal/cleanup/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/.
Expand Down
2 changes: 1 addition & 1 deletion internal/cleanup/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/docs/readme.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion internal/elasticsearch/ingest/datastream.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion internal/export/dashboards.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/fields/dependency_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
4 changes: 2 additions & 2 deletions internal/fields/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,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 (
Expand Down
2 changes: 1 addition & 1 deletion internal/kibana/packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion internal/kibana/policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion internal/registry/revisions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions internal/testrunner/runners/asset/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion internal/testrunner/runners/pipeline/coverage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion internal/testrunner/runners/pipeline/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ 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/testrunner"
"github.com/elastic/elastic-package/pkg/packages"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/testrunner/runners/static/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions internal/testrunner/runners/system/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,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 (
Expand Down
2 changes: 1 addition & 1 deletion internal/testrunner/runners/system/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 9bd70c6

Please sign in to comment.