Skip to content

Commit 0550534

Browse files
committed
elastic-agent.yml: no such file or directory when running linux elastic-agent artifact (#34)
* add scripts * add buildtime * mage check * mage fmt update
1 parent 602e59b commit 0550534

File tree

16 files changed

+384
-241
lines changed

16 files changed

+384
-241
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ kind load docker-image custom-agent-image:latest
5757
```
5858
ELASTIC_AGENT_VERSION="8.0"
5959
ELASTIC_AGENT_MODE="standalone" # ELASTIC_AGENT_MODE="managed"
60-
curl -L -O https://raw.githubusercontent.com/elastic/beats/${ELASTIC_AGENT_VERSION}/deploy/kubernetes/elastic-agent-${ELASTIC_AGENT_MODE}-kubernetes.yaml
60+
curl -L -O https://raw.githubusercontent.com/elastic/elastic-agent/${ELASTIC_AGENT_VERSION}/deploy/kubernetes/elastic-agent-${ELASTIC_AGENT_MODE}-kubernetes.yaml
6161
```
6262
- Modify downloaded manifest:
6363
- change image name to the one, that was created in the previous step and add `imagePullPolicy: Never`:

dev-tools/mage/common.go

-11
Original file line numberDiff line numberDiff line change
@@ -804,17 +804,6 @@ func XPackBeatDir(path ...string) string {
804804
return OSSBeatDir(append([]string{XPackDir, BeatName}, path...)...)
805805
}
806806

807-
// LibbeatDir returns the libbeat directory. You can pass paths and
808-
// they will be joined and appended to the libbeat dir.
809-
func LibbeatDir(path ...string) string {
810-
esBeatsDir, err := ElasticBeatsDir()
811-
if err != nil {
812-
panic(errors.Wrap(err, "failed determine libbeat dir location"))
813-
}
814-
815-
return filepath.Join(append([]string{esBeatsDir, "libbeat"}, path...)...)
816-
}
817-
818807
// createDir creates the parent directory for the given file.
819808
// Deprecated: Use CreateDir.
820809
func createDir(file string) string {

dev-tools/mage/docs.go

-173
This file was deleted.

dev-tools/mage/fmt.go

+14-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212

1313
"github.com/magefile/mage/mg"
1414
"github.com/magefile/mage/sh"
15+
"github.com/pkg/errors"
1516

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

107108
mg.Deps(InstallGoLicenser)
108109

110+
var license string
111+
switch BeatLicense {
112+
case "ASL2", "ASL 2.0":
113+
license = "ASL2"
114+
case "Elastic", "Elastic License":
115+
license = "Elastic"
116+
case "Elasticv2", "Elastic License 2.0":
117+
license = "Elasticv2"
118+
default:
119+
return errors.Errorf("unknown license type %v", BeatLicense)
120+
}
121+
109122
licenser := gotool.Licenser
110-
return licenser(
111-
licenser.Check(),
112-
licenser.License("Elastic"),
113-
)
123+
return licenser(licenser.License(license))
114124
}

dev-tools/mage/settings.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const (
3434

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

37-
elasticAgentModulePath = "github.com/elastic/elastic-agent/v7"
37+
elasticAgentModulePath = "github.com/elastic/elastic-agent"
3838
)
3939

4040
// Common settings with defaults derived from files, CWD, and environment.

magefile_test.go dev-tools/mage/target/build/build.go

+4-9
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,13 @@
22
// or more contributor license agreements. Licensed under the Elastic License;
33
// you may not use this file except in compliance with the Elastic License.
44

5-
package main
5+
package build
66

77
import (
8-
"testing"
9-
108
devtools "github.com/elastic/elastic-agent/dev-tools/mage"
119
)
1210

13-
// Test started when the test binary is started. Only calls main.
14-
func TestPackage(t *testing.T) {
15-
devtools.Snapshot = true
16-
devtools.PLATFORMS = "linux/arm64"
17-
devtools.ExternalBuild = true
18-
//Package()
11+
// Build builds the Beat binary.
12+
func Build() error {
13+
return devtools.Build(devtools.DefaultBuildArgs())
1914
}

dev-tools/mage/target/docs/docs.go

-27
This file was deleted.
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
2+
// or more contributor license agreements. Licensed under the Elastic License;
3+
// you may not use this file except in compliance with the Elastic License.
4+
5+
package update
6+
7+
import "github.com/magefile/mage/sh"
8+
9+
// Update updates the generated files (aka make update).
10+
func Update() error {
11+
return sh.Run("make", "update")
12+
}

0 commit comments

Comments
 (0)