mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-12-25 01:07:45 +00:00
Use non-default directory for pod logs and limit path to ASCII characters
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"time"
|
||||
"unicode"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
||||
@@ -300,5 +301,13 @@ func ValidateKubeletConfiguration(kc *kubeletconfig.KubeletConfiguration, featur
|
||||
allErrors = append(allErrors, fmt.Errorf("invalid configuration: pod logs path %q must be normalized", kc.PodLogsDir))
|
||||
}
|
||||
|
||||
// Since pod logs path is used in metrics, make sure it contains only ASCII characters.
|
||||
for _, c := range kc.PodLogsDir {
|
||||
if c > unicode.MaxASCII {
|
||||
allErrors = append(allErrors, fmt.Errorf("invalid configuration: pod logs path %q mut contains ASCII characters only", kc.PodLogsDir))
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return utilerrors.NewAggregate(allErrors)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user