From a3dcf0dffa1ebd5067b1c7985a75c401624f2c19 Mon Sep 17 00:00:00 2001 From: Chris Hirsch Date: Wed, 15 Jul 2020 13:25:52 -0600 Subject: [PATCH] Added storage class name to a timeout error on creating storage --- cmd/storage-check/run_check.go | 12 +++++++++--- go.mod | 6 ------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/storage-check/run_check.go b/cmd/storage-check/run_check.go index f6dd65a..444d459 100644 --- a/cmd/storage-check/run_check.go +++ b/cmd/storage-check/run_check.go @@ -87,7 +87,13 @@ func runStorageCheck() { case <-ctx.Done(): // If there is a cancellation interrupt signal. log.Infoln("Cancelling storage creation job and shutting down due to interrupt.") - reportErrorsToKuberhealthy([]string{"failed to create storage within timeout. Permissions?"}) + errorString := "failed to create storage PVC/PV within timeout (got interrupt). storageConfig=" + if storageConfig.Spec.StorageClassName != nil { + errorString += *storageConfig.Spec.StorageClassName + } else { + errorString += "default" + } + reportErrorsToKuberhealthy([]string{errorString}) return case <-runTimeout: // If creating a storage took too long, exit. @@ -116,7 +122,7 @@ func runStorageCheck() { log.Infoln("Initialized storage in", initStorageResult.Pod.Namespace, "namespace:", initStorageResult.Pod.Name) case <-ctx.Done(): // If there is a cancellation interrupt signal. - log.Infoln("Cancelling init storage job and shutting down due to interrupt.") + log.Infoln("Cancelling init storage job and shutting down due to interrupt. err:" + ctx.Err().Error()) reportErrorsToKuberhealthy([]string{"failed to initialize storage storage within timeout"}) return case <-runTimeout: @@ -130,7 +136,7 @@ func runStorageCheck() { // TODO Can almost certainly combine this into a function for allowed and ignore log.Infof("CHECK_STORAGE_ALLOWED_CHECK_NODES=%+v", allowedCheckNodesEnv) if allowedCheckNodesEnv != "" { - log.Infof("Requsted explicit nodes to perform storage check. Will NOT do discovery %+v", allowedCheckNodesEnv) + log.Infof("Requested explicit nodes to perform storage check. Will NOT do discovery %+v", allowedCheckNodesEnv) delimiter := " " // Support , or space separated strings if strings.Contains(allowedCheckNodesEnv, ",") { diff --git a/go.mod b/go.mod index 71f7997..e61ce73 100644 --- a/go.mod +++ b/go.mod @@ -8,17 +8,11 @@ replace github.com/Sirupsen/logrus => github.com/sirupsen/logrus v1.3.0 require ( github.com/Comcast/kuberhealthy/v2 v2.2.0 - github.com/aws/aws-sdk-go v1.25.24 - github.com/ghodss/yaml v1.0.0 - github.com/google/uuid v1.1.1 - github.com/influxdata/influxdb1-client v0.0.0-20190402204710-8ff2fc3824fc github.com/kr/pretty v0.1.0 // indirect - github.com/pkg/errors v0.8.1 github.com/sirupsen/logrus v1.4.0 github.com/spf13/pflag v1.0.3 // indirect golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9 // indirect gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect - gopkg.in/yaml.v2 v2.2.8 k8s.io/api v0.0.0-20190819141258-3544db3b9e44 k8s.io/apimachinery v0.0.0-20190817020851-f2f3a405f61d k8s.io/client-go v0.0.0-20190819141724-e14f31a72a77