Skip to content

Commit

Permalink
elastic-agent.yml: no such file or directory when running linux el…
Browse files Browse the repository at this point in the history
…astic-agent artifact (elastic#34)

* add scripts

* add buildtime

* mage check

* mage fmt update
  • Loading branch information
narph committed Mar 3, 2022
1 parent 602e59b commit 0550534
Show file tree
Hide file tree
Showing 16 changed files with 384 additions and 241 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ kind load docker-image custom-agent-image:latest
```
ELASTIC_AGENT_VERSION="8.0"
ELASTIC_AGENT_MODE="standalone" # ELASTIC_AGENT_MODE="managed"
curl -L -O https://raw.githubusercontent.com/elastic/beats/${ELASTIC_AGENT_VERSION}/deploy/kubernetes/elastic-agent-${ELASTIC_AGENT_MODE}-kubernetes.yaml
curl -L -O https://raw.githubusercontent.com/elastic/elastic-agent/${ELASTIC_AGENT_VERSION}/deploy/kubernetes/elastic-agent-${ELASTIC_AGENT_MODE}-kubernetes.yaml
```
- Modify downloaded manifest:
- change image name to the one, that was created in the previous step and add `imagePullPolicy: Never`:
Expand Down
11 changes: 0 additions & 11 deletions dev-tools/mage/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -804,17 +804,6 @@ func XPackBeatDir(path ...string) string {
return OSSBeatDir(append([]string{XPackDir, BeatName}, path...)...)
}

// LibbeatDir returns the libbeat directory. You can pass paths and
// they will be joined and appended to the libbeat dir.
func LibbeatDir(path ...string) string {
esBeatsDir, err := ElasticBeatsDir()
if err != nil {
panic(errors.Wrap(err, "failed determine libbeat dir location"))
}

return filepath.Join(append([]string{esBeatsDir, "libbeat"}, path...)...)
}

// createDir creates the parent directory for the given file.
// Deprecated: Use CreateDir.
func createDir(file string) string {
Expand Down
173 changes: 0 additions & 173 deletions dev-tools/mage/docs.go

This file was deleted.

18 changes: 14 additions & 4 deletions dev-tools/mage/fmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/magefile/mage/mg"
"github.com/magefile/mage/sh"
"github.com/pkg/errors"

"github.com/elastic/elastic-agent/dev-tools/mage/gotool"
)
Expand Down Expand Up @@ -106,9 +107,18 @@ func AddLicenseHeaders() error {

mg.Deps(InstallGoLicenser)

var license string
switch BeatLicense {
case "ASL2", "ASL 2.0":
license = "ASL2"
case "Elastic", "Elastic License":
license = "Elastic"
case "Elasticv2", "Elastic License 2.0":
license = "Elasticv2"
default:
return errors.Errorf("unknown license type %v", BeatLicense)
}

licenser := gotool.Licenser
return licenser(
licenser.Check(),
licenser.License("Elastic"),
)
return licenser(licenser.License(license))
}
2 changes: 1 addition & 1 deletion dev-tools/mage/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const (

elasticAgentImportPath = "github.com/elastic/elastic-agent"

elasticAgentModulePath = "github.com/elastic/elastic-agent/v7"
elasticAgentModulePath = "github.com/elastic/elastic-agent"
)

// Common settings with defaults derived from files, CWD, and environment.
Expand Down
13 changes: 4 additions & 9 deletions magefile_test.go → dev-tools/mage/target/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@
// 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
package build

import (
"testing"

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

// Test started when the test binary is started. Only calls main.
func TestPackage(t *testing.T) {
devtools.Snapshot = true
devtools.PLATFORMS = "linux/arm64"
devtools.ExternalBuild = true
//Package()
// Build builds the Beat binary.
func Build() error {
return devtools.Build(devtools.DefaultBuildArgs())
}
27 changes: 0 additions & 27 deletions dev-tools/mage/target/docs/docs.go

This file was deleted.

12 changes: 12 additions & 0 deletions dev-tools/mage/target/update/update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// 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 update

import "github.com/magefile/mage/sh"

// Update updates the generated files (aka make update).
func Update() error {
return sh.Run("make", "update")
}
Loading

0 comments on commit 0550534

Please sign in to comment.