Fix opening /dev/<files> to see if it is a directory (dangerous and it can take too long)

This commit is contained in:
Alexandre Ferreira 2021-05-18 14:45:08 -05:00
parent 1d718e57be
commit a6c2189a98
10 changed files with 18 additions and 9 deletions

View File

@ -58,6 +58,15 @@ func init() {
func readDevDirectory(dirToList string) (files []string, err error) {
var foundFiles []string
fType, err := os.Stat(dirToList)
if err != nil {
return nil, err
}
if !fType.IsDir() {
return nil, nil
}
f, err := os.Open(dirToList)
if err != nil {
return nil, err

View File

@ -15,7 +15,7 @@ spec:
nodeName: smarter-jetson-xavier-4bcc2584
containers:
- name: smarter-device-manager
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.5
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.6
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false

View File

@ -15,7 +15,7 @@ spec:
nodeName: <replace with node to run>
containers:
- name: smarter-device-manager
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.5
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.6
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false

View File

@ -15,7 +15,7 @@ spec:
nodeName: <replace with node to run>
containers:
- name: smarter-device-manager
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.5
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.6
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false

View File

@ -34,7 +34,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: smarter-device-manager
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.5
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.6
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false

View File

@ -34,7 +34,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: smarter-device-manager
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.5
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.6
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false

View File

@ -34,7 +34,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: smarter-device-manager
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.5
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.6
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false

View File

@ -34,7 +34,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: smarter-device-manager
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.5
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.6
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false

View File

@ -34,7 +34,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: smarter-device-manager
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.5
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.6
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false

View File

@ -34,7 +34,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: smarter-device-manager
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.5
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.6
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false