You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kuberhealthy cannot parse the configmap when jobCleanupDuration option is defined because it cannot unmarshal string into Go struct field Config.JobCleanupDuration of type time.Duration
time="2021-02-25T05:12:29Z" level=info msg="WARNING: Failed to read configuration file from disk: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go struct field Config.JobCleanupDuration of type time.Duration"
Steps To Reproduce
Start kuberhealthy with the following associated configmap
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kuberhealthy
namespace: test
data:
kuberhealthy.yaml: |-
listenAddress: ":8080" # The port for kuberhealthy to listen on for web requests
enableForceMaster: false # Set to true to enable local testing, forced master mode
logLevel: "debug" # Log level to be used
listenNamespace: "test" # Kuberhealthy will only monitor khcheck resources from this namespace
jobCleanupDuration: 3m # The maximum age of khjobs before being reaped
maxCheckPods: 1 # The maximum number of check pods in Completed state before being reaped
Check the logs and you'll see a warning like
time="2021-02-25T05:12:29Z" level=info msg="WARNING: Failed to read configuration file from disk: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go struct field Config.JobCleanupDuration of type time.Duration"
Try to adjust jobCleanupDuration value in configmap
Check kuberhealthy logs and you'll see
time="2021-02-25T10:07:35Z" level=debug msg="configReloader: configuration file hash has changed to: 1807f3c6108d085b5b5b6b2a87294b16"
time="2021-02-25T10:07:41Z" level=error msg="configReloader: Error reloading config: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go struct field Config.JobCleanupDuration of type time.Duration"
Expected behavior
No warnings/errors during starting or configmap changes
Versions
Cluster OS: Flatcar
Kubernetes Version: 1.18.14
Kuberhealthy Release: v2.4.0
The text was updated successfully, but these errors were encountered:
This is really strange considering that the helm chart defaults to 15m in the values.yaml... We will need to reproduce this one and figure out what the difference is
@joshulyne and I looked into this and it looks like the root cause of the failed time.Duration parsing is due to the package used here. I am going to open a new PR for this one here soon. Reopening.
Describe the bug
Kuberhealthy cannot parse the configmap when
jobCleanupDuration
option is defined because it cannot unmarshal string into Go struct fieldConfig.JobCleanupDuration
of typetime.Duration
Steps To Reproduce
jobCleanupDuration
value in configmapExpected behavior
No warnings/errors during starting or configmap changes
Versions
The text was updated successfully, but these errors were encountered: