Skip to content

Commit

Permalink
Merge branch 'master' into fix-13043
Browse files Browse the repository at this point in the history
  • Loading branch information
srebhan committed May 16, 2023
2 parents 7ce0b5a + afab345 commit ad1e4f9
Show file tree
Hide file tree
Showing 266 changed files with 10,890 additions and 3,376 deletions.
104 changes: 102 additions & 2 deletions .circleci/config.yml
Expand Up @@ -8,7 +8,7 @@ executors:
working_directory: '/go/src/github.com/influxdata/telegraf'
resource_class: large
docker:
- image: 'quay.io/influxdb/telegraf-ci:1.20.2'
- image: 'quay.io/influxdb/telegraf-ci:1.20.4'
environment:
GOFLAGS: -p=4
mac:
Expand Down Expand Up @@ -379,6 +379,25 @@ jobs:
--include "*.rpm" \
--include "*.zip" \
--acl public-read
release:
executor: telegraf-ci
steps:
- attach_workspace:
at: '/build'
- run:
command: |
aws s3 sync /build/dist s3://dl.influxdata.com/telegraf/releases/ \
--exclude "*" \
--include "telegraf*.DIGESTS" \
--include "telegraf*.digests" \
--include "telegraf*.asc" \
--include "telegraf*.deb" \
--include "telegraf*.dmg" \
--include "telegraf*.rpm" \
--include "telegraf*.tar.gz" \
--include "telegraf*.zip" \
--dryrun \
--acl public-read
docker-nightly:
machine:
image: ubuntu-2004:current
Expand Down Expand Up @@ -481,6 +500,60 @@ jobs:
PR=${CIRCLE_PULL_REQUEST##*/}
printf -v payload '{ "pullRequestNumber": "%s" }' "$PR"
curl -X POST "https://182c7jdgog.execute-api.us-east-1.amazonaws.com/prod/shareArtifacts" --data "$payload"
package-sign:
circleci_ip_ranges: true
docker:
- image: quay.io/influxdb/rsign:latest
auth:
username: $QUAY_RSIGN_USERNAME
password: $QUAY_RSIGN_PASSWORD
steps:
- add_ssh_keys:
fingerprints:
- 3b:c0:fe:a0:8a:93:33:69:de:22:ac:20:a6:ed:6b:e5
- attach_workspace:
at: .
- run: |
cd dist
# Generate the *.DIGESTS files. This must be done before the signing
# step so that the *.DIGEST files are also signed.
for target in *
do
sha256sum "${target}" > "${target}.DIGESTS"
done
for target in *
do
case "${target}"
in
# rsign is shipped on Alpine Linux which uses "busybox ash" instead
# of bash. ash is somewhat more posix compliant and is missing some
# extensions and niceties from bash.
*.deb|*.dmg|*.rpm|*.tar.gz|*.zip|*.DIGESTS)
rsign "${target}"
;;
esac
done
for target in *
do
case "${target}"
in
*.deb|*.dmg|*.rpm|*.tar.gz|*.zip)
# Combine the metadata from the *.DIGESTS and *.asc files into one
# listing. Since the gpg signature contains multiple lines which
# must be preserved, it is base64 encoded.
printf '%s %s %s\n' "${target}" "$(awk '{ print $1 }' "${target}.DIGESTS")" "$(base64 -w 0 <"${target}.asc")" >>"telegraf-${CIRCLE_TAG}-digests"
;;
esac
done
- persist_to_workspace:
root: ./
paths:
- dist
- store_artifacts:
path: ./dist

workflows:
version: 2
Expand Down Expand Up @@ -656,6 +729,25 @@ workflows:
only: /.*/
branches:
ignore: /.*/
- 'package-sign':
requires:
- 'i386-package'
- 'ppc64le-package'
- 'riscv64-package'
- 's390x-package'
- 'armel-package'
- 'amd64-package'
- 'mipsel-package'
- 'mips-package'
- 'arm64-package'
- 'armhf-package'
- 'package-sign-mac'
- 'package-sign-windows'
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- 'package-consolidate':
requires:
- 'i386-package'
Expand All @@ -670,12 +762,20 @@ workflows:
- 'riscv64-package'
- 'package-sign-mac'
- 'package-sign-windows'
- 'package-sign'
filters:
tags:
only: /.*/
branches:
ignore: /.*/

- 'release':
requires:
- 'package-consolidate'
filters:
tags:
only: /.*/
branches:
ignore: /.*/
nightly:
when:
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Expand Up @@ -25,5 +25,5 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51.2
version: v1.52.2
args: --timeout 15m0s --verbose --out-${NO_FUTURE}format tab
4 changes: 2 additions & 2 deletions .github/workflows/govulncheck.yml
Expand Up @@ -12,8 +12,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Scan for Vulnerabilities in Code
uses: Templum/govulncheck-action@v0.10.0
uses: Templum/govulncheck-action@v0.10.1
with:
go-version: '1.20'
vulncheck-version: v0.0.0-20230320232729-bfc1eaef17a4
vulncheck-version: v0.1.0
package: ./...
15 changes: 10 additions & 5 deletions .golangci.yml
Expand Up @@ -90,10 +90,12 @@ linters-settings:
includes:
- G101
- G102
- G103
- G106
- G107
- G108
- G109
- G110
- G111
- G112
- G114
Expand All @@ -107,10 +109,13 @@ linters-settings:
- G306
- G401
- G403
- G404
- G501
- G502
- G503
- G505
- G601
# G104, G105, G113, G204, G304, G307, G402, G504 were not enabled intentionally
# To specify the configuration of rules.
config:
# Maximum allowed permissions mode for os.OpenFile and os.Chmod
Expand Down Expand Up @@ -241,7 +246,7 @@ issues:
# revive:var-naming
- don't use an underscore in package name
# EXC0001 errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
- Error return value of .((os\.)?std(out|err)\..*|.*Close.*|.*Flush|.*Disconnect|.*Clear|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
# EXC0013 revive: Annoying issue about not having a comment. The rare codebase has such comments
- package comment should be of the form "(.+)...
# EXC0015 revive: Annoying issue about not having a comment. The rare codebase has such comments
Expand All @@ -254,13 +259,13 @@ issues:
- govet

- path: cmd/telegraf/(main|printer).go
text: "Error return value of `outputBuffer.Write` is not checked"
text: "Error return value of `outputBuffer.Write` is not checked" #errcheck

- path: cmd/telegraf/(main|printer).go
text: "unhandled-error: Unhandled error in call to function outputBuffer.Write"
- path: _test\.go
text: "Potential hardcoded credentials" #gosec:G101

- path: _test\.go
text: "Potential hardcoded credentials"
text: "Use of weak random number generator" #gosec:G404

# Independently of option `exclude` we use default exclude patterns,
# it can be disabled by this option.
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,31 @@
<!-- markdownlint-disable MD024 -->
# Changelog

## v1.26.2 [2023-04-24]

### Bugfixes

- [#13020](https://github.com/influxdata/telegraf/pull/13020) `agent` Pass quiet flag earlier
- [#13063](https://github.com/influxdata/telegraf/pull/13063) `inputs.prometheus` Add namespace option in k8s informer factory
- [#13059](https://github.com/influxdata/telegraf/pull/13059) `inputs.socket_listener` Fix tracking of unix sockets
- [#13078](https://github.com/influxdata/telegraf/pull/13078) `parsers.grok` Fix nil metric for multiline inputs
- [#13092](https://github.com/influxdata/telegraf/pull/13092) `processors.lookup` Fix tracking metrics

### Dependency Updates

- [#13106](https://github.com/influxdata/telegraf/pull/13106) `deps` Bump github.com/aws/aws-sdk-go-v2/credentials from 1.13.15 to 1.13.20
- [#13072](https://github.com/influxdata/telegraf/pull/13072) `deps` Bump github.com/aws/aws-sdk-go-v2/service/cloudwatch from 1.21.6 to 1.25.9
- [#13107](https://github.com/influxdata/telegraf/pull/13107) `deps` Bump github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs from 1.15.13 to 1.20.9
- [#13027](https://github.com/influxdata/telegraf/pull/13027) `deps` Bump github.com/aws/aws-sdk-go-v2/service/kinesis from 1.15.19 to 1.17.8
- [#13069](https://github.com/influxdata/telegraf/pull/13069) `deps` Bump github.com/aws/aws-sdk-go-v2/service/sts from 1.18.5 to 1.18.9
- [#13105](https://github.com/influxdata/telegraf/pull/13105) `deps` Bump github.com/docker/docker from 23.0.0 to 23.0.4
- [#13024](https://github.com/influxdata/telegraf/pull/13024) `deps` Bump github.com/openconfig/gnmi from 0.0.0-20220920173703-480bf53a74d2 to 0.9.1
- [#13026](https://github.com/influxdata/telegraf/pull/13026) `deps` Bump github.com/prometheus/common from 0.41.0 to 0.42.0
- [#13025](https://github.com/influxdata/telegraf/pull/13025) `deps` Bump github.com/safchain/ethtool from 0.2.0 to 0.3.0
- [#13023](https://github.com/influxdata/telegraf/pull/13023) `deps` Bump github.com/tinylib/msgp from 1.1.6 to 1.1.8
- [#13071](https://github.com/influxdata/telegraf/pull/13071) `deps` Bump github.com/vishvananda/netns from 0.0.2 to 0.0.4
- [#13070](https://github.com/influxdata/telegraf/pull/13070) `deps` Bump github.com/wavefronthq/wavefront-sdk-go from 0.11.0 to 0.12.0

## v1.26.1 [2023-04-03]

### Bugfixes
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Expand Up @@ -172,7 +172,7 @@ vet:
.PHONY: lint-install
lint-install:
@echo "Installing golangci-lint"
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2

@echo "Installing markdownlint"
npm install -g markdownlint-cli
Expand Down Expand Up @@ -247,8 +247,8 @@ plugins/parsers/influx/machine.go: plugins/parsers/influx/machine.go.rl

.PHONY: ci
ci:
docker build -t quay.io/influxdb/telegraf-ci:1.20.2 - < scripts/ci.docker
docker push quay.io/influxdb/telegraf-ci:1.20.2
docker build -t quay.io/influxdb/telegraf-ci:1.20.4 - < scripts/ci.docker
docker push quay.io/influxdb/telegraf-ci:1.20.4

.PHONY: install
install: $(buildbin)
Expand Down
4 changes: 1 addition & 3 deletions agent/agent.go
Expand Up @@ -961,9 +961,7 @@ func (a *Agent) Test(ctx context.Context, wait time.Duration) error {
wg.Add(1)
go func() {
defer wg.Done()
s := influx.NewSerializer()
s.SetFieldSortOrder(influx.SortFields)

s := &influx.Serializer{SortFields: true}
for metric := range src {
octets, err := s.Serialize(metric)
if err == nil {
Expand Down
1 change: 1 addition & 0 deletions cmd/telegraf/main.go
Expand Up @@ -23,6 +23,7 @@ import (
_ "github.com/influxdata/telegraf/plugins/parsers/all"
_ "github.com/influxdata/telegraf/plugins/processors/all"
_ "github.com/influxdata/telegraf/plugins/secretstores/all"
_ "github.com/influxdata/telegraf/plugins/serializers/all"
)

type TelegrafConfig interface {
Expand Down

0 comments on commit ad1e4f9

Please sign in to comment.