test: set lower logLevel in e2e test

update chart file
This commit is contained in:
andyzhangx 2021-02-11 01:47:51 +00:00
parent 17fe20dd80
commit 1c97d2cce4
8 changed files with 14 additions and 6 deletions

View File

@ -115,6 +115,8 @@ e2e-bootstrap: install-helm
--set image.nfs.repository=$(REGISTRY)/$(IMAGENAME) \ --set image.nfs.repository=$(REGISTRY)/$(IMAGENAME) \
--set image.nfs.tag=$(IMAGE_VERSION) \ --set image.nfs.tag=$(IMAGE_VERSION) \
--set image.nfs.pullPolicy=Always --set image.nfs.pullPolicy=Always
--set controller.logLevel=8
--set node.logLevel=8
.PHONY: e2e-teardown .PHONY: e2e-teardown
e2e-teardown: e2e-teardown:

View File

@ -47,6 +47,8 @@ The following table lists the configurable parameters of the latest NFS CSI Driv
| `rbac.create` | whether create rbac of csi-nfs-controller | true | | `rbac.create` | whether create rbac of csi-nfs-controller | true |
| `controller.replicas` | the replicas of csi-nfs-controller | 2 | | `controller.replicas` | the replicas of csi-nfs-controller | 2 |
| `controller.runOnMaster` | run controller on master node | false | | `controller.runOnMaster` | run controller on master node | false |
| `controller.logLevel` | controller driver log level |`5` |
| `node.logLevel` | node driver log level |`5` |
## troubleshooting ## troubleshooting
- Add `--wait -v=5 --debug` in `helm install` command to get detailed error - Add `--wait -v=5 --debug` in `helm install` command to get detailed error

View File

@ -75,7 +75,7 @@ spec:
allowPrivilegeEscalation: true allowPrivilegeEscalation: true
imagePullPolicy: {{ .Values.image.nfs.pullPolicy }} imagePullPolicy: {{ .Values.image.nfs.pullPolicy }}
args: args:
- "-v=5" - "--v={{ .Values.controller.logLevel }}"
- "--nodeid=$(NODE_ID)" - "--nodeid=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)" - "--endpoint=$(CSI_ENDPOINT)"
env: env:

View File

@ -67,7 +67,7 @@ spec:
allowPrivilegeEscalation: true allowPrivilegeEscalation: true
image: "{{ .Values.image.nfs.repository }}:{{ .Values.image.nfs.tag }}" image: "{{ .Values.image.nfs.repository }}:{{ .Values.image.nfs.tag }}"
args : args :
- "-v=5" - "--v={{ .Values.node.logLevel }}"
- "--nodeid=$(NODE_ID)" - "--nodeid=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)" - "--endpoint=$(CSI_ENDPOINT)"
env: env:

View File

@ -22,3 +22,7 @@ rbac:
controller: controller:
replicas: 2 replicas: 2
runOnMaster: false runOnMaster: false
logLevel: 5
node:
logLevel: 5

View File

@ -74,7 +74,7 @@ func getLogLevel(method string) int32 {
if method == "/csi.v1.Identity/Probe" || if method == "/csi.v1.Identity/Probe" ||
method == "/csi.v1.Node/NodeGetCapabilities" || method == "/csi.v1.Node/NodeGetCapabilities" ||
method == "/csi.v1.Node/NodeGetVolumeStats" { method == "/csi.v1.Node/NodeGetVolumeStats" {
return 10 return 8
} }
return 2 return 2
} }

View File

@ -91,15 +91,15 @@ func TestGetLogLevel(t *testing.T) {
}{ }{
{ {
method: "/csi.v1.Identity/Probe", method: "/csi.v1.Identity/Probe",
level: 10, level: 8,
}, },
{ {
method: "/csi.v1.Node/NodeGetCapabilities", method: "/csi.v1.Node/NodeGetCapabilities",
level: 10, level: 8,
}, },
{ {
method: "/csi.v1.Node/NodeGetVolumeStats", method: "/csi.v1.Node/NodeGetVolumeStats",
level: 10, level: 8,
}, },
{ {
method: "", method: "",