Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feature/split-pip…
Browse files Browse the repository at this point in the history
…eline

* upstream/master:
  CI: curl seems to be available but where cannot find it (#24965)
  [mergify] backport automation to 7.x, 7.12 and 7.11 (#24608)
  Only show deprecation warnings for CN-based verification once (#24948)
  CI: use ubuntu-20 (#24963)
  Debug empty root field instead of error (#24966)
  Kubernetes_secrets provider improvements (#24912)
  • Loading branch information
v1v committed Apr 7, 2021
2 parents 415e012 + 156ec34 commit 0a0faef
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .ci/beats-tester.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pipeline {
}
stages {
stage('Filter build') {
agent { label 'ubuntu && immutable' }
agent { label 'ubuntu-20' }
when {
beforeAgent true
anyOf {
Expand Down
2 changes: 1 addition & 1 deletion .ci/build-docker-images.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@Library('apm@current') _

pipeline {
agent { label 'ubuntu-16 && immutable' }
agent { label 'ubuntu-20' }
environment {
REPO = 'beats'
BASE_DIR = "src/github.com/elastic/${env.REPO}"
Expand Down
6 changes: 4 additions & 2 deletions .ci/scripts/install-tools.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ IF NOT EXIST "%PROGRAMFILES(X86)%" (
)
set PATH=%WORKSPACE%\bin;C:\ProgramData\chocolatey\bin;C:\tools\mingw%MINGW_ARCH%\bin;%PATH%

where /q curl
IF ERRORLEVEL 1 (
curl --version >nul 2>&1 && (
echo found curl
) || (
choco install curl -y --no-progress --skipdownloadcache
)

mkdir %WORKSPACE%\bin

IF EXIST "%PROGRAMFILES(X86)%" (
Expand Down
42 changes: 42 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
pull_request_rules:
- name: backport patches to 7.x branch
conditions:
- merged
- base=master
- label=backport-v7.13.0
actions:
backport:
branches:
- "7.x"
- name: backport patches to 7.12 branch
conditions:
- merged
- base=master
- label=backport-v7.12.0
actions:
backport:
branches:
- "7.12"
- name: backport patches to 7.11 branch
conditions:
- merged
- base=master
- label=backport-v7.11.0
actions:
backport:
branches:
- "7.11"
- name: ask to resolve conflict
conditions:
- conflict
actions:
comment:
message: |
This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/
```
git fetch upstream
git checkout -b {{head}} upstream/{{head}}
git merge upstream/{{base}}
git push upstream {{head}}
```
5 changes: 5 additions & 0 deletions deploy/kubernetes/elastic-agent-standalone-kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,11 @@ rules:
- events
- pods
verbs: ["get", "list", "watch"]
# Enable this rule only if planing to use kubernetes_secrets provider
#- apiGroups: [""]
# resources:
# - secrets
# verbs: ["get"]
- apiGroups: ["extensions"]
resources:
- replicasets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ rules:
- events
- pods
verbs: ["get", "list", "watch"]
# Enable this rule only if planing to use kubernetes_secrets provider
#- apiGroups: [""]
# resources:
# - secrets
# verbs: ["get"]
- apiGroups: ["extensions"]
resources:
- replicasets
Expand Down
7 changes: 6 additions & 1 deletion libbeat/common/transport/tlscommon/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ package tlscommon

import (
"crypto/tls"
"sync"

"github.com/joeshaw/multierror"

"github.com/elastic/beats/v7/libbeat/common/cfgwarn"
)

var warnOnce sync.Once

// Config defines the user configurable options in the yaml file.
type Config struct {
Enabled *bool `config:"enabled" yaml:"enabled,omitempty"`
Expand Down Expand Up @@ -98,7 +101,9 @@ func LoadTLSConfig(config *Config) (*TLSConfig, error) {
// Validate values the TLSConfig struct making sure certificate sure we have both a certificate and
// a key.
func (c *Config) Validate() error {
cfgwarn.Deprecate("8.0.0", "Treating the CommonName field on X.509 certificates as a host name when no Subject Alternative Names are present is going to be removed. Please update your certificates if needed.")
warnOnce.Do(func() {
cfgwarn.Deprecate("8.0.0", "Treating the CommonName field on X.509 certificates as a host name when no Subject Alternative Names are present is going to be removed. Please update your certificates if needed.")
})

return c.Certificate.Validate()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ func ContextProviderBuilder(logger *logger.Logger, c *config.Config) (corecomp.C

func (p *contextProviderK8sSecrets) Fetch(key string) (string, bool) {
// key = "kubernetes_secrets.somenamespace.somesecret.value"
if p.client == nil {
return "", false
}
tokens := strings.Split(key, ".")
if len(tokens) > 0 && tokens[0] != "kubernetes_secrets" {
return "", false
Expand Down
14 changes: 10 additions & 4 deletions x-pack/filebeat/input/httpjson/internal/v2/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,20 @@ func (rp *responseProcessor) startProcessing(stdCtx context.Context, trCtx *tran
}

if err := rp.split.run(trCtx, tr, ch); err != nil {
if err == errEmptyField {
switch err {
case errEmptyField:
// nothing else to send for this page
rp.log.Debug("split operation finished")
continue
case errEmptyRootField:
// root field not found, most likely the response is empty
rp.log.Debug(err)
return
default:
rp.log.Debug("split operation failed")
ch <- maybeMsg{err: err}
return
}
rp.log.Debug("split operation failed")
ch <- maybeMsg{err: err}
return
}
}
}
Expand Down

0 comments on commit 0a0faef

Please sign in to comment.