mirror of
https://gitlab.com/arm-research/smarter/smarter-device-manager.git
synced 2025-04-06 23:09:03 +00:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
fe5dca8f1c | ||
|
07f4b88b53 | ||
|
d65b7208db | ||
|
fe9b26d283 | ||
|
e20fb9b58f |
@ -10,15 +10,13 @@ COPY . .
|
|||||||
|
|
||||||
RUN echo $PATH;export CGO_LDFLAGS_ALLOW='-Wl,--unresolved-symbols=ignore-in-object-files' && \
|
RUN echo $PATH;export CGO_LDFLAGS_ALLOW='-Wl,--unresolved-symbols=ignore-in-object-files' && \
|
||||||
go mod init arm.com/smarter-device-management && go mod tidy && go mod vendor && \
|
go mod init arm.com/smarter-device-management && go mod tidy && go mod vendor && \
|
||||||
go build -ldflags="-s -w" .
|
CGO_ENABLED=0 go build -ldflags='-s -w -extldflags="-static"' .
|
||||||
|
|
||||||
FROM alpine
|
FROM scratch
|
||||||
|
|
||||||
RUN apk update && apk upgrade
|
|
||||||
|
|
||||||
WORKDIR /root
|
WORKDIR /root
|
||||||
|
|
||||||
COPY conf.yaml /root/config/conf.yaml
|
COPY conf.yaml /root/config/conf.yaml
|
||||||
COPY --from=build /arm.com/smarter-device-management/smarter-device-management /usr/bin/smarter-device-management
|
COPY --from=build /arm.com/smarter-device-management/smarter-device-management /usr/bin/smarter-device-management
|
||||||
|
|
||||||
CMD ["smarter-device-management","-logtostderr=true","-v=0"]
|
CMD ["/usr/bin/smarter-device-management","-logtostderr=true","-v=0"]
|
||||||
|
17
main.go
17
main.go
@ -93,7 +93,22 @@ func readDevDirectory(dirToList string, allowedRecursions uint8) (files []string
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sanitizeName(path string) string {
|
func sanitizeName(path string) string {
|
||||||
return strings.Replace(path, "/", "_" ,-1)
|
sanitizeChar := func(r rune) rune {
|
||||||
|
switch {
|
||||||
|
case r >= 'A' && r <= 'Z':
|
||||||
|
return r
|
||||||
|
case r >= 'a' && r <= 'z':
|
||||||
|
return r
|
||||||
|
case r >= '0' && r <= '9':
|
||||||
|
return r
|
||||||
|
case r == '_':
|
||||||
|
return r
|
||||||
|
case r == '-':
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
return '_'
|
||||||
|
}
|
||||||
|
return strings.Map(sanitizeChar, path)
|
||||||
}
|
}
|
||||||
|
|
||||||
func findDevicesPattern(listDevices []string, pattern string) ([]string,error) {
|
func findDevicesPattern(listDevices []string, pattern string) ([]string,error) {
|
||||||
|
@ -15,7 +15,7 @@ spec:
|
|||||||
nodeName: smarter-jetson-xavier-4bcc2584
|
nodeName: smarter-jetson-xavier-4bcc2584
|
||||||
containers:
|
containers:
|
||||||
- name: smarter-device-manager
|
- name: smarter-device-manager
|
||||||
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.7
|
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.11
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
@ -15,7 +15,7 @@ spec:
|
|||||||
nodeName: <replace with node to run>
|
nodeName: <replace with node to run>
|
||||||
containers:
|
containers:
|
||||||
- name: smarter-device-manager
|
- name: smarter-device-manager
|
||||||
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.7
|
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.11
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
@ -15,7 +15,7 @@ spec:
|
|||||||
nodeName: <replace with node to run>
|
nodeName: <replace with node to run>
|
||||||
containers:
|
containers:
|
||||||
- name: smarter-device-manager
|
- name: smarter-device-manager
|
||||||
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.7
|
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.11
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
@ -34,7 +34,7 @@ spec:
|
|||||||
dnsPolicy: ClusterFirstWithHostNet
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
containers:
|
containers:
|
||||||
- name: smarter-device-manager
|
- name: smarter-device-manager
|
||||||
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.7
|
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.11
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
@ -34,7 +34,7 @@ spec:
|
|||||||
dnsPolicy: ClusterFirstWithHostNet
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
containers:
|
containers:
|
||||||
- name: smarter-device-manager
|
- name: smarter-device-manager
|
||||||
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.7
|
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.11
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
@ -34,7 +34,7 @@ spec:
|
|||||||
dnsPolicy: ClusterFirstWithHostNet
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
containers:
|
containers:
|
||||||
- name: smarter-device-manager
|
- name: smarter-device-manager
|
||||||
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.7
|
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.11
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
@ -34,7 +34,7 @@ spec:
|
|||||||
dnsPolicy: ClusterFirstWithHostNet
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
containers:
|
containers:
|
||||||
- name: smarter-device-manager
|
- name: smarter-device-manager
|
||||||
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.7
|
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.11
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
@ -34,7 +34,7 @@ spec:
|
|||||||
dnsPolicy: ClusterFirstWithHostNet
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
containers:
|
containers:
|
||||||
- name: smarter-device-manager
|
- name: smarter-device-manager
|
||||||
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.7
|
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.11
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
@ -34,7 +34,7 @@ spec:
|
|||||||
dnsPolicy: ClusterFirstWithHostNet
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
containers:
|
containers:
|
||||||
- name: smarter-device-manager
|
- name: smarter-device-manager
|
||||||
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.7
|
image: registry.gitlab.com/arm-research/smarter/smarter-device-manager:v1.20.11
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user