Skip to content

Commit d1f341b

Browse files
authored
host system packages collector/analyzer (#506)
* host system packages collector/analyzer
1 parent 1861806 commit d1f341b

20 files changed

+1069
-4
lines changed

.github/workflows/build-test-deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
on:
22
pull_request:
33
branches:
4-
- master
4+
- main
55
push:
66
branches:
7-
- "master"
7+
- "main"
88
tags:
99
- "v*.*.*"
1010

config/crds/troubleshoot.sh_hostcollectors.yaml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,49 @@ spec:
548548
required:
549549
- outcomes
550550
type: object
551+
systemPackages:
552+
properties:
553+
checkName:
554+
type: string
555+
collectorName:
556+
type: string
557+
exclude:
558+
type: BoolString
559+
outcomes:
560+
items:
561+
properties:
562+
fail:
563+
properties:
564+
message:
565+
type: string
566+
uri:
567+
type: string
568+
when:
569+
type: string
570+
type: object
571+
pass:
572+
properties:
573+
message:
574+
type: string
575+
uri:
576+
type: string
577+
when:
578+
type: string
579+
type: object
580+
warn:
581+
properties:
582+
message:
583+
type: string
584+
uri:
585+
type: string
586+
when:
587+
type: string
588+
type: object
589+
type: object
590+
type: array
591+
required:
592+
- outcomes
593+
type: object
551594
tcpConnect:
552595
properties:
553596
checkName:
@@ -951,6 +994,89 @@ spec:
951994
exclude:
952995
type: BoolString
953996
type: object
997+
systemPackages:
998+
properties:
999+
amzn:
1000+
items:
1001+
type: string
1002+
type: array
1003+
amzn2:
1004+
items:
1005+
type: string
1006+
type: array
1007+
centos:
1008+
items:
1009+
type: string
1010+
type: array
1011+
centos7:
1012+
items:
1013+
type: string
1014+
type: array
1015+
centos8:
1016+
items:
1017+
type: string
1018+
type: array
1019+
collectorName:
1020+
type: string
1021+
exclude:
1022+
type: BoolString
1023+
ol:
1024+
items:
1025+
type: string
1026+
type: array
1027+
ol7:
1028+
items:
1029+
type: string
1030+
type: array
1031+
ol8:
1032+
items:
1033+
type: string
1034+
type: array
1035+
rhel:
1036+
items:
1037+
type: string
1038+
type: array
1039+
rhel7:
1040+
items:
1041+
type: string
1042+
type: array
1043+
rhel8:
1044+
items:
1045+
type: string
1046+
type: array
1047+
ubuntu:
1048+
items:
1049+
type: string
1050+
type: array
1051+
ubuntu16:
1052+
items:
1053+
type: string
1054+
type: array
1055+
ubuntu18:
1056+
items:
1057+
type: string
1058+
type: array
1059+
ubuntu20:
1060+
items:
1061+
type: string
1062+
type: array
1063+
required:
1064+
- amzn
1065+
- amzn2
1066+
- centos
1067+
- centos7
1068+
- centos8
1069+
- ol
1070+
- ol7
1071+
- ol8
1072+
- rhel
1073+
- rhel7
1074+
- rhel8
1075+
- ubuntu
1076+
- ubuntu16
1077+
- ubuntu18
1078+
- ubuntu20
1079+
type: object
9541080
tcpConnect:
9551081
properties:
9561082
address:

config/crds/troubleshoot.sh_hostpreflights.yaml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,49 @@ spec:
548548
required:
549549
- outcomes
550550
type: object
551+
systemPackages:
552+
properties:
553+
checkName:
554+
type: string
555+
collectorName:
556+
type: string
557+
exclude:
558+
type: BoolString
559+
outcomes:
560+
items:
561+
properties:
562+
fail:
563+
properties:
564+
message:
565+
type: string
566+
uri:
567+
type: string
568+
when:
569+
type: string
570+
type: object
571+
pass:
572+
properties:
573+
message:
574+
type: string
575+
uri:
576+
type: string
577+
when:
578+
type: string
579+
type: object
580+
warn:
581+
properties:
582+
message:
583+
type: string
584+
uri:
585+
type: string
586+
when:
587+
type: string
588+
type: object
589+
type: object
590+
type: array
591+
required:
592+
- outcomes
593+
type: object
551594
tcpConnect:
552595
properties:
553596
checkName:
@@ -951,6 +994,89 @@ spec:
951994
exclude:
952995
type: BoolString
953996
type: object
997+
systemPackages:
998+
properties:
999+
amzn:
1000+
items:
1001+
type: string
1002+
type: array
1003+
amzn2:
1004+
items:
1005+
type: string
1006+
type: array
1007+
centos:
1008+
items:
1009+
type: string
1010+
type: array
1011+
centos7:
1012+
items:
1013+
type: string
1014+
type: array
1015+
centos8:
1016+
items:
1017+
type: string
1018+
type: array
1019+
collectorName:
1020+
type: string
1021+
exclude:
1022+
type: BoolString
1023+
ol:
1024+
items:
1025+
type: string
1026+
type: array
1027+
ol7:
1028+
items:
1029+
type: string
1030+
type: array
1031+
ol8:
1032+
items:
1033+
type: string
1034+
type: array
1035+
rhel:
1036+
items:
1037+
type: string
1038+
type: array
1039+
rhel7:
1040+
items:
1041+
type: string
1042+
type: array
1043+
rhel8:
1044+
items:
1045+
type: string
1046+
type: array
1047+
ubuntu:
1048+
items:
1049+
type: string
1050+
type: array
1051+
ubuntu16:
1052+
items:
1053+
type: string
1054+
type: array
1055+
ubuntu18:
1056+
items:
1057+
type: string
1058+
type: array
1059+
ubuntu20:
1060+
items:
1061+
type: string
1062+
type: array
1063+
required:
1064+
- amzn
1065+
- amzn2
1066+
- centos
1067+
- centos7
1068+
- centos8
1069+
- ol
1070+
- ol7
1071+
- ol8
1072+
- rhel
1073+
- rhel7
1074+
- rhel8
1075+
- ubuntu
1076+
- ubuntu16
1077+
- ubuntu18
1078+
- ubuntu20
1079+
type: object
9541080
tcpConnect:
9551081
properties:
9561082
address:
@@ -1219,6 +1345,13 @@ spec:
12191345
exclude:
12201346
type: BoolString
12211347
type: object
1348+
systemPackages:
1349+
properties:
1350+
collectorName:
1351+
type: string
1352+
exclude:
1353+
type: BoolString
1354+
type: object
12221355
tcpConnect:
12231356
properties:
12241357
address:

config/crds/troubleshoot.sh_preflights.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,6 +1780,13 @@ spec:
17801780
exclude:
17811781
type: BoolString
17821782
type: object
1783+
systemPackages:
1784+
properties:
1785+
collectorName:
1786+
type: string
1787+
exclude:
1788+
type: BoolString
1789+
type: object
17831790
tcpConnect:
17841791
properties:
17851792
address:

config/crds/troubleshoot.sh_remotecollectors.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,13 @@ spec:
284284
exclude:
285285
type: BoolString
286286
type: object
287+
systemPackages:
288+
properties:
289+
collectorName:
290+
type: string
291+
exclude:
292+
type: BoolString
293+
type: object
287294
tcpConnect:
288295
properties:
289296
address:
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
apiVersion: troubleshoot.sh/v1beta2
2+
kind: HostPreflight
3+
metadata:
4+
name: packages
5+
spec:
6+
collectors:
7+
- systemPackages:
8+
ubuntu:
9+
- open-iscsi
10+
ubuntu16:
11+
- nfs-common
12+
ubuntu18:
13+
- nmap
14+
ubuntu20:
15+
- nmap
16+
- nfs-common
17+
rhel:
18+
- iscsi-initiator-utils
19+
rhel7:
20+
- libzstd
21+
rhel8:
22+
- nfs-utils
23+
- openssl
24+
centos:
25+
- iscsi-initiator-utils
26+
centos7:
27+
- libzstd
28+
centos8:
29+
- nfs-utils
30+
- openssl
31+
ol:
32+
- lvm2
33+
ol7:
34+
- libzstd
35+
- openssl
36+
ol8:
37+
- nfs-utils
38+
amzn:
39+
- libzstd
40+
amzn2:
41+
- nfs-utils
42+
- openssl
43+
analyzers:
44+
- systemPackages:
45+
outcomes:
46+
- fail:
47+
when: "{{ not .IsInstalled }}"
48+
message: Package {{ .Name }} is not installed.
49+
- pass:
50+
message: Package {{ .Name }} is installed.

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ require (
182182
k8s.io/klog/v2 v2.9.0 // indirect
183183
k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c // indirect
184184
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a // indirect
185+
periph.io/x/periph v3.6.8+incompatible // indirect
185186
sigs.k8s.io/kustomize/api v0.8.11 // indirect
186187
sigs.k8s.io/kustomize/kyaml v0.11.0 // indirect
187188
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect

0 commit comments

Comments
 (0)