Commit Graph

552 Commits

Author SHA1 Message Date
Evans Mungai
b693e6650d chore: Add GH workflow to ensure schemas are generated in a PR (#872)
* Make file target to check generated schemas

* Add missing yaml tag to Logs struct

* chore: Add GH workflow to ensure schemas are generated in a PR
2022-11-28 10:58:09 +13:00
Dexter Yan
7e3a59cfc0 feat(analyze): add ExcludeFiles field to textAnazlye (#867)
* feat(analyze): add ExcludeFiles field to textAnazlye

* feat(analyze): fix test for getFiles

* feat(analyze): change function name to  excludeFilePaths

* feat(analyze): fix preflight test fail

* feat(analyze): add tests for excludeFiles

* feat(schemas): run make schemas

* feat(analyze): use getChildCollectedFileContents function prototype

* feat(analyze): reduce time complexity

* feat(longhorn): add getFileContents as getCollectedFileContents
2022-11-28 10:45:10 +13:00
Evans Mungai
fbbcf87405 feat(collectors): Store all pod logs in cluster-resources directory (#821)
* feat(collectors): Store all pod logs in cluster-resources directory

All pod logs collected by the logs collector will now be stored in
/cluster-resources/pods/logs/[namespace]/[pod]/[container].log. This
will provide consistency and allow sbctl to find the logs when we run
`kubectl logs <pod>`. To allow backwards compatibility, symlinks of the
log files will be created in the current expected locations.

Closes: #744
2022-11-22 07:10:34 +13:00
Dexter Yan
78bcafe489 fix(flag): fix wrong output filename (#834)
* fix(flag): fix wrong output filename

* fix(flag): add reset flag function

* fix(flag): add output flag test cases

* fix(flag): move resetFlags function into private go test

* fix(flag): restructure flag tests with testify

* fix(flag): remove resetFlags function

* fix(flag): remove duplicated test and rewrite test names
2022-11-17 14:38:01 +13:00
Diamon Wiggins
c34d80c300 Discover Redactors in Cluster (#827)
Adds the ability to search for support bundle specs and redactors, in both configmaps and secrets
2022-11-10 17:36:51 +13:00
Xav Paice
80cca8a487 Add omitempty to StorageClassName in schema (#814)
* Add omitempty to StorageClassName in schema

Allow a StorageClass spec to not require specify storageClassName.

Fixes: #813
2022-11-09 11:34:37 +13:00
Xav Paice
3513eeca19 Ensure clusterResources is added prior to other collectors (#768)
This change ensures that the clusterResources collector runs prior to any others
in order to not collect info on pods that collectors run during collection.

Additionally centralizes functions that are common to all collection to make future
maintenance simpler.

Fixes: #767
2022-11-01 12:16:01 +13:00
Edgar Lanting
34817b67d0 Update cluster_resources.go (#804)
Due to deprecation of the API at `policy/v1beta1` for `PodDisruptionBudgets` and `batch/v1beta1` for `CronJobs`, updated cluster_resources.go to accommodate using either apiVersion v1 & v1beta1
2022-10-28 14:56:57 +13:00
Diamon Wiggins
e2ac7bf715 fix ceph title (#799) 2022-10-24 12:35:35 -05:00
Diamon Wiggins
3d4bd4b601 trim whitespace from collected contents (#796) 2022-10-21 16:41:07 +13:00
Ahmed Mousa
764f0ac8b6 'added collection of roles, cluster roles and their respective bindings' (#779)
Co-authored-by: Edgar Lanting <edgarlanting@users.noreply.github.com>
2022-10-17 11:02:07 -05:00
Diamon Wiggins
04c7a18da3 Fix Progress Callback for Support Bundle Collection (#781)
fix progress callback for support bundle and revert collector title changes
2022-10-14 12:29:59 -04:00
Diamon Wiggins
bcaaa9e59a Fix Preflight CheckRBAC (#776)
* return collect result instead of nil
2022-10-13 12:54:40 +13:00
Chuck D'Antonio
2298ec3030 Supports the Kubernetes distribution analyzer identifying VMware Tanzu (#766)
Adds a check to the Kubernetes distribution analyzer to identify VMware Tanzu using the same approach as identifying OpenShift.
2022-10-13 12:52:22 +13:00
Diamon Wiggins
48beb303be export context field from collector structs (#771) 2022-10-11 14:54:54 -04:00
stefanrepl
9c986a74a6 make runPreflight and preflight cli flags public (#769) 2022-10-10 16:34:54 -06:00
ada mancini
eb40b9422f implement uri: field (#702) 2022-10-05 15:35:55 +13:00
danj-replicated
e80235f0a8 Collect resourcequotas (#729)
Signed-off-by: Dan Jones <danj@replicated.com>

Signed-off-by: Dan Jones <danj@replicated.com>
2022-10-05 12:58:54 +13:00
Diamon Wiggins
c7b84ad1e5 Refactor in-clusters collectors to use struct per collector (#670)
refactor in-clusters collectors to use struct per collector
2022-10-03 13:53:05 -04:00
Diamon Wiggins
7eecf6c526 improving error handling 2022-09-14 10:58:08 -04:00
Diamon Wiggins
ec6ec59303 fixing tests 2022-09-13 23:27:49 -04:00
Diamon Wiggins
e53871b4dc adding tests 2022-09-13 23:00:57 -04:00
Diamon Wiggins
ad23763d6b remove comment 2022-09-11 18:46:31 -04:00
Diamon Wiggins
ed34afc51b adding back default collectors 2022-09-11 18:33:35 -04:00
Diamon Wiggins
d4e5c0dba4 discovery support bundle specs from secrets matching label selector 2022-09-11 18:28:24 -04:00
Xav Paice
05d3e66de9 Merge pull request #683 from replicatedhq/danj-multiple-inputs
Danj multiple inputs
2022-09-09 15:09:25 +12:00
Dan Jones
d70ecf7e5f Add a rough test for bundle concatenation
Signed-off-by: Dan Jones <danj@replicated.com>
2022-09-08 17:16:38 +01:00
Xav Paice
92382e600f run make fmt across repo 2022-09-08 15:10:53 +12:00
Dan Jones
b5a56e5239 Remove redundant loops
Signed-off-by: Dan Jones <danj@replicated.com>
2022-09-07 09:14:09 +01:00
Dan Jones
b6f8ac211e Format
Signed-off-by: Dan Jones <danj@replicated.com>
2022-09-05 15:54:54 +01:00
Dan Jones
63510fc89d Moved ConcatSpec to supportbundle package and clean up dead code
Signed-off-by: Dan Jones <danj@replicated.com>
2022-09-05 14:12:29 +01:00
Edgar Lanting
8fcb65d2a6 Update supportbundle_types.go
Alter comment for the additional `uri` field into one single sentence.
2022-09-02 12:21:40 +02:00
Edgar Lanting
b2c3280623 EL 20220901 - Implement new type for #682 2022-09-01 14:58:51 +02:00
Edgar Lanting
f6bffb6982 Merge pull request #594 from replicatedhq/divolgin/sc-50371/support-bundle-takes-a-long-time-to-collect
Check if user has access to namespace resources before collecting
2022-08-29 11:57:56 +02:00
Dan Jones
8bdb09ff7d Only accept one clusterResources collector
Signed-off-by: Dan Jones <danj@replicated.com>
2022-08-26 11:36:44 +01:00
Dan Jones
b20a8e5321 Add example breakout point for collector merging
Signed-off-by: Dan Jones <danj@replicated.com>
2022-08-26 11:16:07 +01:00
Dan Jones
f5652df9da remove old method definition
Signed-off-by: Dan Jones <danj@replicated.com>
2022-08-23 16:26:19 +01:00
Dan Jones
b716374070 Had append targets inverted
Signed-off-by: Dan Jones <danj@replicated.com>
2022-08-23 13:13:30 +01:00
Dan Jones
1a637f3c4f Add concatspec method
Signed-off-by: Dan Jones <danj@replicated.com>
2022-08-23 13:03:04 +01:00
Dan Jones
3b3ae4e7bf initial attempt
Signed-off-by: Dan Jones <danj@replicated.com>
2022-08-22 16:57:54 +01:00
xavpaice
414bf84c68 Merge pull request #644 from replicatedhq/danj-custom-absent-messages
Allow custom messages to be passed if a deployment/statefulset is absent
2022-08-19 09:06:08 +12:00
Dan Jones
b3ee989cfe Add some more tests, and fix and issue where "absent" was falling through to the int comparison
Signed-off-by: Dan Jones <danj@replicated.com>
2022-08-12 18:55:05 +01:00
Dan Jones
c3773b7f26 %s -> %q
Signed-off-by: Dan Jones <danj@replicated.com>
2022-08-12 09:47:46 +01:00
Dan Jones
fa2daa70b1 %s -> %q
Signed-off-by: Dan Jones <danj@replicated.com>
2022-08-12 09:46:18 +01:00
Dan Jones
3a5b65dec4 Add tests for absent deployments/statefulsets
Signed-off-by: Dan Jones <danj@replicated.com>
2022-08-11 17:11:58 +01:00
xavpaice
a463403bde Merge pull request #649 from replicatedhq/danj-collect-networkpolicies
Collect networkPolicies
2022-08-11 14:58:51 +12:00
divolgin
75bc9d576c Check if user has access to namespace resources before collecting 2022-08-10 19:40:18 -07:00
xavpaice
6a08536556 Merge pull request #648 from replicatedhq/danj-longhorn-replica-check
Add a check for longhorn volume replicas
2022-08-11 14:26:18 +12:00
Chris Sanders
330263aae8 Merge pull request #645 from replicatedhq/el-cluster_resources_typo-20220805
Update cluster_resources.go - typo
2022-08-09 11:36:14 -05:00
Dmitriy Ivolgin
052a8656ba Merge pull request #643 from YoyoTT/yue-fix-log
Fix the saving log process
2022-08-09 07:36:01 -07:00