Skip to content

Commit

Permalink
Merge pull request #25 from castai/CSU-2454
Browse files Browse the repository at this point in the history
CSU-2454: Make getting k8sVersion optional
  • Loading branch information
krystiancastai authored Nov 27, 2024
2 parents 18fba61 + 4555837 commit 1a129ee
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func main() {

k8sVersion, err := version.Get(log, clientset)
if err != nil {
log.Fatalf("failed getting kubernetes version: %v", err)
log.Warnf("failed getting kubernetes version: %v", err)
}

handlerVersion := &version.HandlerVersion{
Expand All @@ -52,8 +52,16 @@ func main() {
}

log = logger.WithFields(logrus.Fields{
"version": handlerVersion,
"k8s_version": k8sVersion.Full(),
"version": handlerVersion,
})

k8sVersionField := "unknown"
if k8sVersion != nil {
k8sVersionField = k8sVersion.Full()
}

log = log.WithFields(logrus.Fields{
"k8s_version": k8sVersionField,
})

interruptChecker, err := buildInterruptChecker(cfg.Provider)
Expand Down

0 comments on commit 1a129ee

Please sign in to comment.