Skip to content

Commit

Permalink
Merge branch 'main' into 2024.10.03_LogQL
Browse files Browse the repository at this point in the history
  • Loading branch information
JStickler authored Oct 9, 2024
2 parents 1dd13be + 61aa418 commit c105958
Show file tree
Hide file tree
Showing 225 changed files with 1,995 additions and 1,333 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"check":
"uses": "grafana/loki-release/.github/workflows/check.yml@main"
"with":
"build_image": "grafana/loki-build-image:0.34.0"
"build_image": "grafana/loki-build-image:0.34.1"
"golang_ci_lint_version": "v1.60.3"
"release_lib_ref": "main"
"skip_validation": false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/helm-loki-ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
name: helm-loki-ci
on:
pull_request:
# It runs with the configuration from base branch, so the changes of this file from the PR won't be taken into account until they are merged into main. see: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request_target .
# This change is required to allow this CI to be run on Pull Requests opened from a fork repository
pull_request_target:
paths:
- "production/helm/loki/**"

jobs:
publish-diff:
# temporarily disable the workflow for the PRs where PRs branch is from fork.
if: github.event.pull_request.head.repo.full_name == github.repository
name: Publish Rendered Helm Chart Diff
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"check":
"uses": "grafana/loki-release/.github/workflows/check.yml@main"
"with":
"build_image": "grafana/loki-build-image:0.34.0"
"build_image": "grafana/loki-build-image:0.34.1"
"golang_ci_lint_version": "v1.60.3"
"release_lib_ref": "main"
"skip_validation": false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/minor-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
check:
uses: "grafana/loki-release/.github/workflows/check.yml@main"
with:
build_image: "grafana/loki-build-image:0.34.0"
build_image: "grafana/loki-build-image:0.34.1"
golang_ci_lint_version: "v1.60.3"
release_lib_ref: "main"
skip_validation: false
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
--env SKIP_ARM \
--volume .:/src/loki \
--workdir /src/loki \
--entrypoint /bin/sh "grafana/loki-build-image:0.34.0"
--entrypoint /bin/sh "grafana/loki-build-image:0.34.1"
git config --global --add safe.directory /src/loki
echo "${NFPM_SIGNING_KEY}" > $NFPM_SIGNING_KEY_FILE
make dist packages
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/operator-check-prepare-release-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ jobs:
github.event.pull_request.head.ref == 'release-please--branches--main--components--operator' &&
contains(github.event.pull_request.title, 'chore( operator): community release')
steps:
- id: "get_github_app_token"
name: Get GitHub Token
uses: "actions/create-github-app-token@v1"
with:
app-id: "${{ secrets.APP_ID }}"
owner: "${{ github.repository_owner }}"
private-key: "${{ secrets.APP_PRIVATE_KEY }}"

- name: Extract release version
id: pr_semver
env:
Expand All @@ -31,7 +39,7 @@ jobs:
- name: Check main commits for prepare release commit
id: check_commit
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ steps.get_github_app_token.outputs.token }}
working-directory: "release"
run: |
COMMIT=$(gh search commits "chore(operator): prepare community release v${{ steps.pr_semver.outputs.semver }}")
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/operator-publish-operator-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ jobs:
with:
org: redhat-openshift-ecosystem
repo: community-operators-prod
secrets:
GRAFANABOT_GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

operator-hub-community-release:
if: startsWith(github.event.release.tag_name, 'operator/')
uses: ./.github/workflows/operator-reusable-hub-release.yml
with:
org: k8s-operatorhub
repo: community-operators
secrets:
GRAFANABOT_GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
20 changes: 17 additions & 3 deletions .github/workflows/operator-release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,39 @@ jobs:
release_created: ${{ steps.release.outputs.operator--release_created }}
release_name: ${{ steps.release.outputs.operator--tag_name }}
steps:
- uses: google-github-actions/release-please-action@v4
- id: "get_github_app_token"
name: Get GitHub App Token
uses: "actions/create-github-app-token@v1"
with:
app-id: "${{ secrets.APP_ID }}"
owner: "${{ github.repository_owner }}"
private-key: "${{ secrets.APP_PRIVATE_KEY }}"
- uses: googleapis/release-please-action@v4
id: release
with:
path: operator
config-file: operator/release-please-config.json
token: ${{ secrets.GH_TOKEN }}
token: ${{ steps.get_github_app_token.outputs.token }}
publishRelease:
needs:
- "releasePlease"
runs-on: ubuntu-latest
if: ${{ needs.releasePlease.outputs.release_created }}
steps:
- id: "get_github_app_token"
name: Get GitHub App Token
uses: "actions/create-github-app-token@v1"
with:
app-id: "${{ secrets.APP_ID }}"
owner: "${{ github.repository_owner }}"
private-key: "${{ secrets.APP_PRIVATE_KEY }}"
- name: "pull code to release"
uses: "actions/checkout@v4"
with:
path: "release"
- name: "publish release"
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ steps.get_github_app_token.outputs.token }}
working-directory: "release"
run: |
gh release edit "${{ needs.releasePlease.outputs.release_name }}" --draft=false --latest=false
19 changes: 12 additions & 7 deletions .github/workflows/operator-reusable-hub-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ on:
repo:
type: string
required: true
secrets:
GRAFANABOT_GITHUB_TOKEN:
required: true

jobs:
create-operator-pull-request:
runs-on: ubuntu-latest
steps:
- id: "get_github_app_token"
name: Get GitHub App Token
uses: "actions/create-github-app-token@v1"
with:
app-id: "${{ secrets.APP_ID }}"
owner: "${{ github.repository_owner }}"
private-key: "${{ secrets.APP_PRIVATE_KEY }}"

- name: Set redhat-openshift-ecosystem specific variables
if: ${{ inputs.org == 'redhat-openshift-ecosystem' }}
env:
Expand All @@ -36,7 +41,7 @@ jobs:
- name: Sync fork
env:
GH_TOKEN: ${{ secrets.GRAFANABOT_GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.get_github_app_token.outputs.token }}
run: |
# synchronizing the fork is fast, and avoids the need to fetch the full upstream repo
# (fetching the upstream repo with "--depth 1" would lead to "shallow update not allowed"
Expand All @@ -49,13 +54,13 @@ jobs:
uses: actions/checkout@v4
with:
repository: grafanabot/${{ inputs.repo }}
token: ${{ secrets.GRAFANABOT_GITHUB_TOKEN }}
token: ${{ steps.get_github_app_token.outputs.token }}

- name: Checkout loki to tmp/ directory
uses: actions/checkout@v4
with:
repository: grafana/loki
token: ${{ secrets.GRAFANABOT_GITHUB_TOKEN }}
token: ${{ steps.get_github_app_token.outputs.token }}
path: tmp/

- name: Update version
Expand Down Expand Up @@ -85,7 +90,7 @@ jobs:
- name: Create pull request against ${{ inputs.org }}/${{ inputs.repo }}
env:
VERSION: ${{ env.version }}
GH_TOKEN: ${{ secrets.GRAFANABOT_GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.get_github_app_token.outputs.token }}
run: |
message="Update the loki-operator to $VERSION"
body="Release loki-operator \`$VERSION\`.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/patch-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
check:
uses: "grafana/loki-release/.github/workflows/check.yml@main"
with:
build_image: "grafana/loki-build-image:0.34.0"
build_image: "grafana/loki-build-image:0.34.1"
golang_ci_lint_version: "v1.60.3"
release_lib_ref: "main"
skip_validation: false
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
--env SKIP_ARM \
--volume .:/src/loki \
--workdir /src/loki \
--entrypoint /bin/sh "grafana/loki-build-image:0.34.0"
--entrypoint /bin/sh "grafana/loki-build-image:0.34.1"
git config --global --add safe.directory /src/loki
echo "${NFPM_SIGNING_KEY}" > $NFPM_SIGNING_KEY_FILE
make dist packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,4 @@ name: "create release"
permissions:
contents: "write"
id-token: "write"
pull-requests: "write"
pull-requests: "write"
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ run:
- cgo
- promtail_journal_enabled
- integration

# output configuration options
output:
formats:
Expand Down Expand Up @@ -63,7 +63,7 @@ linters:
- govet
- typecheck
- depguard
- exportloopref
- copyloopvar
- gofmt
- goimports
- gosimple
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ DOCKER_IMAGE_DIRS := $(patsubst %/Dockerfile,%,$(DOCKERFILES))
BUILD_IN_CONTAINER ?= true

# ensure you run `make release-workflows` after changing this
BUILD_IMAGE_VERSION ?= 0.34.0
BUILD_IMAGE_VERSION ?= 0.34.1
GO_VERSION := 1.23.1

# Docker image info
Expand Down Expand Up @@ -664,7 +664,7 @@ else
endif

build-image: ensure-buildx-builder
$(SUDO) $(BUILD_OCI) --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-build-image:$(IMAGE_TAG) ./loki-build-image
$(SUDO) $(BUILD_OCI) --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-build-image:$(BUILD_IMAGE_VERSION) ./loki-build-image
build-image-push: build-image ## push the docker build image
ifneq (,$(findstring WIP,$(IMAGE_TAG)))
@echo "Cannot push a WIP image, commit changes first"; \
Expand Down
2 changes: 1 addition & 1 deletion clients/cmd/fluentd/docker/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
source 'https://rubygems.org'

gem 'fluentd', '1.15.3'
gem 'fluent-plugin-multi-format-parser', '~>1.0.0'
gem 'fluent-plugin-multi-format-parser', '~>1.1.0'
1 change: 0 additions & 1 deletion clients/pkg/logentry/metric/counters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ func Test_validateCounterConfig(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
err := validateCounterConfig(&tt.config)
Expand Down
2 changes: 0 additions & 2 deletions clients/pkg/logentry/stages/decolorize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ func TestPipeline_Decolorize(t *testing.T) {
}

for testName, testData := range tests {
testData := testData

t.Run(testName, func(t *testing.T) {
t.Parallel()

Expand Down
4 changes: 0 additions & 4 deletions clients/pkg/logentry/stages/eventlogmessage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ func TestEventLogMessage_simple(t *testing.T) {
}

for testName, testData := range tests {
testData := testData
testData.extractedValues[testData.sourcekey] = testData.msgdata

t.Run(testName, func(t *testing.T) {
Expand Down Expand Up @@ -151,7 +150,6 @@ func TestEventLogMessageConfig_validate(t *testing.T) {
},
}
for tName, tt := range tests {
tt := tt
t.Run(tName, func(t *testing.T) {
_, err := newEventLogMessageStage(util_log.Logger, tt.config)
if tt.err != nil {
Expand Down Expand Up @@ -262,7 +260,6 @@ func TestEventLogMessage_Real(t *testing.T) {
}

for testName, testData := range tests {
testData := testData
testData.extractedValues[testData.sourcekey] = testData.msgdata

t.Run(testName, func(t *testing.T) {
Expand Down Expand Up @@ -318,7 +315,6 @@ func TestEventLogMessage_invalid(t *testing.T) {
}

for testName, testData := range tests {
testData := testData
testData.extractedValues[testData.sourcekey] = testData.msgdata

t.Run(testName, func(t *testing.T) {
Expand Down
2 changes: 0 additions & 2 deletions clients/pkg/logentry/stages/extensions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func TestNewDocker(t *testing.T) {
}

for tName, tt := range tests {
tt := tt
t.Run(tName, func(t *testing.T) {
t.Parallel()
p, err := NewDocker(util_log.Logger, prometheus.DefaultRegisterer)
Expand Down Expand Up @@ -268,7 +267,6 @@ func TestNewCri(t *testing.T) {
}

for tName, tt := range tests {
tt := tt
t.Run(tName, func(t *testing.T) {
t.Parallel()
cfg := map[string]interface{}{}
Expand Down
4 changes: 0 additions & 4 deletions clients/pkg/logentry/stages/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ func TestPipeline_JSON(t *testing.T) {
}

for testName, testData := range tests {
testData := testData

t.Run(testName, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -179,7 +177,6 @@ func TestJSONConfig_validate(t *testing.T) {
},
}
for tName, tt := range tests {
tt := tt
t.Run(tName, func(t *testing.T) {
c, err := parseJSONConfig(tt.config)
assert.NoError(t, err, "failed to create config: %s", err)
Expand Down Expand Up @@ -339,7 +336,6 @@ func TestJSONParser_Parse(t *testing.T) {
},
}
for tName, tt := range tests {
tt := tt
t.Run(tName, func(t *testing.T) {
t.Parallel()
p, err := New(util_log.Logger, nil, StageTypeJSON, tt.config, nil)
Expand Down
2 changes: 0 additions & 2 deletions clients/pkg/logentry/stages/labels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ func TestLabels(t *testing.T) {
},
}
for name, test := range tests {
test := test
t.Run(name, func(t *testing.T) {
t.Parallel()
err := validateLabelsConfig(test.config)
Expand Down Expand Up @@ -176,7 +175,6 @@ func TestLabelStage_Process(t *testing.T) {
},
}
for name, test := range tests {
test := test
t.Run(name, func(t *testing.T) {
t.Parallel()
st, err := newLabelStage(util_log.Logger, test.config)
Expand Down
4 changes: 0 additions & 4 deletions clients/pkg/logentry/stages/logfmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ func TestPipeline_Logfmt(t *testing.T) {
}

for testName, testData := range tests {
testData := testData

t.Run(testName, func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -153,7 +151,6 @@ func TestLogfmtConfig_validate(t *testing.T) {
},
}
for tName, tt := range tests {
tt := tt
t.Run(tName, func(t *testing.T) {
c, err := parseLogfmtConfig(tt.config)
assert.NoError(t, err)
Expand Down Expand Up @@ -281,7 +278,6 @@ func TestLogfmtParser_Parse(t *testing.T) {
},
}
for tName, tt := range tests {
tt := tt
t.Run(tName, func(t *testing.T) {
t.Parallel()
p, err := New(util_log.Logger, nil, StageTypeLogfmt, tt.config, nil)
Expand Down
1 change: 0 additions & 1 deletion clients/pkg/logentry/stages/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ func TestValidateMetricsConfig(t *testing.T) {
}

for name, test := range tests {
test := test
t.Run(name, func(t *testing.T) {
t.Parallel()
err := validateMetricsConfig(test.config)
Expand Down
Loading

0 comments on commit c105958

Please sign in to comment.