Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Beats to use go 1.11.2 #8746

Merged
merged 4 commits into from
Nov 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.3
1.11.2
1 change: 1 addition & 0 deletions CHANGELOG-developer.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ The list below covers the major changes between 6.3.0 and master only.
- Add `cfgwarn.CheckRemoved6xSetting(s)` to display a warning for options removed in 7.0. {pull}8909[8909]
- Add docker image building to `mage.Package`. {pull}8898[8898]
- Simplified exporting of dashboards. {pull}7730[7730]
- Update Beats to use go 1.11.2 {pull}8746[8746]
8 changes: 4 additions & 4 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

--------------------------------------------------------------------
Dependency: github.com/fsnotify/fsevents
Revision: 4d5197691b054c220286f7c6ea167de9753d902d
Revision: e1d381a4d27063baac2e9d3c5887ceb4ab059287
License type (autodetected): BSD-3-Clause
./vendor/github.com/fsnotify/fsevents/LICENSE:
--------------------------------------------------------------------
Expand Down Expand Up @@ -1713,7 +1713,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI

--------------------------------------------------------------------
Dependency: github.com/magefile/mage
Revision: 5e51f9ad1ed0886c5d06a8c46a09703cfc4d9034
Revision: 11d15918ff3aa6f75cd6d3340a9507bb5309c679
License type (autodetected): Apache-2.0
./vendor/github.com/magefile/mage/LICENSE:
--------------------------------------------------------------------
Expand Down Expand Up @@ -2849,7 +2849,7 @@ THE SOFTWARE.

--------------------------------------------------------------------
Dependency: golang.org/x/crypto
Revision: 5119cf507ed5294cc409c092980c7497ee5d6fd2
Revision: 85e1b3f9139abd58575d728a509643924e3b2ebf
License type (autodetected): BSD-3-Clause
./vendor/golang.org/x/crypto/LICENSE:
--------------------------------------------------------------------
Expand Down Expand Up @@ -2918,7 +2918,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------
Dependency: golang.org/x/sys
Revision: 0ffbfd41fbef8ffcf9b62b0b0aa3a5873ed7a4fe
Revision: d989b31c87461dc8ab2f1cac6792814e27fadea9
License type (autodetected): BSD-3-Clause
./vendor/golang.org/x/sys/LICENSE:
--------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.10.3
FROM golang:1.11.2
MAINTAINER Nicolas Ruflin <ruflin@elastic.co>

RUN set -x && \
Expand Down
4 changes: 2 additions & 2 deletions auditbeat/module/file_integrity/metricset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func TestExcludedFiles(t *testing.T) {
}

wanted := map[string]bool{
dir: true,
dir: true,
filepath.Join(dir, "FILE.TXT"): true,
filepath.Join(dir, ".gitignore"): true,
}
Expand Down Expand Up @@ -271,7 +271,7 @@ func TestIncludedExcludedFiles(t *testing.T) {
}

wanted := map[string]bool{
dir: true,
dir: true,
filepath.Join(dir, ".ssh"): true,
filepath.Join(dir, ".ssh/known_hosts"): true,
}
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/module/file_integrity/monitor/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func TestRecursiveSubdirPermissions(t *testing.T) {
// File "b/b" is missing because a watch to b couldn't be installed

expected := map[string]fsnotify.Op{
dest: fsnotify.Create,
dest: fsnotify.Create,
filepath.Join(dest, "a"): fsnotify.Create,
filepath.Join(dest, "a/a"): fsnotify.Create,
filepath.Join(dest, "b"): fsnotify.Create,
Expand Down
2 changes: 1 addition & 1 deletion filebeat/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.10.3
FROM golang:1.11.2

RUN \
apt-get update \
Expand Down
2 changes: 1 addition & 1 deletion filebeat/autodiscover/builder/hints/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (l *logHints) getFilesets(hints common.MapStr, module string) map[string]*f

moduleFilesets, err := l.Registry.ModuleFilesets(module)
if err != nil {
logp.Err("Error retrieving module filesets", err)
logp.Err("Error retrieving module filesets: %+v", err)
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion filebeat/input/log/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ func (p *Input) harvestExistingFile(newState file.State, oldState file.State) {

// File size was reduced -> truncated file
if oldState.Finished && newState.Fileinfo.Size() < oldState.Offset {
logp.Debug("input", "Old file was truncated. Starting from the beginning: %s, offset: %d, new size: %d ", newState.Source, newState.Fileinfo.Size())
logp.Debug("input", "Old file was truncated. Starting from the beginning: %s, offset: %d, new size: %d ", newState.Source, newState.Offset, newState.Fileinfo.Size())
err := p.startHarvester(newState, 0)
if err != nil {
logp.Err("Harvester could not be started on truncated file: %s, Err: %s", newState.Source, err)
Expand Down
2 changes: 1 addition & 1 deletion generator/beat/{beat}/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
language: go

go:
- 1.10.3
- 1.11.2

os:
- linux
Expand Down
2 changes: 1 addition & 1 deletion heartbeat/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.10.3
FROM golang:1.11.2
MAINTAINER Nicolas Ruflin <ruflin@elastic.co>

RUN set -x && \
Expand Down
2 changes: 1 addition & 1 deletion journalbeat/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.10.3
FROM golang:1.11.2
MAINTAINER Noémi Ványi <noemi.vanyi@elastic.co>

RUN set -x && \
Expand Down
4 changes: 2 additions & 2 deletions journalbeat/checkpoint/file_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func createWriteThroughFile(path string) (*os.File, error) {
pathp, // Path
syscall.GENERIC_READ|syscall.GENERIC_WRITE, // Access Mode
uint32(syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE), // Share Mode
nil, // Security Attributes
syscall.CREATE_ALWAYS, // Create Mode
nil, // Security Attributes
syscall.CREATE_ALWAYS, // Create Mode
uint32(syscall.FILE_ATTRIBUTE_NORMAL|_FILE_FLAG_WRITE_THROUGH), // Flags and Attributes
0) // Template File

Expand Down
2 changes: 1 addition & 1 deletion libbeat/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Beats dockerfile used for testing
FROM golang:1.10.3
FROM golang:1.11.2
MAINTAINER Nicolas Ruflin <ruflin@elastic.co>

RUN set -x && \
Expand Down
6 changes: 3 additions & 3 deletions libbeat/autodiscover/appenders/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func NewConfigAppender(cfg *common.Config) (autodiscover.Appender, error) {
confs := configs{}
err := cfg.Unpack(&confs)
if err != nil {
return nil, fmt.Errorf("unable to unpack config appender due to error: %v", err)
return nil, fmt.Errorf("unable to unpack config appender due to error: %+v", err)
}

var configMaps []configMap
Expand All @@ -66,7 +66,7 @@ func NewConfigAppender(cfg *common.Config) (autodiscover.Appender, error) {
if conf.ConditionConfig != nil {
cond, err = conditions.NewCondition(conf.ConditionConfig)
if err != nil {
logp.Warn("config", "unable to create condition due to error: %v", err)
logp.Warn("unable to create condition due to error: %+v", err)
continue
}
}
Expand All @@ -76,7 +76,7 @@ func NewConfigAppender(cfg *common.Config) (autodiscover.Appender, error) {
cf := common.MapStr{}
err = conf.Config.Unpack(&cf)
if err != nil {
logp.Warn("config", "unable to unpack config due to error: %v", err)
logp.Warn("unable to unpack config due to error: %+v", err)
continue
}
cm.config = cf
Expand Down
2 changes: 1 addition & 1 deletion libbeat/autodiscover/autodiscover.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (a *Autodiscover) handleStop(event bus.Event) bool {
delete(a.configs, hash)
updated = true
} else {
logp.Debug(debugK, "Runner not found for stopping: %s", hash)
logp.Debug(debugK, "Runner not found for stopping: %d", hash)
}
}

Expand Down
2 changes: 1 addition & 1 deletion libbeat/autodiscover/providers/jolokia/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ var queryMessage = []byte(`{"type":"query"}`)
func (d *Discovery) sendProbe(config InterfaceConfig) {
interfaces, err := d.interfaces(config.Name)
if err != nil {
logp.Err("failed to get interfaces: ", err)
logp.Err("failed to get interfaces: %+v", err)
return
}

Expand Down
2 changes: 1 addition & 1 deletion libbeat/autodiscover/providers/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func AutodiscoverBuilder(bus bus.Bus, c *common.Config) (autodiscover.Provider,
Namespace: config.Namespace,
})
if err != nil {
logp.Err("kubernetes: Couldn't create watcher for %t", &kubernetes.Pod{})
logp.Err("kubernetes: Couldn't create watcher for %T", &kubernetes.Pod{})
return nil, err
}

Expand Down
8 changes: 4 additions & 4 deletions libbeat/common/kubernetes/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ func DiscoverKubernetesNode(host string, inCluster bool, client *k8s.Client) (no
if inCluster {
ns, err := inClusterNamespace()
if err != nil {
logp.Err("kubernetes: Couldn't get namespace when beat is in cluster with error: ", err.Error())
logp.Err("kubernetes: Couldn't get namespace when beat is in cluster with error: %+v", err.Error())
return defaultNode
}
podName, err := os.Hostname()
if err != nil {
logp.Err("kubernetes: Couldn't get hostname as beat pod name in cluster with error: ", err.Error())
logp.Err("kubernetes: Couldn't get hostname as beat pod name in cluster with error: %+v", err.Error())
return defaultNode
}
logp.Info("kubernetes: Using pod name %s and namespace %s to discover kubernetes node", podName, ns)
pod := v1.Pod{}
err = client.Get(context.TODO(), ns, podName, &pod)
if err != nil {
logp.Err("kubernetes: Querying for pod failed with error: %v", err.Error())
logp.Err("kubernetes: Querying for pod failed with error: %+v", err.Error())
return defaultNode
}
logp.Info("kubernetes: Using node %s discovered by in cluster pod node query", pod.Spec.GetNodeName())
Expand All @@ -103,7 +103,7 @@ func DiscoverKubernetesNode(host string, inCluster bool, client *k8s.Client) (no
nodes := v1.NodeList{}
err := client.List(context.TODO(), k8s.AllNamespaces, &nodes)
if err != nil {
logp.Err("kubernetes: Querying for nodes failed with error: ", err.Error())
logp.Err("kubernetes: Querying for nodes failed with error: %+v", err.Error())
return defaultNode
}
for _, n := range nodes.Items {
Expand Down
6 changes: 3 additions & 3 deletions libbeat/common/transport/tlscommon/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ func LoadCertificate(config *CertificateConfig) (*tls.Certificate, error) {

certPEM, err := ReadPEMFile(certificate, config.Passphrase)
if err != nil {
logp.Critical("Failed reading certificate file %v: %v", certificate, err)
logp.Critical("Failed reading certificate file %v: %+v", certificate, err)
return nil, fmt.Errorf("%v %v", err, certificate)
}

keyPEM, err := ReadPEMFile(key, config.Passphrase)
if err != nil {
logp.Critical("Failed reading key file %v: %v", key, err)
logp.Critical("Failed reading key file %v: %+v", key, err)
return nil, fmt.Errorf("%v %v", err, key)
}

cert, err := tls.X509KeyPair(certPEM, keyPEM)
if err != nil {
logp.Critical("Failed loading client certificate", err)
logp.Critical("Failed loading client certificate %+v", err)
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion libbeat/docs/version.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:stack-version: 7.0.0-alpha1
:doc-branch: master
:go-version: 1.10.3
:go-version: 1.11.2
:release-state: prerelease
:python: 2.7.9
:docker: 1.12
Expand Down
4 changes: 2 additions & 2 deletions libbeat/generator/fields/validate/mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func recursiveFattenFields(fields interface{}, prefix Prefix, mapping *Mapping,
if hasRequired {
required, ok = requiredIf.(bool)
if !ok {
return errors.Errorf("field [%s](%s) has 'required' property but is not a boolean, but %T (value=%v)", requiredIf, requiredIf)
return errors.Errorf("field [%s](%s) has 'required' property but is not a boolean, but %T (value=%v)", key, prefix, requiredIf, requiredIf)
}
}

Expand Down Expand Up @@ -235,7 +235,7 @@ func recursiveFattenFields(fields interface{}, prefix Prefix, mapping *Mapping,
if fieldsIf != nil {
innerFields, ok := fieldsIf.([]interface{})
if !ok {
return errors.Errorf("field [%s](%s) has a 'fields' tag of unexpected type (type=%T value=%v)", nameIf, nameIf)
return errors.Errorf("field [%s](%s) has a 'fields' tag of unexpected type (type=%T value=%v)", key, prefix, nameIf, nameIf)
}
for _, field := range innerFields {
if err := recursiveFattenFields(field, prefix, mapping, key); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion libbeat/kibana/fields_transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func newFieldsTransformer(version *common.Version, fields common.Fields) (*field
version: version,
transformedFields: []common.MapStr{},
transformedFieldFormatMap: common.MapStr{},
keys: common.MapStr{},
keys: common.MapStr{},
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion libbeat/outputs/elasticsearch/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ func (conn *Connection) execRequest(
) (int, []byte, error) {
req, err := http.NewRequest(method, url, body)
if err != nil {
logp.Warn("Failed to create request", err)
logp.Warn("Failed to create request %+v", err)
return 0, nil, err
}
if body != nil {
Expand Down
2 changes: 1 addition & 1 deletion libbeat/outputs/transport/transptest/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func GenCertForTestingPurpose(t *testing.T, host, name, keyPassword string) erro
NotAfter: time.Now().AddDate(10, 0, 0),
SubjectKeyId: []byte("12345"),
BasicConstraintsValid: true,
IsCA: true,
IsCA: true,
ExtKeyUsage: []x509.ExtKeyUsage{
x509.ExtKeyUsageClientAuth,
x509.ExtKeyUsageServerAuth},
Expand Down
2 changes: 1 addition & 1 deletion libbeat/plugin/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (p *pluginList) String() string {
func (p *pluginList) Set(v string) error {
for _, path := range p.paths {
if path == v {
logp.Warn("%s is already a registered plugin")
logp.Warn("%s is already a registered plugin", path)
return nil
}
}
Expand Down
4 changes: 2 additions & 2 deletions libbeat/processors/add_kubernetes_metadata/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func newKubernetesAnnotator(cfg *common.Config) (processors.Processor, error) {

config.Host = kubernetes.DiscoverKubernetesNode(config.Host, config.InCluster, client)

logp.Debug("kubernetes", "Using host ", config.Host)
logp.Debug("kubernetes", "Using host: %s", config.Host)
logp.Debug("kubernetes", "Initializing watcher")

watcher, err := kubernetes.NewWatcher(client, &kubernetes.Pod{}, kubernetes.WatchOptions{
Expand All @@ -112,7 +112,7 @@ func newKubernetesAnnotator(cfg *common.Config) (processors.Processor, error) {
Namespace: config.Namespace,
})
if err != nil {
logp.Err("kubernetes: Couldn't create watcher for %t", &kubernetes.Pod{})
logp.Err("kubernetes: Couldn't create watcher for %T", &kubernetes.Pod{})
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion libbeat/reader/readfile/line.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (r *LineReader) Next() ([]byte, int, error) {
if buf[len(buf)-1] == '\n' {
break
} else {
logp.Debug("line", "Line ending char found which wasn't one: %s", buf[len(buf)-1])
logp.Debug("line", "Line ending char found which wasn't one: %c", buf[len(buf)-1])
}
}

Expand Down
2 changes: 1 addition & 1 deletion metricbeat/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.10.3
FROM golang:1.11.2
MAINTAINER Nicolas Ruflin <ruflin@elastic.co>

RUN set -x && \
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/ceph/cluster_disk/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func eventMapping(content []byte) common.MapStr {
var d DfRequest
err := json.Unmarshal(content, &d)
if err != nil {
logp.Err("Error: ", err)
logp.Err("Error: %+v", err)
}

return common.MapStr{
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/ceph/cluster_health/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func eventMapping(content []byte) common.MapStr {
var d HealthRequest
err := json.Unmarshal(content, &d)
if err != nil {
logp.Err("Error: ", err)
logp.Err("Error: %+v", err)
}

return common.MapStr{
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/ceph/cluster_status/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func eventsMapping(content []byte) ([]common.MapStr, error) {
var d HealthRequest
err := json.Unmarshal(content, &d)
if err != nil {
logp.Err("Error: ", err)
logp.Err("Error: %+v", err)
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/ceph/monitor_health/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func eventsMapping(content []byte) []common.MapStr {
var d HealthRequest
err := json.Unmarshal(content, &d)
if err != nil {
logp.Err("Error: ", err)
logp.Err("Error: %+v", err)
}

events := []common.MapStr{}
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/ceph/osd_df/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func eventsMapping(content []byte) ([]common.MapStr, error) {
var d OsdDfRequest
err := json.Unmarshal(content, &d)
if err != nil {
logp.Err("Error: ", err)
logp.Err("Error: %+v", err)
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/ceph/osd_tree/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func eventsMapping(content []byte) ([]common.MapStr, error) {
var d OsdTreeRequest
err := json.Unmarshal(content, &d)
if err != nil {
logp.Err("Error: ", err)
logp.Err("Error: %+v", err)
return nil, err
}

Expand Down
Loading