Skip to content
Open
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 .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
run: make ginkgo kind

- name: Run e2e tests
run: make e2e
run: make test-e2e

build:
runs-on: ubuntu-22.04
Expand Down
53 changes: 22 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,27 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet setup-envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out

# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
.PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
test-e2e:
go test ./tests/e2e/ -v -ginkgo.v
KIND_CLUSTER ?= fluent-operator-test-e2e

.PHONY: setup-test-e2e
setup-test-e2e: $(KIND) ## Set up a Kind cluster for e2e tests if it does not exist
@case "$$($(KIND) get clusters)" in \
*"$(KIND_CLUSTER)"*) \
echo "Kind cluster '$(KIND_CLUSTER)' already exists. Skipping creation." ;; \
*) \
echo "Creating Kind cluster '$(KIND_CLUSTER)'…"; \
$(KIND) create cluster --name $(KIND_CLUSTER) ;; \
esac

.PHONY: cleanup-test-e2e
cleanup-test-e2e:
$(KIND) delete cluster --name $(KIND_CLUSTER)

.PHONY: test-e2e
test-e2e: setup-test-e2e fluentd-e2e ## Run the e2e tests against a Kind k8s instance that is spun up.

%-e2e: ginkgo
@export KIND_CLUSTER=$(KIND_CLUSTER); tests/scripts/$*_e2e.sh

.PHONY: lint
lint: golangci-lint ## Run golangci-lint linter
Expand Down Expand Up @@ -231,7 +248,7 @@ $(CONTROLLER_GEN): $(LOCALBIN)

.PHONY: setup-envtest
setup-envtest: envtest ## Download the binaries required for ENVTEST in the local bin directory.
@echo "Setting up envtest binaries for Kubernetes version $(ENVTEST_K8S_VERSION)..."
@echo "Setting up envtest binaries for Kubernetes version $(ENVTEST_K8S_VERSION)"
@$(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path || { \
echo "Error: Failed to set up envtest binaries for version $(ENVTEST_K8S_VERSION)."; \
exit 1; \
Expand All @@ -257,26 +274,6 @@ code-generator: $(CODE_GENERATOR) ## Download code-generator locally if necessar
$(CODE_GENERATOR): $(LOCALBIN)
$(call go-install-tool,$(CODE_GENERATOR),k8s.io/code-generator,$(CODE_GENERATOR_VERSION))

KIND_CLUSTER ?= fluent-operator-test-e2e

.PHONY: setup-test-e2e
setup-test-e2e: ## Set up a Kind cluster for e2e tests if it does not exist
@command -v $(KIND) >/dev/null 2>&1 || { \
echo "Kind is not installed. Please install Kind manually."; \
exit 1; \
}
@case "$$($(KIND) get clusters)" in \
*"$(KIND_CLUSTER)"*) \
echo "Kind cluster '$(KIND_CLUSTER)' already exists. Skipping creation." ;; \
*) \
echo "Creating Kind cluster '$(KIND_CLUSTER)'..."; \
$(KIND) create cluster --name $(KIND_CLUSTER) ;; \
esac

.PHONY: cleanup-test-e2e
cleanup-test-e2e:
$(KIND) delete cluster --name $(KIND_CLUSTER)

.PHONY: kind
kind: $(KIND) ## Download code-generator locally if necessary.
$(KIND): $(LOCALBIN)
Expand Down Expand Up @@ -376,12 +373,6 @@ go-deps: # download go dependencies
docs-update: # update api docs
go run ./cmd/doc-gen/main.go

e2e: ginkgo # make e2e tests
tests/scripts/fluentd_e2e.sh

helm-e2e: ginkgo # make helm e2e tests
tests/scripts/fluentd_helm_e2e.sh

update-helm-package: # update helm repo
./hack/update-helm-package.sh

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.5.0
latest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think this change belongs to this PR

Suggested change
latest
v3.5.0

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will block the test to run successfully if we don't fix it. see here

Copy link
Collaborator

@marcofranssen marcofranssen Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing this will break stuff like releases, we rather fix it in the script by doing a sed replacement or something like that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the release #1741 should be actually be merged into a separate release branch and keep the master's version to latest. There was a mistake that we didn't create a release branch for v3.5.0

Please check the file history and you will know.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<source>
@type forward
bind 0.0.0.0
port 24224
</source>
<match **>
@id main
@type label_router
<route>
@label @5789d57841808bf91cfb0ed603d9ee86
<match>
namespaces fluent
</match>
</route>
</match>
<label @5789d57841808bf91cfb0ed603d9ee86>
<filter **>
@id FluentdConfig-fluent-fluentd-config-label-selector-test::fluent::filter::test-filter-recordtransformer-0
@type record_transformer
<record>
environment testing
hostname test-host
</record>
</filter>
<match **>
@id FluentdConfig-fluent-fluentd-config-label-selector-test::fluent::output::test-output-stdout-0
@type stdout
</match>
</label>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<source>
@type forward
bind 0.0.0.0
port 24224
</source>
<match **>
@id main
@type label_router
<route>
@label @7d670e99fb44ef7d003c936b2c226ac3
<match>
namespaces fluent
</match>
</route>
</match>
<label @7d670e99fb44ef7d003c936b2c226ac3>
<filter **>
@id FluentdConfig-fluent-fluentd-config-filter-only::fluent::filter::test-filter-grep-0
@type grep
<regexp>
key level
pattern /error/
</regexp>
</filter>
<match **>
@id FluentdConfig-fluent-fluentd-config-filter-only::cluster::clusteroutput::cluster-output-stdout-filter-test-0
@type stdout
</match>
</label>
5 changes: 3 additions & 2 deletions tests/e2e/fluentd/cfgrender_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fluentd

import (
"context"
"fmt"
"os"
"testing"
Expand All @@ -22,7 +23,7 @@ var k8sClient client.Client
func TestCompareFluentdMainAppConfig(t *testing.T) {
RegisterFailHandler(Fail)

BeforeSuite(func() {
BeforeSuite(func(ctx context.Context) {
path := os.Getenv("TESTCONFIG")
if path == "" {
path = fmt.Sprintf("%s/.kube/config", os.Getenv("HOME"))
Expand All @@ -46,7 +47,7 @@ func TestCompareFluentdMainAppConfig(t *testing.T) {
Expect(k8sClient).NotTo(BeNil())

_, _ = fmt.Fprintf(GinkgoWriter, "%s: Info: Setup Suite Execution\n", time.Now().Format(time.StampMilli))
}, 60)
}, NodeTimeout(60*time.Second))

AfterSuite(func() {
By("After Suite Execution")
Expand Down
Loading
Loading