Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added storage class name to a timeout error on creating storage #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions cmd/storage-check/run_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand All @@ -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, ",") {
Expand Down
6 changes: 0 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down