diff --git a/.github/workflows/helm-ci.yaml b/.github/workflows/helm-ci.yaml
index aa7f43049..18b291ad9 100644
--- a/.github/workflows/helm-ci.yaml
+++ b/.github/workflows/helm-ci.yaml
@@ -50,7 +50,7 @@ jobs:
version: ${{ env.HELM_VERSION }}
- name: Install dependences
- run: make ginkgo kind
+ run: make kind ginkgo setup-test-e2e
- name: Run helm e2e tests
- run: make helm-e2e
+ run: make fluentd_helm-e2e
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index c088d3677..4648412ee 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -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
diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml
index f0a9ba80b..8c3bcdb9f 100644
--- a/.github/workflows/test-e2e.yml
+++ b/.github/workflows/test-e2e.yml
@@ -16,12 +16,10 @@ jobs:
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: go.mod
+ cache-dependency-path: go.sum
- - name: Install the latest version of kind
- run: |
- curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64
- chmod +x ./kind
- sudo mv ./kind /usr/local/bin/kind
+ - name: Install dependences
+ run: make kind ginkgo setup-test-e2e
- name: Verify kind installation
run: kind version
diff --git a/Makefile b/Makefile
index 4dd968335..fcc2dadf9 100644
--- a/Makefile
+++ b/Makefile
@@ -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); export PATH="$$PWD/bin:$$PATH"; tests/scripts/$*_e2e.sh
.PHONY: lint
lint: golangci-lint ## Run golangci-lint linter
@@ -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; \
@@ -257,28 +274,8 @@ 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: $(KIND) ## Install kind locally if necessary.
$(KIND): $(LOCALBIN)
$(call go-install-tool,$(KIND),sigs.k8s.io/kind,$(KIND_VERSION))
@@ -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
diff --git a/VERSION b/VERSION
index c0c4025db..b9bc2fdcb 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-v3.5.0
+latest
\ No newline at end of file
diff --git a/apis/fluentd/v1alpha1/tests/expected/fluentd-namespaced-cfg-filter-output-selector.cfg b/apis/fluentd/v1alpha1/tests/expected/fluentd-namespaced-cfg-filter-output-selector.cfg
new file mode 100644
index 000000000..88fc7b0c1
--- /dev/null
+++ b/apis/fluentd/v1alpha1/tests/expected/fluentd-namespaced-cfg-filter-output-selector.cfg
@@ -0,0 +1,29 @@
+
+ @type forward
+ bind 0.0.0.0
+ port 24224
+
+
+ @id main
+ @type label_router
+
+ @label @5789d57841808bf91cfb0ed603d9ee86
+
+ namespaces fluent
+
+
+
+
diff --git a/apis/fluentd/v1alpha1/tests/expected/fluentd-namespaced-cfg-filter-selector.cfg b/apis/fluentd/v1alpha1/tests/expected/fluentd-namespaced-cfg-filter-selector.cfg
new file mode 100644
index 000000000..a07b41b8c
--- /dev/null
+++ b/apis/fluentd/v1alpha1/tests/expected/fluentd-namespaced-cfg-filter-selector.cfg
@@ -0,0 +1,29 @@
+
+ @type forward
+ bind 0.0.0.0
+ port 24224
+
+
+ @id main
+ @type label_router
+
+ @label @7d670e99fb44ef7d003c936b2c226ac3
+
+ namespaces fluent
+
+
+
+
diff --git a/tests/e2e/fluentd/cfgrender_suite_test.go b/tests/e2e/fluentd/cfgrender_suite_test.go
index 6f7619172..997cedf30 100644
--- a/tests/e2e/fluentd/cfgrender_suite_test.go
+++ b/tests/e2e/fluentd/cfgrender_suite_test.go
@@ -1,6 +1,7 @@
package fluentd
import (
+ "context"
"fmt"
"os"
"testing"
@@ -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"))
@@ -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")
diff --git a/tests/e2e/fluentd/label_selector_test.go b/tests/e2e/fluentd/label_selector_test.go
index ce12e4fc8..ca171b2d7 100644
--- a/tests/e2e/fluentd/label_selector_test.go
+++ b/tests/e2e/fluentd/label_selector_test.go
@@ -4,19 +4,23 @@ import (
"context"
"fmt"
"strings"
+ "sync"
"time"
+ fluentdv1alpha1 "github.com/fluent/fluent-operator/v3/apis/fluentd/v1alpha1"
+ cfgrender "github.com/fluent/fluent-operator/v3/apis/fluentd/v1alpha1/tests"
+ "github.com/fluent/fluent-operator/v3/tests/utils"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
- "sigs.k8s.io/yaml"
-
- fluentdv1alpha1 "github.com/fluent/fluent-operator/v3/apis/fluentd/v1alpha1"
)
var (
+ once sync.Once
+
// Fluentd instance for label selector tests
+ Fluentd fluentdv1alpha1.Fluentd
FluentdLabelSelectorRaw = `
apiVersion: fluentd.fluent.io/v1alpha1
kind: Fluentd
@@ -34,10 +38,11 @@ spec:
image: ghcr.io/fluent/fluent-operator/fluentd:v1.19.1
fluentdCfgSelector:
matchLabels:
- config.fluentd.fluent.io/enabled: "true"
+ label.config.fluentd.fluent.io/enabled: "true"
`
// FluentdConfig with filterSelector and outputSelector
+ FluentdConfig fluentdv1alpha1.FluentdConfig
FluentdConfigLabelSelectorRaw = `
apiVersion: fluentd.fluent.io/v1alpha1
kind: FluentdConfig
@@ -45,7 +50,7 @@ metadata:
name: fluentd-config-label-selector-test
namespace: fluent
labels:
- config.fluentd.fluent.io/enabled: "true"
+ label.config.fluentd.fluent.io/enabled: "true"
spec:
filterSelector:
matchLabels:
@@ -58,6 +63,7 @@ spec:
`
// Filter with matching labels
+ FluentdFilter fluentdv1alpha1.Filter
FilterLabelSelectorRaw = `
apiVersion: fluentd.fluent.io/v1alpha1
kind: Filter
@@ -78,6 +84,7 @@ spec:
`
// Output with matching labels
+ FluentdOutput fluentdv1alpha1.Output
OutputLabelSelectorRaw = `
apiVersion: fluentd.fluent.io/v1alpha1
kind: Output
@@ -93,6 +100,7 @@ spec:
`
// FluentdConfig with only filterSelector
+ FluentdConfigFilterOnly fluentdv1alpha1.FluentdConfig
FluentdConfigFilterOnlyRaw = `
apiVersion: fluentd.fluent.io/v1alpha1
kind: FluentdConfig
@@ -100,7 +108,7 @@ metadata:
name: fluentd-config-filter-only
namespace: fluent
labels:
- config.fluentd.fluent.io/enabled: "true"
+ label.config.fluentd.fluent.io/enabled: "true"
spec:
filterSelector:
matchLabels:
@@ -110,8 +118,9 @@ spec:
output.fluentd.fluent.io/enabled: "true"
`
- // Grep Filter
- FilterGrepRaw = `
+ // Grep Filter with matching labels
+ FluentdFilterGrep fluentdv1alpha1.Filter
+ FilterGrepRaw = `
apiVersion: fluentd.fluent.io/v1alpha1
kind: Filter
metadata:
@@ -128,6 +137,7 @@ spec:
`
// ClusterOutput for filter-only test
+ FluentdClusterOutput fluentdv1alpha1.ClusterOutput
ClusterOutputStdoutRaw = `
apiVersion: fluentd.fluent.io/v1alpha1
kind: ClusterOutput
@@ -141,6 +151,56 @@ spec:
`
)
+func init() {
+ once.Do(setupFluentdObjects)
+}
+
+func setupFluentdObjects() {
+ cfgrender.MustParseIntoObject(FluentdLabelSelectorRaw, &Fluentd)
+ cfgrender.MustParseIntoObject(FluentdConfigLabelSelectorRaw, &FluentdConfig)
+ cfgrender.MustParseIntoObject(FluentdConfigFilterOnlyRaw, &FluentdConfigFilterOnly)
+ cfgrender.MustParseIntoObject(FilterLabelSelectorRaw, &FluentdFilter)
+ cfgrender.MustParseIntoObject(OutputLabelSelectorRaw, &FluentdOutput)
+ cfgrender.MustParseIntoObject(FilterGrepRaw, &FluentdFilterGrep)
+ cfgrender.MustParseIntoObject(ClusterOutputStdoutRaw, &FluentdClusterOutput)
+}
+
+// Helper function to run a fluentd label selector test
+func testFluentdLabelSelector(
+ ctx context.Context,
+ expectedConfig []byte,
+ fluentd fluentdv1alpha1.Fluentd,
+ objects []client.Object,
+) {
+ // Create all objects
+ err := CreateObjs(ctx, objects)
+ Expect(err).NotTo(HaveOccurred())
+
+ // Ensure cleanup runs even if the test fails
+ DeferCleanup(func() {
+ // Clean up all objects
+ err := DeleteObjs(ctx, objects)
+ if err != nil {
+ // Log the error but don't fail the cleanup
+ fmt.Printf("Warning: failed to cleanup objects: %v\n", err)
+ }
+ })
+
+ // Wait for reconciliation
+ time.Sleep(time.Second * 3)
+
+ // Get the generated configuration
+ seckey := types.NamespacedName{
+ Namespace: fluentd.Namespace,
+ Name: fmt.Sprintf("%s-config", fluentd.Name),
+ }
+ config, err := GetCfgFromSecret(ctx, seckey)
+ Expect(err).NotTo(HaveOccurred())
+
+ // Verify that the configuration matches expected
+ Expect(strings.TrimRight(string(expectedConfig), "\r\n")).To(Equal(config))
+}
+
// This test verifies the fix for the bug where filterSelector and outputSelector
// were incorrectly writing to the inputs list instead of their respective lists.
var _ = Describe("Test FluentdConfig with namespace-level filter and output selectors", func() {
@@ -157,116 +217,31 @@ var _ = Describe("Test FluentdConfig with namespace-level filter and output sele
Describe("Test namespace-level resources with label selectors", func() {
It("E2E_FLUENTD_NAMESPACE_FILTER_OUTPUT_SELECTORS: FluentdConfig with filterSelector and outputSelector", func() {
-
- // Parse YAML into objects
- var fluentd fluentdv1alpha1.Fluentd
- err := yaml.Unmarshal([]byte(FluentdLabelSelectorRaw), &fluentd)
- Expect(err).NotTo(HaveOccurred())
-
- var fluentdConfig fluentdv1alpha1.FluentdConfig
- err = yaml.Unmarshal([]byte(FluentdConfigLabelSelectorRaw), &fluentdConfig)
- Expect(err).NotTo(HaveOccurred())
-
- var testFilter fluentdv1alpha1.Filter
- err = yaml.Unmarshal([]byte(FilterLabelSelectorRaw), &testFilter)
- Expect(err).NotTo(HaveOccurred())
-
- var testOutput fluentdv1alpha1.Output
- err = yaml.Unmarshal([]byte(OutputLabelSelectorRaw), &testOutput)
- Expect(err).NotTo(HaveOccurred())
-
- // Create all objects
- objects := []client.Object{
- &fluentd,
- &fluentdConfig,
- &testFilter,
- &testOutput,
- }
-
- err = CreateObjs(ctx, objects)
- Expect(err).NotTo(HaveOccurred())
-
- // Wait for reconciliation
- time.Sleep(time.Second * 3)
-
- // Get the generated configuration
- seckey := types.NamespacedName{
- Namespace: fluentd.Namespace,
- Name: fmt.Sprintf("%s-config", fluentd.Name),
- }
- config, err := GetCfgFromSecret(ctx, seckey)
- Expect(err).NotTo(HaveOccurred())
-
- // Verify that the filter configuration is present
- // Before the fix, the filter would not be loaded because it was written to the inputs list
- Expect(config).To(ContainSubstring("/dev/null
- ginkgo build -r e2e/fluentd/
+ "$GINKGO_BIN" build -r e2e/fluentd/
popd >/dev/null
}
# shellcheck disable=SC2329
function cleanup() {
- # shellcheck disable=SC2317
- pushd "$PROJECT_ROOT" >/dev/null
- # kubectl delete -f manifests/setup/setup.yaml
- # kubectl delete ns $LOGGING_NAMESPACE
- # shellcheck disable=SC2317
- kind delete cluster --name test
- # shellcheck disable=SC2317
- popd >/dev/null
- # shellcheck disable=SC2317
- exit 0
+ local exit_code=$?
+
+ if [ "${SKIP_CLEANUP:-false}" == "true" ]; then
+ echo "Skipping cleanup as requested."
+ exit "$exit_code"
+ fi
+
+ echo "Cleaning up…"
+ pushd "$PROJECT_ROOT" >/dev/null || true
+ make cleanup-test-e2e KIND_CLUSTER="$KIND_CLUSTER"
+ popd >/dev/null || true
}
function prepare_cluster() {
- kind create cluster --name test
- kubectl create ns $LOGGING_NAMESPACE
+ kubectl create ns "$LOGGING_NAMESPACE"
- echo "wait the control-plane ready..."
- kubectl wait --for=condition=Ready node/test-control-plane --timeout=60s
+ echo "wait the control-plane ready…"
+ kubectl wait --for=condition=Ready "node/${KIND_CLUSTER}-control-plane" --timeout=60s
}
function build_image() {
pushd "$PROJECT_ROOT" >/dev/null
- make build-op-amd64 -e "FO_IMG=kubesphere/fluent-operator:$IMAGE_TAG"
- kind load docker-image "kubesphere/fluent-operator:$IMAGE_TAG" --name test
+ make build-op-amd64 -e "FO_IMG=$IMAGE_NAME:$IMAGE_TAG"
+ kind load docker-image "$IMAGE_NAME:$IMAGE_TAG" --name "$KIND_CLUSTER"
popd >/dev/null
}
function start_fluent_operator() {
pushd "$PROJECT_ROOT" >/dev/null
- sed "s#kubesphere/fluent-operator:${VERSION}#kubesphere/fluent-operator:${IMAGE_TAG}#g" < manifests/setup/setup.yaml | kubectl apply -f -
- kubectl -n $LOGGING_NAMESPACE wait --for=condition=available deployment/fluent-operator --timeout=60s
+ sed "s#$IMAGE_NAME:${VERSION}#$IMAGE_NAME:$IMAGE_TAG#g" < manifests/setup/setup.yaml | kubectl create -f -
+ kubectl -n "$LOGGING_NAMESPACE" wait --for=condition=available deployment/fluent-operator --timeout=60s
popd >/dev/null
}
function run_test() {
- # inspired by github.com/kubeedge/kubeedge/tests/e2e/scripts/helm_keadm_e2e.sh
- :> /tmp/testcase.log
- "$E2E_DIR/e2e/fluentd/fluentd.test" "$debugflag" 2>&1 | tee -a /tmp/testcase.log
-
- grep -e "Running Suite" -e "SUCCESS\!" -e "FAIL\!" /tmp/testcase.log | sed -r 's/\x1B\[([0-9];)?([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g' | sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g'
- echo "Integration Test Final Summary Report"
- echo "======================================================="
- echo "Total Number of Test cases = $(grep "Ran " /tmp/testcase.log | awk '{sum+=$2} END {print sum}')"
- passed=$(grep -e "SUCCESS\!" -e "FAIL\!" /tmp/testcase.log | awk '{print $3}' | sed -r "s/\x1B\[([0-9];)?([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | awk '{sum+=$1} END {print sum}')
- echo "Number of Test cases PASSED = $passed"
- fail=$(grep -e "SUCCESS\!" -e "FAIL\!" /tmp/testcase.log | awk '{print $6}' | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | awk '{sum+=$1} END {print sum}')
- echo "Number of Test cases FAILED = $fail"
- echo "==================Result Summary======================="
-
- if [ "$fail" != "0" ];then
+ export ACK_GINKGO_RC=true
+ if ! "$GINKGO_BIN" -v "$E2E_DIR/e2e/fluentd/fluentd.test" -- "$debugflag"; then
echo "Integration suite has failures, Please check !!"
exit 1
else
@@ -74,20 +74,23 @@ function run_test() {
fi
}
-set -Ee
-trap cleanup EXIT ERR
+function main() {
+ trap cleanup EXIT
-echo -e "\nBuilding testcases..."
-build_ginkgo_test
+ echo -e "\nBuilding testcases…"
+ build_ginkgo_test
-echo -e "\nPreparing cluster..."
-prepare_cluster
+ echo -e "\nPreparing cluster…"
+ prepare_cluster
-echo -e "\nBuilding image..."
-build_image
+ echo -e "\nBuilding image…"
+ build_image
-echo -e "\nStart fluent operator..."
-start_fluent_operator
+ echo -e "\nStart fluent operator…"
+ start_fluent_operator
+
+ echo -e "\nRunning test…"
+ run_test
+}
-echo -e "\nRunning test..."
-run_test
+main "$@"
diff --git a/tests/scripts/fluentd_helm_e2e.sh b/tests/scripts/fluentd_helm_e2e.sh
index 08455584c..ff5d5f4b0 100755
--- a/tests/scripts/fluentd_helm_e2e.sh
+++ b/tests/scripts/fluentd_helm_e2e.sh
@@ -6,6 +6,7 @@ PROJECT_ROOT=$PWD
E2E_DIR=$(realpath "$(dirname "$0")/..")
LOGGING_NAMESPACE=fluent
IMAGE_TAG=$(date "+%Y-%m-%d-%H-%M-%S")
+KIND_CLUSTER="${KIND_CLUSTER:-fluent-operator-test-e2e}"
function build_ginkgo_test() {
ginkgo build -r e2e/fluentd/
@@ -18,7 +19,7 @@ function cleanup() {
# helm uninstall fluent-operator -n $LOGGING_NAMESPACE
# kubectl delete ns $LOGGING_NAMESPACE
# shellcheck disable=SC2317
- kind delete cluster --name test-helm
+ kind delete cluster --name "$KIND_CLUSTER"
# shellcheck disable=SC2317
popd >/dev/null
# shellcheck disable=SC2317
@@ -26,22 +27,22 @@ function cleanup() {
}
function prepare_cluster() {
- kind create cluster --name test-helm
kubectl create ns $LOGGING_NAMESPACE
- echo "wait the control-plane ready..."
- kubectl wait --for=condition=Ready node/test-helm-control-plane --timeout=60s
+ echo "wait the control-plane ready…"
+ kubectl wait --for=condition=Ready "node/${KIND_CLUSTER}-control-plane" --timeout=60s
}
function build_image() {
pushd "$PROJECT_ROOT" >/dev/null
make build-op-amd64 -e "FO_IMG=kubesphere/fluent-operator:$IMAGE_TAG"
- kind load docker-image "kubesphere/fluent-operator:$IMAGE_TAG" --name test-helm
+ kind load docker-image "kubesphere/fluent-operator:$IMAGE_TAG" --name "$KIND_CLUSTER"
popd >/dev/null
}
function start_fluent_operator() {
pushd "$PROJECT_ROOT" >/dev/null
+ helm dependency build charts/fluent-operator/
helm install --wait --timeout 30s fluent-operator --create-namespace -n $LOGGING_NAMESPACE charts/fluent-operator/ --set "operator.container.tag=$IMAGE_TAG"
kubectl -n $LOGGING_NAMESPACE wait --for=condition=available deployment/fluent-operator --timeout=60s
popd >/dev/null
@@ -74,19 +75,19 @@ function run_test() {
set -Ee
trap cleanup EXIT ERR
-echo -e "\nBuilding testcases..."
+echo -e "\nBuilding testcases…"
pushd "$E2E_DIR" >/dev/null
build_ginkgo_test
popd >/dev/null
-echo -e "\nPreparing cluster..."
+echo -e "\nPreparing cluster…"
prepare_cluster
-echo -e "\nBuilding image..."
+echo -e "\nBuilding image…"
build_image
-echo -e "\nStart fluent operator..."
+echo -e "\nStart fluent operator…"
start_fluent_operator
-echo -e "\nRunning test..."
+echo -e "\nRunning test…"
run_test
diff --git a/tests/utils/utils.go b/tests/utils/utils.go
index 451231705..8b9a0f026 100644
--- a/tests/utils/utils.go
+++ b/tests/utils/utils.go
@@ -9,14 +9,16 @@ import (
var (
once sync.Once
- ExpectedFluentdClusterCfgOutputES []byte
- ExpectedFluentdClusterCfgOutputKafka []byte
- ExpectedFluentdClusterCfgOutputWithBuffer []byte
- ExpectedFluentdMixedCfgsMultiTenant []byte
- ExpectedFluentdMixedCfgsOutputES []byte
- ExpectedFluentdNamespacedCfgOutputES []byte
- ExpectedDuplicateRemovalCRSPECS []byte
- ExpectedFluentdClusterCfgOutputCustom []byte
+ ExpectedFluentdClusterCfgOutputES []byte
+ ExpectedFluentdClusterCfgOutputKafka []byte
+ ExpectedFluentdClusterCfgOutputWithBuffer []byte
+ ExpectedFluentdMixedCfgsMultiTenant []byte
+ ExpectedFluentdMixedCfgsOutputES []byte
+ ExpectedFluentdNamespacedCfgOutputES []byte
+ ExpectedDuplicateRemovalCRSPECS []byte
+ ExpectedFluentdClusterCfgOutputCustom []byte
+ ExpectedFluentdNamespacedCfgFilterOutputSelector []byte
+ ExpectedFluentdNamespacedCfgFilterSelector []byte
)
func init() {
@@ -37,6 +39,10 @@ func init() {
getExpectedCfg("./apis/fluentd/v1alpha1/tests/expected/duplicate-removal-cr-specs.cfg")
ExpectedFluentdClusterCfgOutputCustom =
getExpectedCfg("./apis/fluentd/v1alpha1/tests/expected/fluentd-cluster-cfg-output-custom.cfg")
+ ExpectedFluentdNamespacedCfgFilterOutputSelector =
+ getExpectedCfg("./apis/fluentd/v1alpha1/tests/expected/fluentd-namespaced-cfg-filter-output-selector.cfg")
+ ExpectedFluentdNamespacedCfgFilterSelector =
+ getExpectedCfg("./apis/fluentd/v1alpha1/tests/expected/fluentd-namespaced-cfg-filter-selector.cfg")
})
}