Details
-
Bug
-
Resolution: Done
-
Blocker
-
Logging 5.6.0
-
False
-
None
-
False
-
NEW
-
Impediment
-
VERIFIED
-
Log Collection - Sprint 227, Log Collection - Sprint 228
Description
Description of problem:
Cluster-logging-operator panic when forword to splunk via ClientAuth with password.panic: template: generate:2: function "p" not defined
Version-Release number of selected component (if applicable):
openshift-logging/cluster-logging-rhel8-operator/images/v5.6.0-45
https://github.com/openshift/cluster-logging-operator/commit/195773756243dc5140de48bf8a15a1892e4b9add
How reproducible:
always
Steps to Reproduce:
1.Create to_splunk secret
oc n openshift-logging create secret generic to-splunk-secret --from-file=hecToken=hec_token --from-file=ca-bundle.crt=ca/ca_bundle.crt --from-file=tls.crt=collector_cert/collector.crt from-file=tls.key=collector_cert/collector.key -from-literal=passphrase=aosqe2021
2.
Create ClusterLogForwarder instance
apiVersion: logging.openshift.io/v1
kind: ClusterLogForwarder
metadata:
name: instance
namespace: openshift-logging
spec:
outputs:
- name: splunk-aosqe
type: splunk
secret:
name: to-splunk-secret
url: https://splunk-default-service.splunk-aosqe.svc:8088
pipelines:
- name: simple-test
inputRefs:
- application
outputRefs:
- splunk-aosqe
3. create clusterlogging instance
apiVersion: "logging.openshift.io/v1"
kind: "ClusterLogging"
metadata:
name: "instance"
namespace: openshift-logging
spec:
managementState: "Managed"
collection:
type: "vector"
Actual results:
oc logs cluster-logging-operator-5f6646b5cc-6mcg9 -f
{"_ts":"2022-11-17T03:24:14.296425623Z","_level":"0","_component":"cluster-logging-operator","_message":"starting up...","go_arch":"amd64","go_os":"linux","go_version":"go1.17.12","operator_version":"5.6"}I1117 03:24:15.347661 1 request.go:665] Waited for 1.04146771s due to client-side throttling, not priority and fairness, request: GET:https://172.30.0.1:443/apis/security.internal.openshift.io/v1?timeout=32s
{"_ts":"2022-11-17T03:24:16.75499343Z","_level":"0","_component":"cluster-logging-operator","_message":"migrating resources provided by the manifest"} {"_ts":"2022-11-17T03:24:16.758130822Z","_level":"0","_component":"cluster-logging-operator","_message":"Registering Components."}{"_ts":"2022-11-17T03:24:16.758299219Z","_level":"0","_component":"cluster-logging-operator","_message":"Starting the Cmd."}
panic: template: generate:2: function "p" not defined
goroutine 432 [running]:
text/template.Must(...)
/usr/lib/golang/src/text/template/helper.go:25
github.com/openshift/cluster-logging-operator/internal/generator.Generator.generate(0x0, {0xc0005a0100, 0xe, 0x5b})
/remote-source/cluster-logging-operator/app/internal/generator/generator.go:83 +0x671
github.com/openshift/cluster-logging-operator/internal/generator.Generator.GenerateConf(0xc0005cc8f0, {0xc0005a0100, 0x0, 0xc000624450})
/remote-source/cluster-logging-operator/app/internal/generator/generator.go:47 +0x1e
github.com/openshift/cluster-logging-operator/internal/generator/forwarder.(*ConfigGenerator).GenerateConf(0xc0002f89d8, 0x6, 0x181d6f0, 0xc0000d8310, {0xc000624450, 0x0}, 0xc00078c7c0)
/remote-source/cluster-logging-operator/app/internal/generator/forwarder/generator.go:56 +0x58
github.com/openshift/cluster-logging-operator/internal/k8shandler.(*ClusterLoggingRequest).generateCollectorConfig(0xc0000d82c0)
/remote-source/cluster-logging-operator/app/internal/k8shandler/forwarding.go:116 +0x51b
github.com/openshift/cluster-logging-operator/internal/k8shandler.(*ClusterLoggingRequest).CreateOrUpdateCollection(0xc0000d82c0)
/remote-source/cluster-logging-operator/app/internal/k8shandler/collection.go:74 +0x65a
github.com/openshift/cluster-logging-operator/internal/k8shandler.Reconcile(0xc00000c5a0, {0x1a84ff8, 0xc00038b130}, {0x7fd9a790b280, 0xc000390850}, {0x1a4f0f8, 0xc000051780}, {0xc0001b2600, 0x24})
/remote-source/cluster-logging-operator/app/internal/k8shandler/reconciler.go:107 +0x80c
github.com/openshift/cluster-logging-operator/controllers/clusterlogging.(*ReconcileClusterLogging).Reconcile(0xc00038a1e0, {0x1a55218, 0xc0008cf020}, {0xc000624450, 0x1733ba0}, {0xc000393758, 0x30})
/remote-source/cluster-logging-operator/app/controllers/clusterlogging/clusterlogging_controller.go:87 +0x3b8
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0xc0000d9080, {0x1a55218, 0xc0008ceff0}, {0xc000624450, 0x1733ba0}, {0xc000393758, 0x419f54})
/remote-source/cluster-logging-operator/deps/gomod/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.0/pkg/internal/controller/controller.go:114 +0x26f
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0000d9080, {0x1a55170, 0xc0006962c0}, {0x1675480, 0xc0001d8400})
/remote-source/cluster-logging-operator/deps/gomod/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.0/pkg/internal/controller/controller.go:311 +0x33e
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0000d9080, {0x1a55170, 0xc0006962c0})
/remote-source/cluster-logging-operator/deps/gomod/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.0/pkg/internal/controller/controller.go:266 +0x205
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
/remote-source/cluster-logging-operator/deps/gomod/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.0/pkg/internal/controller/controller.go:227 +0x85
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2
/remote-source/cluster-logging-operator/deps/gomod/pkg/mod/sigs.k8s.io/controller-runtime@v0.11.0/pkg/internal/controller/controller.go:223 +0x357