Compare commits

..
285 Commits
Author SHA1 Message Date
Xav Paice e30d279cad update CODEOWNERS file (#770)
Adds a new group to CODEOWNERS as global owner, and CREs for .md files.
2022-10-11 09:02:34 -05:00
stefanrepl 9c986a74a6 make runPreflight and preflight cli flags public (#769) 2022-10-10 16:34:54 -06:00
Evans Mungai e02074941e Add golangci-lint linter make target (#752)
Add line, and lint-and-fix make targets
2022-10-10 09:52:02 +13:00
Edgar Lanting 56a68a4fef Issue #695 - Add --no-uri flag to support-bundle to ignore the uri field and revert back to the default spec… (#717)
Add --follow-uri flag to support-bundle to ignore the uri field when set in a spec

Implement the new CLI flag in `root.go` so we can pass it if we need to ignore the `uri` field in a spec. This also serves as a minimal documentation effort when running `support-bundle --help`.

Fixes: #695
2022-10-10 07:30:21 +13:00
Xav Paice b3e662c988 minor lint update for README.md (#727) 2022-10-07 13:15:01 -04:00
Diamon Wiggins a0fb06f0b9 E2E Tests for Support Bundle CLI (#761)
* adding e2e tests for support bundle cli

* update e2e.yaml
2022-10-07 14:43:16 +13:00
Evans Mungai 906fa88119 Fit wrapped long url in more information analyser message (#758) 2022-10-06 10:21:52 +13:00
ada mancini eb40b9422f implement uri: field (#702) 2022-10-05 15:35:55 +13:00
Xav Paice f6531b8434 Update golang.org/x/net to current version (#757)
Fixes: #756 (CVE resolution)
2022-10-05 13:13:02 +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 44ae409081 fix concat spec for cluster secrets (#750) 2022-09-30 08:24:33 +13:00
dependabot[bot]andlnx01 d1318ff4fd Bump k8s.io/cli-runtime from 0.25.0 to 0.25.2 (#737)
Bumps [k8s.io/cli-runtime](https://github.com/kubernetes/cli-runtime) from 0.25.0 to 0.25.2.
- [Release notes](https://github.com/kubernetes/cli-runtime/releases)
- [Commits](https://github.com/kubernetes/cli-runtime/compare/v0.25.0...v0.25.2)

---
updated-dependencies:
- dependency-name: k8s.io/cli-runtime
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-29 17:22:19 +13:00
dependabot[bot]andlnx01 169f3c6ea7 Bump k8s.io/apiserver from 0.25.1 to 0.25.2 (#740)
Bumps [k8s.io/apiserver](https://github.com/kubernetes/apiserver) from 0.25.1 to 0.25.2.
- [Release notes](https://github.com/kubernetes/apiserver/releases)
- [Commits](https://github.com/kubernetes/apiserver/compare/v0.25.1...v0.25.2)

---
updated-dependencies:
- dependency-name: k8s.io/apiserver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-29 17:05:19 +13:00
dependabot[bot]andlnx01 7a7507b5e4 Bump k8s.io/client-go from 0.25.1 to 0.25.2 (#741)
Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.25.1 to 0.25.2.
- [Release notes](https://github.com/kubernetes/client-go/releases)
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kubernetes/client-go/compare/v0.25.1...v0.25.2)

---
updated-dependencies:
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-29 16:42:59 +13:00
Nick Meyer d5c7522be5 use push-only token (#730) 2022-09-22 07:28:34 +12:00
f5b6a108a1 Bump k8s.io/apiserver from 0.25.0 to 0.25.1 (#722)
Bumps [k8s.io/apiserver](https://github.com/kubernetes/apiserver) from 0.25.0 to 0.25.1.
- [Release notes](https://github.com/kubernetes/apiserver/releases)
- [Commits](https://github.com/kubernetes/apiserver/compare/v0.25.0...v0.25.1)

---
updated-dependencies:
- dependency-name: k8s.io/apiserver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Xav Paice <xavpaice@users.noreply.github.com>
2022-09-20 12:09:59 +12:00
Nick Meyer c4746e766b Add gate to prevent attempt to run on fork (#721) 2022-09-20 11:41:21 +12:00
ada mancini 4fadd471e6 Update CONTRIBUTING.md (#718)
add notes about squashing
2022-09-16 17:48:38 -05:00
Xav Paice c397171b79 Merge pull request #709 from replicatedhq/diamonwiggins/supportbundle-specs-in-secrets-discovery
Load support bundle specs from secrets matching label selector
2022-09-16 13:06:31 +12:00
Nick Meyer a20f9d9408 Merge pull request #714 from replicatedhq/nickmeyer/sc-53201
add FOSSA PR scan; update label requirements [sc-53201][sc-53409]
2022-09-15 10:41:35 -05:00
Nick Meyer ebd49e70df add FOSSA PR scan; update label requirements [sc-53201][sc-53409] 2022-09-15 10:17:34 -05:00
Diamon Wiggins b66145e514 fixing logger statements 2022-09-14 11:56:16 -04:00
Diamon Wiggins be070c98e1 add handling for when no collectors or host collectors are specified 2022-09-14 11:19:44 -04:00
Diamon Wiggins 7eecf6c526 improving error handling 2022-09-14 10:58:08 -04:00
Diamon Wiggins 126346e1fe update run.go 2022-09-14 00:57:33 -04:00
Diamon Wiggins e7fe012f2f handling when no args are provided 2022-09-14 00:36:04 -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 93da8b6ac7 change name of flag 2022-09-13 18:42:33 -04:00
Evans Mungai ad4cfc6d9e Merge pull request #704 from replicatedhq/update-issue-template
Update issue template
2022-09-12 10:05:25 +01:00
Diamon Wiggins ad23763d6b remove comment 2022-09-11 18:46:31 -04:00
Diamon Wiggins 7120516b13 fixing description for cli flags 2022-09-11 18:39:55 -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
dependabot[bot]andlnx01 a50263c725 Bump github.com/lib/pq from 1.10.6 to 1.10.7 (#708)
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.10.6 to 1.10.7.
- [Release notes](https://github.com/lib/pq/releases)
- [Commits](https://github.com/lib/pq/compare/v1.10.6...v1.10.7)

---
updated-dependencies:
- dependency-name: github.com/lib/pq
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-12 09:49:54 +12:00
dependabot[bot]andlnx01 818a9bc9a2 Bump github.com/spf13/viper from 1.12.0 to 1.13.0 (#707)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.12.0...v1.13.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-12 09:46:23 +12:00
dependabot[bot]andlnx01 e98497b78b Bump k8s.io/klog/v2 from 2.70.1 to 2.80.1 (#706)
Bumps [k8s.io/klog/v2](https://github.com/kubernetes/klog) from 2.70.1 to 2.80.1.
- [Release notes](https://github.com/kubernetes/klog/releases)
- [Changelog](https://github.com/kubernetes/klog/blob/main/RELEASE.md)
- [Commits](https://github.com/kubernetes/klog/compare/v2.70.1...v2.80.1)

---
updated-dependencies:
- dependency-name: k8s.io/klog/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-12 09:35:48 +12:00
dependabot[bot]andlnx01 60c2547cc0 Bump sigs.k8s.io/controller-runtime from 0.12.3 to 0.13.0 (#700)
Bumps [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) from 0.12.3 to 0.13.0.
- [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases)
- [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/controller-runtime/compare/v0.12.3...v0.13.0)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/controller-runtime
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-12 09:21:49 +12:00
Evans Mungai 934bf8ed87 Update issue template 2022-09-09 18:03:10 +01: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
Chris Sanders 7403e39210 Merge pull request #703 from replicatedhq/xav/gofmt
run make fmt across repo
2022-09-08 11:12:24 -05: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
Chris Sanders 91c387b0ca Merge pull request #696 from replicatedhq/el_issue_682_20220831
EL 20220901 - Implement new type  for #682
2022-09-02 08:13:43 -05: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
Chris Sanders cdf4d730d4 Merge pull request #681 from replicatedhq/xav/updateable-specs
Add proposal for updatable specs
2022-08-31 10:39:24 -05:00
xavpaice ca9bc007e5 Merge pull request #689 from replicatedhq/dependabot/go_modules/k8s.io/cli-runtime-0.25.0
Bump k8s.io/cli-runtime from 0.24.3 to 0.25.0
2022-08-31 14:47:01 +12:00
dependabot[bot] f082ef43dc Bump k8s.io/cli-runtime from 0.24.3 to 0.25.0
Bumps [k8s.io/cli-runtime](https://github.com/kubernetes/cli-runtime) from 0.24.3 to 0.25.0.
- [Release notes](https://github.com/kubernetes/cli-runtime/releases)
- [Commits](https://github.com/kubernetes/cli-runtime/compare/v0.24.3...v0.25.0)

---
updated-dependencies:
- dependency-name: k8s.io/cli-runtime
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-31 02:23:08 +00:00
xavpaice fb71cd4ef6 Merge pull request #687 from replicatedhq/dependabot/go_modules/k8s.io/apiserver-0.25.0
Bump k8s.io/apiserver from 0.24.3 to 0.25.0
2022-08-31 14:21:58 +12:00
dependabot[bot] 92dc66f338 Bump k8s.io/apiserver from 0.24.3 to 0.25.0
Bumps [k8s.io/apiserver](https://github.com/kubernetes/apiserver) from 0.24.3 to 0.25.0.
- [Release notes](https://github.com/kubernetes/apiserver/releases)
- [Commits](https://github.com/kubernetes/apiserver/compare/v0.24.3...v0.25.0)

---
updated-dependencies:
- dependency-name: k8s.io/apiserver
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-30 23:30:19 +00:00
xavpaice e3553198d1 Merge pull request #693 from replicatedhq/xav/go-1.19
Update to go 1.19
2022-08-31 11:29:13 +12:00
Chris Sanders a4f57ec3c9 Merge pull request #686 from replicatedhq/design-principles
Add Design Principles to the design folder
2022-08-30 14:07:32 -05:00
Xav Paice e5a7409b5e Update to go 1.19 2022-08-30 18:29:39 +12:00
dependabot[bot]andlnx01 2a1108776e Bump github.com/mattn/go-isatty from 0.0.14 to 0.0.16 (#669)
Bumps [github.com/mattn/go-isatty](https://github.com/mattn/go-isatty) from 0.0.14 to 0.0.16.
- [Release notes](https://github.com/mattn/go-isatty/releases)
- [Commits](https://github.com/mattn/go-isatty/compare/v0.0.14...v0.0.16)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-isatty
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-30 17:38:41 +12:00
Xav Paice eeac031e70 updateable-spec design - change specURI to uri 2022-08-30 15:36:30 +12:00
Xav Paice 7e77cb9723 update updateable-specs design based on feedback 2022-08-30 15:34:22 +12:00
Xav Paice 1495214261 updates to udpateable specs design 2022-08-30 15:34:22 +12:00
Xav Paice e75a3a07b9 add proposal for updateable specs 2022-08-30 15:34:22 +12: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
Chris Sanders a9e3a6ba1c Add a reference to principles to CONTRIBUTING 2022-08-26 12:26:05 -05:00
Chris Sanders 0fb2026192 Add design-principles.md to design folder 2022-08-26 12:24:21 -05:00
Chris Sanders 1b4caf3592 Markdown lint on CONTRIBUTING.md 2022-08-26 11:39:14 -05:00
Chris Sanders 8dc4ac1732 Correct template checklist format 2022-08-26 11:27:47 -05:00
Chris Sanders c027ed9c1b Fix link and alter description of the feature_epic template 2022-08-26 11:05:01 -05:00
Chris Sanders b11dd5ff73 Add an epic issue type 2022-08-26 10:54:28 -05: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
Nick Meyer 1c9d3510cd Merge pull request #679 from replicatedhq/nickmeyer/sc-56448/remove-all-usage-of-ubuntu-18-04-gha-runners
update GHA runner from 18.04 [sc-56448]
2022-08-25 14:28:51 -05:00
Nick Meyer ec246a62b9 update GHA runner from 18.04 [sc-56448] 2022-08-24 12:44:50 -05: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
Chris Sanders eea128856c Merge pull request #662 from replicatedhq/design-mergeable-specs
Add design proposal for mergeable specs
2022-08-12 10:14:54 -05:00
Chris Sanders 4517030473 Adjust some phrasing to use less Replciated specific terminology 2022-08-12 08:52:32 -05: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
Salah Al Saleh 6adc5b3c7f Require PR labels (#661) 2022-08-11 20:15:03 -07:00
Xav Paice a46548c119 Add design proposal for mergeable specs 2022-08-12 14:31:08 +12: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
Edgar Lanting f1d0e3ce0d Merge pull request #647 from replicatedhq/el-44743-20220805
Update cluster_resources.go - Shortcut 44743
2022-08-09 16:02:35 +02:00
Dan Jones ed0d252f39 Rename output directory to be consistent with others
Signed-off-by: Dan Jones <danj@replicated.com>
2022-08-09 14:38:32 +01:00
Edgar Lanting 56126fb602 Update cluster_resources.go - Add more readability
Made some small changes to improve readability by using `PodDisruptionBudgets` instead of `pdb`.
2022-08-09 12:35:04 +02:00
Dan Jones f58080b604 Collect networkPolicies
Signed-off-by: Dan Jones <danj@replicated.com>
2022-08-09 11:20:38 +01:00
Dan Jones 1a488eabc2 Add a check for longhorn volume replicas
This is to address part of internal shortcut 48952

Signed-off-by: Dan Jones <danj@replicated.com>
2022-08-05 16:21:14 +01:00
Edgar Lanting 67cc83fa9a Update cluster_resources.go - Shortcut 44743
When troubleshooting an issue we want to see and check the `PodDisruptionBudget` for any application. As we currently do not have that 'standard' output in our support bundle, this PR serves as an implementation of providing one with an overview of `PodDisruptionBudget` on a per-namespace basis.

After creating a support bundle, the output can be reviewed by checking out `../cluster-resources/pdb/*.json`
2022-08-05 15:39:47 +02:00
Edgar Lanting a91ef9edfe Update cluster_resources.go - typo
Fix a typo: `exprted` -> `exported`
2022-08-05 13:53:50 +02:00
Yue Tan 007609565a Fix saving logs 2022-08-02 16:29:35 -07:00
Dan Jones 6319d2a264 Allow custom messages to be passed if a deployment/statefulset is absent
Signed-off-by: Dan Jones <danj@replicated.com>
2022-08-02 18:11:29 +01:00
Edgar Lanting f6afe7e7e9 Merge pull request #642 from replicatedhq/xav/typos
Small typo fix in collect.go
2022-08-02 17:44:35 +02:00
Xav Paice f06201e050 Small typo fix in collect.go 2022-08-02 14:36:34 +12:00
Diamon Wiggins 661bc3a557 Merge pull request #640 from replicatedhq/diamonwiggins/generate-bundle-when-host-collectors-exist
Always attempt to generate a Support Bundle when Host Collectors exist
2022-08-01 13:12:45 -04:00
Diamon Wiggins 114749d5b7 always attempt to generate a support bundle when host collectors exists 2022-07-30 18:57:24 -04:00
Dmitriy Ivolgin 4f8c1f3d8b Merge pull request #639 from replicatedhq/divolgin/helm
Fix path for Helm registry credentials
2022-07-27 12:04:31 -07:00
divolgin 14f9ae8f3b Fix path for Helm registry credentials 2022-07-27 00:43:44 +00:00
xavpaice 248b393288 Merge pull request #573 from replicatedhq/pa1/update-go-mod-archiver
update go module github.com/mholt/archiver/v3
2022-07-27 08:10:52 +12:00
xavpaice 6fe887df62 Merge pull request #638 from replicatedhq/xav/go_modules/periph.io/x/periph-3.7.2
Bump periph.io/x/periph from 3.6.8+incompatible to 3.7.2
2022-07-27 07:28:08 +12:00
xavpaice 65c8980504 Merge pull request #637 from replicatedhq/dependabot-17
Update containerd to 1.6.6
2022-07-27 07:27:45 +12:00
Dmitriy Ivolgin 41d2bae380 Merge pull request #621 from mesosphere/mh/fix-multiple-crd-version
fix: use kube-aware version selector for crs collector
2022-07-26 09:27:48 -07:00
Pavan Sokke Nagaraj 912e76c97e update go mod github.com/mholt/archiver/v3 2022-07-26 08:03:45 -04:00
xavpaice f6e49c95f9 Merge branch 'main' into dependabot-17 2022-07-26 19:47:40 +12:00
xavpaice 85aa5334b0 Merge branch 'main' into xav/go_modules/periph.io/x/periph-3.7.2 2022-07-26 19:47:09 +12:00
xavpaice 29e817475a Merge pull request #636 from replicatedhq/dependabot/go_modules/github.com/go-logr/logr-1.2.3
Bump github.com/go-logr/logr from 1.2.2 to 1.2.3
2022-07-26 19:45:12 +12:00
dependabot[bot] e0caefc9df Bump github.com/go-logr/logr from 1.2.2 to 1.2.3
Bumps [github.com/go-logr/logr](https://github.com/go-logr/logr) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/go-logr/logr/releases)
- [Changelog](https://github.com/go-logr/logr/blob/master/CHANGELOG.md)
- [Commits](https://github.com/go-logr/logr/compare/v1.2.2...v1.2.3)

---
updated-dependencies:
- dependency-name: github.com/go-logr/logr
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 06:38:24 +00:00
xavpaice 09eef9019f Merge pull request #635 from replicatedhq/dependabot/go_modules/oras.land/oras-go-1.2.0
Bump oras.land/oras-go from 1.1.1 to 1.2.0
2022-07-26 18:37:08 +12:00
dependabot[bot] 057be29943 Bump periph.io/x/periph from 3.6.8+incompatible to 3.7.2
- [Release notes](https://github.com/google/periph/releases)

updated-dependencies:
- dependency-name: periph.io/x/periph
  dependency-type: direct:production
  update-type: version-update:semver-minor

Module periph.io/x/periph has moved from 3.6.8 to re-arrange locations
in 3.7.2.  This reworks to take advantage of the new format.
2022-07-26 18:33:22 +12:00
Xav Paice 4ec239e94f Update containerd to 1.6.6
https://github.com/replicatedhq/troubleshoot/security/dependabot/17
suggests update of containerd, but dependabot was unable to do so.
2022-07-26 17:52:00 +12:00
dependabot[bot] 11b54a2ed3 Bump oras.land/oras-go from 1.1.1 to 1.2.0
Bumps [oras.land/oras-go](https://github.com/oras-project/oras-go) from 1.1.1 to 1.2.0.
- [Release notes](https://github.com/oras-project/oras-go/releases)
- [Commits](https://github.com/oras-project/oras-go/compare/v1.1.1...v1.2.0)

---
updated-dependencies:
- dependency-name: oras.land/oras-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 05:46:09 +00:00
xavpaice 33a92a81e4 Merge pull request #633 from replicatedhq/dependabot/go_modules/github.com/lib/pq-1.10.6
Bump github.com/lib/pq from 1.10.4 to 1.10.6
2022-07-26 17:44:53 +12:00
dependabot[bot] 5f11410677 Bump github.com/lib/pq from 1.10.4 to 1.10.6
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.10.4 to 1.10.6.
- [Release notes](https://github.com/lib/pq/releases)
- [Commits](https://github.com/lib/pq/compare/v1.10.4...v1.10.6)

---
updated-dependencies:
- dependency-name: github.com/lib/pq
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 05:33:02 +00:00
xavpaice 6b076a7d4d Merge pull request #634 from replicatedhq/dependabot/go_modules/github.com/sirupsen/logrus-1.9.0
Bump github.com/sirupsen/logrus from 1.8.1 to 1.9.0
2022-07-26 17:31:58 +12:00
dependabot[bot] 0070a5fb10 Bump github.com/sirupsen/logrus from 1.8.1 to 1.9.0
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.8.1 to 1.9.0.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.8.1...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 05:04:08 +00:00
xavpaice be47f06217 Merge pull request #632 from replicatedhq/dependabot/go_modules/github.com/stretchr/testify-1.8.0
Bump github.com/stretchr/testify from 1.7.1 to 1.8.0
2022-07-26 17:02:49 +12:00
dependabot[bot] 16e395b90a Bump github.com/stretchr/testify from 1.7.1 to 1.8.0
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.1 to 1.8.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.1...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 04:48:58 +00:00
xavpaice ef1a186f9e Merge pull request #631 from replicatedhq/dependabot/go_modules/sigs.k8s.io/controller-runtime-0.12.3
Bump sigs.k8s.io/controller-runtime from 0.11.0 to 0.12.3
2022-07-26 16:47:45 +12:00
dependabot[bot] 5ade1cb4b6 Bump sigs.k8s.io/controller-runtime from 0.11.0 to 0.12.3
Bumps [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) from 0.11.0 to 0.12.3.
- [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases)
- [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/controller-runtime/compare/v0.11.0...v0.12.3)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/controller-runtime
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 03:01:12 +00:00
xavpaice 8b90f2595d Merge pull request #583 from replicatedhq/dependabot/go_modules/github.com/spf13/viper-1.12.0
Bump github.com/spf13/viper from 1.10.0 to 1.12.0
2022-07-26 14:59:55 +12:00
xavpaice f98fa5c637 Merge branch 'main' into dependabot/go_modules/github.com/spf13/viper-1.12.0 2022-07-26 14:43:56 +12:00
xavpaice f21ba951a5 Merge pull request #619 from replicatedhq/dependabot/go_modules/k8s.io/klog/v2-2.70.1
Bump k8s.io/klog/v2 from 2.60.1 to 2.70.1
2022-07-26 14:43:25 +12:00
dependabot[bot] 5bae5efb92 Bump k8s.io/klog/v2 from 2.60.1 to 2.70.1
Bumps [k8s.io/klog/v2](https://github.com/kubernetes/klog) from 2.60.1 to 2.70.1.
- [Release notes](https://github.com/kubernetes/klog/releases)
- [Changelog](https://github.com/kubernetes/klog/blob/main/RELEASE.md)
- [Commits](https://github.com/kubernetes/klog/compare/v2.60.1...v2.70.1)

---
updated-dependencies:
- dependency-name: k8s.io/klog/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 02:27:00 +00:00
dependabot[bot] 5568f241a3 Bump github.com/spf13/viper from 1.10.0 to 1.12.0
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.10.0 to 1.12.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.10.0...v1.12.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 02:26:46 +00:00
xavpaice 19f66574c6 Merge pull request #628 from replicatedhq/dependabot/go_modules/github.com/spf13/cobra-1.5.0
Bump github.com/spf13/cobra from 1.4.0 to 1.5.0
2022-07-26 14:25:38 +12:00
xavpaice ae75f325c2 Merge branch 'main' into dependabot/go_modules/github.com/spf13/cobra-1.5.0 2022-07-26 14:10:58 +12:00
xavpaice 28cad0cf4a Merge pull request #629 from replicatedhq/dependabot/go_modules/k8s.io/cli-runtime-0.24.3
Bump k8s.io/cli-runtime from 0.24.0 to 0.24.3
2022-07-26 14:09:48 +12:00
dependabot[bot] 83d7e48999 Bump k8s.io/cli-runtime from 0.24.0 to 0.24.3
Bumps [k8s.io/cli-runtime](https://github.com/kubernetes/cli-runtime) from 0.24.0 to 0.24.3.
- [Release notes](https://github.com/kubernetes/cli-runtime/releases)
- [Commits](https://github.com/kubernetes/cli-runtime/compare/v0.24.0...v0.24.3)

---
updated-dependencies:
- dependency-name: k8s.io/cli-runtime
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 01:00:58 +00:00
xavpaice e2d1ce2fb0 Merge pull request #611 from replicatedhq/design
Proposal provide extendable API for bundle information
2022-07-26 12:19:20 +12:00
Chris Sanders e6cc4e6c47 Merge branch 'main' into design 2022-07-25 16:58:46 -05:00
xavpaice 8c0c83776f Merge pull request #622 from replicatedhq/el-49103-patch
Patch node_resources.go
2022-07-21 08:58:52 +12:00
dependabot[bot] ae888134a3 Bump github.com/spf13/cobra from 1.4.0 to 1.5.0
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.4.0...v1.5.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-20 08:44:49 +00:00
xavpaice 276cf7ce06 Merge branch 'main' into el-49103-patch 2022-07-20 20:43:56 +12:00
xavpaice 7132ee7405 Merge pull request #624 from replicatedhq/dependabot/go_modules/k8s.io/apiserver-0.24.3
Bump k8s.io/apiserver from 0.24.0 to 0.24.3
2022-07-20 20:42:31 +12:00
xavpaice 817ebaad41 Merge branch 'main' into dependabot/go_modules/k8s.io/apiserver-0.24.3 2022-07-20 19:55:21 +12:00
xavpaice 9e90e94ced Merge pull request #625 from replicatedhq/dependabot/go_modules/k8s.io/api-0.24.3
Bump k8s.io/api from 0.24.0 to 0.24.3
2022-07-20 19:54:25 +12:00
xavpaice fd1594520e Merge branch 'main' into dependabot/go_modules/k8s.io/api-0.24.3 2022-07-20 19:29:51 +12:00
xavpaice 9b6f8d3aff Merge pull request #626 from replicatedhq/adamancini-patch-1
add instructions to cross-compile with Go
2022-07-20 19:28:20 +12:00
ada mancini d84a919b33 add instructions to cross-compile with Go 2022-07-19 16:50:20 -04:00
dependabot[bot] fc745c1144 Bump k8s.io/api from 0.24.0 to 0.24.3
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.24.0 to 0.24.3.
- [Release notes](https://github.com/kubernetes/api/releases)
- [Commits](https://github.com/kubernetes/api/compare/v0.24.0...v0.24.3)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-18 17:09:42 +00:00
dependabot[bot] 8f38b7c5aa Bump k8s.io/apiserver from 0.24.0 to 0.24.3
Bumps [k8s.io/apiserver](https://github.com/kubernetes/apiserver) from 0.24.0 to 0.24.3.
- [Release notes](https://github.com/kubernetes/apiserver/releases)
- [Commits](https://github.com/kubernetes/apiserver/compare/v0.24.0...v0.24.3)

---
updated-dependencies:
- dependency-name: k8s.io/apiserver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-18 17:09:36 +00:00
Kira C Boyle 0203889171 Merge pull request #623 from replicatedhq/update-opencontainers-runc
update github.com/opencontainers/runc to 1.1.3 to resolve CVE-2022-29162
2022-07-18 10:07:58 -07:00
Kira Boyle 78c93418ca update github.com/opencontainers/runc to 1.1.3 to resolve CVE-2022-29162
* https://avd.aquasec.com/nvd/2022/cve-2022-29162/
2022-07-18 09:07:08 -07:00
Edgar Lanting c1d303350f Patch node_resources.go
Fix the behaviour of the node Ready/NotReady check when running a support bundle with:
`support-bundle https://kots.io`
2022-07-18 11:09:23 +02:00
Martin Hrabovcin 642d098238 fix: use kube-aware version selector for crs collector 2022-07-15 08:36:16 +02:00
Chris Sanders 532f1583b5 Merge branch 'main' into design 2022-07-13 13:14:38 -05:00
Chris Sanders ab42cd766f Update proposal for PR discussion and capture next steps 2022-07-13 13:14:05 -05:00
Dmitriy Ivolgin 050345f123 Merge pull request #618 from replicatedhq/divolgin/sc-51321/kots-does-not-automatically-re-write-private
Adding some utility interfaces for collectors
2022-07-08 15:10:05 -07:00
divolgin 8e7ea022f7 Adding some utility interfaces for collectors 2022-07-08 14:53:46 -07:00
Diamon Wiggins c1c772e59f Merge pull request #617 from replicatedhq/diamonwiggins/sc-48402/support-bundle-host-analyzers
Add HostAnalyzers to Support Bundles
2022-07-07 16:17:56 -04:00
Diamon Wiggins a1533d5ec5 adding host analyzers to kind analyzer and supportbundle 2022-07-06 12:19:44 -04:00
Ethan Mosbaugh 1820c40c43 Make sure to clean up resources when done including run pods (#615) 2022-07-02 14:40:55 -07:00
Diamon Wiggins cab3fc7f4e Redact Host Collectors in Support Bundles (#614)
Add redactors for Host Collectors
2022-07-01 18:57:58 -04:00
Dmitriy Ivolgin 3ff0e82fcc Merge pull request #593 from replicatedhq/dependabot/go_modules/github.com/hashicorp/go-getter-1.6.2
Bump github.com/hashicorp/go-getter from 1.5.9 to 1.6.2
2022-07-01 11:24:01 -07:00
Dmitriy Ivolgin 40f1f0193a Merge branch 'main' into dependabot/go_modules/github.com/hashicorp/go-getter-1.6.2 2022-07-01 11:08:13 -07:00
Edgar Lanting 2de46a18a5 Merge pull request #602 from replicatedhq/el-analyze-typo-20220615
Update analyze.go - fix typo
2022-07-01 15:50:24 +02:00
Edgar Lanting cdbf189955 Merge branch 'main' into el-analyze-typo-20220615 2022-07-01 15:32:56 +02:00
xavpaice ff5ee2b709 Merge pull request #609 from xavpaice/xav/sc37229/ceph-secrets
Add Ceph auth redactors
2022-06-30 17:54:25 +12:00
xavpaice d98c01a3b9 Merge branch 'main' into xav/sc37229/ceph-secrets 2022-06-30 17:40:19 +12:00
ada mancini 0996b3b1ad Merge pull request #612 from adamancini/sc-51130/postgres-analyzer
include the db connection error message with the outcome
2022-06-29 15:04:34 -04:00
ada mancini b617de3fd0 include the db connection error message with the outcome 2022-06-29 12:28:29 -04:00
Diamon Wiggins c9c305570b Host Run Collector (#606)
Host Run Collector
2022-06-29 12:14:56 -04:00
Diamon Wiggins 601bf75ceb Merge pull request #610 from replicatedhq/diamonwiggins/fix-flaky-ceph-test
Fix flaky Ceph analyzer test
2022-06-28 17:57:59 -04:00
Chris Sanders fe1137d8ec Change design to have collectors write to etcd rather than push to an api-server after discussion with ethan 2022-06-28 16:54:42 -05:00
Diamon Wiggins 69b34c45b2 changing flaky ceph analyzer test 2022-06-28 13:04:10 -04:00
Edgar Lanting f1cff2cd74 Merge branch 'main' into el-analyze-typo-20220615 2022-06-27 13:23:54 +02:00
Edgar Lanting 0f2976cac5 Merge pull request #595 from edgarlanting/main
Update CONTRIBUTING.md
2022-06-27 13:23:23 +02:00
Edgar Lanting 65570ac121 Merge branch 'main' into main 2022-06-27 10:56:48 +02:00
Xav Paice 4acd7e4951 Add Ceph auth redactors
Add automatic redactors for Ceph auth_dump json which includes auth keys.
2022-06-27 17:50:38 +12:00
Dmitriy Ivolgin 7b4bfa3af7 Merge pull request #607 from takirala/tga/use-storedVersion-cr-collection
fix: use `storedVersions` to determine specific CR version
2022-06-24 15:43:22 -07:00
Tarun Gupta Akirala 43a936a0d7 fix: use storedVersions to determine specific CR version 2022-06-24 12:09:10 -07:00
Edgar Lanting 27479e856f Merge branch 'main' into el-analyze-typo-20220615 2022-06-23 00:11:43 +02:00
Edgar Lanting 567fa5950c Merge branch 'main' into main 2022-06-23 00:11:17 +02:00
Alex Parker b29ef61cc5 Merge pull request #605 from replicatedhq/ajp-io-patch-1
Update K8s versions and container runtime
2022-06-22 15:44:22 -04:00
Alex Parker 34c59eb237 Update K8s versions and container runtime 2022-06-22 15:20:48 -04:00
Edgar Lanting 650916f77c Merge branch 'main' into el-analyze-typo-20220615 2022-06-20 10:25:54 +02:00
Dmitriy Ivolgin 7ec008479a Merge pull request #601 from replicatedhq/divolgin/reflect
Use reflection instead of hardcoding all alnalyzers
2022-06-17 14:12:36 -07:00
divolgin f02566c712 Use reflection instead of hardcoding all alnalyzers 2022-06-17 13:54:23 -07:00
Craig O'Donnell 354a996edc feat: adds new yamlCompare and jsonCompare analyzers (#598)
* feat: adds new yamlCompare analyzer

* feat: adds new jsonCompare analyzer

* outcome when for yamlCompare and jsonCompare
2022-06-17 14:43:56 -04:00
Edgar Lanting 31d6a0d8fd Merge branch 'main' into main 2022-06-17 10:17:51 +02:00
Dmitriy Ivolgin 1de5a79855 Merge pull request #600 from replicatedhq/divolgin/sc-50660/when-all-preflights-are-excluded-we-should
Wrapper function for analyzer's exclude flag
2022-06-16 17:44:40 -07:00
divolgin b308f4a2b2 Wrapper function for analyzer's exclude flag 2022-06-16 14:18:39 -07:00
Chris Sanders 33ddee27ed typos 2022-06-15 17:57:43 -05:00
Chris Sanders 6d7bf73aba Add initial design folder with standard-interfaces design 2022-06-15 12:22:19 -05:00
dependabot[bot] a5fceaf476 Bump github.com/hashicorp/go-getter from 1.5.9 to 1.6.2
Bumps [github.com/hashicorp/go-getter](https://github.com/hashicorp/go-getter) from 1.5.9 to 1.6.2.
- [Release notes](https://github.com/hashicorp/go-getter/releases)
- [Changelog](https://github.com/hashicorp/go-getter/blob/main/.goreleaser.yml)
- [Commits](https://github.com/hashicorp/go-getter/compare/v1.5.9...v1.6.2)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/go-getter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-15 15:31:10 +00:00
Edgar Lanting 1e2e7e9aee Update analyze.go - fix typo
Fixed a typo in the comments: `analysze` -> `analyze`
2022-06-15 16:41:05 +02:00
Kira C Boyle 319a3a8d38 Merge pull request #596 from replicatedhq/kiraboyle/sc-49361/strict-preflight-is-still-being-enforced
do not return that a strict analyzer is present in an application if …
2022-06-14 12:03:54 -07:00
Kira Boyle 5e7bd06fcb do not return that a strict analyzer is present in an application if a strict analyzer is excluded 2022-06-14 10:23:42 -07:00
Edgar Lanting b92037171e Merge pull request #1 from edgarlanting/el-patch-contributing
Update CONTRIBUTING.md with small textual changes
2022-06-14 15:00:40 +02:00
Edgar Lanting fc52426a4a Update CONTRIBUTING.md with small textual changes
Changed wording in requirements for clarification
2022-06-14 14:59:40 +02:00
Ethan Mosbaugh 3a5816cd18 Merge pull request #592 from replicatedhq/disable-client-go-logs
Disable client-go logging
2022-06-13 15:04:41 -07:00
Ethan Mosbaugh 7c74f8b755 Disable client-go logging 2022-06-10 15:39:23 +00:00
Diamon Wiggins a881877fd8 Merge pull request #591 from replicatedhq/diamonwiggins/sc-48784/update-contributed-md
Update Contributing.md
2022-06-10 10:28:17 -04:00
Diamon Wiggins c044cc6021 update contributing.md 2022-06-09 11:42:13 -04:00
Alexander 009829c3ff Merge pull request #577 from nachtmaar/template-textanalyzer-message
Template message in outcome block when using textAnalyzer
2022-06-07 16:35:57 +01:00
Alexander 4404849e76 Merge branch 'main' into template-textanalyzer-message 2022-06-06 11:54:05 +01:00
Marc Campbell 374a65522d Merge pull request #588 from replicatedhq/oci-specs
Support for oci:// retreival of specs
2022-06-03 15:26:39 -07:00
Marc Campbell 5da84663b1 Support for oci:// retreival of specs 2022-06-03 12:40:15 -07:00
Nils Seip 0bbf2dff48 Merge branch 'main' into template-textanalyzer-message 2022-06-03 19:41:14 +02:00
Pavan Sokke Nagaraj 156965fd10 Merge pull request #586 from replicatedhq/pa1/fix-client-gen
remove redundant client-gen code generated in wrong path
2022-06-02 20:48:43 -04:00
Pavan Sokke Nagaraj 3da43b18c9 remove redundant client-gen code 2022-06-02 19:33:47 -04:00
Ethan Mosbaugh 78314a5fc4 Merge pull request #587 from replicatedhq/template-delims
Allow for repl{{ template delim
2022-06-02 13:09:51 -07:00
Ethan Mosbaugh 9792289ac1 Remove namespace template from examples 2022-06-02 19:54:31 +00:00
Ethan Mosbaugh 6018068349 Allow for repl{{ template delim 2022-06-02 19:24:23 +00:00
Ethan Mosbaugh 7f829bb3ca Merge pull request #585 from replicatedhq/e2e-test-local 2022-06-02 06:53:55 -07:00
Ethan Mosbaugh d3cf4fc7f4 Run e2e tests locally 2022-06-02 13:41:00 +00:00
Nils Seip e85e9cd464 Merge branch 'main' into template-textanalyzer-message 2022-05-30 09:32:01 +02:00
Pavan Sokke Nagaraj a0a6a5bf19 Merge pull request #581 from replicatedhq/pa1/fix-deployment-status-panic
fix panic: return nil result when no files to check deployment status analyzer
2022-05-27 15:55:14 -04:00
Pavan Sokke Nagaraj 750ebc1277 return nil when no matching analyzer result 2022-05-27 14:33:35 -04:00
Nils Seip 6f997a47a3 Merge branch 'main' into template-textanalyzer-message 2022-05-27 16:49:00 +02:00
Ethan Mosbaugh af1afd09ca Merge pull request #580 from replicatedhq/k8s-1.24-support
Add support for k8s 1.24+
2022-05-24 11:57:10 -07:00
Ethan Mosbaugh 74b4802b46 Add support for k8s 1.24+ 2022-05-24 11:05:59 -07:00
Ethan Mosbaugh c31b803092 Merge pull request #578 from replicatedhq/emosbaugh/sc-48809/analyze-api-fromanalyzerresult-invalid-memory
filter nil analyzer results to prevent panic
2022-05-23 14:35:39 -07:00
Ethan Mosbaugh 84b40804b5 filter nil analyzer results to prevent panic 2022-05-23 19:43:43 +00:00
nachtmaar 3d6841c11e Fix typos 2022-05-20 17:28:44 +02:00
nachtmaar 8adf58b717 Return err instead of panic 2022-05-20 17:23:22 +02:00
nachtmaar 44c07c2a00 Rename CRD -> CR 2022-05-20 17:13:14 +02:00
nachtmaar 9179dc8fec Add test for pass outcome black 2022-05-20 17:01:48 +02:00
nachtmaar a9df4552b4 Use warn log level in warn test 2022-05-20 15:54:12 +02:00
nachtmaar c5505bc017 Rename tests 2022-05-20 15:47:19 +02:00
nachtmaar 3ceffbc4b2 Add test for warn outcome block 2022-05-20 15:45:22 +02:00
nachtmaar 5967105ad2 Make test data more generic 2022-05-20 15:35:47 +02:00
nachtmaar 7eb6263dc1 Template messages in outcome block for textAnalyzer 2022-05-18 15:46:42 +02:00
Ethan Mosbaugh 249e52d3da Merge pull request #576 from replicatedhq/emosbaugh/fix-run-collector-text-analyze
Fix run collector text analyze file path mismatch
2022-05-17 12:09:36 -07:00
Ethan Mosbaugh 6b5b9297ba Use k3s rather than kind for tests 2022-05-17 18:03:04 +00:00
Ethan Mosbaugh 8c15bb1fae build-test-deploy concurrency 1 2022-05-17 17:20:45 +00:00
Ethan Mosbaugh d2d19a2490 Change build step name to test 2022-05-17 17:20:45 +00:00
Ethan Mosbaugh 5c269e2aaf E2E preflight tests 2022-05-17 17:20:45 +00:00
Ethan Mosbaugh 30fb4e2108 Fix run collector text analyze file path mismatch 2022-05-16 23:33:23 +00:00
Diamon Wiggins 24096b0272 Merge pull request #575 from replicatedhq/diamonwiggins/sc-40946/ceph-analyzer-health-status
Ceph health status messages in Analzyer result
2022-05-13 20:05:23 -04:00
diamonwiggins cccc9f23a1 adding new test case for ceph analyzers 2022-05-13 23:39:03 +00:00
diamonwiggins ff4353817f adding ceph health status messages to analyzer result 2022-05-13 22:27:19 +00:00
Diamon Wiggins c2136fcea0 Merge pull request #574 from replicatedhq/diamonwiggins/sc-46879/hostcollectors-supportbundles
Host Collectors in Support Bundles
2022-05-13 11:46:55 -04:00
Diamon Wiggins 9898d3fbb2 Merge branch 'main' into diamonwiggins/sc-46879/hostcollectors-supportbundles 2022-05-13 10:11:56 -04:00
diamonwiggins 5ec3524bde fixing host filesystem perf function for windows and darwin 2022-05-12 20:09:03 +00:00
diamonwiggins a471ad5e74 fixing filepath for kernel modules test 2022-05-12 19:49:04 +00:00
diamonwiggins 7b30e283ea fixing filepath for kernel modules test 2022-05-12 19:43:45 +00:00
diamonwiggins 8c62aadcfc using subdirectory for all host collectors in support bundle 2022-05-12 16:46:24 +00:00
diamonwiggins e7f2685ed8 fix output file for diskUsage collector 2022-05-12 04:20:24 +00:00
diamonwiggins 3b1ba08a6b hardcoding system hostcollector filenames 2022-05-12 03:39:19 +00:00
diamonwiggins 17fe3db79f adding host collectors to support bundles 2022-05-11 22:50:03 +00:00
Pavan Sokke Nagaraj 9ec9806b62 add cve scan github cron action (#572) 2022-05-10 13:52:30 -04:00
Pavan Sokke Nagaraj 061ce1d2eb Merge pull request #569 from replicatedhq/pa1/cves
fix go binaries cve
2022-05-10 12:14:55 -04:00
Pavan Sokke Nagaraj 0f56baf4dc fix cve and update uuid mod 2022-05-10 09:52:42 -04:00
Diamon Wiggins d6a17951d3 Merge pull request #564 from replicatedhq/diamonwiggins/sc-44286/run-pod-spec
RunPod Collector
2022-05-06 11:27:21 -04:00
Diamon Wiggins 9f527ee6a5 Merge branch 'main' into diamonwiggins/sc-44286/run-pod-spec 2022-05-06 11:08:15 -04:00
Ethan Mosbaugh 2c9a37a4f1 BoolOrString pollutes marshalling, does not respect omitempty (#566)
* BoolOrString pollutes marshalling, does not respect omitempty

* fix panic
2022-05-05 16:10:05 -07:00
Ethan Mosbaugh e6e9df1773 Merge pull request #565 from replicatedhq/mysql-collector-example
Mysql collector example
2022-05-04 11:14:25 -07:00
Ethan Mosbaugh 755220cd4c Mysql collector example 2022-05-04 17:45:10 +00:00
Edgar OchoaandEthan Mosbaugh 7289134757 Add Mysql variables to collector (#562)
* Add Mysql variables to collector

* Cleanup row scanning and a few updates based on feedback

* Close db connection

* Move defer db.close

* Updates based on feedback

* Use vars in loop instead of struct

* Only pull parameters specified in collector config

Co-authored-by: Ethan Mosbaugh <ethan@replicated.com>
2022-05-04 10:42:37 -07:00
Jalaja Ganapathy 63362d32ee Include osd disk usage (#563)
* Include osd disk usage

* add timeouts to ceph commands

* removed df, collect from host
2022-05-02 09:51:49 -07:00
diamonwiggins 6cdcb36127 change naming for runPod collector object 2022-05-02 03:12:07 +00:00
diamonwiggins dfe5538132 remove podLabels from run function 2022-05-02 02:53:29 +00:00
diamonwiggins 42902405cd adding new runpod collector and refactoring old run collector to use new code 2022-05-02 02:44:02 +00:00
diamonwiggins 2516924a92 moving imagepullsecret creation into non pod spec declaration 2022-04-19 20:41:28 +00:00
diamonwiggins ce4165f69e fixing typo 2022-04-19 20:29:28 +00:00
diamonwiggins 648f9b8d35 allow entire podspec to be passed in run collector 2022-04-19 16:25:59 +00:00
Ethan Mosbaugh aeb89e57a7 Merge pull request #556 from replicatedhq/emosbaugh/sc-45934/longhorn-logs-collector-all-files-are-empty
Fix missing longhorn logs
2022-04-01 15:21:56 -07:00
Ethan Mosbaugh 8d1a0f6d24 return ReadCloser 2022-04-01 14:22:44 -07:00
Ethan Mosbaugh 0cfd431274 Fix missing longhorn logs 2022-04-01 14:13:32 -07:00
Andrew Lavery fe5dd3ee8f Merge pull request #554 from replicatedhq/laverya/pods-with-notready-containers-are-unhealthy
pods with containers that are not 'ready' are unhealthy
2022-03-25 22:31:25 -04:00
Andrew Lavery 7eb1d5a5fb better parse namespaces, and parse legacy list-of-pods storage format 2022-03-25 22:13:52 -04:00
Andrew Lavery 40cdc6805e pods with containers that are not 'ready' are unhealthy 2022-03-25 21:36:22 -04:00
Pavan Sokke Nagaraj 3d7a255e32 update: add missing database collector code for func GetName() (#553) 2022-03-23 22:00:25 -04:00
Pavan Sokke Nagaraj 77a2475bd2 fix: return true when one of analyzers strict field is true (#552)
* fix: return true when one of analyzers is true

* fix: return true when one of analyzers is true

* update: add unit test

* update: log errors while processing analyzers

* fix: return parse error instead of logging

* fix: update err message

* fix: evaluate strict check err separately
2022-03-23 20:24:21 -04:00
Pavan Sokke Nagaraj 7bfb54360c map strict flag to analyze result (#551)
* add util functions

* rename func HasStrictAnalyzersFailed

* map strict flag to analyze err result
2022-03-22 20:47:50 -04:00
Diamon Wiggins ca0b3c31c1 Merge pull request #544 from replicatedhq/diamonwiggins/sc-44015/run-pod-service-account
Add ServiceAccountName parameter to Run collector
2022-03-03 10:46:31 -05:00
diamonwiggins 2b774e16d7 adding serviceaccountname parameter to run collector 2022-03-03 06:12:42 +00:00
Salah Al Saleh 9d41d4a7be Fix getting pod details for new support bundle formats (#543) 2022-03-01 15:55:47 -08:00
e248ab0f97 Fix strict flag mapping (#542)
* add func BoolOrDefaultFalse and Bool

* use strict.BoolOrDefaultFalse

* Update pkg/multitype/boolstring.go

Co-authored-by: Andrew Lavery <laverya@umich.edu>

* Update pkg/multitype/boolstring_test.go

Co-authored-by: Andrew Lavery <laverya@umich.edu>

* Update pkg/multitype/boolstring_test.go

Co-authored-by: Andrew Lavery <laverya@umich.edu>

* Update boolstring_test.go

* remove duplicate test

* Update pkg/multitype/boolstring_test.go

Co-authored-by: garcialuis <garcialuisdev@gmail.com>

Co-authored-by: Andrew Lavery <laverya@umich.edu>
Co-authored-by: garcialuis <garcialuisdev@gmail.com>
2022-02-24 13:31:51 -05:00
Pavan Sokke Nagaraj 942234da80 Add strict flag to Analyzers and ResultAnalyzers (#539)
* add strict flag to Analyzer/AnalyzerMeta

and regenerate schemas and controller-gen code

* map analyzer strict to result

* Update stdout for human and json format

* fix review comment

* update interactive result

* update interactive results

* Update types.go

* Update upload_results.go

* print strict when only true
2022-02-23 15:07:51 -05:00
Craig O'Donnell 0a2ed01a46 improvement: added --output flag for preflight and support bundle (#538)
* improvement: added --output flag for preflight and support bundle

* improvement: added datetime to preflight default file name
2022-02-17 17:28:28 -05:00
Jeff Golden a818417e8c include atomic collector statuses (#534) 2022-02-10 11:27:13 -06:00
divolgin f9039a0fb5 Merge pull request #533 from replicatedhq/divolgin/gvk
Add GVK to k8s objects in cluster-resources files
2022-02-04 09:28:29 -08:00
divolgin 3351c289ab Add GVK to k8s objects in cluster-resources files 2022-02-04 01:31:07 +00:00
Salah Aldeen Al Saleh 6f0cf6550d find total memory instead of available (#525) 2022-01-11 17:02:44 -08:00
256 changed files with 64094 additions and 20500 deletions
+4
View File
@@ -0,0 +1,4 @@
version: 3
project:
id: github.com/replicatedhq/troubleshoot
+17 -1
View File
@@ -1 +1,17 @@
* @replicatedhq/day2
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.
# More details are here: https://help.github.com/articles/about-codeowners/
# The '*' pattern is global owners.
# Order is important. The last matching pattern has the most precedence.
# The folders are ordered as follows:
# In each subsection folders are ordered first by depth, then alphabetically.
# This should make it easy to add new rules without breaking existing ones.
## RULES
* @replicatedhq/troubleshoot
*.md @replicatedhq/cre
+28
View File
@@ -0,0 +1,28 @@
---
name: Feature Epic
about: Create a tracking issue for a change that is larger than a single task
labels: 'epic'
---
# Design Proposal
Link to the [proposal](https://github.com/replicatedhq/troubleshoot/tree/main/design/template.md)
# Definition of done
Describe what specific goals can measure if this overall task is considered completed. Things to consider are documentation, high level description of the feature working, and tests.
* [ ]
# Subtasks
Create a list of the smaller tasks to implement this design. Task can start as simple descriptions but should be converted to issues before work is started.
## Started
* [ ]
## Planned
* [ ]
+3 -3
View File
@@ -7,11 +7,11 @@ labels: 'feature'
**Describe the rationale for the suggested feature.**
Insert a description of the rationale for the new feature here. For example, you could describe a problem that Troubleshoot doesn't address, a limitation, or an idea to improve Troubleshoot.
Insert a description of the rationale for the new feature here. For example, you could describe a problem that Troubleshoot doesn't address, a limitation, or an idea to improve Troubleshoot.
**Describe the feature**
Insert a description of the feature here. Be specific about how it addresses the any problems, limitations, or suggested improvements outlined in the rationale for the feature.
Insert a description of the feature here. Be specific about how it addresses the problem. Mention any limitations, or suggested improvements outlined in the rationale for the feature.
**Describe alternatives you've considered**
@@ -19,4 +19,4 @@ Describe alternative solutions here. Include any workarounds you've considered.
**Additional context**
Add additional context about the feature request. If the change is substantial, consider attaching files to the issue outlining architectural changes, data flows, file formats etc., anything that helps describe the requested change.
Add additional context about the feature request. If the change is substantial, consider attaching files to the issue outlining architectural changes, data flows, file formats etc., anything that helps describe the requested change.
+84 -23
View File
@@ -7,14 +7,18 @@ on:
- "main"
tags:
- "v*.*.*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-18.04
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.17"
go-version: "1.19"
- name: setup env
run: |
@@ -24,37 +28,39 @@ jobs:
- uses: actions/checkout@v2
- run: make
- run: make test
compile-preflight:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-go@v1
with:
go-version: '1.17'
go-version: '1.19'
- name: setup env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
shell: bash
- uses: actions/checkout@master
- run: make preflight
- run: make generate preflight
- uses: actions/upload-artifact@v1
with:
name: preflight
path: bin/preflight
validate-preflight:
runs-on: ubuntu-latest
needs: compile-preflight
steps:
- uses: replicatedhq/action-k3s@main
id: k3s
with:
version: v1.23.6-k3s1
- name: Download preflight binary
uses: actions/download-artifact@v1
with:
name: preflight
path: bin/
- uses: engineerd/setup-kind@v0.5.0
- run: chmod +x bin/preflight
- run: |
./bin/preflight --interactive=false --format=json https://preflight.replicated.com > result.json
@@ -83,20 +89,36 @@ jobs:
exit $EXIT_STATUS
validate-preflight-e2e:
runs-on: ubuntu-latest
needs: compile-preflight
steps:
- uses: actions/checkout@master
- uses: replicatedhq/action-k3s@main
id: k3s
with:
version: v1.23.6-k3s1
- name: Download preflight binary
uses: actions/download-artifact@v1
with:
name: preflight
path: bin/
- run: chmod +x bin/preflight
- run: make preflight-e2e-test
compile-supportbundle:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-go@v1
with:
go-version: '1.17'
go-version: '1.19'
- name: setup env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
shell: bash
- uses: actions/checkout@master
- run: make support-bundle
- run: make generate support-bundle
- uses: actions/upload-artifact@v1
with:
name: support-bundle
@@ -107,30 +129,68 @@ jobs:
needs: compile-supportbundle
steps:
- uses: actions/checkout@v1
- uses: replicatedhq/action-k3s@main
id: k3s
with:
version: v1.23.6-k3s1
- name: Download support-bundle binary
uses: actions/download-artifact@v1
with:
name: support-bundle
path: bin/
- uses: engineerd/setup-kind@v0.5.0
- run: chmod +x bin/support-bundle
- run: ./bin/support-bundle ./examples/support-bundle/sample-collectors.yaml
- run: ./bin/support-bundle ./examples/support-bundle/sample-supportbundle.yaml
- run: ./bin/support-bundle https://kots.io
validate-supportbundle-e2e:
runs-on: ubuntu-latest
needs: compile-supportbundle
steps:
- uses: actions/checkout@master
- uses: replicatedhq/action-k3s@main
id: k3s
with:
version: v1.23.6-k3s1
- name: Download support bundle binary
uses: actions/download-artifact@v1
with:
name: support-bundle
path: bin/
- run: chmod +x bin/support-bundle
- run: make support-bundle-e2e-test
compile-collect:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
with:
go-version: '1.19'
- name: setup env
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
shell: bash
- uses: actions/checkout@master
- run: make generate collect
- uses: actions/upload-artifact@v1
with:
name: collect
path: bin/collect
goreleaser-test:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') != true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- uses: actions/setup-go@v1
with:
go-version: "1.17"
go-version: "1.19"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
@@ -142,12 +202,13 @@ jobs:
runs-on: ubuntu-latest
needs:
- validate-preflight
- validate-preflight-e2e
- validate-supportbundle
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: azure/docker-login@v1
with:
username: repldeploy2
@@ -155,10 +216,10 @@ jobs:
- name: Unshallow
run: git fetch --prune --unshallow
- uses: actions/setup-go@v1
with:
go-version: "1.17"
go-version: "1.19"
- uses: sigstore/cosign-installer@main
with:
@@ -169,14 +230,14 @@ jobs:
echo $COSIGN_KEY | base64 -d > ./cosign.key
env:
COSIGN_KEY: ${{secrets.COSIGN_KEY}}
- name: Generate SBOM
run: |
make sbom
env:
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
COSIGN_KEY: ${{ secrets.COSIGN_KEY }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
+27
View File
@@ -0,0 +1,27 @@
name: Scan vulnerabilities
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
scan_troubleshoot_files_systems:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'HIGH,CRITICAL'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: 'trivy-results.sarif'
+19
View File
@@ -0,0 +1,19 @@
name: PR license scan
on:
pull_request:
jobs:
fossa-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Run FOSSA Analyze"
uses: fossas/fossa-action@main
with:
api-key: cf2d0196f5b5bb2fd245c559af8766d8 # push-only token, safe to expose
- name: "Run FOSSA Test"
uses: fossas/fossa-action@main
with:
api-key: cf2d0196f5b5bb2fd245c559af8766d8 # push-only token, safe to expose
run-tests: true
+25
View File
@@ -0,0 +1,25 @@
name: Require pull request labels
permissions:
pull-requests: read
on:
pull_request:
types:
- opened
- labeled
- unlabeled
- synchronize
jobs:
require-pr-labels:
uses: replicatedhq/reusable-workflows/.github/workflows/pr-enforce-labels.yaml@main
require-bug-labels:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v2
if: ${{ github.event.label.name == 'type::bug' }}
with:
mode: exactly
count: 1
labels: "bug::normal, bug::regression"
+4
View File
@@ -6,6 +6,7 @@
*.so
*.dylib
bin
.DS_Store
# Test binary, build with `go test -c`
*.test
@@ -34,3 +35,6 @@ workspace.*
cosign.key
sbom/
# Ignore local pre-commit config
.pre-commit-config.yaml
+12
View File
@@ -0,0 +1,12 @@
# https://golangci-lint.run/usage/configuration/#config-file
run:
allow-parallel-runners: true
timeout: 30s
linters:
enable:
- gocritic
- gocyclo
- gofmt
- gosec
+64 -4
View File
@@ -3,9 +3,69 @@
Thank you for your interest in Troubleshoot, we welcome your participation. Please familiarize yourself with our [Code of Conduct](https://github.com/replicatedhq/troubleshoot/blob/master/CODE_OF_CONDUCT.md) prior to contributing. There are a number of ways to participate in Troubleshoot as outlined below:
## Issues
- [Request a New Feature](https://github.com/replicatedhq/troubleshoot/issues/new?assignees=&labels=feature&template=feature_enhancement.md) Create an issue to add functionality that addresses a problem or adds an enhancement.
- [Report a Bug](https://github.com/replicatedhq/troubleshoot/issues/new?assignees=&labels=bug&template=bug_report.md) Report a problem or unexpected behaviour with Troubleshoot.
## Pull Requests
- [Request a New Feature](https://github.com/replicatedhq/troubleshoot/issues/new?assignees=&labels=feature&template=feature_enhancement.md) Create an issue to add functionality that addresses a problem or adds an enhancement.
- [Report a Bug](https://github.com/replicatedhq/troubleshoot/issues/new?assignees=&labels=bug&template=bug_report.md) Report a problem or unexpected behaviour with Troubleshoot.
If you are interested in contributing a change to the code or documentation please open a pull request with your set of changes. The pull request will be reviewed in a timely manner.
## Design Principles
When implementing a new feature please review the [design principles](./design/design-principles.md) to help guide the approach.
## Development Environment
To get started we recommend:
1. Go (v1.17 or later)
2. A Kubernetes cluster (we recommend <https://k3d.io/>. This requires Docker v20.10.5 or later)
3. Fork and clone the repo to $GOPATH/src/github.com/replicatedhq/
4. Run `make support-bundle preflight` to generate binaries
5. Run `make run-troubleshoot` to generate a support bundle with the `sample-troubleshoot.yaml` in the root of the repo
> Note: recent versions of Go support easy cross-compilation. For example, to cross-compile a Linux binary from MacOS:
> `GOOS=linux GOARCH=amd64 make support-bundle preflight`
6. Install [golangci-lint] linter and run `make lint` to execute code linters.
### Testing
To run the tests locally run the following:
```bash
make test
```
Additionally, e2e tests can be run with:
```bash
make support-bundle preflight e2e-test
```
A Kubernetes cluster as well as `jq` are required to run e2e tests.
## Contribution workflow
This is a rough outline of how to prepare a contribution:
- Create a fork of this repo.
- Create a topic branch from where you want to base your work (branched from `main` is a safe choice).
- Make commits of logical units.
- When your changes are ready to merge, squash your history to 1 commit.
- For example, if you want to squash your last 3 commits and write a new commit message:
```
git reset --soft HEAD~3 &&
git commit
```
- If you want to keep the previous commit messages and concatenate them all into a new commit, you can do something like this instead:
```
git reset --soft HEAD~3 &&
git commit --edit -m"$(git log --format=%B --reverse HEAD..HEAD@{1})"
```
- Push your changes to a topic branch in your fork of the repository.
- Submit a pull request to the original repository. It will be reviewed in a timely manner.
### Pull Requests
A pull request should address a single issue, feature or bug. For example, lets say you've written code that fixes two issues. That's great! However, you should submit two small pull requests, one for each issue as opposed to combining them into a single larger pull request. In general the size of the pull request should be kept small in order to make it easy for a reviewer to understand, and to minimize risks from integrating many changes at the same time. For example, if you are working on a large feature you should break it into several smaller PRs by implementing the feature as changes to several packages and submitting a separate pull request for each one. Squash commit history when preparing your PR so it merges as 1 commit.
Code submitted in pull requests must be properly documented, formatted and tested in order to be approved and merged. The following guidelines describe the things a reviewer will look for when they evaluate your pull request. Here's a tip. If your reviewer doesn't understand what the code is doing, they won't approve the pull request. Strive to make code clear and well documented. If possible, request a reviewer that has some context on the PR.
+35 -9
View File
@@ -35,31 +35,39 @@ endef
BUILDFLAGS = -tags "netgo containers_image_ostree_stub exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp" -installsuffix netgo
all: test
all: test support-bundle preflight collect
.PHONY: ffi
ffi: fmt vet
go build ${BUILDFLAGS} ${LDFLAGS} -o bin/troubleshoot.so -buildmode=c-shared ffi/main.go
# Run tests
.PHONY: test
test: generate fmt vet
go test ${BUILDFLAGS} ./pkg/... ./cmd/... -coverprofile cover.out
.PHONY: preflight-e2e-test
preflight-e2e-test:
./test/validate-preflight-e2e.sh
.PHONY: support-bundle-e2e-test
support-bundle-e2e-test:
./test/validate-support-bundle-e2e.sh
.PHONY: support-bundle
support-bundle: generate fmt vet
support-bundle:
go build ${BUILDFLAGS} ${LDFLAGS} -o bin/support-bundle github.com/replicatedhq/troubleshoot/cmd/troubleshoot
.PHONY: preflight
preflight: generate fmt vet
preflight:
go build ${BUILDFLAGS} ${LDFLAGS} -o bin/preflight github.com/replicatedhq/troubleshoot/cmd/preflight
.PHONY: analyze
analyze: generate fmt vet
analyze:
go build ${BUILDFLAGS} ${LDFLAGS} -o bin/analyze github.com/replicatedhq/troubleshoot/cmd/analyze
.PHONY: collect
collect: generate fmt vet
go build ${BUILDFLAGS} ${LDFLAGS} -o bin/collect github.com/replicatedhq/troubleshoot/cmd/collect
collect:
go build ${BUILDFLAGS} ${LDFLAGS} -o bin/collect github.com/replicatedhq/troubleshoot/cmd/collect
.PHONY: fmt
fmt:
@@ -74,6 +82,7 @@ generate: controller-gen client-gen
$(CONTROLLER_GEN) \
object:headerFile=./hack/boilerplate.go.txt paths=./pkg/apis/...
$(CLIENT_GEN) \
--output-base=./../../../ \
--output-package=github.com/replicatedhq/troubleshoot/pkg/client \
--clientset-name troubleshootclientset \
--input-base github.com/replicatedhq/troubleshoot/pkg/apis \
@@ -150,7 +159,7 @@ generate-sbom: install-spdx-sbom-generator
$(SPDX_GENERATOR) -o ./sbom/spdx
sbom/assets/troubleshoot-sbom.tgz: generate-sbom
tar -czf sbom/assets/troubleshoot-sbom.tgz sbom/spdx/*.spdx
tar -czf sbom/assets/troubleshoot-sbom.tgz sbom/spdx/*.spdx
sbom: sbom/assets/troubleshoot-sbom.tgz
cosign sign-blob -key cosign.key sbom/assets/troubleshoot-sbom.tgz > sbom/assets/troubleshoot-sbom.tgz.sig
@@ -169,3 +178,20 @@ longhorn:
find pkg/longhorn -type f | xargs sed -i "s/github.com\/longhorn\/longhorn-manager\/types/github.com\/replicatedhq\/troubleshoot\/pkg\/longhorn\/types/g"
find pkg/longhorn -type f | xargs sed -i "s/github.com\/longhorn\/longhorn-manager\/util/github.com\/replicatedhq\/troubleshoot\/pkg\/longhorn\/util/g"
rm -rf longhorn-manager
.PHONY: scan
scan:
trivy fs \
--security-checks vuln \
--exit-code=1 \
--severity="HIGH,CRITICAL" \
--ignore-unfixed \
./
.PHONY: lint
lint:
golangci-lint run -c .golangci.yaml
.PHONY: lint-and-fix
lint-and-fix:
golangci-lint run --fix -c .golangci.yaml
+5 -5
View File
@@ -9,12 +9,12 @@ Preflight checks are an easy-to-run set of conformance tests that can be written
To run a sample preflight check from a sample application, install the preflight kubectl plugin:
```shell
```
curl https://krew.sh/preflight | bash
```
and run:
```shell
```
kubectl preflight https://preflight.replicated.com
```
@@ -26,12 +26,12 @@ A support bundle is an archive that's created in-cluster, by collecting logs and
To collect a sample support bundle, install the troubleshoot kubectl plugin:
```shell
```
curl https://krew.sh/support-bundle | bash
```
and run:
```shell
```
kubectl support-bundle https://support-bundle.replicated.com
```
For more details on creating the custom resource files that drive support-bundle collection, visit [creating collectors](https://troubleshoot.sh/docs/collect/) and [creating analyzers](https://troubleshoot.sh/docs/analyze/).
@@ -48,7 +48,7 @@ A signed SBOM that includes Troubleshoot dependencies is included in each relea
The following example illustrates using [cosign](https://github.com/sigstore/cosign) to verify that **troubleshoot-sbom.tgz** has
not been tampered with.
```shell
```
$ cosign verify-blob -key key.pub -signature troubleshoot-sbom.tgz.sig troubleshoot-sbom.tgz
Verified OK
```
+9 -1
View File
@@ -4,10 +4,12 @@ import (
"os"
"strings"
"github.com/go-logr/logr"
"github.com/replicatedhq/troubleshoot/pkg/k8sutil"
"github.com/replicatedhq/troubleshoot/pkg/logger"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"k8s.io/klog/v2"
)
func RootCmd() *cobra.Command {
@@ -18,7 +20,12 @@ func RootCmd() *cobra.Command {
Long: `Run a series of analyzers on a support bundle archive`,
SilenceUsage: true,
PreRun: func(cmd *cobra.Command, args []string) {
viper.BindPFlags(cmd.Flags())
v := viper.GetViper()
v.BindPFlags(cmd.Flags())
if !v.GetBool("debug") {
klog.SetLogger(logr.Discard())
}
},
RunE: func(cmd *cobra.Command, args []string) error {
v := viper.GetViper()
@@ -32,6 +39,7 @@ func RootCmd() *cobra.Command {
cobra.OnInitialize(initConfig)
cmd.Flags().String("analyzers", "", "filename or url of the analyzers to use")
cmd.Flags().Bool("debug", false, "enable debug logging")
viper.BindPFlags(cmd.Flags())
+9 -1
View File
@@ -4,10 +4,12 @@ import (
"os"
"strings"
"github.com/go-logr/logr"
"github.com/replicatedhq/troubleshoot/pkg/k8sutil"
"github.com/replicatedhq/troubleshoot/pkg/logger"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"k8s.io/klog/v2"
)
func RootCmd() *cobra.Command {
@@ -18,7 +20,12 @@ func RootCmd() *cobra.Command {
Long: `Run a collector and output the results.`,
SilenceUsage: true,
PreRun: func(cmd *cobra.Command, args []string) {
viper.BindPFlags(cmd.Flags())
v := viper.GetViper()
v.BindPFlags(cmd.Flags())
if !v.GetBool("debug") {
klog.SetLogger(logr.Discard())
}
},
RunE: func(cmd *cobra.Command, args []string) error {
v := viper.GetViper()
@@ -39,6 +46,7 @@ func RootCmd() *cobra.Command {
cmd.Flags().String("collector-pull-policy", "", "the pull policy of the collector image")
cmd.Flags().String("selector", "", "selector (label query) to filter remote collection nodes on.")
cmd.Flags().Bool("collect-without-permissions", false, "always generate a support bundle, even if it some require additional permissions")
cmd.Flags().Bool("debug", false, "enable debug logging")
// hidden in favor of the `insecure-skip-tls-verify` flag
cmd.Flags().Bool("allow-insecure-connections", false, "when set, do not verify TLS certs when retrieving spec and reporting results")
+11 -11
View File
@@ -4,9 +4,12 @@ import (
"os"
"strings"
"github.com/go-logr/logr"
"github.com/replicatedhq/troubleshoot/pkg/k8sutil"
"github.com/replicatedhq/troubleshoot/pkg/preflight"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"k8s.io/klog/v2"
)
func RootCmd() *cobra.Command {
@@ -18,26 +21,23 @@ func RootCmd() *cobra.Command {
that a cluster meets the requirements to run an application.`,
SilenceUsage: true,
PreRun: func(cmd *cobra.Command, args []string) {
viper.BindPFlags(cmd.Flags())
v := viper.GetViper()
v.BindPFlags(cmd.Flags())
if !v.GetBool("debug") {
klog.SetLogger(logr.Discard())
}
},
RunE: func(cmd *cobra.Command, args []string) error {
v := viper.GetViper()
return runPreflights(v, args[0])
return preflight.RunPreflights(v.GetBool("interactive"), v.GetString("output"), v.GetString("format"), args[0])
},
}
cobra.OnInitialize(initConfig)
cmd.AddCommand(VersionCmd())
cmd.Flags().Bool("interactive", true, "interactive preflights")
cmd.Flags().String("format", "human", "output format, one of human, json, yaml. only used when interactive is set to false")
cmd.Flags().String("collector-image", "", "the full name of the collector image to use")
cmd.Flags().String("collector-pullpolicy", "", "the pull policy of the collector image")
cmd.Flags().Bool("collect-without-permissions", true, "always run preflight checks even if some require permissions that preflight does not have")
cmd.Flags().String("selector", "", "selector (label query) to filter remote collection nodes on.")
cmd.Flags().String("since-time", "", "force pod logs collectors to return logs after a specific date (RFC3339)")
cmd.Flags().String("since", "", "force pod logs collectors to return logs newer than a relative duration like 5s, 2m, or 3h.")
preflight.AddFlags(cmd.PersistentFlags())
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
+3 -2
View File
@@ -204,10 +204,11 @@ func drawDetails(analysisResult *analyzerunner.AnalyzeResult) {
uri := widgets.NewParagraph()
uri.Text = fmt.Sprintf("For more information: %s", analysisResult.URI)
uri.Border = false
height = estimateNumberOfLines(uri.Text, termWidth/2)
// For long urls that lead to wrapping text, make the rectangle bigger by
// increasing the calculated height by 2
height = estimateNumberOfLines(uri.Text, termWidth/2) + 2
uri.SetRect(termWidth/2, currentTop, termWidth, currentTop+height)
ui.Render(uri)
currentTop = currentTop + height + 1
}
}
+18 -3
View File
@@ -5,29 +5,36 @@ import (
"os"
"strings"
"github.com/go-logr/logr"
troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
"github.com/replicatedhq/troubleshoot/pkg/k8sutil"
"github.com/replicatedhq/troubleshoot/pkg/logger"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"k8s.io/klog/v2"
)
func RootCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "support-bundle [url]",
Args: cobra.MinimumNArgs(1),
Args: cobra.MinimumNArgs(0),
Short: "Generate a support bundle",
Long: `A support bundle is an archive of files, output, metrics and state
from a server that can be used to assist when troubleshooting a Kubernetes cluster.`,
SilenceUsage: true,
PreRun: func(cmd *cobra.Command, args []string) {
viper.BindPFlags(cmd.Flags())
v := viper.GetViper()
v.BindPFlags(cmd.Flags())
if !v.GetBool("debug") {
klog.SetLogger(logr.Discard())
}
},
RunE: func(cmd *cobra.Command, args []string) error {
v := viper.GetViper()
logger.SetQuiet(v.GetBool("quiet"))
return runTroubleshoot(v, args[0])
return runTroubleshoot(v, args)
},
}
@@ -40,13 +47,21 @@ from a server that can be used to assist when troubleshooting a Kubernetes clust
cmd.Flags().Bool("redact", true, "enable/disable default redactions")
cmd.Flags().Bool("interactive", true, "enable/disable interactive mode")
cmd.Flags().Bool("collect-without-permissions", true, "always generate a support bundle, even if it some require additional permissions")
cmd.Flags().StringSliceP("selector", "l", []string{"troubleshoot.io/kind=supportbundle-spec"}, "selector to filter on for loading additional support bundle specs found in secrets within the cluster")
cmd.Flags().Bool("load-cluster-specs", false, "enable/disable loading additional support bundle specs found in secrets within the cluster. required when no specs are provided on the command line")
cmd.Flags().String("since-time", "", "force pod logs collectors to return logs after a specific date (RFC3339)")
cmd.Flags().String("since", "", "force pod logs collectors to return logs newer than a relative duration like 5s, 2m, or 3h.")
cmd.Flags().StringP("output", "o", "", "specify the output file path for the support bundle")
cmd.Flags().Bool("debug", false, "enable debug logging")
// hidden in favor of the `insecure-skip-tls-verify` flag
cmd.Flags().Bool("allow-insecure-connections", false, "when set, do not verify TLS certs when retrieving spec and reporting results")
cmd.Flags().MarkHidden("allow-insecure-connections")
// `no-uri` references the `followURI` functionality where we can use an upstream spec when creating a support bundle
// This flag makes sure we can also disable this and fall back to the default spec.
cmd.Flags().Bool("no-uri", false, "When this flag is used, Troubleshoot does not attempt to retrieve the bundle referenced by the uri: field in the spec.`")
viper.BindPFlags(cmd.Flags())
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
+113 -39
View File
@@ -22,16 +22,27 @@ import (
"github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
troubleshootclientsetscheme "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
"github.com/replicatedhq/troubleshoot/pkg/convert"
"github.com/replicatedhq/troubleshoot/pkg/docrewrite"
"github.com/replicatedhq/troubleshoot/pkg/httputil"
"github.com/replicatedhq/troubleshoot/pkg/k8sutil"
"github.com/replicatedhq/troubleshoot/pkg/logger"
"github.com/replicatedhq/troubleshoot/pkg/specs"
"github.com/replicatedhq/troubleshoot/pkg/supportbundle"
"github.com/spf13/viper"
spin "github.com/tj/go-spin"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
)
func runTroubleshoot(v *viper.Viper, arg string) error {
const (
SupportBundleSecretKey = "support-bundle-spec"
)
func runTroubleshoot(v *viper.Viper, arg []string) error {
if v.GetBool("load-cluster-specs") == false && len(arg) < 1 {
return errors.New("flag load-cluster-specs must be set if no specs are provided on the command line")
}
interactive := v.GetBool("interactive") && isatty.IsTerminal(os.Stdout.Fd())
if interactive {
@@ -68,23 +79,104 @@ func runTroubleshoot(v *viper.Viper, arg string) error {
})
}
collectorContent, err := supportbundle.LoadSupportBundleSpec(arg)
if err != nil {
return errors.Wrap(err, "failed to load collector spec")
}
multidocs := strings.Split(string(collectorContent), "\n---\n")
// we support both raw collector kinds and supportbundle kinds here
supportBundle, err := supportbundle.ParseSupportBundleFromDoc([]byte(multidocs[0]))
if err != nil {
return errors.Wrap(err, "failed to parse collector")
}
var mainBundle *troubleshootv1beta2.SupportBundle
troubleshootclientsetscheme.AddToScheme(scheme.Scheme)
decode := scheme.Codecs.UniversalDeserializer().Decode
additionalRedactors := &troubleshootv1beta2.Redactor{}
// Defining `v` below will render using `v` in reference to Viper unusable.
// Therefore refactoring `v` to `val` will make sure we can still use it.
for i, val := range arg {
collectorContent, err := supportbundle.LoadSupportBundleSpec(val)
if err != nil {
return errors.Wrap(err, "failed to load support bundle spec")
}
multidocs := strings.Split(string(collectorContent), "\n---\n")
// Referencing `ParseSupportBundle with a secondary arg of `no-uri`
// Will make sure we can enable or disable the use of the `Spec.uri` field for an upstream spec.
// This change will not have an impact on KOTS' usage of `ParseSupportBundle`
// As Kots uses `load.go` directly.
supportBundle, err := supportbundle.ParseSupportBundle([]byte(multidocs[0]), !v.GetBool("no-uri"))
if err != nil {
return errors.Wrap(err, "failed to parse support bundle spec")
}
if i == 0 {
mainBundle = supportBundle
} else {
mainBundle = supportbundle.ConcatSpec(mainBundle, supportBundle)
}
parsedRedactors, err := supportbundle.ParseRedactorsFromSpec(multidocs)
if err != nil {
return errors.Wrap(err, "failed to parse redactors from doc")
}
additionalRedactors.Spec.Redactors = append(additionalRedactors.Spec.Redactors, parsedRedactors...)
}
if v.GetBool("load-cluster-specs") {
labelSelector := strings.Join(v.GetStringSlice("selector"), ",")
parsedSelector, err := labels.Parse(labelSelector)
if err != nil {
return errors.Wrap(err, "unable to parse selector")
}
namespace := ""
if v.GetString("namespace") != "" {
namespace = v.GetString("namespace")
}
config, err := k8sutil.GetRESTConfig()
if err != nil {
return errors.Wrap(err, "failed to convert kube flags to rest config")
}
client, err := kubernetes.NewForConfig(config)
if err != nil {
return errors.Wrap(err, "failed to convert create k8s client")
}
bundlesFromSecrets, err := specs.LoadFromSecretMatchingLabel(client, parsedSelector.String(), namespace, SupportBundleSecretKey)
if err != nil {
logger.Printf("failed to load support bundle spec from secrets: %s", err)
}
if bundlesFromSecrets != nil {
for _, bundle := range bundlesFromSecrets {
multidocs := strings.Split(string(bundle), "\n---\n")
parsedBundlesFromSecrets, err := supportbundle.ParseSupportBundleFromDoc([]byte(multidocs[0]))
if err != nil {
logger.Printf("failed to parse support bundle spec: %s", err)
continue
}
if mainBundle == nil {
mainBundle = parsedBundlesFromSecrets
} else {
mainBundle = supportbundle.ConcatSpec(mainBundle, parsedBundlesFromSecrets)
}
parsedRedactors, err := supportbundle.ParseRedactorsFromSpec(multidocs)
if err != nil {
logger.Printf("failed to parse redactors from doc: %s", err)
continue
}
additionalRedactors.Spec.Redactors = append(additionalRedactors.Spec.Redactors, parsedRedactors...)
}
}
if mainBundle == nil {
return errors.New("no specs found in cluster")
}
}
if mainBundle == nil {
return errors.New("no support bundle specs provided to run")
} else if mainBundle.Spec.Collectors == nil && mainBundle.Spec.HostCollectors == nil {
return errors.New("no collectors specified in support bundle")
}
for idx, redactor := range v.GetStringSlice("redactors") {
redactorObj, err := supportbundle.GetRedactorFromURI(redactor)
if err != nil {
@@ -96,25 +188,6 @@ func runTroubleshoot(v *viper.Viper, arg string) error {
}
}
for i, additionalDoc := range multidocs {
if i == 0 {
continue
}
additionalDoc, err := docrewrite.ConvertToV1Beta2([]byte(additionalDoc))
if err != nil {
return errors.Wrap(err, "failed to convert to v1beta2")
}
obj, _, err := decode(additionalDoc, nil, nil)
if err != nil {
return errors.Wrapf(err, "failed to parse additional doc %d", i)
}
multidocRedactors, ok := obj.(*troubleshootv1beta2.Redactor)
if !ok {
continue
}
additionalRedactors.Spec.Redactors = append(additionalRedactors.Spec.Redactors, multidocRedactors.Spec.Redactors...)
}
var collectorCB func(chan interface{}, string)
progressChan := make(chan interface{}) // non-zero buffer can result in missed messages
finishedCh := make(chan bool, 1)
@@ -181,6 +254,7 @@ func runTroubleshoot(v *viper.Viper, arg string) error {
Namespace: v.GetString("namespace"),
ProgressChan: progressChan,
SinceTime: sinceTime,
OutputPath: v.GetString("output"),
Redact: v.GetBool("redact"),
FromCLI: true,
}
@@ -192,7 +266,7 @@ func runTroubleshoot(v *viper.Viper, arg string) error {
c.Println(fmt.Sprintf("\r%s\r", cursor.ClearEntireLine()))
}
response, err := supportbundle.CollectSupportBundleFromSpec(&supportBundle.Spec, additionalRedactors, createOpts)
response, err := supportbundle.CollectSupportBundleFromSpec(&mainBundle.Spec, additionalRedactors, createOpts)
if err != nil {
return errors.Wrap(err, "failed to run collect and analyze process")
}
@@ -201,7 +275,7 @@ func runTroubleshoot(v *viper.Viper, arg string) error {
close(finishedCh) // this removes the spinner
isFinishedChClosed = true
if err := showInteractiveResults(supportBundle.Name, response.AnalyzerResults); err != nil {
if err := showInteractiveResults(mainBundle.Name, response.AnalyzerResults); err != nil {
interactive = false
}
} else {
@@ -210,7 +284,7 @@ func runTroubleshoot(v *viper.Viper, arg string) error {
}
if !response.FileUploaded {
if appName := supportBundle.Labels["applicationName"]; appName != "" {
if appName := mainBundle.Labels["applicationName"]; appName != "" {
f := `A support bundle for %s has been created in this directory
named %s. Please upload it on the Troubleshoot page of
the %s Admin Console to begin analysis.`
@@ -228,7 +302,7 @@ the %s Admin Console to begin analysis.`
return nil
}
fmt.Printf("%s\n", response.ArchivePath)
fmt.Printf("\n%s\n", response.ArchivePath)
return nil
}
@@ -81,6 +81,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- namespace
- outcomes
@@ -127,6 +129,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -168,6 +172,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -215,6 +221,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- configMapName
- namespace
@@ -258,6 +266,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -301,6 +311,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- customResourceDefinitionName
- outcomes
@@ -351,6 +363,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- name
- outcomes
@@ -393,6 +407,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -436,6 +452,8 @@ spec:
type: array
registryName:
type: string
strict:
type: BoolString
required:
- outcomes
- registryName
@@ -482,6 +500,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- ingressName
- namespace
@@ -533,6 +553,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- name
- outcomes
@@ -579,6 +601,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- namespace
- outcomes
@@ -625,6 +649,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- collectorName
- outcomes
@@ -693,6 +719,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -738,6 +766,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- collectorName
- outcomes
@@ -784,6 +814,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- collectorName
- outcomes
@@ -828,6 +860,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- collectorName
- outcomes
@@ -882,6 +916,8 @@ spec:
items:
type: string
type: array
strict:
type: BoolString
required:
- name
- outcomes
@@ -931,6 +967,8 @@ spec:
type: array
secretName:
type: string
strict:
type: BoolString
required:
- namespace
- outcomes
@@ -982,6 +1020,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- name
- outcomes
@@ -1026,6 +1066,8 @@ spec:
type: array
storageClassName:
type: string
strict:
type: BoolString
required:
- outcomes
- storageClassName
@@ -1068,6 +1110,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -1119,6 +1163,8 @@ spec:
type: string
regexGroups:
type: string
strict:
type: BoolString
required:
- outcomes
type: object
@@ -1130,6 +1176,8 @@ spec:
type: BoolString
reportFileGlob:
type: string
strict:
type: BoolString
required:
- reportFileGlob
type: object
File diff suppressed because it is too large Load Diff
+130 -80
View File
@@ -43,6 +43,8 @@ spec:
properties:
checkName:
type: string
collectorName:
type: string
exclude:
type: BoolString
includeUnmountedPartitions:
@@ -82,6 +84,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- includeUnmountedPartitions
- minimumAcceptableSize
@@ -127,6 +131,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -134,6 +140,8 @@ spec:
properties:
checkName:
type: string
collectorName:
type: string
exclude:
type: BoolString
outcomes:
@@ -168,6 +176,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -211,6 +221,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -254,6 +266,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -261,46 +275,7 @@ spec:
properties:
checkName:
type: string
exclude:
type: BoolString
outcomes:
items:
properties:
fail:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
pass:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
warn:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
type: object
type: array
required:
- outcomes
type: object
hostServices:
properties:
checkName:
collectorName:
type: string
exclude:
type: BoolString
@@ -336,6 +311,53 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
hostServices:
properties:
checkName:
type: string
collectorName:
type: string
exclude:
type: BoolString
outcomes:
items:
properties:
fail:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
pass:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
warn:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -379,6 +401,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -422,6 +446,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -429,6 +455,8 @@ spec:
properties:
checkName:
type: string
collectorName:
type: string
exclude:
type: BoolString
outcomes:
@@ -463,6 +491,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -470,46 +500,7 @@ spec:
properties:
checkName:
type: string
exclude:
type: BoolString
outcomes:
items:
properties:
fail:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
pass:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
warn:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
type: object
type: array
required:
- outcomes
type: object
memory:
properties:
checkName:
collectorName:
type: string
exclude:
type: BoolString
@@ -545,6 +536,53 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
memory:
properties:
checkName:
type: string
collectorName:
type: string
exclude:
type: BoolString
outcomes:
items:
properties:
fail:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
pass:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
warn:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -588,6 +626,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -631,6 +671,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -674,6 +716,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -717,6 +761,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -724,6 +770,8 @@ spec:
properties:
checkName:
type: string
collectorName:
type: string
exclude:
type: BoolString
outcomes:
@@ -758,6 +806,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
+130 -80
View File
@@ -43,6 +43,8 @@ spec:
properties:
checkName:
type: string
collectorName:
type: string
exclude:
type: BoolString
includeUnmountedPartitions:
@@ -82,6 +84,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- includeUnmountedPartitions
- minimumAcceptableSize
@@ -127,6 +131,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -134,6 +140,8 @@ spec:
properties:
checkName:
type: string
collectorName:
type: string
exclude:
type: BoolString
outcomes:
@@ -168,6 +176,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -211,6 +221,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -254,6 +266,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -261,46 +275,7 @@ spec:
properties:
checkName:
type: string
exclude:
type: BoolString
outcomes:
items:
properties:
fail:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
pass:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
warn:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
type: object
type: array
required:
- outcomes
type: object
hostServices:
properties:
checkName:
collectorName:
type: string
exclude:
type: BoolString
@@ -336,6 +311,53 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
hostServices:
properties:
checkName:
type: string
collectorName:
type: string
exclude:
type: BoolString
outcomes:
items:
properties:
fail:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
pass:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
warn:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -379,6 +401,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -422,6 +446,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -429,6 +455,8 @@ spec:
properties:
checkName:
type: string
collectorName:
type: string
exclude:
type: BoolString
outcomes:
@@ -463,6 +491,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -470,46 +500,7 @@ spec:
properties:
checkName:
type: string
exclude:
type: BoolString
outcomes:
items:
properties:
fail:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
pass:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
warn:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
type: object
type: array
required:
- outcomes
type: object
memory:
properties:
checkName:
collectorName:
type: string
exclude:
type: BoolString
@@ -545,6 +536,53 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
memory:
properties:
checkName:
type: string
collectorName:
type: string
exclude:
type: BoolString
outcomes:
items:
properties:
fail:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
pass:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
warn:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -588,6 +626,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -631,6 +671,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -674,6 +716,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -717,6 +761,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
@@ -724,6 +770,8 @@ spec:
properties:
checkName:
type: string
collectorName:
type: string
exclude:
type: BoolString
outcomes:
@@ -758,6 +806,8 @@ spec:
type: object
type: object
type: array
strict:
type: BoolString
required:
- outcomes
type: object
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -3,6 +3,7 @@ kind: Collector
metadata:
name: collector-sample
spec:
uri: https://raw.githubusercontent.com/replicatedhq/troubleshoot-specs/main/in-cluster/default.yaml
collectors:
- clusterInfo: {}
- clusterResources: {}
+27
View File
@@ -0,0 +1,27 @@
# Troubleshoot Design Principles
This document captures design principles that the Troubleshoot project abides by. This is intended to provide new contributors with guidance on how to approach problems and a better understanding of what to consider and address while implementing features.
## Client not Cluster based
Troubleshoot has to communicate with the Kubernetes API server to gather information. However, Troubleshoot should interact with the cluster as little as reasonably possible and has no intention of having a persistent in-cluster presence. There are several reasons for this approach, in no particular order those include:
* Users experiencing an issue in their cluster may discover Troubleshoot after they have a problem and requiring installed components may exclude them from solving their problem.
* A user may have limited cluster access and requiring cluster wide installation like a CRD or Operator can prevent them for using tools to recover from their errors.
* By definition Troubleshoot is being used because there is an issue with the cluster, to prevent exasperating the issue Troubleshoot should avoid writing to the cluster.
## Tools not specs
The Troubleshoot project should include tools which can be used to diagnose issues but is not attempting to include Specs built into the project itself. The number of issues and projects which could benefit from Troubleshoot is very large and we intended to enable those projects to better support their project. It is unreasonable and undesirable for Troubleshoot to be the source of truth for all possible cluster and software issues.
## Fail forward
Clusters with issues can be unpredictable, the scope of error conditions is likely unbounded. Troubleshoot should keep this in mind when doing error handling and fail forward proceeding with as much of the intended operation as possible while logging the errors. For example if a collector fails to collect information that should not prevent other collectors from running. Any condition that causes Troubleshoot to hang or not complete a run is considered a bug.
## Provide a predictable user experience
When things go wrong people can be stressed and stressed people aren't likely to thoroughly read documentation. Whenever possible default values, command line flags, etc should be set to provide a user the best experience possible with the input provided. Some examples of this include:
* When accepting flags for things like Namespaces, as much as possible, use the same syntax that `kubectl` accepts which users are likely to try instinctively.
* Default to gathering more information not less, rarely is it easier to diagnose an issue with less information.
+138
View File
@@ -0,0 +1,138 @@
# Provide the ability to specify multiple Troubleshoot specs in one run of support-bundle or preflight
Troubleshoot doesn't have a modular way for different components to specify specifications. If a software project wanted to include project specific items the end user would have a hard time knowing where to find those and how to collect them. Furthermore if multiple projects were to do this the user would have to run troubleshoot multiple times.
Ideally troubleshoot would allow merging of specs to allow building a spec either automatically or influenced by user input to target specific needs.
## Goals
Primary goal: Allow folks that develop a particular component to maintain Troubleshoot specs for that component, including Vendors for their application.
Long term goal: allow folks to update the component specs without needing to run any other upgrades.
This proposal initially adds the ability to supply multiple support bundle specs for a single run of support-bundle and/or preflight so that:
* when Troubleshoot runs, the spec it uses is an aggregate of multiple specs from the same source - yaml file, URL, configMap, or (new) CRD
* each software component can contribute a Troubleshoot spec that is specific to that software
* Ownership of each individual spec per component transfers to the owner of that component
This will:
* Ensure support bundles generated by users are comprehensive and contain all needed information for a project maintainer to action
* Allow multiple specs from different projects, should a cluster have multiple projects using Troubleshoot
* Software developers to continually update specs for components to easily identify known issues and reduce support noise.
## Non Goals
* Compatibility with previous URL, configMap and yaml specs, both Redactors and SupportBundle types
* Maintain the ability to read secrets from the Kubernetes API
## Background
When users of Troubleshoot create a support bundle from the CLI, they use a single spec that is provided from:
* A secret installed in the cluster by an application such as [KOTS](kots.io)
* A url like <http://kots.io>
* some other single example spec, e.g. <https://github.com/replicatedhq/troubleshoot-specs>
When KOTS collects a support bundles from the KOTS UI, the spec is a [merged](https://github.com/replicatedhq/kots/blob/main/pkg/supportbundle/spec.go#L426) combination of the following:
* The [default spec](https://github.com/replicatedhq/kots/blob/main/pkg/supportbundle/defaultspec/spec.yaml) in the kots code
* The spec provided by the Vendors application bundle
* This merged spec is deduplicated by kots [here](https://github.com/replicatedhq/kots/blob/main/pkg/supportbundle/spec.go#L217).
Redactors are [hard coded](https://github.com/replicatedhq/troubleshoot/blob/main/pkg/redact/redact.go#L160) into Troubleshoot as well as supplied in the spec.
Although were currently making strides in improving the Troubleshoot project by creating new collectors, analyzers, and specs, we have no way to more quickly deliver Troubleshoot improvements to installations in the field without updating the kots application and pushing a new release, or upgrading kots to a new version.
When folks find a support issue that could have been identified by Troubleshoot, we ask them to write a new collector, and/or analyzer, for that information. However, if we do that, the new collector/analyzer is not easily available to end users.
Some of the useful features of Troubleshoot are actually implemented as part of KOTS, while both open source Troubleshoot should address this independently.
## High-Level Design
Add CRD support to Troubleshoot:
* Design a custom resource (CRD) that allows adding spec(s) to the Kubernetes cluster using `kubectl`. There is no need to extend this to use [API server aggregation](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#api-server-aggregation).
* Update Troubleshoot to allow consuming the first object found of the new custom resource, by default - i.e. if there are no specs provided on the CLI or entrypoint, use CRD
* Once merge is implemented, update Troubleshoot to consume and merge all the instances of the CRD.
* To minimize code changes in Troubleshoot, we could implement two CRDs, of `type: SupportBundle` and `type: Redactor`. However, there is no specific need to separate the two and it maybe advantageous to keep things simple, combining them.
Allow multiple specs to be merged by Troubleshoot:
* create an interface for collectors, analyzers, and redactors to merge
* each collector/analyzer/redactor can use a generic implementation of the interface for the merge, or can use a specific one for that task if that particular collector will benefit from a more intelligent merge.
* the spec merge code in kots can, at this stage, be removed once kots ships CRDs for the Troubleshoot specs
Spec sources:
* Alter Troubleshoot to accept multiple yaml files on the CLI
* Create a CRD containing a spec, have Troubleshoot search for spec CRDs and combine them all when run
* maintain the URL compatibility as is
* maintain the configMap compatibility as is
## Detailed Design
CRD: to be designed
Merge:
* define a new interface that provides the merge functionality for collectors, analyzers, and redactors
* there should be a generic implementation of that interface which is used by default for all objects. This can simply use `append()`.
* specific collectors may have alternative implementations of the interface where overrides are required.
Particular overrides known at this point in time:
* clusterResources has an option namespaces config, these should be merged and deduplicated
* Two runPod collectors with the same name and different commands are unmergable. Only one should be run and an error logged.
* Two configMap collectors can be deduplicated and merged depending on the configurations
* Two logs collectors likely only need deduplication to prevent collecting the same thing twice
## Limitations
### Visibility
Users may collect more than intended with the new implementation if all available CRD objects are run. We therefore need to be sure the Troubleshoot client allows for selection of what to run. While the default would be to run everything, a user should be able to just run specific SupportBundle specs based on labels, namespaces, etc. By doing this no functionality is lost.
### Airgap
Some of the spec locations such as URL wouldnt work here. There may be other considerations around airgap as well.
Airgap installs are intentionally feature limited. Failure to retrieve new versions of specs should fail gracefully and proceed with the run.
As a follow up feature to improve support bundle collection Troubleshoot could gain some abilities to help manage and upgrade SupportBundles found in a cluster in a fashion that allows the user to split the discovery, download, and upgrade so they could be run on different machines.
An example implementation would be:
* A command to find, deduplicate, and output a list of SupportBundles in the cluster. The list would include at least the upstream URL and version currently installed in the cluster.
* A command to take the output of the above command and check for updates, downloading all updated SupportBundles into a single .tgz file.
* A command to apply the above .tgz file to the cluster upgrading any existing SupportBundles with the newer versions.
## Assumptions
* all deployments are able to deploy CRDs to the Kubernetes cluster
## Testing
## Alternatives Considered
### Use the existing URL functionality in Troubleshoot
Proposal: Provide a custom URL for each install, that when called by Troubleshoot returns a spec composed of the latest for every component spec specified in that installation, much like we do with <https://kurl.sh/latest> now.
Pros:
* No changes required to Troubleshoot
* Always use the latest specs for components other than the Vendors application
Cons:
* Would not work for airgap installations
* Software developers need to update their application in order to get new specs from all dependencies
* Replicated would need to provide a new API/web service to host the specs, reducing the general community applicability of troubleshoot as a stand alone project
* Discourages individual projects from maintaining Troubleshoot specs for that project
## Security Considerations
Passing control of component specs to individual projects presents a possibility of reducing the amount of review a spec goes through for each update, allowing a spec provided by, say, a kURL addon to run collectors. The current implementation relies on the kots review process for default specs, plus the review of individual example specs. Depending on the final implementation, it is unlikely that this change itself increases any risk since the delivery of automated and default specs to Troubleshoot is maintained within kots, and/or Troubleshoot itself much as it is already.
+74
View File
@@ -0,0 +1,74 @@
# Provide an extendable API for accessing bundle information
## Goals
* Provide API based access to collected information, decoupling other projects from troubleshoot on-disk format
* Reuse existing APIs when they exist to make the bundle compatible with existing tools without modification
* Plan for extensibility for accessing information beyond just the standard kubernetes api
## Non Goals
* Compatibility with previous on-disk formats
* Compatibility with existing collectors without modification
* There should be a plan to allow the implementation of existing collectors
## Background
While using the information gathered in a support bundle users were finding it hard to find information while manually reviewing the various files collected in the bundle. Users have to understand the folder structure, files structure, and process JSON files to find information about the cluster. The [sbctl](https://github.com/replicatedhq/sbctl) project was created to prove out the utility of providing api based access so that users could use existing tools which they already understood. This has been a very successful experiment with feedback being that most users now use this utility as their primary, or only, interface to the support bundle information.
There are some drawbacks to the current approach. The `sbctl` project is tightly coupled to troubleshoot on-disk formats, each kubernetes API must be implemented in `sbctl` individually and will require being kept up to date as APIs change, and `sbctl` has no plan today to provide similar API based access to information other than the standard kubernetes api.
This proposal is meant to take the learnings from `sbctl` and consider implementing it as a first class feature of troubleshoot while attempting to address the current maintenance and expandability limitations.
## High-Level Design
To help address standard access to API data, troubleshoot will start an etcd instance which collectors can then use to store collected information rather than writing to custom on-disk locations. Collectors that only need to collect Kubernetes API information then do not need to serve up data as the API server will be used to provide access to the collected data. Storing data directly in etcd will allow troubleshoot to later serve up this same information by again starting an api-server and etcd using the previously collected etcd data store. This should remove almost all maintenance from troubleshoot for implementing API calls to access the collected information.
There will also be information that is desired to be stored that doesn't have any native representation in the api-server today. Examples could include custom collectors which execute into containers and extensions like [metrics server](https://github.com/kubernetes-sigs/metrics-server). These components can be addressed using the built in [Kubernetes API Aggregation Layer](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/) which is how `metrics server` itself works to extend and provide api based access to node information. By registering additional API extensions troubleshoot plugins can implement both a collection and an API for retrieving custom information which is accessible in the same fashion as the rest of the api-server.
The additional benefit to this, which can be demonstrated with `metrics-server`, is that collectors can be written for any other extension API and be compatible with existing tools the same way using the api-server provides compatibility with `kubectl`. Using `metrics-server` as an example, a collector can be written to collect node information which can be stored locally. The collector can then implement the standard [GET Endpoints](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/) from the metrics-server and reply to them with the results it collected. By doing so, all tools that work with metrics-server today, like `kubectl top` will also work with information served from a support bundle. Additionally, the collector implementation handles any custom file formats without exposing that to any other tool making it easy to maintain.
Any other access to the filesystem directly will be modified to instead use the provided api-server. This means analyzers will not directly reference files on disk and will instead run against the api-server to analyze the collected information. This decouples analyzers from how collectors store data providing clean separation of concerns for maintaining both collectors and analyzers. Decoupling these also creates a natural way to implement analyzers that use data from multiple collectors. This could also allow analyzers to run against existing clusters providing a use for analyzers independent of support bundle collection. This could encourage additional community contributions of analyzers.
An initially unintended benefit of using the Aggregation Layer is that any HostCollector using this implementation would be very close to an implementation of an extension which you could install in clusters. This could make HostCollectors also useful to install as a service in a live cluster for operations information about hosts.
## Detailed Design
### Outstanding design questions
1. How reasonable is it to start an api-server as part of troubleshoot? Consider the following known implementations that do something like this:
* [envtest](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/envtest) - requires binaries present on the machine
* [microk8s implementation](https://github.com/canonical/microk8s/blob/master/build-scripts/patches/0000-Kubelite-integration.patch) - bundles slightly modified binaries
* [k0s uses upstream binaries statically compiled](https://docs.k0sproject.io/v1.23.8+k0s.0/architecture/) - bundles statically compiled binaries that self extract and uses a process monitor to run them
2. Can you in fact push metadat like "Status" into an api-server or do we have to write directly to etcd?
* If we can't push to the api-server is just writing the information directly into etcd something we can do and have a reasonable expectation of compatibility?
3. Is the overhead to write an Aggregation API going to add an unnecessary burden to writing new collector plugins? Can these be templated into a reasonably to ease collector creation?
## Limitations
Using the actual API server will provide limitations on the version skew which can be collected/displayed. This could be addressed by including multiple versions of the kubernetes-api server to allow serving a wide range of support bundles. This limitation likely already exists today but would exist in the tooling that is trying to collect, analyzer, or server the data.
## Assumptions
* Serving logs hasn't been designed yet, and presumably can be addressed in the detailed design to provide logs to the api-server in place of kubelet. Ideally this can be done using the standard upstream kubernetes-api server it is undesirable to fork it.
* Running the api-server, etcd, and any other supporting services (like kubelet) as go routines while adding some overhead to the collection process won't cause a significant burden on ram or cpu to collect support bundles.
## Testing
## Alternatives Considered
### Keep sbctl separate
The current `sbctl` project could be left to run it's course independent of this project. This leaves the troubleshoot project reliant on a separate project to provide a good user experience for anything other than analyzers.
## Security Considerations
Consideration to how Redactors are implemented needs to be considered.
## References
Original PR discussion found [here](https://github.com/replicatedhq/troubleshoot/pull/611)
+95
View File
@@ -0,0 +1,95 @@
# Provide a facility to automatically obtain updated specs
## Background
Troubleshoot is limited in that when folks write an update or a new spec for data collection and analysis, that upgrade is not available when Troubleshoot is invoked if specs for it are stored in a secret or a file which was deployed by an application. Updating the local spec is simple enough, but may require an upgrade to the application (e.g. KOTS) in order to collect updates to the spec supplied by that application. This update requirement delays folks from accessing updated Troubleshoot specs and therefore discourages people from writing new/updated specs.
## Goals
* Provide a means for a spec to optionally specify a location for a spec that can replace it if successfully reached.
## Other requirements
* Maintain the ability for Troubleshoot to run in an airgapped environment, though with some feature limitations.
* Maintain compatilbility with existing Troubleshoot specs.
## High-Level Design
Add a new field to the Troubleshoot spec definition, which includes a URI used to locate a replacement spec.
If the field is populated, Troubleshoot is to attempt to collect the spec from the location provided, and if successful, ignore the remainder of the spec provided and use the spec listed in the new field.
If the additional spec is not found at the location (or, if there is no network access to that location), Troubleshoot is to continue processing the remainder of the spec provided, with a log message describing the failure to process the URI.
Add a CLI flag (e.g. `--no-updates`) to disable the URI specified location from being accessed. This would be useful in airgap environments and/or when we simply do not want to have the external spec used, without having to update the yaml, secret, or remote source.
URI's provided may be any of the URI types already accepted by Troubleshoot, including web addresses (https://), secrets, or files.
## Detailed Design
Current spec format is like this example:
```yaml
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
name: default
spec:
collectors:
- clusterInfo: {}
- clusterResources: {}
analyzers:
- cephStatus: {}
- longhorn: {}
```
We could add a new type, `specURI`, which contains one or more URIs from which to obtain specs. If the spec is retrieved successfully then the remainder of the provided spec is ignored, and replaced with the one downloaded:
```yaml
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
name: default
spec:
uri: https://raw.githubusercontent.com/replicatedhq/troubleshoot-specs/main/in-cluster/default.yaml
collectors:
- clusterInfo: {}
- clusterResources: {}
analyzers:
- cephStatus: {}
- longhorn: {}
```
When a spec is parsed from the initial call to Troubleshoot, the content should be read and if a `specURI` exists which is not blank, the code should attempt to download that URI. Should that be successful, the collectors and analyzers sections of the downloaded content should be used to replace the remainder of the spec provided via the initial call.
## Impact on kURL and KOTS
This section is included because KOTS is a significant consumer of the Troubleshoot codebase, and as such deserves consideration when significant changes are made.
The code changes proposed in this document do not require any changes to kURL or KOTS, and any changes to those repos are excluded from the scope of work described here. The following notes are suggestions for how the kURL and KOTS repos could benefit from the changes in this document, and could relate to any project which calls Troubleshoot or includes Troubleshoot specs.
For kURL, each component/addon installed could include adding an individual spec with a URI pointing at a specific spec for that component, which could be updated independently of other components. Invoking troubleshoot with all the individual specs required would allow updated specs to be collected without needing to upgrade any particular component in the cluster.
KOTS currently provides a spec to Troubleshoot which is a merge of a default spec provided by the KOTS codebase, and the spec provided by an application vendor. Should either of those provide a URI, that would mean the downloaded spec would replace the entire spec. This is undesirable since the URI would need to contain the application vendor's updated spec as well as the generic cluster-wide collectors and analyzers, which is a significant maintenance challenge. To resolve this, it is desirable that the following is completed before KOTS uses the URI field:
* Troubleshoot should accept multiple specs (see #650)
* KOTS would need to be modified to provide the application vendor and the default specs independently of one another.
## Limitations
Redactors are currently excluded from this proposal, though it would be desirable to add a similar feature in the future.
If a URI provided includes a spec which includes another URI, it is possible to get into some kind of recursion if the downloaded spec contains another URI. For this reason, and to ensure that the results are predictable, we should only parse the URI field once per spec for specs passed to Troubleshoot on initiation via the CLI or entrypoint.
## Assumptions
## Testing
## Alternatives Considered
* Some mechanism to trigger a process to update secrets stored in Kubernetes. This was rejected due to the need to run a manual update spec for something installed in the cluster.
* Altering KOTS to provide a URL for the spec rather than storing it in code. This was rejected to allow airgap compatibility.
## Security Considerations
This change will make additional network calls with default usage of Troubleshoot. To ensure a user has control of limiting these calls an argument to disable this feature entirely will be provided. This allows users with different security postures to select what's appropriate for their environment.
+21
View File
@@ -0,0 +1,21 @@
# Title
## Goals
## Non Goals
## Background
## High-Level Design
## Detailed Design
## Limitations
## Assumptions
## Testing
## Alternatives Considered
## Security Considerations
+98
View File
@@ -0,0 +1,98 @@
apiVersion: troubleshoot.sh/v1beta2
kind: Preflight
metadata:
name: example
spec:
collectors:
- data:
name: config/replicas.txt
data: "5"
- run:
collectorName: "static-hi"
image: 'alpine:3.5'
command: ["echo", "hi static!"]
analyzers:
- clusterVersion:
outcomes:
- fail:
when: "< 1.13.0"
message: This application requires at least Kubernetes 1.13.0 or later, and recommends 1.15.0.
uri: https://www.kubernetes.io
- warn:
when: "< 1.15.0"
message: Your cluster meets the minimum version of Kubernetes, but we recommend you update to 1.15.0 or later.
uri: https://kubernetes.io
- pass:
when: ">= 1.15.0"
message: Your cluster meets the recommended and required versions of Kubernetes.
- distribution:
outcomes:
- pass:
when: "== k3s"
message: K3S is a supported distribution
- warn:
message: Unable to determine the distribution of Kubernetes
- textAnalyze:
checkName: Replica Count
fileName: config/replicas.txt
regexGroups: '(?P<Replicas>\d+)'
outcomes:
- fail:
when: "Replicas < 5"
message: That's not enough replicas!
- pass:
message: You have at least 5 replicas
- textAnalyze:
checkName: Said hi!
fileName: /static-hi.log
regex: 'hi static'
outcomes:
- fail:
message: Didn't say hi.
- pass:
message: Said hi!
- nodeResources:
checkName: Must be exactly 1 node in the cluster
outcomes:
- pass:
when: "= 1"
message: This cluster has exactly 1 node
- fail:
message: This application requires exactly 1 node
- nodeResources:
checkName: Must have 1 node with at least 2 cores
filters:
cpuCapacity: "2"
outcomes:
- pass:
when: "= 1"
message: This cluster has exactly 1 node with at least 2 cores
- fail:
message: This application requires exactly 1 node with at least 2 cores
- nodeResources:
checkName: Must have 1 node with 2Gi (available) memory and at least 2 cores (on a single node)
filters:
allocatableMemory: 2Gi
cpuCapacity: "2"
outcomes:
- pass:
when: "= 1"
message: This cluster has exactly 1 node with at least 2Gi available memory and 2 cores
- fail:
message: This application requires exactly 1 node with at least 2Gi available memory and 2 cores
- nodeResources:
checkName: There must be exactly 1 node in the cluster
outcomes:
- pass:
when: "count() = 1"
message: This has exactly 1 node in the cluster
- fail:
message: This application requires exactly 1 node in the cluster
- nodeResources:
checkName: There must be a total of at least 2Gi of memory on all nodes
outcomes:
- fail:
when: "sum(memoryCapacity) < 2Gi"
message: This application requires that 2Gi or more memory be available to the cluster
- pass:
message: This cluster has sufficient memory
+9 -9
View File
@@ -7,15 +7,15 @@ spec:
- clusterVersion:
outcomes:
- fail:
when: "< 1.13.0"
message: This application requires at least Kubernetes 1.13.0 or later, and recommends 1.15.0.
when: "< 1.20.0"
message: This application requires at least Kubernetes 1.20.0, and recommends 1.22.0.
uri: https://www.kubernetes.io
- warn:
when: "< 1.15.0"
message: Your cluster meets the minimum version of Kubernetes, but we recommend you update to 1.15.0 or later.
when: "< 1.22.0"
message: Your cluster meets the minimum version of Kubernetes, but we recommend you update to 1.22.0 or later.
uri: https://kubernetes.io
- pass:
when: ">= 1.15.0"
when: ">= 1.22.0"
message: Your cluster meets the recommended and required versions of Kubernetes.
- customResourceDefinition:
checkName: Ingress
@@ -28,10 +28,10 @@ spec:
- containerRuntime:
outcomes:
- pass:
when: "== docker"
message: Docker container runtime was found.
when: "== containerd"
message: containerd container runtime was found.
- fail:
message: Did not find Docker container runtime.
message: Did not find containerd container runtime.
- storageClass:
checkName: Required storage classes
storageClassName: "default"
@@ -121,4 +121,4 @@ spec:
message: All nodes are recommended to have at least 100 GB of ephemeral storage.
uri: https://kurl.sh/docs/install-with-kurl/system-requirements
- pass:
message: All nodes have at least 100 GB of ephemeral storage.
message: All nodes have at least 100 GB of ephemeral storage.
+103
View File
@@ -0,0 +1,103 @@
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
name: example
spec:
collectors:
- clusterInfo: {}
- clusterResources: {}
- data:
name: config/replicas.txt
data: "5"
- runPod:
collectorName: "static-hi"
podSpec:
containers:
- name: static-hi
image: alpine:3.5
command: ["echo", "hi static!"]
analyzers:
- clusterVersion:
outcomes:
- fail:
when: "< 1.20.0"
message: This application requires at least Kubernetes 1.13.0 or later, and recommends 1.15.0.
uri: https://www.kubernetes.io
- warn:
when: "< 1.21.0"
message: Your cluster meets the minimum version of Kubernetes, but we recommend you update to 1.15.0 or later.
uri: https://kubernetes.io
- pass:
when: ">= 1.22.0"
message: Your cluster meets the recommended and required versions of Kubernetes.
- distribution:
outcomes:
- pass:
when: "== k3s"
message: K3S is a supported distribution
- warn:
message: Unable to determine the distribution of Kubernetes
- textAnalyze:
checkName: Replica Count
fileName: config/replicas.txt
regexGroups: '(?P<Replicas>\d+)'
outcomes:
- fail:
when: "Replicas < 5"
message: That's not enough replicas!
- pass:
message: You have at least 5 replicas
- textAnalyze:
checkName: Said hi!
fileName: /static-hi.log
regex: 'hi static'
outcomes:
- fail:
message: Didn't say hi.
- pass:
message: Said hi!
- nodeResources:
checkName: Must be exactly 1 node in the cluster
outcomes:
- pass:
when: "= 1"
message: This cluster has exactly 1 node
- fail:
message: This application requires exactly 1 node
- nodeResources:
checkName: Must have 1 node with at least 2 cores
filters:
cpuCapacity: "2"
outcomes:
- pass:
when: "= 1"
message: This cluster has exactly 1 node with at least 2 cores
- fail:
message: This application requires exactly 1 node with at least 2 cores
- nodeResources:
checkName: Must have 1 node with 2Gi (available) memory and at least 2 cores (on a single node)
filters:
allocatableMemory: 2Gi
cpuCapacity: "2"
outcomes:
- pass:
when: "= 1"
message: This cluster has exactly 1 node with at least 2Gi available memory and 2 cores
- fail:
message: This application requires exactly 1 node with at least 2Gi available memory and 2 cores
- nodeResources:
checkName: There must be exactly 1 node in the cluster
outcomes:
- pass:
when: "count() = 1"
message: This has exactly 1 node in the cluster
- fail:
message: This application requires exactly 1 node in the cluster
- nodeResources:
checkName: There must be a total of at least 2Gi of memory on all nodes
outcomes:
- fail:
when: "sum(memoryCapacity) < 2Gi"
message: This application requires that 2Gi or more memory be available to the cluster
- pass:
message: This cluster has sufficient memory
@@ -0,0 +1,17 @@
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
name: mysql
spec:
collectors:
- mysql:
collectorName: mysql
uri: 'root:my-secret-pw@tcp(localhost:3306)/mysql'
parameters:
- character_set_server
- collation_server
- init_connect
- innodb_file_format
- innodb_large_prefix
- innodb_strict_mode
- log_bin_trust_function_creators
@@ -8,7 +8,7 @@ spec:
selector:
- app=example
- component=nginx
namespace: repl{{ Namespace }}
namespace: default
limits:
maxAge: 720h # 30*24
maxLines: 10000
@@ -30,6 +30,7 @@ spec:
outcomes:
- fail:
message: The Rook CRD was not found in the cluster.
uri: https://kurl.sh/docs/add-ons/rook/some/path/that/does/not/exist/for/the/sake/of/having/a/very/long/url.md
- pass:
message: Rook is installed and available.
- containerRuntime:
@@ -1,110 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package troubleshootclientset
import (
"fmt"
troubleshootv1beta1 "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/typed/troubleshoot/v1beta1"
troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/typed/troubleshoot/v1beta2"
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol"
)
type Interface interface {
Discovery() discovery.DiscoveryInterface
TroubleshootV1beta1() troubleshootv1beta1.TroubleshootV1beta1Interface
TroubleshootV1beta2() troubleshootv1beta2.TroubleshootV1beta2Interface
}
// Clientset contains the clients for groups. Each group has exactly one
// version included in a Clientset.
type Clientset struct {
*discovery.DiscoveryClient
troubleshootV1beta1 *troubleshootv1beta1.TroubleshootV1beta1Client
troubleshootV1beta2 *troubleshootv1beta2.TroubleshootV1beta2Client
}
// TroubleshootV1beta1 retrieves the TroubleshootV1beta1Client
func (c *Clientset) TroubleshootV1beta1() troubleshootv1beta1.TroubleshootV1beta1Interface {
return c.troubleshootV1beta1
}
// TroubleshootV1beta2 retrieves the TroubleshootV1beta2Client
func (c *Clientset) TroubleshootV1beta2() troubleshootv1beta2.TroubleshootV1beta2Interface {
return c.troubleshootV1beta2
}
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
if c == nil {
return nil
}
return c.DiscoveryClient
}
// NewForConfig creates a new Clientset for the given config.
// If config's RateLimiter is not set and QPS and Burst are acceptable,
// NewForConfig will generate a rate-limiter in configShallowCopy.
func NewForConfig(c *rest.Config) (*Clientset, error) {
configShallowCopy := *c
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
if configShallowCopy.Burst <= 0 {
return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
}
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
}
var cs Clientset
var err error
cs.troubleshootV1beta1, err = troubleshootv1beta1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
cs.troubleshootV1beta2, err = troubleshootv1beta2.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
return &cs, nil
}
// NewForConfigOrDie creates a new Clientset for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *Clientset {
var cs Clientset
cs.troubleshootV1beta1 = troubleshootv1beta1.NewForConfigOrDie(c)
cs.troubleshootV1beta2 = troubleshootv1beta2.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &cs
}
// New creates a new Clientset for the given RESTClient.
func New(c rest.Interface) *Clientset {
var cs Clientset
cs.troubleshootV1beta1 = troubleshootv1beta1.New(c)
cs.troubleshootV1beta2 = troubleshootv1beta2.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs
}
@@ -1,19 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated clientset.
package troubleshootclientset
@@ -1,88 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
clientset "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset"
troubleshootv1beta1 "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/typed/troubleshoot/v1beta1"
faketroubleshootv1beta1 "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/typed/troubleshoot/v1beta1/fake"
troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/typed/troubleshoot/v1beta2"
faketroubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/typed/troubleshoot/v1beta2/fake"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing"
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
for _, obj := range objects {
if err := o.Add(obj); err != nil {
panic(err)
}
}
cs := &Clientset{tracker: o}
cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
cs.AddReactor("*", "*", testing.ObjectReaction(o))
cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
gvr := action.GetResource()
ns := action.GetNamespace()
watch, err := o.Watch(gvr, ns)
if err != nil {
return false, nil, err
}
return true, watch, nil
})
return cs
}
// Clientset implements clientset.Interface. Meant to be embedded into a
// struct to get a default implementation. This makes faking out just the method
// you want to test easier.
type Clientset struct {
testing.Fake
discovery *fakediscovery.FakeDiscovery
tracker testing.ObjectTracker
}
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
return c.discovery
}
func (c *Clientset) Tracker() testing.ObjectTracker {
return c.tracker
}
var _ clientset.Interface = &Clientset{}
// TroubleshootV1beta1 retrieves the TroubleshootV1beta1Client
func (c *Clientset) TroubleshootV1beta1() troubleshootv1beta1.TroubleshootV1beta1Interface {
return &faketroubleshootv1beta1.FakeTroubleshootV1beta1{Fake: &c.Fake}
}
// TroubleshootV1beta2 retrieves the TroubleshootV1beta2Client
func (c *Clientset) TroubleshootV1beta2() troubleshootv1beta2.TroubleshootV1beta2Interface {
return &faketroubleshootv1beta2.FakeTroubleshootV1beta2{Fake: &c.Fake}
}
@@ -1,19 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated fake clientset.
package fake
@@ -1,57 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
troubleshootv1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
)
var scheme = runtime.NewScheme()
var codecs = serializer.NewCodecFactory(scheme)
var parameterCodec = runtime.NewParameterCodec(scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
troubleshootv1beta1.AddToScheme,
troubleshootv1beta2.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
// import (
// "k8s.io/client-go/kubernetes"
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
// )
//
// kclientset, _ := kubernetes.NewForConfig(c)
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
var AddToScheme = localSchemeBuilder.AddToScheme
func init() {
v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"})
utilruntime.Must(AddToScheme(scheme))
}
@@ -1,19 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package contains the scheme of the automatically generated clientset.
package scheme
@@ -1,57 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package scheme
import (
troubleshootv1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
)
var Scheme = runtime.NewScheme()
var Codecs = serializer.NewCodecFactory(Scheme)
var ParameterCodec = runtime.NewParameterCodec(Scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
troubleshootv1beta1.AddToScheme,
troubleshootv1beta2.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
// import (
// "k8s.io/client-go/kubernetes"
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
// )
//
// kclientset, _ := kubernetes.NewForConfig(c)
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
var AddToScheme = localSchemeBuilder.AddToScheme
func init() {
v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
utilruntime.Must(AddToScheme(Scheme))
}
@@ -1,194 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
import (
"context"
"time"
v1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
scheme "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// AnalyzersGetter has a method to return a AnalyzerInterface.
// A group's client should implement this interface.
type AnalyzersGetter interface {
Analyzers(namespace string) AnalyzerInterface
}
// AnalyzerInterface has methods to work with Analyzer resources.
type AnalyzerInterface interface {
Create(ctx context.Context, analyzer *v1beta1.Analyzer, opts v1.CreateOptions) (*v1beta1.Analyzer, error)
Update(ctx context.Context, analyzer *v1beta1.Analyzer, opts v1.UpdateOptions) (*v1beta1.Analyzer, error)
UpdateStatus(ctx context.Context, analyzer *v1beta1.Analyzer, opts v1.UpdateOptions) (*v1beta1.Analyzer, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Analyzer, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.AnalyzerList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Analyzer, err error)
AnalyzerExpansion
}
// analyzers implements AnalyzerInterface
type analyzers struct {
client rest.Interface
ns string
}
// newAnalyzers returns a Analyzers
func newAnalyzers(c *TroubleshootV1beta1Client, namespace string) *analyzers {
return &analyzers{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the analyzer, and returns the corresponding analyzer object, and an error if there is any.
func (c *analyzers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Analyzer, err error) {
result = &v1beta1.Analyzer{}
err = c.client.Get().
Namespace(c.ns).
Resource("analyzers").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Analyzers that match those selectors.
func (c *analyzers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.AnalyzerList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.AnalyzerList{}
err = c.client.Get().
Namespace(c.ns).
Resource("analyzers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested analyzers.
func (c *analyzers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("analyzers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a analyzer and creates it. Returns the server's representation of the analyzer, and an error, if there is any.
func (c *analyzers) Create(ctx context.Context, analyzer *v1beta1.Analyzer, opts v1.CreateOptions) (result *v1beta1.Analyzer, err error) {
result = &v1beta1.Analyzer{}
err = c.client.Post().
Namespace(c.ns).
Resource("analyzers").
VersionedParams(&opts, scheme.ParameterCodec).
Body(analyzer).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a analyzer and updates it. Returns the server's representation of the analyzer, and an error, if there is any.
func (c *analyzers) Update(ctx context.Context, analyzer *v1beta1.Analyzer, opts v1.UpdateOptions) (result *v1beta1.Analyzer, err error) {
result = &v1beta1.Analyzer{}
err = c.client.Put().
Namespace(c.ns).
Resource("analyzers").
Name(analyzer.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(analyzer).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *analyzers) UpdateStatus(ctx context.Context, analyzer *v1beta1.Analyzer, opts v1.UpdateOptions) (result *v1beta1.Analyzer, err error) {
result = &v1beta1.Analyzer{}
err = c.client.Put().
Namespace(c.ns).
Resource("analyzers").
Name(analyzer.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(analyzer).
Do(ctx).
Into(result)
return
}
// Delete takes name of the analyzer and deletes it. Returns an error if one occurs.
func (c *analyzers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("analyzers").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *analyzers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("analyzers").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched analyzer.
func (c *analyzers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Analyzer, err error) {
result = &v1beta1.Analyzer{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("analyzers").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
@@ -1,194 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
import (
"context"
"time"
v1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
scheme "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// CollectorsGetter has a method to return a CollectorInterface.
// A group's client should implement this interface.
type CollectorsGetter interface {
Collectors(namespace string) CollectorInterface
}
// CollectorInterface has methods to work with Collector resources.
type CollectorInterface interface {
Create(ctx context.Context, collector *v1beta1.Collector, opts v1.CreateOptions) (*v1beta1.Collector, error)
Update(ctx context.Context, collector *v1beta1.Collector, opts v1.UpdateOptions) (*v1beta1.Collector, error)
UpdateStatus(ctx context.Context, collector *v1beta1.Collector, opts v1.UpdateOptions) (*v1beta1.Collector, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Collector, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CollectorList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Collector, err error)
CollectorExpansion
}
// collectors implements CollectorInterface
type collectors struct {
client rest.Interface
ns string
}
// newCollectors returns a Collectors
func newCollectors(c *TroubleshootV1beta1Client, namespace string) *collectors {
return &collectors{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the collector, and returns the corresponding collector object, and an error if there is any.
func (c *collectors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Collector, err error) {
result = &v1beta1.Collector{}
err = c.client.Get().
Namespace(c.ns).
Resource("collectors").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Collectors that match those selectors.
func (c *collectors) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CollectorList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.CollectorList{}
err = c.client.Get().
Namespace(c.ns).
Resource("collectors").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested collectors.
func (c *collectors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("collectors").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a collector and creates it. Returns the server's representation of the collector, and an error, if there is any.
func (c *collectors) Create(ctx context.Context, collector *v1beta1.Collector, opts v1.CreateOptions) (result *v1beta1.Collector, err error) {
result = &v1beta1.Collector{}
err = c.client.Post().
Namespace(c.ns).
Resource("collectors").
VersionedParams(&opts, scheme.ParameterCodec).
Body(collector).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a collector and updates it. Returns the server's representation of the collector, and an error, if there is any.
func (c *collectors) Update(ctx context.Context, collector *v1beta1.Collector, opts v1.UpdateOptions) (result *v1beta1.Collector, err error) {
result = &v1beta1.Collector{}
err = c.client.Put().
Namespace(c.ns).
Resource("collectors").
Name(collector.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(collector).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *collectors) UpdateStatus(ctx context.Context, collector *v1beta1.Collector, opts v1.UpdateOptions) (result *v1beta1.Collector, err error) {
result = &v1beta1.Collector{}
err = c.client.Put().
Namespace(c.ns).
Resource("collectors").
Name(collector.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(collector).
Do(ctx).
Into(result)
return
}
// Delete takes name of the collector and deletes it. Returns an error if one occurs.
func (c *collectors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("collectors").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *collectors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("collectors").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched collector.
func (c *collectors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Collector, err error) {
result = &v1beta1.Collector{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("collectors").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
@@ -1,19 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1beta1
@@ -1,19 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// Package fake has the automatically generated clients.
package fake
@@ -1,141 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeAnalyzers implements AnalyzerInterface
type FakeAnalyzers struct {
Fake *FakeTroubleshootV1beta1
ns string
}
var analyzersResource = schema.GroupVersionResource{Group: "troubleshoot.replicated.com", Version: "v1beta1", Resource: "analyzers"}
var analyzersKind = schema.GroupVersionKind{Group: "troubleshoot.replicated.com", Version: "v1beta1", Kind: "Analyzer"}
// Get takes name of the analyzer, and returns the corresponding analyzer object, and an error if there is any.
func (c *FakeAnalyzers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Analyzer, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(analyzersResource, c.ns, name), &v1beta1.Analyzer{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Analyzer), err
}
// List takes label and field selectors, and returns the list of Analyzers that match those selectors.
func (c *FakeAnalyzers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.AnalyzerList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(analyzersResource, analyzersKind, c.ns, opts), &v1beta1.AnalyzerList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta1.AnalyzerList{ListMeta: obj.(*v1beta1.AnalyzerList).ListMeta}
for _, item := range obj.(*v1beta1.AnalyzerList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested analyzers.
func (c *FakeAnalyzers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(analyzersResource, c.ns, opts))
}
// Create takes the representation of a analyzer and creates it. Returns the server's representation of the analyzer, and an error, if there is any.
func (c *FakeAnalyzers) Create(ctx context.Context, analyzer *v1beta1.Analyzer, opts v1.CreateOptions) (result *v1beta1.Analyzer, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(analyzersResource, c.ns, analyzer), &v1beta1.Analyzer{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Analyzer), err
}
// Update takes the representation of a analyzer and updates it. Returns the server's representation of the analyzer, and an error, if there is any.
func (c *FakeAnalyzers) Update(ctx context.Context, analyzer *v1beta1.Analyzer, opts v1.UpdateOptions) (result *v1beta1.Analyzer, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(analyzersResource, c.ns, analyzer), &v1beta1.Analyzer{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Analyzer), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeAnalyzers) UpdateStatus(ctx context.Context, analyzer *v1beta1.Analyzer, opts v1.UpdateOptions) (*v1beta1.Analyzer, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(analyzersResource, "status", c.ns, analyzer), &v1beta1.Analyzer{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Analyzer), err
}
// Delete takes name of the analyzer and deletes it. Returns an error if one occurs.
func (c *FakeAnalyzers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(analyzersResource, c.ns, name), &v1beta1.Analyzer{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeAnalyzers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(analyzersResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.AnalyzerList{})
return err
}
// Patch applies the patch and returns the patched analyzer.
func (c *FakeAnalyzers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Analyzer, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(analyzersResource, c.ns, name, pt, data, subresources...), &v1beta1.Analyzer{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Analyzer), err
}
@@ -1,141 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeCollectors implements CollectorInterface
type FakeCollectors struct {
Fake *FakeTroubleshootV1beta1
ns string
}
var collectorsResource = schema.GroupVersionResource{Group: "troubleshoot.replicated.com", Version: "v1beta1", Resource: "collectors"}
var collectorsKind = schema.GroupVersionKind{Group: "troubleshoot.replicated.com", Version: "v1beta1", Kind: "Collector"}
// Get takes name of the collector, and returns the corresponding collector object, and an error if there is any.
func (c *FakeCollectors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Collector, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(collectorsResource, c.ns, name), &v1beta1.Collector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Collector), err
}
// List takes label and field selectors, and returns the list of Collectors that match those selectors.
func (c *FakeCollectors) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CollectorList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(collectorsResource, collectorsKind, c.ns, opts), &v1beta1.CollectorList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta1.CollectorList{ListMeta: obj.(*v1beta1.CollectorList).ListMeta}
for _, item := range obj.(*v1beta1.CollectorList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested collectors.
func (c *FakeCollectors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(collectorsResource, c.ns, opts))
}
// Create takes the representation of a collector and creates it. Returns the server's representation of the collector, and an error, if there is any.
func (c *FakeCollectors) Create(ctx context.Context, collector *v1beta1.Collector, opts v1.CreateOptions) (result *v1beta1.Collector, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(collectorsResource, c.ns, collector), &v1beta1.Collector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Collector), err
}
// Update takes the representation of a collector and updates it. Returns the server's representation of the collector, and an error, if there is any.
func (c *FakeCollectors) Update(ctx context.Context, collector *v1beta1.Collector, opts v1.UpdateOptions) (result *v1beta1.Collector, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(collectorsResource, c.ns, collector), &v1beta1.Collector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Collector), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeCollectors) UpdateStatus(ctx context.Context, collector *v1beta1.Collector, opts v1.UpdateOptions) (*v1beta1.Collector, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(collectorsResource, "status", c.ns, collector), &v1beta1.Collector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Collector), err
}
// Delete takes name of the collector and deletes it. Returns an error if one occurs.
func (c *FakeCollectors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(collectorsResource, c.ns, name), &v1beta1.Collector{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeCollectors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(collectorsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.CollectorList{})
return err
}
// Patch applies the patch and returns the patched collector.
func (c *FakeCollectors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Collector, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(collectorsResource, c.ns, name, pt, data, subresources...), &v1beta1.Collector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Collector), err
}
@@ -1,141 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakePreflights implements PreflightInterface
type FakePreflights struct {
Fake *FakeTroubleshootV1beta1
ns string
}
var preflightsResource = schema.GroupVersionResource{Group: "troubleshoot.replicated.com", Version: "v1beta1", Resource: "preflights"}
var preflightsKind = schema.GroupVersionKind{Group: "troubleshoot.replicated.com", Version: "v1beta1", Kind: "Preflight"}
// Get takes name of the preflight, and returns the corresponding preflight object, and an error if there is any.
func (c *FakePreflights) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Preflight, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(preflightsResource, c.ns, name), &v1beta1.Preflight{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Preflight), err
}
// List takes label and field selectors, and returns the list of Preflights that match those selectors.
func (c *FakePreflights) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PreflightList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(preflightsResource, preflightsKind, c.ns, opts), &v1beta1.PreflightList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta1.PreflightList{ListMeta: obj.(*v1beta1.PreflightList).ListMeta}
for _, item := range obj.(*v1beta1.PreflightList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested preflights.
func (c *FakePreflights) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(preflightsResource, c.ns, opts))
}
// Create takes the representation of a preflight and creates it. Returns the server's representation of the preflight, and an error, if there is any.
func (c *FakePreflights) Create(ctx context.Context, preflight *v1beta1.Preflight, opts v1.CreateOptions) (result *v1beta1.Preflight, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(preflightsResource, c.ns, preflight), &v1beta1.Preflight{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Preflight), err
}
// Update takes the representation of a preflight and updates it. Returns the server's representation of the preflight, and an error, if there is any.
func (c *FakePreflights) Update(ctx context.Context, preflight *v1beta1.Preflight, opts v1.UpdateOptions) (result *v1beta1.Preflight, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(preflightsResource, c.ns, preflight), &v1beta1.Preflight{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Preflight), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakePreflights) UpdateStatus(ctx context.Context, preflight *v1beta1.Preflight, opts v1.UpdateOptions) (*v1beta1.Preflight, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(preflightsResource, "status", c.ns, preflight), &v1beta1.Preflight{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Preflight), err
}
// Delete takes name of the preflight and deletes it. Returns an error if one occurs.
func (c *FakePreflights) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(preflightsResource, c.ns, name), &v1beta1.Preflight{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakePreflights) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(preflightsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.PreflightList{})
return err
}
// Patch applies the patch and returns the patched preflight.
func (c *FakePreflights) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Preflight, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(preflightsResource, c.ns, name, pt, data, subresources...), &v1beta1.Preflight{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Preflight), err
}
@@ -1,141 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeRedactors implements RedactorInterface
type FakeRedactors struct {
Fake *FakeTroubleshootV1beta1
ns string
}
var redactorsResource = schema.GroupVersionResource{Group: "troubleshoot.replicated.com", Version: "v1beta1", Resource: "redactors"}
var redactorsKind = schema.GroupVersionKind{Group: "troubleshoot.replicated.com", Version: "v1beta1", Kind: "Redactor"}
// Get takes name of the redactor, and returns the corresponding redactor object, and an error if there is any.
func (c *FakeRedactors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Redactor, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(redactorsResource, c.ns, name), &v1beta1.Redactor{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Redactor), err
}
// List takes label and field selectors, and returns the list of Redactors that match those selectors.
func (c *FakeRedactors) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RedactorList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(redactorsResource, redactorsKind, c.ns, opts), &v1beta1.RedactorList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta1.RedactorList{ListMeta: obj.(*v1beta1.RedactorList).ListMeta}
for _, item := range obj.(*v1beta1.RedactorList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested redactors.
func (c *FakeRedactors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(redactorsResource, c.ns, opts))
}
// Create takes the representation of a redactor and creates it. Returns the server's representation of the redactor, and an error, if there is any.
func (c *FakeRedactors) Create(ctx context.Context, redactor *v1beta1.Redactor, opts v1.CreateOptions) (result *v1beta1.Redactor, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(redactorsResource, c.ns, redactor), &v1beta1.Redactor{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Redactor), err
}
// Update takes the representation of a redactor and updates it. Returns the server's representation of the redactor, and an error, if there is any.
func (c *FakeRedactors) Update(ctx context.Context, redactor *v1beta1.Redactor, opts v1.UpdateOptions) (result *v1beta1.Redactor, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(redactorsResource, c.ns, redactor), &v1beta1.Redactor{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Redactor), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeRedactors) UpdateStatus(ctx context.Context, redactor *v1beta1.Redactor, opts v1.UpdateOptions) (*v1beta1.Redactor, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(redactorsResource, "status", c.ns, redactor), &v1beta1.Redactor{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Redactor), err
}
// Delete takes name of the redactor and deletes it. Returns an error if one occurs.
func (c *FakeRedactors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(redactorsResource, c.ns, name), &v1beta1.Redactor{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeRedactors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(redactorsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.RedactorList{})
return err
}
// Patch applies the patch and returns the patched redactor.
func (c *FakeRedactors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Redactor, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(redactorsResource, c.ns, name, pt, data, subresources...), &v1beta1.Redactor{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Redactor), err
}
@@ -1,141 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeSupportBundles implements SupportBundleInterface
type FakeSupportBundles struct {
Fake *FakeTroubleshootV1beta1
ns string
}
var supportbundlesResource = schema.GroupVersionResource{Group: "troubleshoot.replicated.com", Version: "v1beta1", Resource: "supportbundles"}
var supportbundlesKind = schema.GroupVersionKind{Group: "troubleshoot.replicated.com", Version: "v1beta1", Kind: "SupportBundle"}
// Get takes name of the supportBundle, and returns the corresponding supportBundle object, and an error if there is any.
func (c *FakeSupportBundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.SupportBundle, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(supportbundlesResource, c.ns, name), &v1beta1.SupportBundle{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.SupportBundle), err
}
// List takes label and field selectors, and returns the list of SupportBundles that match those selectors.
func (c *FakeSupportBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.SupportBundleList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(supportbundlesResource, supportbundlesKind, c.ns, opts), &v1beta1.SupportBundleList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta1.SupportBundleList{ListMeta: obj.(*v1beta1.SupportBundleList).ListMeta}
for _, item := range obj.(*v1beta1.SupportBundleList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested supportBundles.
func (c *FakeSupportBundles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(supportbundlesResource, c.ns, opts))
}
// Create takes the representation of a supportBundle and creates it. Returns the server's representation of the supportBundle, and an error, if there is any.
func (c *FakeSupportBundles) Create(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.CreateOptions) (result *v1beta1.SupportBundle, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(supportbundlesResource, c.ns, supportBundle), &v1beta1.SupportBundle{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.SupportBundle), err
}
// Update takes the representation of a supportBundle and updates it. Returns the server's representation of the supportBundle, and an error, if there is any.
func (c *FakeSupportBundles) Update(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.UpdateOptions) (result *v1beta1.SupportBundle, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(supportbundlesResource, c.ns, supportBundle), &v1beta1.SupportBundle{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.SupportBundle), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeSupportBundles) UpdateStatus(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.UpdateOptions) (*v1beta1.SupportBundle, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(supportbundlesResource, "status", c.ns, supportBundle), &v1beta1.SupportBundle{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.SupportBundle), err
}
// Delete takes name of the supportBundle and deletes it. Returns an error if one occurs.
func (c *FakeSupportBundles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(supportbundlesResource, c.ns, name), &v1beta1.SupportBundle{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeSupportBundles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(supportbundlesResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.SupportBundleList{})
return err
}
// Patch applies the patch and returns the patched supportBundle.
func (c *FakeSupportBundles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.SupportBundle, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(supportbundlesResource, c.ns, name, pt, data, subresources...), &v1beta1.SupportBundle{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.SupportBundle), err
}
@@ -1,55 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1beta1 "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/typed/troubleshoot/v1beta1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeTroubleshootV1beta1 struct {
*testing.Fake
}
func (c *FakeTroubleshootV1beta1) Analyzers(namespace string) v1beta1.AnalyzerInterface {
return &FakeAnalyzers{c, namespace}
}
func (c *FakeTroubleshootV1beta1) Collectors(namespace string) v1beta1.CollectorInterface {
return &FakeCollectors{c, namespace}
}
func (c *FakeTroubleshootV1beta1) Preflights(namespace string) v1beta1.PreflightInterface {
return &FakePreflights{c, namespace}
}
func (c *FakeTroubleshootV1beta1) Redactors(namespace string) v1beta1.RedactorInterface {
return &FakeRedactors{c, namespace}
}
func (c *FakeTroubleshootV1beta1) SupportBundles(namespace string) v1beta1.SupportBundleInterface {
return &FakeSupportBundles{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeTroubleshootV1beta1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}
@@ -1,28 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
type AnalyzerExpansion interface{}
type CollectorExpansion interface{}
type PreflightExpansion interface{}
type RedactorExpansion interface{}
type SupportBundleExpansion interface{}
@@ -1,194 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
import (
"context"
"time"
v1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
scheme "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// PreflightsGetter has a method to return a PreflightInterface.
// A group's client should implement this interface.
type PreflightsGetter interface {
Preflights(namespace string) PreflightInterface
}
// PreflightInterface has methods to work with Preflight resources.
type PreflightInterface interface {
Create(ctx context.Context, preflight *v1beta1.Preflight, opts v1.CreateOptions) (*v1beta1.Preflight, error)
Update(ctx context.Context, preflight *v1beta1.Preflight, opts v1.UpdateOptions) (*v1beta1.Preflight, error)
UpdateStatus(ctx context.Context, preflight *v1beta1.Preflight, opts v1.UpdateOptions) (*v1beta1.Preflight, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Preflight, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PreflightList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Preflight, err error)
PreflightExpansion
}
// preflights implements PreflightInterface
type preflights struct {
client rest.Interface
ns string
}
// newPreflights returns a Preflights
func newPreflights(c *TroubleshootV1beta1Client, namespace string) *preflights {
return &preflights{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the preflight, and returns the corresponding preflight object, and an error if there is any.
func (c *preflights) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Preflight, err error) {
result = &v1beta1.Preflight{}
err = c.client.Get().
Namespace(c.ns).
Resource("preflights").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Preflights that match those selectors.
func (c *preflights) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PreflightList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.PreflightList{}
err = c.client.Get().
Namespace(c.ns).
Resource("preflights").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested preflights.
func (c *preflights) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("preflights").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a preflight and creates it. Returns the server's representation of the preflight, and an error, if there is any.
func (c *preflights) Create(ctx context.Context, preflight *v1beta1.Preflight, opts v1.CreateOptions) (result *v1beta1.Preflight, err error) {
result = &v1beta1.Preflight{}
err = c.client.Post().
Namespace(c.ns).
Resource("preflights").
VersionedParams(&opts, scheme.ParameterCodec).
Body(preflight).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a preflight and updates it. Returns the server's representation of the preflight, and an error, if there is any.
func (c *preflights) Update(ctx context.Context, preflight *v1beta1.Preflight, opts v1.UpdateOptions) (result *v1beta1.Preflight, err error) {
result = &v1beta1.Preflight{}
err = c.client.Put().
Namespace(c.ns).
Resource("preflights").
Name(preflight.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(preflight).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *preflights) UpdateStatus(ctx context.Context, preflight *v1beta1.Preflight, opts v1.UpdateOptions) (result *v1beta1.Preflight, err error) {
result = &v1beta1.Preflight{}
err = c.client.Put().
Namespace(c.ns).
Resource("preflights").
Name(preflight.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(preflight).
Do(ctx).
Into(result)
return
}
// Delete takes name of the preflight and deletes it. Returns an error if one occurs.
func (c *preflights) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("preflights").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *preflights) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("preflights").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched preflight.
func (c *preflights) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Preflight, err error) {
result = &v1beta1.Preflight{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("preflights").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
@@ -1,194 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
import (
"context"
"time"
v1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
scheme "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// RedactorsGetter has a method to return a RedactorInterface.
// A group's client should implement this interface.
type RedactorsGetter interface {
Redactors(namespace string) RedactorInterface
}
// RedactorInterface has methods to work with Redactor resources.
type RedactorInterface interface {
Create(ctx context.Context, redactor *v1beta1.Redactor, opts v1.CreateOptions) (*v1beta1.Redactor, error)
Update(ctx context.Context, redactor *v1beta1.Redactor, opts v1.UpdateOptions) (*v1beta1.Redactor, error)
UpdateStatus(ctx context.Context, redactor *v1beta1.Redactor, opts v1.UpdateOptions) (*v1beta1.Redactor, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Redactor, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RedactorList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Redactor, err error)
RedactorExpansion
}
// redactors implements RedactorInterface
type redactors struct {
client rest.Interface
ns string
}
// newRedactors returns a Redactors
func newRedactors(c *TroubleshootV1beta1Client, namespace string) *redactors {
return &redactors{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the redactor, and returns the corresponding redactor object, and an error if there is any.
func (c *redactors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Redactor, err error) {
result = &v1beta1.Redactor{}
err = c.client.Get().
Namespace(c.ns).
Resource("redactors").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Redactors that match those selectors.
func (c *redactors) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RedactorList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.RedactorList{}
err = c.client.Get().
Namespace(c.ns).
Resource("redactors").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested redactors.
func (c *redactors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("redactors").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a redactor and creates it. Returns the server's representation of the redactor, and an error, if there is any.
func (c *redactors) Create(ctx context.Context, redactor *v1beta1.Redactor, opts v1.CreateOptions) (result *v1beta1.Redactor, err error) {
result = &v1beta1.Redactor{}
err = c.client.Post().
Namespace(c.ns).
Resource("redactors").
VersionedParams(&opts, scheme.ParameterCodec).
Body(redactor).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a redactor and updates it. Returns the server's representation of the redactor, and an error, if there is any.
func (c *redactors) Update(ctx context.Context, redactor *v1beta1.Redactor, opts v1.UpdateOptions) (result *v1beta1.Redactor, err error) {
result = &v1beta1.Redactor{}
err = c.client.Put().
Namespace(c.ns).
Resource("redactors").
Name(redactor.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(redactor).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *redactors) UpdateStatus(ctx context.Context, redactor *v1beta1.Redactor, opts v1.UpdateOptions) (result *v1beta1.Redactor, err error) {
result = &v1beta1.Redactor{}
err = c.client.Put().
Namespace(c.ns).
Resource("redactors").
Name(redactor.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(redactor).
Do(ctx).
Into(result)
return
}
// Delete takes name of the redactor and deletes it. Returns an error if one occurs.
func (c *redactors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("redactors").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *redactors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("redactors").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched redactor.
func (c *redactors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Redactor, err error) {
result = &v1beta1.Redactor{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("redactors").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
@@ -1,194 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
import (
"context"
"time"
v1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
scheme "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// SupportBundlesGetter has a method to return a SupportBundleInterface.
// A group's client should implement this interface.
type SupportBundlesGetter interface {
SupportBundles(namespace string) SupportBundleInterface
}
// SupportBundleInterface has methods to work with SupportBundle resources.
type SupportBundleInterface interface {
Create(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.CreateOptions) (*v1beta1.SupportBundle, error)
Update(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.UpdateOptions) (*v1beta1.SupportBundle, error)
UpdateStatus(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.UpdateOptions) (*v1beta1.SupportBundle, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.SupportBundle, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.SupportBundleList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.SupportBundle, err error)
SupportBundleExpansion
}
// supportBundles implements SupportBundleInterface
type supportBundles struct {
client rest.Interface
ns string
}
// newSupportBundles returns a SupportBundles
func newSupportBundles(c *TroubleshootV1beta1Client, namespace string) *supportBundles {
return &supportBundles{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the supportBundle, and returns the corresponding supportBundle object, and an error if there is any.
func (c *supportBundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.SupportBundle, err error) {
result = &v1beta1.SupportBundle{}
err = c.client.Get().
Namespace(c.ns).
Resource("supportbundles").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of SupportBundles that match those selectors.
func (c *supportBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.SupportBundleList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.SupportBundleList{}
err = c.client.Get().
Namespace(c.ns).
Resource("supportbundles").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested supportBundles.
func (c *supportBundles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("supportbundles").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a supportBundle and creates it. Returns the server's representation of the supportBundle, and an error, if there is any.
func (c *supportBundles) Create(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.CreateOptions) (result *v1beta1.SupportBundle, err error) {
result = &v1beta1.SupportBundle{}
err = c.client.Post().
Namespace(c.ns).
Resource("supportbundles").
VersionedParams(&opts, scheme.ParameterCodec).
Body(supportBundle).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a supportBundle and updates it. Returns the server's representation of the supportBundle, and an error, if there is any.
func (c *supportBundles) Update(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.UpdateOptions) (result *v1beta1.SupportBundle, err error) {
result = &v1beta1.SupportBundle{}
err = c.client.Put().
Namespace(c.ns).
Resource("supportbundles").
Name(supportBundle.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(supportBundle).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *supportBundles) UpdateStatus(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.UpdateOptions) (result *v1beta1.SupportBundle, err error) {
result = &v1beta1.SupportBundle{}
err = c.client.Put().
Namespace(c.ns).
Resource("supportbundles").
Name(supportBundle.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(supportBundle).
Do(ctx).
Into(result)
return
}
// Delete takes name of the supportBundle and deletes it. Returns an error if one occurs.
func (c *supportBundles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("supportbundles").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *supportBundles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("supportbundles").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched supportBundle.
func (c *supportBundles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.SupportBundle, err error) {
result = &v1beta1.SupportBundle{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("supportbundles").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
@@ -1,108 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
import (
v1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
"github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
rest "k8s.io/client-go/rest"
)
type TroubleshootV1beta1Interface interface {
RESTClient() rest.Interface
AnalyzersGetter
CollectorsGetter
PreflightsGetter
RedactorsGetter
SupportBundlesGetter
}
// TroubleshootV1beta1Client is used to interact with features provided by the troubleshoot.replicated.com group.
type TroubleshootV1beta1Client struct {
restClient rest.Interface
}
func (c *TroubleshootV1beta1Client) Analyzers(namespace string) AnalyzerInterface {
return newAnalyzers(c, namespace)
}
func (c *TroubleshootV1beta1Client) Collectors(namespace string) CollectorInterface {
return newCollectors(c, namespace)
}
func (c *TroubleshootV1beta1Client) Preflights(namespace string) PreflightInterface {
return newPreflights(c, namespace)
}
func (c *TroubleshootV1beta1Client) Redactors(namespace string) RedactorInterface {
return newRedactors(c, namespace)
}
func (c *TroubleshootV1beta1Client) SupportBundles(namespace string) SupportBundleInterface {
return newSupportBundles(c, namespace)
}
// NewForConfig creates a new TroubleshootV1beta1Client for the given config.
func NewForConfig(c *rest.Config) (*TroubleshootV1beta1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &TroubleshootV1beta1Client{client}, nil
}
// NewForConfigOrDie creates a new TroubleshootV1beta1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *TroubleshootV1beta1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new TroubleshootV1beta1Client for the given RESTClient.
func New(c rest.Interface) *TroubleshootV1beta1Client {
return &TroubleshootV1beta1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1beta1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *TroubleshootV1beta1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}
@@ -1,194 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta2
import (
"context"
"time"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
scheme "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// AnalyzersGetter has a method to return a AnalyzerInterface.
// A group's client should implement this interface.
type AnalyzersGetter interface {
Analyzers(namespace string) AnalyzerInterface
}
// AnalyzerInterface has methods to work with Analyzer resources.
type AnalyzerInterface interface {
Create(ctx context.Context, analyzer *v1beta2.Analyzer, opts v1.CreateOptions) (*v1beta2.Analyzer, error)
Update(ctx context.Context, analyzer *v1beta2.Analyzer, opts v1.UpdateOptions) (*v1beta2.Analyzer, error)
UpdateStatus(ctx context.Context, analyzer *v1beta2.Analyzer, opts v1.UpdateOptions) (*v1beta2.Analyzer, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.Analyzer, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.AnalyzerList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Analyzer, err error)
AnalyzerExpansion
}
// analyzers implements AnalyzerInterface
type analyzers struct {
client rest.Interface
ns string
}
// newAnalyzers returns a Analyzers
func newAnalyzers(c *TroubleshootV1beta2Client, namespace string) *analyzers {
return &analyzers{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the analyzer, and returns the corresponding analyzer object, and an error if there is any.
func (c *analyzers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Analyzer, err error) {
result = &v1beta2.Analyzer{}
err = c.client.Get().
Namespace(c.ns).
Resource("analyzers").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Analyzers that match those selectors.
func (c *analyzers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.AnalyzerList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.AnalyzerList{}
err = c.client.Get().
Namespace(c.ns).
Resource("analyzers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested analyzers.
func (c *analyzers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("analyzers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a analyzer and creates it. Returns the server's representation of the analyzer, and an error, if there is any.
func (c *analyzers) Create(ctx context.Context, analyzer *v1beta2.Analyzer, opts v1.CreateOptions) (result *v1beta2.Analyzer, err error) {
result = &v1beta2.Analyzer{}
err = c.client.Post().
Namespace(c.ns).
Resource("analyzers").
VersionedParams(&opts, scheme.ParameterCodec).
Body(analyzer).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a analyzer and updates it. Returns the server's representation of the analyzer, and an error, if there is any.
func (c *analyzers) Update(ctx context.Context, analyzer *v1beta2.Analyzer, opts v1.UpdateOptions) (result *v1beta2.Analyzer, err error) {
result = &v1beta2.Analyzer{}
err = c.client.Put().
Namespace(c.ns).
Resource("analyzers").
Name(analyzer.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(analyzer).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *analyzers) UpdateStatus(ctx context.Context, analyzer *v1beta2.Analyzer, opts v1.UpdateOptions) (result *v1beta2.Analyzer, err error) {
result = &v1beta2.Analyzer{}
err = c.client.Put().
Namespace(c.ns).
Resource("analyzers").
Name(analyzer.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(analyzer).
Do(ctx).
Into(result)
return
}
// Delete takes name of the analyzer and deletes it. Returns an error if one occurs.
func (c *analyzers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("analyzers").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *analyzers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("analyzers").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched analyzer.
func (c *analyzers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Analyzer, err error) {
result = &v1beta2.Analyzer{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("analyzers").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
@@ -1,194 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta2
import (
"context"
"time"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
scheme "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// CollectorsGetter has a method to return a CollectorInterface.
// A group's client should implement this interface.
type CollectorsGetter interface {
Collectors(namespace string) CollectorInterface
}
// CollectorInterface has methods to work with Collector resources.
type CollectorInterface interface {
Create(ctx context.Context, collector *v1beta2.Collector, opts v1.CreateOptions) (*v1beta2.Collector, error)
Update(ctx context.Context, collector *v1beta2.Collector, opts v1.UpdateOptions) (*v1beta2.Collector, error)
UpdateStatus(ctx context.Context, collector *v1beta2.Collector, opts v1.UpdateOptions) (*v1beta2.Collector, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.Collector, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.CollectorList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Collector, err error)
CollectorExpansion
}
// collectors implements CollectorInterface
type collectors struct {
client rest.Interface
ns string
}
// newCollectors returns a Collectors
func newCollectors(c *TroubleshootV1beta2Client, namespace string) *collectors {
return &collectors{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the collector, and returns the corresponding collector object, and an error if there is any.
func (c *collectors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Collector, err error) {
result = &v1beta2.Collector{}
err = c.client.Get().
Namespace(c.ns).
Resource("collectors").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Collectors that match those selectors.
func (c *collectors) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.CollectorList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.CollectorList{}
err = c.client.Get().
Namespace(c.ns).
Resource("collectors").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested collectors.
func (c *collectors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("collectors").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a collector and creates it. Returns the server's representation of the collector, and an error, if there is any.
func (c *collectors) Create(ctx context.Context, collector *v1beta2.Collector, opts v1.CreateOptions) (result *v1beta2.Collector, err error) {
result = &v1beta2.Collector{}
err = c.client.Post().
Namespace(c.ns).
Resource("collectors").
VersionedParams(&opts, scheme.ParameterCodec).
Body(collector).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a collector and updates it. Returns the server's representation of the collector, and an error, if there is any.
func (c *collectors) Update(ctx context.Context, collector *v1beta2.Collector, opts v1.UpdateOptions) (result *v1beta2.Collector, err error) {
result = &v1beta2.Collector{}
err = c.client.Put().
Namespace(c.ns).
Resource("collectors").
Name(collector.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(collector).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *collectors) UpdateStatus(ctx context.Context, collector *v1beta2.Collector, opts v1.UpdateOptions) (result *v1beta2.Collector, err error) {
result = &v1beta2.Collector{}
err = c.client.Put().
Namespace(c.ns).
Resource("collectors").
Name(collector.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(collector).
Do(ctx).
Into(result)
return
}
// Delete takes name of the collector and deletes it. Returns an error if one occurs.
func (c *collectors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("collectors").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *collectors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("collectors").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched collector.
func (c *collectors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Collector, err error) {
result = &v1beta2.Collector{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("collectors").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
@@ -1,19 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1beta2
@@ -1,19 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// Package fake has the automatically generated clients.
package fake
@@ -1,141 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeAnalyzers implements AnalyzerInterface
type FakeAnalyzers struct {
Fake *FakeTroubleshootV1beta2
ns string
}
var analyzersResource = schema.GroupVersionResource{Group: "troubleshoot.sh", Version: "v1beta2", Resource: "analyzers"}
var analyzersKind = schema.GroupVersionKind{Group: "troubleshoot.sh", Version: "v1beta2", Kind: "Analyzer"}
// Get takes name of the analyzer, and returns the corresponding analyzer object, and an error if there is any.
func (c *FakeAnalyzers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Analyzer, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(analyzersResource, c.ns, name), &v1beta2.Analyzer{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Analyzer), err
}
// List takes label and field selectors, and returns the list of Analyzers that match those selectors.
func (c *FakeAnalyzers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.AnalyzerList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(analyzersResource, analyzersKind, c.ns, opts), &v1beta2.AnalyzerList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta2.AnalyzerList{ListMeta: obj.(*v1beta2.AnalyzerList).ListMeta}
for _, item := range obj.(*v1beta2.AnalyzerList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested analyzers.
func (c *FakeAnalyzers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(analyzersResource, c.ns, opts))
}
// Create takes the representation of a analyzer and creates it. Returns the server's representation of the analyzer, and an error, if there is any.
func (c *FakeAnalyzers) Create(ctx context.Context, analyzer *v1beta2.Analyzer, opts v1.CreateOptions) (result *v1beta2.Analyzer, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(analyzersResource, c.ns, analyzer), &v1beta2.Analyzer{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Analyzer), err
}
// Update takes the representation of a analyzer and updates it. Returns the server's representation of the analyzer, and an error, if there is any.
func (c *FakeAnalyzers) Update(ctx context.Context, analyzer *v1beta2.Analyzer, opts v1.UpdateOptions) (result *v1beta2.Analyzer, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(analyzersResource, c.ns, analyzer), &v1beta2.Analyzer{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Analyzer), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeAnalyzers) UpdateStatus(ctx context.Context, analyzer *v1beta2.Analyzer, opts v1.UpdateOptions) (*v1beta2.Analyzer, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(analyzersResource, "status", c.ns, analyzer), &v1beta2.Analyzer{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Analyzer), err
}
// Delete takes name of the analyzer and deletes it. Returns an error if one occurs.
func (c *FakeAnalyzers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(analyzersResource, c.ns, name), &v1beta2.Analyzer{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeAnalyzers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(analyzersResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta2.AnalyzerList{})
return err
}
// Patch applies the patch and returns the patched analyzer.
func (c *FakeAnalyzers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Analyzer, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(analyzersResource, c.ns, name, pt, data, subresources...), &v1beta2.Analyzer{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Analyzer), err
}
@@ -1,141 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeCollectors implements CollectorInterface
type FakeCollectors struct {
Fake *FakeTroubleshootV1beta2
ns string
}
var collectorsResource = schema.GroupVersionResource{Group: "troubleshoot.sh", Version: "v1beta2", Resource: "collectors"}
var collectorsKind = schema.GroupVersionKind{Group: "troubleshoot.sh", Version: "v1beta2", Kind: "Collector"}
// Get takes name of the collector, and returns the corresponding collector object, and an error if there is any.
func (c *FakeCollectors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Collector, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(collectorsResource, c.ns, name), &v1beta2.Collector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Collector), err
}
// List takes label and field selectors, and returns the list of Collectors that match those selectors.
func (c *FakeCollectors) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.CollectorList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(collectorsResource, collectorsKind, c.ns, opts), &v1beta2.CollectorList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta2.CollectorList{ListMeta: obj.(*v1beta2.CollectorList).ListMeta}
for _, item := range obj.(*v1beta2.CollectorList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested collectors.
func (c *FakeCollectors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(collectorsResource, c.ns, opts))
}
// Create takes the representation of a collector and creates it. Returns the server's representation of the collector, and an error, if there is any.
func (c *FakeCollectors) Create(ctx context.Context, collector *v1beta2.Collector, opts v1.CreateOptions) (result *v1beta2.Collector, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(collectorsResource, c.ns, collector), &v1beta2.Collector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Collector), err
}
// Update takes the representation of a collector and updates it. Returns the server's representation of the collector, and an error, if there is any.
func (c *FakeCollectors) Update(ctx context.Context, collector *v1beta2.Collector, opts v1.UpdateOptions) (result *v1beta2.Collector, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(collectorsResource, c.ns, collector), &v1beta2.Collector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Collector), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeCollectors) UpdateStatus(ctx context.Context, collector *v1beta2.Collector, opts v1.UpdateOptions) (*v1beta2.Collector, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(collectorsResource, "status", c.ns, collector), &v1beta2.Collector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Collector), err
}
// Delete takes name of the collector and deletes it. Returns an error if one occurs.
func (c *FakeCollectors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(collectorsResource, c.ns, name), &v1beta2.Collector{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeCollectors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(collectorsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta2.CollectorList{})
return err
}
// Patch applies the patch and returns the patched collector.
func (c *FakeCollectors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Collector, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(collectorsResource, c.ns, name, pt, data, subresources...), &v1beta2.Collector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Collector), err
}
@@ -1,141 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeHostCollectors implements HostCollectorInterface
type FakeHostCollectors struct {
Fake *FakeTroubleshootV1beta2
ns string
}
var hostcollectorsResource = schema.GroupVersionResource{Group: "troubleshoot.sh", Version: "v1beta2", Resource: "hostcollectors"}
var hostcollectorsKind = schema.GroupVersionKind{Group: "troubleshoot.sh", Version: "v1beta2", Kind: "HostCollector"}
// Get takes name of the hostCollector, and returns the corresponding hostCollector object, and an error if there is any.
func (c *FakeHostCollectors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.HostCollector, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(hostcollectorsResource, c.ns, name), &v1beta2.HostCollector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.HostCollector), err
}
// List takes label and field selectors, and returns the list of HostCollectors that match those selectors.
func (c *FakeHostCollectors) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.HostCollectorList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(hostcollectorsResource, hostcollectorsKind, c.ns, opts), &v1beta2.HostCollectorList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta2.HostCollectorList{ListMeta: obj.(*v1beta2.HostCollectorList).ListMeta}
for _, item := range obj.(*v1beta2.HostCollectorList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested hostCollectors.
func (c *FakeHostCollectors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(hostcollectorsResource, c.ns, opts))
}
// Create takes the representation of a hostCollector and creates it. Returns the server's representation of the hostCollector, and an error, if there is any.
func (c *FakeHostCollectors) Create(ctx context.Context, hostCollector *v1beta2.HostCollector, opts v1.CreateOptions) (result *v1beta2.HostCollector, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(hostcollectorsResource, c.ns, hostCollector), &v1beta2.HostCollector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.HostCollector), err
}
// Update takes the representation of a hostCollector and updates it. Returns the server's representation of the hostCollector, and an error, if there is any.
func (c *FakeHostCollectors) Update(ctx context.Context, hostCollector *v1beta2.HostCollector, opts v1.UpdateOptions) (result *v1beta2.HostCollector, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(hostcollectorsResource, c.ns, hostCollector), &v1beta2.HostCollector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.HostCollector), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeHostCollectors) UpdateStatus(ctx context.Context, hostCollector *v1beta2.HostCollector, opts v1.UpdateOptions) (*v1beta2.HostCollector, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(hostcollectorsResource, "status", c.ns, hostCollector), &v1beta2.HostCollector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.HostCollector), err
}
// Delete takes name of the hostCollector and deletes it. Returns an error if one occurs.
func (c *FakeHostCollectors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(hostcollectorsResource, c.ns, name), &v1beta2.HostCollector{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeHostCollectors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(hostcollectorsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta2.HostCollectorList{})
return err
}
// Patch applies the patch and returns the patched hostCollector.
func (c *FakeHostCollectors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.HostCollector, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(hostcollectorsResource, c.ns, name, pt, data, subresources...), &v1beta2.HostCollector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.HostCollector), err
}
@@ -1,141 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeHostPreflights implements HostPreflightInterface
type FakeHostPreflights struct {
Fake *FakeTroubleshootV1beta2
ns string
}
var hostpreflightsResource = schema.GroupVersionResource{Group: "troubleshoot.sh", Version: "v1beta2", Resource: "hostpreflights"}
var hostpreflightsKind = schema.GroupVersionKind{Group: "troubleshoot.sh", Version: "v1beta2", Kind: "HostPreflight"}
// Get takes name of the hostPreflight, and returns the corresponding hostPreflight object, and an error if there is any.
func (c *FakeHostPreflights) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.HostPreflight, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(hostpreflightsResource, c.ns, name), &v1beta2.HostPreflight{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.HostPreflight), err
}
// List takes label and field selectors, and returns the list of HostPreflights that match those selectors.
func (c *FakeHostPreflights) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.HostPreflightList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(hostpreflightsResource, hostpreflightsKind, c.ns, opts), &v1beta2.HostPreflightList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta2.HostPreflightList{ListMeta: obj.(*v1beta2.HostPreflightList).ListMeta}
for _, item := range obj.(*v1beta2.HostPreflightList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested hostPreflights.
func (c *FakeHostPreflights) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(hostpreflightsResource, c.ns, opts))
}
// Create takes the representation of a hostPreflight and creates it. Returns the server's representation of the hostPreflight, and an error, if there is any.
func (c *FakeHostPreflights) Create(ctx context.Context, hostPreflight *v1beta2.HostPreflight, opts v1.CreateOptions) (result *v1beta2.HostPreflight, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(hostpreflightsResource, c.ns, hostPreflight), &v1beta2.HostPreflight{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.HostPreflight), err
}
// Update takes the representation of a hostPreflight and updates it. Returns the server's representation of the hostPreflight, and an error, if there is any.
func (c *FakeHostPreflights) Update(ctx context.Context, hostPreflight *v1beta2.HostPreflight, opts v1.UpdateOptions) (result *v1beta2.HostPreflight, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(hostpreflightsResource, c.ns, hostPreflight), &v1beta2.HostPreflight{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.HostPreflight), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeHostPreflights) UpdateStatus(ctx context.Context, hostPreflight *v1beta2.HostPreflight, opts v1.UpdateOptions) (*v1beta2.HostPreflight, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(hostpreflightsResource, "status", c.ns, hostPreflight), &v1beta2.HostPreflight{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.HostPreflight), err
}
// Delete takes name of the hostPreflight and deletes it. Returns an error if one occurs.
func (c *FakeHostPreflights) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(hostpreflightsResource, c.ns, name), &v1beta2.HostPreflight{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeHostPreflights) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(hostpreflightsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta2.HostPreflightList{})
return err
}
// Patch applies the patch and returns the patched hostPreflight.
func (c *FakeHostPreflights) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.HostPreflight, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(hostpreflightsResource, c.ns, name, pt, data, subresources...), &v1beta2.HostPreflight{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.HostPreflight), err
}
@@ -1,141 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakePreflights implements PreflightInterface
type FakePreflights struct {
Fake *FakeTroubleshootV1beta2
ns string
}
var preflightsResource = schema.GroupVersionResource{Group: "troubleshoot.sh", Version: "v1beta2", Resource: "preflights"}
var preflightsKind = schema.GroupVersionKind{Group: "troubleshoot.sh", Version: "v1beta2", Kind: "Preflight"}
// Get takes name of the preflight, and returns the corresponding preflight object, and an error if there is any.
func (c *FakePreflights) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Preflight, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(preflightsResource, c.ns, name), &v1beta2.Preflight{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Preflight), err
}
// List takes label and field selectors, and returns the list of Preflights that match those selectors.
func (c *FakePreflights) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PreflightList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(preflightsResource, preflightsKind, c.ns, opts), &v1beta2.PreflightList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta2.PreflightList{ListMeta: obj.(*v1beta2.PreflightList).ListMeta}
for _, item := range obj.(*v1beta2.PreflightList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested preflights.
func (c *FakePreflights) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(preflightsResource, c.ns, opts))
}
// Create takes the representation of a preflight and creates it. Returns the server's representation of the preflight, and an error, if there is any.
func (c *FakePreflights) Create(ctx context.Context, preflight *v1beta2.Preflight, opts v1.CreateOptions) (result *v1beta2.Preflight, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(preflightsResource, c.ns, preflight), &v1beta2.Preflight{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Preflight), err
}
// Update takes the representation of a preflight and updates it. Returns the server's representation of the preflight, and an error, if there is any.
func (c *FakePreflights) Update(ctx context.Context, preflight *v1beta2.Preflight, opts v1.UpdateOptions) (result *v1beta2.Preflight, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(preflightsResource, c.ns, preflight), &v1beta2.Preflight{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Preflight), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakePreflights) UpdateStatus(ctx context.Context, preflight *v1beta2.Preflight, opts v1.UpdateOptions) (*v1beta2.Preflight, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(preflightsResource, "status", c.ns, preflight), &v1beta2.Preflight{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Preflight), err
}
// Delete takes name of the preflight and deletes it. Returns an error if one occurs.
func (c *FakePreflights) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(preflightsResource, c.ns, name), &v1beta2.Preflight{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakePreflights) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(preflightsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta2.PreflightList{})
return err
}
// Patch applies the patch and returns the patched preflight.
func (c *FakePreflights) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Preflight, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(preflightsResource, c.ns, name, pt, data, subresources...), &v1beta2.Preflight{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Preflight), err
}
@@ -1,141 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeRedactors implements RedactorInterface
type FakeRedactors struct {
Fake *FakeTroubleshootV1beta2
ns string
}
var redactorsResource = schema.GroupVersionResource{Group: "troubleshoot.sh", Version: "v1beta2", Resource: "redactors"}
var redactorsKind = schema.GroupVersionKind{Group: "troubleshoot.sh", Version: "v1beta2", Kind: "Redactor"}
// Get takes name of the redactor, and returns the corresponding redactor object, and an error if there is any.
func (c *FakeRedactors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Redactor, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(redactorsResource, c.ns, name), &v1beta2.Redactor{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Redactor), err
}
// List takes label and field selectors, and returns the list of Redactors that match those selectors.
func (c *FakeRedactors) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.RedactorList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(redactorsResource, redactorsKind, c.ns, opts), &v1beta2.RedactorList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta2.RedactorList{ListMeta: obj.(*v1beta2.RedactorList).ListMeta}
for _, item := range obj.(*v1beta2.RedactorList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested redactors.
func (c *FakeRedactors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(redactorsResource, c.ns, opts))
}
// Create takes the representation of a redactor and creates it. Returns the server's representation of the redactor, and an error, if there is any.
func (c *FakeRedactors) Create(ctx context.Context, redactor *v1beta2.Redactor, opts v1.CreateOptions) (result *v1beta2.Redactor, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(redactorsResource, c.ns, redactor), &v1beta2.Redactor{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Redactor), err
}
// Update takes the representation of a redactor and updates it. Returns the server's representation of the redactor, and an error, if there is any.
func (c *FakeRedactors) Update(ctx context.Context, redactor *v1beta2.Redactor, opts v1.UpdateOptions) (result *v1beta2.Redactor, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(redactorsResource, c.ns, redactor), &v1beta2.Redactor{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Redactor), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeRedactors) UpdateStatus(ctx context.Context, redactor *v1beta2.Redactor, opts v1.UpdateOptions) (*v1beta2.Redactor, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(redactorsResource, "status", c.ns, redactor), &v1beta2.Redactor{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Redactor), err
}
// Delete takes name of the redactor and deletes it. Returns an error if one occurs.
func (c *FakeRedactors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(redactorsResource, c.ns, name), &v1beta2.Redactor{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeRedactors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(redactorsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta2.RedactorList{})
return err
}
// Patch applies the patch and returns the patched redactor.
func (c *FakeRedactors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Redactor, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(redactorsResource, c.ns, name, pt, data, subresources...), &v1beta2.Redactor{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Redactor), err
}
@@ -1,141 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeRemoteCollectors implements RemoteCollectorInterface
type FakeRemoteCollectors struct {
Fake *FakeTroubleshootV1beta2
ns string
}
var remotecollectorsResource = schema.GroupVersionResource{Group: "troubleshoot.sh", Version: "v1beta2", Resource: "remotecollectors"}
var remotecollectorsKind = schema.GroupVersionKind{Group: "troubleshoot.sh", Version: "v1beta2", Kind: "RemoteCollector"}
// Get takes name of the remoteCollector, and returns the corresponding remoteCollector object, and an error if there is any.
func (c *FakeRemoteCollectors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.RemoteCollector, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(remotecollectorsResource, c.ns, name), &v1beta2.RemoteCollector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.RemoteCollector), err
}
// List takes label and field selectors, and returns the list of RemoteCollectors that match those selectors.
func (c *FakeRemoteCollectors) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.RemoteCollectorList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(remotecollectorsResource, remotecollectorsKind, c.ns, opts), &v1beta2.RemoteCollectorList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta2.RemoteCollectorList{ListMeta: obj.(*v1beta2.RemoteCollectorList).ListMeta}
for _, item := range obj.(*v1beta2.RemoteCollectorList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested remoteCollectors.
func (c *FakeRemoteCollectors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(remotecollectorsResource, c.ns, opts))
}
// Create takes the representation of a remoteCollector and creates it. Returns the server's representation of the remoteCollector, and an error, if there is any.
func (c *FakeRemoteCollectors) Create(ctx context.Context, remoteCollector *v1beta2.RemoteCollector, opts v1.CreateOptions) (result *v1beta2.RemoteCollector, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(remotecollectorsResource, c.ns, remoteCollector), &v1beta2.RemoteCollector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.RemoteCollector), err
}
// Update takes the representation of a remoteCollector and updates it. Returns the server's representation of the remoteCollector, and an error, if there is any.
func (c *FakeRemoteCollectors) Update(ctx context.Context, remoteCollector *v1beta2.RemoteCollector, opts v1.UpdateOptions) (result *v1beta2.RemoteCollector, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(remotecollectorsResource, c.ns, remoteCollector), &v1beta2.RemoteCollector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.RemoteCollector), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeRemoteCollectors) UpdateStatus(ctx context.Context, remoteCollector *v1beta2.RemoteCollector, opts v1.UpdateOptions) (*v1beta2.RemoteCollector, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(remotecollectorsResource, "status", c.ns, remoteCollector), &v1beta2.RemoteCollector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.RemoteCollector), err
}
// Delete takes name of the remoteCollector and deletes it. Returns an error if one occurs.
func (c *FakeRemoteCollectors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(remotecollectorsResource, c.ns, name), &v1beta2.RemoteCollector{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeRemoteCollectors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(remotecollectorsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta2.RemoteCollectorList{})
return err
}
// Patch applies the patch and returns the patched remoteCollector.
func (c *FakeRemoteCollectors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.RemoteCollector, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(remotecollectorsResource, c.ns, name, pt, data, subresources...), &v1beta2.RemoteCollector{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.RemoteCollector), err
}
@@ -1,141 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeSupportBundles implements SupportBundleInterface
type FakeSupportBundles struct {
Fake *FakeTroubleshootV1beta2
ns string
}
var supportbundlesResource = schema.GroupVersionResource{Group: "troubleshoot.sh", Version: "v1beta2", Resource: "supportbundles"}
var supportbundlesKind = schema.GroupVersionKind{Group: "troubleshoot.sh", Version: "v1beta2", Kind: "SupportBundle"}
// Get takes name of the supportBundle, and returns the corresponding supportBundle object, and an error if there is any.
func (c *FakeSupportBundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.SupportBundle, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(supportbundlesResource, c.ns, name), &v1beta2.SupportBundle{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.SupportBundle), err
}
// List takes label and field selectors, and returns the list of SupportBundles that match those selectors.
func (c *FakeSupportBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.SupportBundleList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(supportbundlesResource, supportbundlesKind, c.ns, opts), &v1beta2.SupportBundleList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta2.SupportBundleList{ListMeta: obj.(*v1beta2.SupportBundleList).ListMeta}
for _, item := range obj.(*v1beta2.SupportBundleList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested supportBundles.
func (c *FakeSupportBundles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(supportbundlesResource, c.ns, opts))
}
// Create takes the representation of a supportBundle and creates it. Returns the server's representation of the supportBundle, and an error, if there is any.
func (c *FakeSupportBundles) Create(ctx context.Context, supportBundle *v1beta2.SupportBundle, opts v1.CreateOptions) (result *v1beta2.SupportBundle, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(supportbundlesResource, c.ns, supportBundle), &v1beta2.SupportBundle{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.SupportBundle), err
}
// Update takes the representation of a supportBundle and updates it. Returns the server's representation of the supportBundle, and an error, if there is any.
func (c *FakeSupportBundles) Update(ctx context.Context, supportBundle *v1beta2.SupportBundle, opts v1.UpdateOptions) (result *v1beta2.SupportBundle, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(supportbundlesResource, c.ns, supportBundle), &v1beta2.SupportBundle{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.SupportBundle), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeSupportBundles) UpdateStatus(ctx context.Context, supportBundle *v1beta2.SupportBundle, opts v1.UpdateOptions) (*v1beta2.SupportBundle, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(supportbundlesResource, "status", c.ns, supportBundle), &v1beta2.SupportBundle{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.SupportBundle), err
}
// Delete takes name of the supportBundle and deletes it. Returns an error if one occurs.
func (c *FakeSupportBundles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(supportbundlesResource, c.ns, name), &v1beta2.SupportBundle{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeSupportBundles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(supportbundlesResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta2.SupportBundleList{})
return err
}
// Patch applies the patch and returns the patched supportBundle.
func (c *FakeSupportBundles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.SupportBundle, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(supportbundlesResource, c.ns, name, pt, data, subresources...), &v1beta2.SupportBundle{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.SupportBundle), err
}
@@ -1,67 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/typed/troubleshoot/v1beta2"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeTroubleshootV1beta2 struct {
*testing.Fake
}
func (c *FakeTroubleshootV1beta2) Analyzers(namespace string) v1beta2.AnalyzerInterface {
return &FakeAnalyzers{c, namespace}
}
func (c *FakeTroubleshootV1beta2) Collectors(namespace string) v1beta2.CollectorInterface {
return &FakeCollectors{c, namespace}
}
func (c *FakeTroubleshootV1beta2) HostCollectors(namespace string) v1beta2.HostCollectorInterface {
return &FakeHostCollectors{c, namespace}
}
func (c *FakeTroubleshootV1beta2) HostPreflights(namespace string) v1beta2.HostPreflightInterface {
return &FakeHostPreflights{c, namespace}
}
func (c *FakeTroubleshootV1beta2) Preflights(namespace string) v1beta2.PreflightInterface {
return &FakePreflights{c, namespace}
}
func (c *FakeTroubleshootV1beta2) Redactors(namespace string) v1beta2.RedactorInterface {
return &FakeRedactors{c, namespace}
}
func (c *FakeTroubleshootV1beta2) RemoteCollectors(namespace string) v1beta2.RemoteCollectorInterface {
return &FakeRemoteCollectors{c, namespace}
}
func (c *FakeTroubleshootV1beta2) SupportBundles(namespace string) v1beta2.SupportBundleInterface {
return &FakeSupportBundles{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeTroubleshootV1beta2) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}
@@ -1,34 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta2
type AnalyzerExpansion interface{}
type CollectorExpansion interface{}
type HostCollectorExpansion interface{}
type HostPreflightExpansion interface{}
type PreflightExpansion interface{}
type RedactorExpansion interface{}
type RemoteCollectorExpansion interface{}
type SupportBundleExpansion interface{}
@@ -1,194 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta2
import (
"context"
"time"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
scheme "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// HostCollectorsGetter has a method to return a HostCollectorInterface.
// A group's client should implement this interface.
type HostCollectorsGetter interface {
HostCollectors(namespace string) HostCollectorInterface
}
// HostCollectorInterface has methods to work with HostCollector resources.
type HostCollectorInterface interface {
Create(ctx context.Context, hostCollector *v1beta2.HostCollector, opts v1.CreateOptions) (*v1beta2.HostCollector, error)
Update(ctx context.Context, hostCollector *v1beta2.HostCollector, opts v1.UpdateOptions) (*v1beta2.HostCollector, error)
UpdateStatus(ctx context.Context, hostCollector *v1beta2.HostCollector, opts v1.UpdateOptions) (*v1beta2.HostCollector, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.HostCollector, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.HostCollectorList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.HostCollector, err error)
HostCollectorExpansion
}
// hostCollectors implements HostCollectorInterface
type hostCollectors struct {
client rest.Interface
ns string
}
// newHostCollectors returns a HostCollectors
func newHostCollectors(c *TroubleshootV1beta2Client, namespace string) *hostCollectors {
return &hostCollectors{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the hostCollector, and returns the corresponding hostCollector object, and an error if there is any.
func (c *hostCollectors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.HostCollector, err error) {
result = &v1beta2.HostCollector{}
err = c.client.Get().
Namespace(c.ns).
Resource("hostcollectors").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of HostCollectors that match those selectors.
func (c *hostCollectors) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.HostCollectorList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.HostCollectorList{}
err = c.client.Get().
Namespace(c.ns).
Resource("hostcollectors").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested hostCollectors.
func (c *hostCollectors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("hostcollectors").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a hostCollector and creates it. Returns the server's representation of the hostCollector, and an error, if there is any.
func (c *hostCollectors) Create(ctx context.Context, hostCollector *v1beta2.HostCollector, opts v1.CreateOptions) (result *v1beta2.HostCollector, err error) {
result = &v1beta2.HostCollector{}
err = c.client.Post().
Namespace(c.ns).
Resource("hostcollectors").
VersionedParams(&opts, scheme.ParameterCodec).
Body(hostCollector).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a hostCollector and updates it. Returns the server's representation of the hostCollector, and an error, if there is any.
func (c *hostCollectors) Update(ctx context.Context, hostCollector *v1beta2.HostCollector, opts v1.UpdateOptions) (result *v1beta2.HostCollector, err error) {
result = &v1beta2.HostCollector{}
err = c.client.Put().
Namespace(c.ns).
Resource("hostcollectors").
Name(hostCollector.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(hostCollector).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *hostCollectors) UpdateStatus(ctx context.Context, hostCollector *v1beta2.HostCollector, opts v1.UpdateOptions) (result *v1beta2.HostCollector, err error) {
result = &v1beta2.HostCollector{}
err = c.client.Put().
Namespace(c.ns).
Resource("hostcollectors").
Name(hostCollector.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(hostCollector).
Do(ctx).
Into(result)
return
}
// Delete takes name of the hostCollector and deletes it. Returns an error if one occurs.
func (c *hostCollectors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("hostcollectors").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *hostCollectors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("hostcollectors").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched hostCollector.
func (c *hostCollectors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.HostCollector, err error) {
result = &v1beta2.HostCollector{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("hostcollectors").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
@@ -1,194 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta2
import (
"context"
"time"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
scheme "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// HostPreflightsGetter has a method to return a HostPreflightInterface.
// A group's client should implement this interface.
type HostPreflightsGetter interface {
HostPreflights(namespace string) HostPreflightInterface
}
// HostPreflightInterface has methods to work with HostPreflight resources.
type HostPreflightInterface interface {
Create(ctx context.Context, hostPreflight *v1beta2.HostPreflight, opts v1.CreateOptions) (*v1beta2.HostPreflight, error)
Update(ctx context.Context, hostPreflight *v1beta2.HostPreflight, opts v1.UpdateOptions) (*v1beta2.HostPreflight, error)
UpdateStatus(ctx context.Context, hostPreflight *v1beta2.HostPreflight, opts v1.UpdateOptions) (*v1beta2.HostPreflight, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.HostPreflight, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.HostPreflightList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.HostPreflight, err error)
HostPreflightExpansion
}
// hostPreflights implements HostPreflightInterface
type hostPreflights struct {
client rest.Interface
ns string
}
// newHostPreflights returns a HostPreflights
func newHostPreflights(c *TroubleshootV1beta2Client, namespace string) *hostPreflights {
return &hostPreflights{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the hostPreflight, and returns the corresponding hostPreflight object, and an error if there is any.
func (c *hostPreflights) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.HostPreflight, err error) {
result = &v1beta2.HostPreflight{}
err = c.client.Get().
Namespace(c.ns).
Resource("hostpreflights").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of HostPreflights that match those selectors.
func (c *hostPreflights) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.HostPreflightList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.HostPreflightList{}
err = c.client.Get().
Namespace(c.ns).
Resource("hostpreflights").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested hostPreflights.
func (c *hostPreflights) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("hostpreflights").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a hostPreflight and creates it. Returns the server's representation of the hostPreflight, and an error, if there is any.
func (c *hostPreflights) Create(ctx context.Context, hostPreflight *v1beta2.HostPreflight, opts v1.CreateOptions) (result *v1beta2.HostPreflight, err error) {
result = &v1beta2.HostPreflight{}
err = c.client.Post().
Namespace(c.ns).
Resource("hostpreflights").
VersionedParams(&opts, scheme.ParameterCodec).
Body(hostPreflight).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a hostPreflight and updates it. Returns the server's representation of the hostPreflight, and an error, if there is any.
func (c *hostPreflights) Update(ctx context.Context, hostPreflight *v1beta2.HostPreflight, opts v1.UpdateOptions) (result *v1beta2.HostPreflight, err error) {
result = &v1beta2.HostPreflight{}
err = c.client.Put().
Namespace(c.ns).
Resource("hostpreflights").
Name(hostPreflight.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(hostPreflight).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *hostPreflights) UpdateStatus(ctx context.Context, hostPreflight *v1beta2.HostPreflight, opts v1.UpdateOptions) (result *v1beta2.HostPreflight, err error) {
result = &v1beta2.HostPreflight{}
err = c.client.Put().
Namespace(c.ns).
Resource("hostpreflights").
Name(hostPreflight.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(hostPreflight).
Do(ctx).
Into(result)
return
}
// Delete takes name of the hostPreflight and deletes it. Returns an error if one occurs.
func (c *hostPreflights) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("hostpreflights").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *hostPreflights) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("hostpreflights").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched hostPreflight.
func (c *hostPreflights) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.HostPreflight, err error) {
result = &v1beta2.HostPreflight{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("hostpreflights").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
@@ -1,194 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta2
import (
"context"
"time"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
scheme "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// PreflightsGetter has a method to return a PreflightInterface.
// A group's client should implement this interface.
type PreflightsGetter interface {
Preflights(namespace string) PreflightInterface
}
// PreflightInterface has methods to work with Preflight resources.
type PreflightInterface interface {
Create(ctx context.Context, preflight *v1beta2.Preflight, opts v1.CreateOptions) (*v1beta2.Preflight, error)
Update(ctx context.Context, preflight *v1beta2.Preflight, opts v1.UpdateOptions) (*v1beta2.Preflight, error)
UpdateStatus(ctx context.Context, preflight *v1beta2.Preflight, opts v1.UpdateOptions) (*v1beta2.Preflight, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.Preflight, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.PreflightList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Preflight, err error)
PreflightExpansion
}
// preflights implements PreflightInterface
type preflights struct {
client rest.Interface
ns string
}
// newPreflights returns a Preflights
func newPreflights(c *TroubleshootV1beta2Client, namespace string) *preflights {
return &preflights{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the preflight, and returns the corresponding preflight object, and an error if there is any.
func (c *preflights) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Preflight, err error) {
result = &v1beta2.Preflight{}
err = c.client.Get().
Namespace(c.ns).
Resource("preflights").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Preflights that match those selectors.
func (c *preflights) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PreflightList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.PreflightList{}
err = c.client.Get().
Namespace(c.ns).
Resource("preflights").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested preflights.
func (c *preflights) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("preflights").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a preflight and creates it. Returns the server's representation of the preflight, and an error, if there is any.
func (c *preflights) Create(ctx context.Context, preflight *v1beta2.Preflight, opts v1.CreateOptions) (result *v1beta2.Preflight, err error) {
result = &v1beta2.Preflight{}
err = c.client.Post().
Namespace(c.ns).
Resource("preflights").
VersionedParams(&opts, scheme.ParameterCodec).
Body(preflight).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a preflight and updates it. Returns the server's representation of the preflight, and an error, if there is any.
func (c *preflights) Update(ctx context.Context, preflight *v1beta2.Preflight, opts v1.UpdateOptions) (result *v1beta2.Preflight, err error) {
result = &v1beta2.Preflight{}
err = c.client.Put().
Namespace(c.ns).
Resource("preflights").
Name(preflight.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(preflight).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *preflights) UpdateStatus(ctx context.Context, preflight *v1beta2.Preflight, opts v1.UpdateOptions) (result *v1beta2.Preflight, err error) {
result = &v1beta2.Preflight{}
err = c.client.Put().
Namespace(c.ns).
Resource("preflights").
Name(preflight.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(preflight).
Do(ctx).
Into(result)
return
}
// Delete takes name of the preflight and deletes it. Returns an error if one occurs.
func (c *preflights) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("preflights").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *preflights) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("preflights").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched preflight.
func (c *preflights) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Preflight, err error) {
result = &v1beta2.Preflight{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("preflights").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
@@ -1,194 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta2
import (
"context"
"time"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
scheme "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// RedactorsGetter has a method to return a RedactorInterface.
// A group's client should implement this interface.
type RedactorsGetter interface {
Redactors(namespace string) RedactorInterface
}
// RedactorInterface has methods to work with Redactor resources.
type RedactorInterface interface {
Create(ctx context.Context, redactor *v1beta2.Redactor, opts v1.CreateOptions) (*v1beta2.Redactor, error)
Update(ctx context.Context, redactor *v1beta2.Redactor, opts v1.UpdateOptions) (*v1beta2.Redactor, error)
UpdateStatus(ctx context.Context, redactor *v1beta2.Redactor, opts v1.UpdateOptions) (*v1beta2.Redactor, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.Redactor, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.RedactorList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Redactor, err error)
RedactorExpansion
}
// redactors implements RedactorInterface
type redactors struct {
client rest.Interface
ns string
}
// newRedactors returns a Redactors
func newRedactors(c *TroubleshootV1beta2Client, namespace string) *redactors {
return &redactors{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the redactor, and returns the corresponding redactor object, and an error if there is any.
func (c *redactors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Redactor, err error) {
result = &v1beta2.Redactor{}
err = c.client.Get().
Namespace(c.ns).
Resource("redactors").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Redactors that match those selectors.
func (c *redactors) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.RedactorList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.RedactorList{}
err = c.client.Get().
Namespace(c.ns).
Resource("redactors").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested redactors.
func (c *redactors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("redactors").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a redactor and creates it. Returns the server's representation of the redactor, and an error, if there is any.
func (c *redactors) Create(ctx context.Context, redactor *v1beta2.Redactor, opts v1.CreateOptions) (result *v1beta2.Redactor, err error) {
result = &v1beta2.Redactor{}
err = c.client.Post().
Namespace(c.ns).
Resource("redactors").
VersionedParams(&opts, scheme.ParameterCodec).
Body(redactor).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a redactor and updates it. Returns the server's representation of the redactor, and an error, if there is any.
func (c *redactors) Update(ctx context.Context, redactor *v1beta2.Redactor, opts v1.UpdateOptions) (result *v1beta2.Redactor, err error) {
result = &v1beta2.Redactor{}
err = c.client.Put().
Namespace(c.ns).
Resource("redactors").
Name(redactor.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(redactor).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *redactors) UpdateStatus(ctx context.Context, redactor *v1beta2.Redactor, opts v1.UpdateOptions) (result *v1beta2.Redactor, err error) {
result = &v1beta2.Redactor{}
err = c.client.Put().
Namespace(c.ns).
Resource("redactors").
Name(redactor.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(redactor).
Do(ctx).
Into(result)
return
}
// Delete takes name of the redactor and deletes it. Returns an error if one occurs.
func (c *redactors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("redactors").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *redactors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("redactors").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched redactor.
func (c *redactors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Redactor, err error) {
result = &v1beta2.Redactor{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("redactors").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
@@ -1,194 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta2
import (
"context"
"time"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
scheme "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// RemoteCollectorsGetter has a method to return a RemoteCollectorInterface.
// A group's client should implement this interface.
type RemoteCollectorsGetter interface {
RemoteCollectors(namespace string) RemoteCollectorInterface
}
// RemoteCollectorInterface has methods to work with RemoteCollector resources.
type RemoteCollectorInterface interface {
Create(ctx context.Context, remoteCollector *v1beta2.RemoteCollector, opts v1.CreateOptions) (*v1beta2.RemoteCollector, error)
Update(ctx context.Context, remoteCollector *v1beta2.RemoteCollector, opts v1.UpdateOptions) (*v1beta2.RemoteCollector, error)
UpdateStatus(ctx context.Context, remoteCollector *v1beta2.RemoteCollector, opts v1.UpdateOptions) (*v1beta2.RemoteCollector, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.RemoteCollector, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.RemoteCollectorList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.RemoteCollector, err error)
RemoteCollectorExpansion
}
// remoteCollectors implements RemoteCollectorInterface
type remoteCollectors struct {
client rest.Interface
ns string
}
// newRemoteCollectors returns a RemoteCollectors
func newRemoteCollectors(c *TroubleshootV1beta2Client, namespace string) *remoteCollectors {
return &remoteCollectors{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the remoteCollector, and returns the corresponding remoteCollector object, and an error if there is any.
func (c *remoteCollectors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.RemoteCollector, err error) {
result = &v1beta2.RemoteCollector{}
err = c.client.Get().
Namespace(c.ns).
Resource("remotecollectors").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of RemoteCollectors that match those selectors.
func (c *remoteCollectors) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.RemoteCollectorList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.RemoteCollectorList{}
err = c.client.Get().
Namespace(c.ns).
Resource("remotecollectors").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested remoteCollectors.
func (c *remoteCollectors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("remotecollectors").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a remoteCollector and creates it. Returns the server's representation of the remoteCollector, and an error, if there is any.
func (c *remoteCollectors) Create(ctx context.Context, remoteCollector *v1beta2.RemoteCollector, opts v1.CreateOptions) (result *v1beta2.RemoteCollector, err error) {
result = &v1beta2.RemoteCollector{}
err = c.client.Post().
Namespace(c.ns).
Resource("remotecollectors").
VersionedParams(&opts, scheme.ParameterCodec).
Body(remoteCollector).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a remoteCollector and updates it. Returns the server's representation of the remoteCollector, and an error, if there is any.
func (c *remoteCollectors) Update(ctx context.Context, remoteCollector *v1beta2.RemoteCollector, opts v1.UpdateOptions) (result *v1beta2.RemoteCollector, err error) {
result = &v1beta2.RemoteCollector{}
err = c.client.Put().
Namespace(c.ns).
Resource("remotecollectors").
Name(remoteCollector.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(remoteCollector).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *remoteCollectors) UpdateStatus(ctx context.Context, remoteCollector *v1beta2.RemoteCollector, opts v1.UpdateOptions) (result *v1beta2.RemoteCollector, err error) {
result = &v1beta2.RemoteCollector{}
err = c.client.Put().
Namespace(c.ns).
Resource("remotecollectors").
Name(remoteCollector.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(remoteCollector).
Do(ctx).
Into(result)
return
}
// Delete takes name of the remoteCollector and deletes it. Returns an error if one occurs.
func (c *remoteCollectors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("remotecollectors").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *remoteCollectors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("remotecollectors").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched remoteCollector.
func (c *remoteCollectors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.RemoteCollector, err error) {
result = &v1beta2.RemoteCollector{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("remotecollectors").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
@@ -1,194 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta2
import (
"context"
"time"
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
scheme "github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// SupportBundlesGetter has a method to return a SupportBundleInterface.
// A group's client should implement this interface.
type SupportBundlesGetter interface {
SupportBundles(namespace string) SupportBundleInterface
}
// SupportBundleInterface has methods to work with SupportBundle resources.
type SupportBundleInterface interface {
Create(ctx context.Context, supportBundle *v1beta2.SupportBundle, opts v1.CreateOptions) (*v1beta2.SupportBundle, error)
Update(ctx context.Context, supportBundle *v1beta2.SupportBundle, opts v1.UpdateOptions) (*v1beta2.SupportBundle, error)
UpdateStatus(ctx context.Context, supportBundle *v1beta2.SupportBundle, opts v1.UpdateOptions) (*v1beta2.SupportBundle, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.SupportBundle, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.SupportBundleList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.SupportBundle, err error)
SupportBundleExpansion
}
// supportBundles implements SupportBundleInterface
type supportBundles struct {
client rest.Interface
ns string
}
// newSupportBundles returns a SupportBundles
func newSupportBundles(c *TroubleshootV1beta2Client, namespace string) *supportBundles {
return &supportBundles{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the supportBundle, and returns the corresponding supportBundle object, and an error if there is any.
func (c *supportBundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.SupportBundle, err error) {
result = &v1beta2.SupportBundle{}
err = c.client.Get().
Namespace(c.ns).
Resource("supportbundles").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of SupportBundles that match those selectors.
func (c *supportBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.SupportBundleList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.SupportBundleList{}
err = c.client.Get().
Namespace(c.ns).
Resource("supportbundles").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested supportBundles.
func (c *supportBundles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("supportbundles").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a supportBundle and creates it. Returns the server's representation of the supportBundle, and an error, if there is any.
func (c *supportBundles) Create(ctx context.Context, supportBundle *v1beta2.SupportBundle, opts v1.CreateOptions) (result *v1beta2.SupportBundle, err error) {
result = &v1beta2.SupportBundle{}
err = c.client.Post().
Namespace(c.ns).
Resource("supportbundles").
VersionedParams(&opts, scheme.ParameterCodec).
Body(supportBundle).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a supportBundle and updates it. Returns the server's representation of the supportBundle, and an error, if there is any.
func (c *supportBundles) Update(ctx context.Context, supportBundle *v1beta2.SupportBundle, opts v1.UpdateOptions) (result *v1beta2.SupportBundle, err error) {
result = &v1beta2.SupportBundle{}
err = c.client.Put().
Namespace(c.ns).
Resource("supportbundles").
Name(supportBundle.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(supportBundle).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *supportBundles) UpdateStatus(ctx context.Context, supportBundle *v1beta2.SupportBundle, opts v1.UpdateOptions) (result *v1beta2.SupportBundle, err error) {
result = &v1beta2.SupportBundle{}
err = c.client.Put().
Namespace(c.ns).
Resource("supportbundles").
Name(supportBundle.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(supportBundle).
Do(ctx).
Into(result)
return
}
// Delete takes name of the supportBundle and deletes it. Returns an error if one occurs.
func (c *supportBundles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("supportbundles").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *supportBundles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("supportbundles").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched supportBundle.
func (c *supportBundles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.SupportBundle, err error) {
result = &v1beta2.SupportBundle{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("supportbundles").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
@@ -1,123 +0,0 @@
/*
Copyright 2019 Replicated, Inc..
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta2
import (
v1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
"github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/scheme"
rest "k8s.io/client-go/rest"
)
type TroubleshootV1beta2Interface interface {
RESTClient() rest.Interface
AnalyzersGetter
CollectorsGetter
HostCollectorsGetter
HostPreflightsGetter
PreflightsGetter
RedactorsGetter
RemoteCollectorsGetter
SupportBundlesGetter
}
// TroubleshootV1beta2Client is used to interact with features provided by the troubleshoot.sh group.
type TroubleshootV1beta2Client struct {
restClient rest.Interface
}
func (c *TroubleshootV1beta2Client) Analyzers(namespace string) AnalyzerInterface {
return newAnalyzers(c, namespace)
}
func (c *TroubleshootV1beta2Client) Collectors(namespace string) CollectorInterface {
return newCollectors(c, namespace)
}
func (c *TroubleshootV1beta2Client) HostCollectors(namespace string) HostCollectorInterface {
return newHostCollectors(c, namespace)
}
func (c *TroubleshootV1beta2Client) HostPreflights(namespace string) HostPreflightInterface {
return newHostPreflights(c, namespace)
}
func (c *TroubleshootV1beta2Client) Preflights(namespace string) PreflightInterface {
return newPreflights(c, namespace)
}
func (c *TroubleshootV1beta2Client) Redactors(namespace string) RedactorInterface {
return newRedactors(c, namespace)
}
func (c *TroubleshootV1beta2Client) RemoteCollectors(namespace string) RemoteCollectorInterface {
return newRemoteCollectors(c, namespace)
}
func (c *TroubleshootV1beta2Client) SupportBundles(namespace string) SupportBundleInterface {
return newSupportBundles(c, namespace)
}
// NewForConfig creates a new TroubleshootV1beta2Client for the given config.
func NewForConfig(c *rest.Config) (*TroubleshootV1beta2Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &TroubleshootV1beta2Client{client}, nil
}
// NewForConfigOrDie creates a new TroubleshootV1beta2Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *TroubleshootV1beta2Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new TroubleshootV1beta2Client for the given RESTClient.
func New(c rest.Interface) *TroubleshootV1beta2Client {
return &TroubleshootV1beta2Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1beta2.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *TroubleshootV1beta2Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}
+101 -84
View File
@@ -1,159 +1,175 @@
module github.com/replicatedhq/troubleshoot
go 1.17
go 1.19
require (
github.com/ahmetalpbalkan/go-cursor v0.0.0-20131010032410-8136607ea412
github.com/blang/semver v3.5.1+incompatible
github.com/containers/image/v5 v5.17.0
github.com/docker/distribution v2.7.1+incompatible
github.com/containers/image/v5 v5.19.3
github.com/docker/distribution v2.8.1+incompatible
github.com/fatih/color v1.13.0
github.com/go-logr/logr v1.2.3
github.com/go-redis/redis/v7 v7.4.1
github.com/go-sql-driver/mysql v1.6.0
github.com/gobwas/glob v0.2.3
github.com/godbus/dbus v4.1.0+incompatible
github.com/google/gofuzz v1.2.0
github.com/google/uuid v1.3.0
github.com/gorilla/handlers v1.5.1
github.com/hashicorp/go-getter v1.5.9
github.com/hashicorp/go-getter v1.6.2
github.com/hashicorp/go-multierror v1.1.1
github.com/lib/pq v1.10.4
github.com/lib/pq v1.10.7
github.com/longhorn/go-iscsi-helper v0.0.0-20210330030558-49a327fb024e
github.com/manifoldco/promptui v0.9.0
github.com/mattn/go-isatty v0.0.14
github.com/mholt/archiver v3.1.1+incompatible
github.com/mattn/go-isatty v0.0.16
github.com/mholt/archiver/v3 v3.5.1
github.com/opencontainers/image-spec v1.0.3-0.20211202193544-a5463b7f9c84
github.com/pkg/errors v0.9.1
github.com/replicatedhq/termui/v3 v3.1.1-0.20200811145416-f40076d26851
github.com/satori/go.uuid v1.2.0
github.com/segmentio/ksuid v1.0.4
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.2.1
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.5.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.9.0
github.com/stretchr/testify v1.7.0
github.com/spf13/viper v1.13.0
github.com/stretchr/testify v1.8.0
github.com/tj/go-spin v1.1.0
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.23.1
k8s.io/apiextensions-apiserver v0.23.0
k8s.io/apimachinery v0.23.1
k8s.io/apiserver v0.23.0
k8s.io/cli-runtime v0.23.1
k8s.io/client-go v0.23.1
periph.io/x/periph v3.6.8+incompatible
sigs.k8s.io/controller-runtime v0.11.0
k8s.io/api v0.25.2
k8s.io/apiextensions-apiserver v0.25.0
k8s.io/apimachinery v0.25.2
k8s.io/apiserver v0.25.2
k8s.io/cli-runtime v0.25.2
k8s.io/client-go v0.25.2
k8s.io/klog/v2 v2.80.1
oras.land/oras-go v1.2.0
sigs.k8s.io/controller-runtime v0.13.0
)
require (
cloud.google.com/go v0.93.3 // indirect
cloud.google.com/go/storage v1.10.0 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
)
require (
cloud.google.com/go v0.100.2 // indirect
cloud.google.com/go/compute v1.6.1 // indirect
cloud.google.com/go/iam v0.3.0 // indirect
cloud.google.com/go/storage v1.14.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.18 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/BurntSushi/toml v0.4.1 // indirect
github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/Microsoft/hcsshim v0.8.22 // indirect
github.com/BurntSushi/toml v1.0.0 // indirect
github.com/Microsoft/go-winio v0.5.1 // indirect
github.com/Microsoft/hcsshim v0.9.3 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/aws/aws-sdk-go v1.15.78 // indirect
github.com/andybalholm/brotli v1.0.1 // indirect
github.com/aws/aws-sdk-go v1.43.16 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/c9s/goprocinfo v0.0.0-20170724085704-0010a05ce49f // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chzyer/logex v1.1.11-0.20160617073814-96a4d311aa9b // indirect
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
github.com/containerd/cgroups v1.0.1 // indirect
github.com/containerd/containerd v1.5.7 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.9.0 // indirect
github.com/containerd/cgroups v1.0.3 // indirect
github.com/containerd/containerd v1.6.6 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.11.0 // indirect
github.com/containers/libtrust v0.0.0-20190913040956-14b96171aa3b // indirect
github.com/containers/ocicrypt v1.1.2 // indirect
github.com/containers/storage v1.37.0 // indirect
github.com/containers/ocicrypt v1.1.4 // indirect
github.com/containers/storage v1.38.3 // indirect
github.com/cyphar/filepath-securejoin v0.2.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/docker v20.10.11+incompatible // indirect
github.com/docker/cli v20.10.17+incompatible // indirect
github.com/docker/docker v20.10.17+incompatible // indirect
github.com/docker/docker-credential-helpers v0.6.4 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/dsnet/compress v0.0.1 // indirect
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
github.com/elazarl/goproxy v0.0.0-20191011121108-aa519ddbe484 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/frankban/quicktest v1.14.0 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-errors/errors v1.0.1 // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/go-intervals v0.0.2 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gax-go/v2 v2.1.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.3.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/klauspost/compress v1.14.2 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mattn/go-colorable v0.1.9 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mattn/go-shellwords v1.0.12 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
github.com/mitchellh/mapstructure v1.4.2 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/sys/mountinfo v0.4.1 // indirect
github.com/moby/sys/mountinfo v0.5.0 // indirect
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d // indirect
github.com/nwaples/rardecode v1.1.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283 // indirect
github.com/opencontainers/runc v1.0.2 // indirect
github.com/opencontainers/runc v1.1.3 // indirect
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 // indirect
github.com/opencontainers/selinux v1.9.1 // indirect
github.com/opencontainers/selinux v1.10.1 // indirect
github.com/ostreedev/ostree-go v0.0.0-20190702140239-759a8c1ac913 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pierrec/lz4/v4 v4.1.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.11.0 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.28.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/sylabs/sif/v2 v2.3.1 // indirect
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
github.com/tchap/go-patricia v2.3.0+incompatible // indirect
github.com/tklauser/go-sysconf v0.3.9 // indirect
@@ -161,32 +177,33 @@ require (
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/vbatts/tar-split v0.11.2 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca // indirect
github.com/xlab/treeprint v1.1.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.opencensus.io v0.23.0 // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8 // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/net v0.0.0-20221002022538-bcab6841153b // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
google.golang.org/api v0.56.0 // indirect
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect
google.golang.org/api v0.81.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20211005153810-c76a74d43a8e // indirect
google.golang.org/grpc v1.41.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd // indirect
google.golang.org/grpc v1.47.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.63.2 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/klog/v2 v2.30.0 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/kustomize/api v0.10.1 // indirect
sigs.k8s.io/kustomize/kyaml v0.13.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
periph.io/x/host/v3 v3.7.2
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/kustomize/api v0.12.1 // indirect
sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
+460 -261
View File
File diff suppressed because it is too large Load Diff
+106 -4
View File
@@ -2,6 +2,7 @@ package analyzer
import (
"fmt"
"reflect"
"strconv"
"github.com/pkg/errors"
@@ -14,6 +15,7 @@ type AnalyzeResult struct {
IsPass bool
IsFail bool
IsWarn bool
Strict bool
Title string
Message string
@@ -27,7 +29,11 @@ type AnalyzeResult struct {
type getCollectedFileContents func(string) ([]byte, error)
type getChildCollectedFileContents func(string) (map[string][]byte, error)
func isExcluded(excludeVal multitype.BoolOrString) (bool, error) {
func isExcluded(excludeVal *multitype.BoolOrString) (bool, error) {
if excludeVal == nil {
return false, nil
}
if excludeVal.Type == multitype.Bool {
return excludeVal.BoolVal, nil
}
@@ -94,6 +100,7 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
result.Strict = analyzer.ClusterVersion.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.StorageClass != nil {
@@ -108,6 +115,7 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
result.Strict = analyzer.StorageClass.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.CustomResourceDefinition != nil {
@@ -122,6 +130,7 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
result.Strict = analyzer.CustomResourceDefinition.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.Ingress != nil {
@@ -136,6 +145,7 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
result.Strict = analyzer.Ingress.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.Secret != nil {
@@ -150,6 +160,7 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
result.Strict = analyzer.Secret.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.ConfigMap != nil {
@@ -164,6 +175,7 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
result.Strict = analyzer.ConfigMap.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.ImagePullSecret != nil {
@@ -178,6 +190,7 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
result.Strict = analyzer.ImagePullSecret.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.DeploymentStatus != nil {
@@ -192,6 +205,9 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
for i := range results {
results[i].Strict = analyzer.DeploymentStatus.Strict.BoolOrDefaultFalse()
}
return results, nil
}
if analyzer.StatefulsetStatus != nil {
@@ -206,6 +222,9 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
for i := range results {
results[i].Strict = analyzer.StatefulsetStatus.Strict.BoolOrDefaultFalse()
}
return results, nil
}
if analyzer.JobStatus != nil {
@@ -220,6 +239,9 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
for i := range results {
results[i].Strict = analyzer.JobStatus.Strict.BoolOrDefaultFalse()
}
return results, nil
}
if analyzer.ReplicaSetStatus != nil {
@@ -234,6 +256,9 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
for i := range results {
results[i].Strict = analyzer.ReplicaSetStatus.Strict.BoolOrDefaultFalse()
}
return results, nil
}
if analyzer.ClusterPodStatuses != nil {
@@ -248,6 +273,9 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
for i := range results {
results[i].Strict = analyzer.ClusterPodStatuses.Strict.BoolOrDefaultFalse()
}
return results, nil
}
if analyzer.ContainerRuntime != nil {
@@ -262,6 +290,7 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
result.Strict = analyzer.ContainerRuntime.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.Distribution != nil {
@@ -276,6 +305,7 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
result.Strict = analyzer.Distribution.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.NodeResources != nil {
@@ -290,6 +320,7 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
result.Strict = analyzer.NodeResources.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.TextAnalyze != nil {
@@ -300,11 +331,44 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if isExcluded {
return nil, nil
}
multiResult, err := analyzeTextAnalyze(analyzer.TextAnalyze, findFiles)
results, err := analyzeTextAnalyze(analyzer.TextAnalyze, findFiles)
if err != nil {
return nil, err
}
return multiResult, nil
for i := range results {
results[i].Strict = analyzer.TextAnalyze.Strict.BoolOrDefaultFalse()
}
return results, nil
}
if analyzer.YamlCompare != nil {
isExcluded, err := isExcluded(analyzer.YamlCompare.Exclude)
if err != nil {
return nil, err
}
if isExcluded {
return nil, nil
}
result, err := analyzeYamlCompare(analyzer.YamlCompare, getFile)
if err != nil {
return nil, err
}
result.Strict = analyzer.YamlCompare.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.JsonCompare != nil {
isExcluded, err := isExcluded(analyzer.JsonCompare.Exclude)
if err != nil {
return nil, err
}
if isExcluded {
return nil, nil
}
result, err := analyzeJsonCompare(analyzer.JsonCompare, getFile)
if err != nil {
return nil, err
}
result.Strict = analyzer.JsonCompare.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.Postgres != nil {
isExcluded, err := isExcluded(analyzer.Postgres.Exclude)
@@ -318,6 +382,7 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
result.Strict = analyzer.Postgres.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.Mysql != nil {
@@ -332,6 +397,7 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
result.Strict = analyzer.Mysql.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.Redis != nil {
@@ -346,6 +412,7 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
result.Strict = analyzer.Redis.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.CephStatus != nil {
@@ -360,6 +427,7 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
result.Strict = analyzer.CephStatus.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
if analyzer.Longhorn != nil {
@@ -370,7 +438,14 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if isExcluded {
return nil, nil
}
return longhorn(analyzer.Longhorn, getFile, findFiles)
results, err := longhorn(analyzer.Longhorn, getFile, findFiles)
if err != nil {
return nil, err
}
for i := range results {
results[i].Strict = analyzer.Longhorn.Strict.BoolOrDefaultFalse()
}
return results, nil
}
if analyzer.RegistryImages != nil {
@@ -385,6 +460,7 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
result.Strict = analyzer.RegistryImages.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
@@ -400,6 +476,9 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if err != nil {
return nil, err
}
for i := range results {
results[i].Strict = analyzer.WeaveReport.Strict.BoolOrDefaultFalse()
}
return results, nil
}
@@ -418,8 +497,31 @@ func Analyze(analyzer *troubleshootv1beta2.Analyze, getFile getCollectedFileCont
if result == nil {
return []*AnalyzeResult{}, nil
}
result.Strict = analyzer.Sysctl.Strict.BoolOrDefaultFalse()
return []*AnalyzeResult{result}, nil
}
return nil, errors.New("invalid analyzer")
}
func GetExcludeFlag(analyzer *troubleshootv1beta2.Analyze) *multitype.BoolOrString {
if analyzer == nil {
return nil
}
reflected := reflect.ValueOf(analyzer).Elem()
for i := 0; i < reflected.NumField(); i++ {
if reflected.Field(i).IsNil() {
continue
}
field := reflect.Indirect(reflected.Field(i)).FieldByName("Exclude")
exclude, ok := field.Interface().(*multitype.BoolOrString)
if !ok {
continue
}
return exclude
}
return nil
}
+67
View File
@@ -0,0 +1,67 @@
package analyzer
import (
"testing"
troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
"github.com/replicatedhq/troubleshoot/pkg/multitype"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func Test_GetExcludeFlag(t *testing.T) {
tests := []struct {
name string
analyzer *troubleshootv1beta2.Analyze
want bool
}{
{
name: "nil case",
analyzer: nil,
want: false,
},
{
name: "true is set",
analyzer: &troubleshootv1beta2.Analyze{
TextAnalyze: &troubleshootv1beta2.TextAnalyze{
AnalyzeMeta: troubleshootv1beta2.AnalyzeMeta{
Exclude: multitype.FromBool(true),
},
},
},
want: true,
},
{
name: "false is set",
analyzer: &troubleshootv1beta2.Analyze{
ClusterVersion: &troubleshootv1beta2.ClusterVersion{
AnalyzeMeta: troubleshootv1beta2.AnalyzeMeta{
Exclude: multitype.FromBool(false),
},
},
},
want: false,
},
{
name: "nothing is set",
analyzer: &troubleshootv1beta2.Analyze{
Postgres: &troubleshootv1beta2.DatabaseAnalyze{
AnalyzeMeta: troubleshootv1beta2.AnalyzeMeta{},
},
},
want: false,
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
req := require.New(t)
gotWrapped := GetExcludeFlag(test.analyzer)
got, err := gotWrapped.Bool()
req.NoError(err)
assert.Equal(t, test.want, got)
})
}
}
+33 -7
View File
@@ -74,7 +74,17 @@ type CephStatus struct {
}
type HealthStatus struct {
Status string `json:"status"`
Status string `json:"status"`
Checks map[string]CheckMessage `json:"checks"`
}
type CheckMessage struct {
Severity string `json:"severity"`
Summary Summary `json:"summary"`
}
type Summary struct {
Message string `json:"message"`
}
type OsdMap struct {
@@ -121,6 +131,7 @@ func cephStatus(analyzer *troubleshootv1beta2.CephStatusAnalyze, getCollectedFil
if outcome.Fail.When == "" {
outcome.Fail.When = string(CephHealthErr)
}
match, err := compareCephStatus(status.Health.Status, outcome.Fail.When)
if err != nil {
return nil, errors.Wrap(err, "failed to compare ceph status")
@@ -134,6 +145,7 @@ func cephStatus(analyzer *troubleshootv1beta2.CephStatusAnalyze, getCollectedFil
if outcome.Warn.When == "" {
outcome.Warn.When = string(CephHealthWarn)
}
match, err := compareCephStatus(status.Health.Status, outcome.Warn.When)
if err != nil {
return nil, errors.Wrap(err, "failed to compare ceph status")
@@ -147,6 +159,7 @@ func cephStatus(analyzer *troubleshootv1beta2.CephStatusAnalyze, getCollectedFil
if outcome.Pass.When == "" {
outcome.Pass.When = string(CephHealthOK)
}
match, err := compareCephStatus(status.Health.Status, outcome.Pass.When)
if err != nil {
return nil, errors.Wrap(err, "failed to compare ceph status")
@@ -154,6 +167,7 @@ func cephStatus(analyzer *troubleshootv1beta2.CephStatusAnalyze, getCollectedFil
analyzeResult.IsPass = true
analyzeResult.Message = outcome.Pass.Message
analyzeResult.URI = outcome.Pass.URI
return analyzeResult, nil
}
}
@@ -195,21 +209,33 @@ func compareCephStatus(actual, when string) (bool, error) {
}
}
func detailedCephMessage(msg string, status CephStatus) string {
func detailedCephMessage(outcomeMessage string, status CephStatus) string {
var msg = []string{}
if outcomeMessage != "" {
msg = append(msg, outcomeMessage)
}
if status.OsdMap.OsdMap.NumOsd > 0 {
msg = fmt.Sprintf("%s. %v/%v OSDs up", msg, status.OsdMap.OsdMap.NumUpOsd, status.OsdMap.OsdMap.NumOsd)
msg = append(msg, fmt.Sprintf("%v/%v OSDs up", status.OsdMap.OsdMap.NumUpOsd, status.OsdMap.OsdMap.NumOsd))
}
if status.OsdMap.OsdMap.Full {
msg = fmt.Sprintf("%s. OSD disk is full", msg)
msg = append(msg, fmt.Sprintf("OSD disk is full"))
} else if status.OsdMap.OsdMap.NearFull {
msg = fmt.Sprintf("%s. OSD disk is nearly full", msg)
msg = append(msg, fmt.Sprintf("OSD disk is nearly full"))
}
if status.PgMap.TotalBytes > 0 {
pgUsage := 100 * float64(status.PgMap.UsedBytes) / float64(status.PgMap.TotalBytes)
msg = fmt.Sprintf("%s. PG storage usage is %.1f%%.", msg, pgUsage)
msg = append(msg, fmt.Sprintf("PG storage usage is %.1f%%", pgUsage))
}
return msg
if status.Health.Checks != nil {
for k, v := range status.Health.Checks {
msg = append(msg, fmt.Sprintf("%s: %s", k, v.Summary.Message))
}
}
return strings.Join(msg, "\n")
}
+34 -3
View File
@@ -56,7 +56,7 @@ func Test_cephStatus(t *testing.T) {
IsWarn: true,
IsFail: false,
Title: "Ceph Status",
Message: "Ceph status is HEALTH_WARN. 5/5 OSDs up. OSD disk is nearly full. PG storage usage is 85.0%.",
Message: "Ceph status is HEALTH_WARN\n5/5 OSDs up\nOSD disk is nearly full\nPG storage usage is 85.0%",
URI: "https://rook.io/docs/rook/v1.4/ceph-common-issues.html",
IconKey: "rook",
IconURI: "https://troubleshoot.sh/images/analyzer-icons/rook.svg?w=11&h=16",
@@ -89,7 +89,7 @@ func Test_cephStatus(t *testing.T) {
IsWarn: false,
IsFail: true,
Title: "Ceph Status",
Message: "Ceph status is HEALTH_ERR. 4/5 OSDs up. OSD disk is full. PG storage usage is 95.0%.",
Message: "Ceph status is HEALTH_ERR\n4/5 OSDs up\nOSD disk is full\nPG storage usage is 95.0%",
URI: "https://rook.io/docs/rook/v1.4/ceph-common-issues.html",
IconKey: "rook",
IconURI: "https://troubleshoot.sh/images/analyzer-icons/rook.svg?w=11&h=16",
@@ -172,7 +172,7 @@ func Test_cephStatus(t *testing.T) {
IsWarn: false,
IsFail: true,
Title: "Ceph Status",
Message: "custom message WARN. 5/5 OSDs up. OSD disk is nearly full. PG storage usage is 85.0%.",
Message: "custom message WARN\n5/5 OSDs up\nOSD disk is nearly full\nPG storage usage is 85.0%",
URI: "custom uri WARN",
IconKey: "rook",
IconURI: "https://troubleshoot.sh/images/analyzer-icons/rook.svg?w=11&h=16",
@@ -218,6 +218,37 @@ func Test_cephStatus(t *testing.T) {
}
}`,
},
{
name: "warn case with health status message and summary",
analyzer: troubleshootv1beta2.CephStatusAnalyze{},
expectResult: AnalyzeResult{
IsPass: false,
IsWarn: true,
IsFail: false,
Title: "Ceph Status",
Message: "Ceph status is HEALTH_WARN\nPOOL_NO_REDUNDANCY: 11 pool(s) have no replicas configured",
URI: "https://rook.io/docs/rook/v1.4/ceph-common-issues.html",
IconKey: "rook",
IconURI: "https://troubleshoot.sh/images/analyzer-icons/rook.svg?w=11&h=16",
},
filePath: "ceph/status.json",
file: `{
"fsid": "96a8178c-6aa2-4adf-a309-9e8869a79611",
"health": {
"status": "HEALTH_WARN",
"checks": {
"POOL_NO_REDUNDANCY": {
"severity": "HEALTH_WARN",
"summary": {
"message": "11 pool(s) have no replicas configured",
"count": 11
},
"muted": false
}
}
}
}`,
},
}
for _, test := range tests {
+9 -4
View File
@@ -22,7 +22,7 @@ func clusterPodStatuses(analyzer *troubleshootv1beta2.ClusterPodStatuses, getChi
var pods []corev1.Pod
for fileName, fileContent := range collected {
podsNs := strings.TrimSuffix(fileName, ".json")
podsNs := strings.TrimSuffix(filepath.Base(fileName), ".json")
include := len(analyzer.Namespaces) == 0
for _, ns := range analyzer.Namespaces {
if ns == podsNs {
@@ -31,11 +31,16 @@ func clusterPodStatuses(analyzer *troubleshootv1beta2.ClusterPodStatuses, getChi
}
}
if include {
var nsPods []corev1.Pod
var nsPods corev1.PodList
if err := json.Unmarshal(fileContent, &nsPods); err != nil {
return nil, errors.Wrapf(err, "failed to unmarshal pods list for namespace %s", podsNs)
var nsPodsArr []corev1.Pod
if err := json.Unmarshal(fileContent, &nsPodsArr); err != nil {
return nil, errors.Wrapf(err, "failed to unmarshal pods list for namespace %s", podsNs)
}
pods = append(pods, nsPodsArr...)
} else {
pods = append(pods, nsPods.Items...)
}
pods = append(pods, nsPods...)
}
}
+68 -9
View File
@@ -1,23 +1,33 @@
package analyzer
import (
"strconv"
"strings"
"fmt"
"github.com/pkg/errors"
troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
"strconv"
"strings"
)
func commonStatus(outcomes []*troubleshootv1beta2.Outcome, title, iconKey string, iconURI string, readyReplicas int) (*AnalyzeResult, error) {
func commonStatus(outcomes []*troubleshootv1beta2.Outcome, name string, iconKey string, iconURI string, readyReplicas int, exists bool, resourceType string) (*AnalyzeResult, error) {
result := &AnalyzeResult{
Title: title,
Title: fmt.Sprintf("%s Status", name),
IconKey: iconKey,
IconURI: iconURI,
}
// ordering from the spec is important, the first one that matches returns
for _, outcome := range outcomes {
if outcome.Fail != nil {
// if we're not checking that something is absent but it is, we should throw a default but meaningful error.
if exists == false && outcome.Fail.When != "absent" {
result.IsFail = true
result.Message = fmt.Sprintf("The %s %q was not found", resourceType, name)
result.URI = outcome.Fail.URI
return result, nil
}
if outcome.Fail.When == "" {
result.IsFail = true
result.Message = outcome.Fail.Message
@@ -26,7 +36,18 @@ func commonStatus(outcomes []*troubleshootv1beta2.Outcome, title, iconKey string
return result, nil
}
match, err := compareActualToWhen(outcome.Fail.When, readyReplicas)
if outcome.Fail.When == "absent" {
if exists == false {
result.IsFail = true
result.Message = outcome.Fail.Message
result.URI = outcome.Fail.URI
return result, nil
} else {
continue
}
}
match, err := compareActualToWhen(outcome.Fail.When, readyReplicas, exists)
if err != nil {
return nil, errors.Wrap(err, "failed to parse fail range")
}
@@ -39,6 +60,14 @@ func commonStatus(outcomes []*troubleshootv1beta2.Outcome, title, iconKey string
return result, nil
}
} else if outcome.Warn != nil {
if exists == false && outcome.Warn.When != "absent" {
result.IsFail = true
result.Message = fmt.Sprintf("The %s %q was not found", resourceType, name)
result.URI = outcome.Fail.URI
return result, nil
}
if outcome.Warn.When == "" {
result.IsWarn = true
result.Message = outcome.Warn.Message
@@ -47,7 +76,18 @@ func commonStatus(outcomes []*troubleshootv1beta2.Outcome, title, iconKey string
return result, nil
}
match, err := compareActualToWhen(outcome.Warn.When, readyReplicas)
if outcome.Warn.When == "absent" {
if exists == false {
result.IsWarn = true
result.Message = outcome.Warn.Message
result.URI = outcome.Warn.URI
return result, nil
} else {
continue
}
}
match, err := compareActualToWhen(outcome.Warn.When, readyReplicas, exists)
if err != nil {
return nil, errors.Wrap(err, "failed to parse warn range")
}
@@ -60,6 +100,14 @@ func commonStatus(outcomes []*troubleshootv1beta2.Outcome, title, iconKey string
return result, nil
}
} else if outcome.Pass != nil {
if exists == false && outcome.Pass.When != "absent" {
result.IsFail = true
result.Message = fmt.Sprintf("The %s %q was not found", resourceType, name)
result.URI = outcome.Fail.URI
return result, nil
}
if outcome.Pass.When == "" {
result.IsPass = true
result.Message = outcome.Pass.Message
@@ -68,7 +116,18 @@ func commonStatus(outcomes []*troubleshootv1beta2.Outcome, title, iconKey string
return result, nil
}
match, err := compareActualToWhen(outcome.Pass.When, readyReplicas)
if outcome.Pass.When == "absent" {
if exists == false {
result.IsPass = true
result.Message = outcome.Pass.Message
result.URI = outcome.Pass.URI
return result, nil
} else {
continue
}
}
match, err := compareActualToWhen(outcome.Pass.When, readyReplicas, exists)
if err != nil {
return nil, errors.Wrap(err, "failed to parse pass range")
}
@@ -86,7 +145,7 @@ func commonStatus(outcomes []*troubleshootv1beta2.Outcome, title, iconKey string
return result, nil
}
func compareActualToWhen(when string, actual int) (bool, error) {
func compareActualToWhen(when string, actual int, exists bool) (bool, error) {
parts := strings.Split(strings.TrimSpace(when), " ")
// we can make this a lot more flexible
+2 -2
View File
@@ -16,13 +16,13 @@ func analyzeContainerRuntime(analyzer *troubleshootv1beta2.ContainerRuntime, get
return nil, errors.Wrap(err, "failed to get contents of nodes.json")
}
var nodes []corev1.Node
var nodes corev1.NodeList
if err := json.Unmarshal(collected, &nodes); err != nil {
return nil, errors.Wrap(err, "failed to unmarshal node list")
}
foundRuntimes := []string{}
for _, node := range nodes {
for _, node := range nodes.Items {
foundRuntimes = append(foundRuntimes, node.Status.NodeInfo.ContainerRuntimeVersion)
}
+2 -2
View File
@@ -14,7 +14,7 @@ func analyzeCustomResourceDefinition(analyzer *troubleshootv1beta2.CustomResourc
return nil, err
}
var crds []apiextensionsv1beta1.CustomResourceDefinition
var crds apiextensionsv1beta1.CustomResourceDefinitionList
if err := json.Unmarshal(crdData, &crds); err != nil {
return nil, err
}
@@ -30,7 +30,7 @@ func analyzeCustomResourceDefinition(analyzer *troubleshootv1beta2.CustomResourc
IconURI: "https://troubleshoot.sh/images/analyzer-icons/custom-resource-definition.svg?w=13&h=16",
}
for _, crd := range crds {
for _, crd := range crds.Items {
if crd.Name == analyzer.CustomResourceDefinitionName {
result.IsPass = true
for _, outcome := range analyzer.Outcomes {
+19 -16
View File
@@ -26,33 +26,36 @@ func analyzeOneDeploymentStatus(analyzer *troubleshootv1beta2.DeploymentStatus,
var result *AnalyzeResult
for _, collected := range files { // only 1 file here
var deployments []appsv1.Deployment
var exists bool = true
var readyReplicas int
var deployments appsv1.DeploymentList
if err := json.Unmarshal(collected, &deployments); err != nil {
return nil, errors.Wrap(err, "failed to unmarshal deployment list")
}
var status *appsv1.DeploymentStatus
for _, deployment := range deployments {
for _, deployment := range deployments.Items {
if deployment.Name == analyzer.Name {
status = deployment.Status.DeepCopy()
}
}
if status == nil {
// there's not an error, but maybe the requested deployment is not even deployed
result = &AnalyzeResult{
Title: fmt.Sprintf("%s Deployment Status", analyzer.Name),
IconKey: "kubernetes_deployment_status",
IconURI: "https://troubleshoot.sh/images/analyzer-icons/deployment-status.svg?w=17&h=17",
IsFail: true,
Message: fmt.Sprintf("The deployment %q was not found", analyzer.Name),
}
exists = false
readyReplicas = 0
} else {
result, err = commonStatus(analyzer.Outcomes, fmt.Sprintf("%s Status", analyzer.Name), "kubernetes_deployment_status", "https://troubleshoot.sh/images/analyzer-icons/deployment-status.svg?w=17&h=17", int(status.ReadyReplicas))
if err != nil {
return nil, errors.Wrap(err, "failed to process status")
}
readyReplicas = int(status.ReadyReplicas)
}
result, err = commonStatus(analyzer.Outcomes, analyzer.Name, "kubernetes_deployment_status", "https://troubleshoot.sh/images/analyzer-icons/deployment-status.svg?w=17&h=17", readyReplicas, exists, "deployment")
if err != nil {
return nil, errors.Wrap(err, "failed to process status")
}
}
if result == nil {
return nil, nil
}
return []*AnalyzeResult{result}, nil
@@ -80,12 +83,12 @@ func analyzeAllDeploymentStatuses(analyzer *troubleshootv1beta2.DeploymentStatus
}
for _, collected := range files {
var deployments []appsv1.Deployment
var deployments appsv1.DeploymentList
if err := json.Unmarshal(collected, &deployments); err != nil {
return nil, errors.Wrap(err, "failed to unmarshal deployment list")
}
for _, deployment := range deployments {
for _, deployment := range deployments.Items {
if deployment.Status.Replicas == deployment.Status.AvailableReplicas {
continue
}
+55
View File
@@ -15,10 +15,53 @@ func Test_deploymentStatus(t *testing.T) {
expectResult []*AnalyzeResult
files map[string][]byte
}{
{
name: "1/1, fail when absent",
analyzer: troubleshootv1beta2.DeploymentStatus{
Outcomes: []*troubleshootv1beta2.Outcome{
{
Fail: &troubleshootv1beta2.SingleOutcome{
When: "absent",
Message: "fail",
},
},
{
Pass: &troubleshootv1beta2.SingleOutcome{
When: "= 1",
Message: "pass",
},
},
},
Namespace: "default",
Name: "nonexistant-deployment",
},
expectResult: []*AnalyzeResult{
{
IsPass: false,
IsWarn: false,
IsFail: true,
Title: "nonexistant-deployment Status",
Message: "fail",
IconKey: "kubernetes_deployment_status",
IconURI: "https://troubleshoot.sh/images/analyzer-icons/deployment-status.svg?w=17&h=17",
},
},
files: map[string][]byte{
"cluster-resources/deployments/default.json": []byte(defaultDeployments),
"cluster-resources/deployments/monitoring.json": []byte(monitoringDeployments),
"cluster-resources/deployments/kube-system.json": []byte(kubeSystemDeployments),
},
},
{
name: "1/1, pass when = 1",
analyzer: troubleshootv1beta2.DeploymentStatus{
Outcomes: []*troubleshootv1beta2.Outcome{
{
Fail: &troubleshootv1beta2.SingleOutcome{
When: "absent",
Message: "fail",
},
},
{
Pass: &troubleshootv1beta2.SingleOutcome{
When: "= 1",
@@ -55,6 +98,12 @@ func Test_deploymentStatus(t *testing.T) {
name: "1/1, pass when = 2",
analyzer: troubleshootv1beta2.DeploymentStatus{
Outcomes: []*troubleshootv1beta2.Outcome{
{
Fail: &troubleshootv1beta2.SingleOutcome{
When: "absent",
Message: "fail",
},
},
{
Pass: &troubleshootv1beta2.SingleOutcome{
When: "= 2",
@@ -91,6 +140,12 @@ func Test_deploymentStatus(t *testing.T) {
name: "1/1, pass when >= 2, warn when = 1, fail when 0",
analyzer: troubleshootv1beta2.DeploymentStatus{
Outcomes: []*troubleshootv1beta2.Outcome{
{
Fail: &troubleshootv1beta2.SingleOutcome{
When: "absent",
Message: "fail",
},
},
{
Pass: &troubleshootv1beta2.SingleOutcome{
When: ">= 2",
+5 -2
View File
@@ -73,6 +73,9 @@ func ParseNodesForProviders(nodes []corev1.Node) (providers, string) {
if k == "node-role.kubernetes.io/master" {
foundMaster = true
}
if k == "node-role.kubernetes.io/control-plane" {
foundMaster = true
}
if k == "kubernetes.azure.com/role" {
foundProviders.aks = true
stringProvider = "aks"
@@ -139,12 +142,12 @@ func analyzeDistribution(analyzer *troubleshootv1beta2.Distribution, getCollecte
return nil, errors.Wrap(err, "failed to get contents of nodes.json")
}
var nodes []corev1.Node
var nodes corev1.NodeList
if err := json.Unmarshal(collected, &nodes); err != nil {
return nil, errors.Wrap(err, "failed to unmarshal node list")
}
foundProviders, _ := ParseNodesForProviders(nodes)
foundProviders, _ := ParseNodesForProviders(nodes.Items)
apiResourcesBytes, err := getCollectedFileContents("cluster-resources/resources.json")
// if the file is not found, that is not a fatal error
+23 -13
View File
@@ -22,7 +22,7 @@ type fileContentProvider struct {
}
// Analyze local will analyze a locally available (already downloaded) bundle
func AnalyzeLocal(localBundlePath string, analyzers []*troubleshootv1beta2.Analyze) ([]*AnalyzeResult, error) {
func AnalyzeLocal(localBundlePath string, analyzers []*troubleshootv1beta2.Analyze, hostAnalyzers []*troubleshootv1beta2.HostAnalyze) ([]*AnalyzeResult, error) {
rootDir, err := FindBundleRootDir(localBundlePath)
if err != nil {
return nil, errors.Wrap(err, "failed to find root dir")
@@ -38,11 +38,19 @@ func AnalyzeLocal(localBundlePath string, analyzers []*troubleshootv1beta2.Analy
continue
}
if analyzeResult != nil {
analyzeResults = append(analyzeResults, analyzeResult...)
// Filter nil results to prevent panic
for _, r := range analyzeResult {
if r != nil {
analyzeResults = append(analyzeResults, r)
}
}
}
for _, hostAnalyzer := range hostAnalyzers {
analyzeResult := HostAnalyze(hostAnalyzer, fcp.getFileContents, fcp.getChildFileContents)
analyzeResults = append(analyzeResults, analyzeResult...)
}
return analyzeResults, nil
}
@@ -68,22 +76,24 @@ func DownloadAndAnalyze(bundleURL string, analyzersSpec string) ([]*AnalyzeResul
}
analyzers := []*troubleshootv1beta2.Analyze{}
hostAnalyzers := []*troubleshootv1beta2.HostAnalyze{}
if analyzersSpec == "" {
defaultAnalyzers, err := getDefaultAnalyzers()
defaultAnalyzers, _, err := getDefaultAnalyzers()
if err != nil {
return nil, errors.Wrap(err, "failed to get default analyzers")
}
analyzers = defaultAnalyzers
} else {
parsedAnalyzers, err := parseAnalyzers(analyzersSpec)
parsedAnalyzers, parsedHostAnalyzers, err := parseAnalyzers(analyzersSpec)
if err != nil {
return nil, errors.Wrap(err, "failed to parse analyzers")
}
analyzers = parsedAnalyzers
hostAnalyzers = parsedHostAnalyzers
}
return AnalyzeLocal(rootDir, analyzers)
return AnalyzeLocal(rootDir, analyzers, hostAnalyzers)
}
func downloadTroubleshootBundle(bundleURL string, destDir string) error {
@@ -171,33 +181,33 @@ func ExtractTroubleshootBundle(reader io.Reader, destDir string) error {
return nil
}
func parseAnalyzers(spec string) ([]*troubleshootv1beta2.Analyze, error) {
func parseAnalyzers(spec string) ([]*troubleshootv1beta2.Analyze, []*troubleshootv1beta2.HostAnalyze, error) {
troubleshootscheme.AddToScheme(scheme.Scheme)
decode := scheme.Codecs.UniversalDeserializer().Decode
convertedSpec, err := docrewrite.ConvertToV1Beta2([]byte(spec))
if err != nil {
return nil, errors.Wrap(err, "failed to convert to v1beta2")
return nil, nil, errors.Wrap(err, "failed to convert to v1beta2")
}
obj, gvk, err := decode(convertedSpec, nil, nil)
if err != nil {
return nil, errors.Wrap(err, "failed to decode analyzers")
return nil, nil, errors.Wrap(err, "failed to decode analyzers")
}
// SupportBundle overwrites Analyzer if defined
if gvk.Group == "troubleshoot.sh" && gvk.Version == "v1beta2" && gvk.Kind == "SupportBundle" {
supportBundle := obj.(*troubleshootv1beta2.SupportBundle)
return supportBundle.Spec.Analyzers, nil
return supportBundle.Spec.Analyzers, supportBundle.Spec.HostAnalyzers, nil
} else if gvk.Group == "troubleshoot.sh" && gvk.Version == "v1beta2" && gvk.Kind == "Analyzer" {
analyzer := obj.(*troubleshootv1beta2.Analyzer)
return analyzer.Spec.Analyzers, nil
return analyzer.Spec.Analyzers, analyzer.Spec.HostAnalyzers, nil
}
return nil, errors.Errorf("invalid gvk %q", gvk)
return nil, nil, errors.Errorf("invalid gvk %q", gvk)
}
func getDefaultAnalyzers() ([]*troubleshootv1beta2.Analyze, error) {
func getDefaultAnalyzers() ([]*troubleshootv1beta2.Analyze, []*troubleshootv1beta2.HostAnalyze, error) {
spec := `apiVersion: troubleshoot.sh/v1beta2
kind: Analyzer
metadata:
+427 -420
View File
@@ -1,452 +1,459 @@
[
{
"metadata": {
"name": "kotsadm-api",
"namespace": "default",
"selfLink": "/apis/apps/v1/namespaces/default/deployments/kotsadm-api",
"uid": "56526035-cd29-4d08-8375-291503b1a006",
"resourceVersion": "1583068",
"generation": 1,
"creationTimestamp": "2019-11-07T00:34:32Z",
"labels": {
"app.kubernetes.io/managed-by": "skaffold-v0.41.0"
},
"annotations": {
"deployment.kubernetes.io/revision": "1",
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"labels\":{\"app.kubernetes.io/managed-by\":\"skaffold-v0.41.0\",\"skaffold.dev/builder\":\"local\",\"skaffold.dev/cleanup\":\"true\",\"skaffold.dev/deployer\":\"kustomize\",\"skaffold.dev/docker-api-version\":\"1.40\",\"skaffold.dev/run-id\":\"98f0a02b-9739-4d94-ba11-3e4d273c743e\",\"skaffold.dev/tag-policy\":\"git-commit\",\"skaffold.dev/tail\":\"true\"},\"name\":\"kotsadm-api\",\"namespace\":\"default\"},\"spec\":{\"selector\":{\"matchLabels\":{\"app\":\"kotsadm-api\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"kotsadm-api\",\"app.kubernetes.io/managed-by\":\"skaffold-v0.41.0\",\"skaffold.dev/builder\":\"local\",\"skaffold.dev/cleanup\":\"true\",\"skaffold.dev/deployer\":\"kustomize\",\"skaffold.dev/docker-api-version\":\"1.40\",\"skaffold.dev/run-id\":\"98f0a02b-9739-4d94-ba11-3e4d273c743e\",\"skaffold.dev/tag-policy\":\"git-commit\",\"skaffold.dev/tail\":\"true\"}},\"spec\":{\"affinity\":{\"podAffinity\":{\"preferredDuringSchedulingIgnoredDuringExecution\":[{\"podAffinityTerm\":{\"labelSelector\":{\"matchExpressions\":[{\"key\":\"app\",\"operator\":\"In\",\"values\":[\"ship-www\"]}]},\"topologyKey\":\"kubernetes.io/hostname\"},\"weight\":1}]},\"podAntiAffinity\":{\"preferredDuringSchedulingIgnoredDuringExecution\":[{\"podAffinityTerm\":{\"labelSelector\":{\"matchExpressions\":[{\"key\":\"app\",\"operator\":\"In\",\"values\":[\"kotsadm-api\"]}]},\"topologyKey\":\"kubernetes.io/hostname\"},\"weight\":2}]}},\"containers\":[{\"env\":[{\"name\":\"DEV_NAMESPACE\",\"value\":\"test\"},{\"name\":\"LOG_LEVEL\",\"value\":\"debug\"},{\"name\":\"SESSION_KEY\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"key\",\"name\":\"session\"}}},{\"name\":\"POSTGRES_URI\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"uri\",\"name\":\"ship-postgres\"}}},{\"name\":\"API_ENCRYPTION_KEY\",\"value\":\"IvWItkB8+ezMisPjSMBknT1PdKjBx7Xc/txZqOP8Y2Oe7+Jy\"},{\"name\":\"INIT_SERVER_URI\",\"value\":\"http://init-server:3000\"},{\"name\":\"WATCH_SERVER_URI\",\"value\":\"http://watch-server:3000\"},{\"name\":\"PINO_LOG_PRETTY\",\"value\":\"1\"},{\"name\":\"S3_BUCKET_NAME\",\"value\":\"shipbucket\"},{\"name\":\"AIRGAP_BUNDLE_S3_BUCKET\",\"value\":\"airgap\"},{\"name\":\"S3_ENDPOINT\",\"value\":\"http://kotsadm-s3.default.svc.cluster.local:4569/\"},{\"name\":\"S3_ACCESS_KEY_ID\",\"value\":\"***HIDDEN***\"},{\"name\":\"S3_SECRET_ACCESS_KEY\",\"value\":\"***HIDDEN***\"},{\"name\":\"S3_BUCKET_ENDPOINT\",\"value\":\"true\"},{\"name\":\"GITHUB_CLIENT_ID\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"client-id\",\"name\":\"github-app\"}}},{\"name\":\"GITHUB_CLIENT_SECRET\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"client-secret\",\"name\":\"github-app\"}}},{\"name\":\"GITHUB_INTEGRATION_ID\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"integration-id\",\"name\":\"github-app\"}}},{\"name\":\"GITHUB_PRIVATE_KEY_FILE\",\"value\":\"/keys/github/private-key.pem\"},{\"name\":\"SHIP_API_ENDPOINT\",\"value\":\"http://kotsadm-api.default.svc.cluster.local:3000\"},{\"name\":\"SHIP_API_ADVERTISE_ENDPOINT\",\"value\":\"http://localhost:30065\"},{\"name\":\"GRAPHQL_PREM_ENDPOINT\",\"value\":\"http://graphql-api-prem:3000/graphql\"},{\"name\":\"AUTO_CREATE_CLUSTER\",\"value\":\"1\"},{\"name\":\"AUTO_CREATE_CLUSTER_NAME\",\"value\":\"microk8s\"},{\"name\":\"AUTO_CREATE_CLUSTER_TOKEN\",\"value\":\"***HIDDEN***\"},{\"name\":\"ENABLE_SHIP\",\"value\":\"1\"},{\"name\":\"ENABLE_KOTS\",\"value\":\"1\"},{\"name\":\"ENABLE_KURL\",\"value\":\"1\"},{\"name\":\"POD_NAMESPACE\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.namespace\"}}}],\"image\":\"localhost:32000/kotsadm-api:v1.0.1-30-g8fa13e34-dirty@sha256:4a0ca1a2eae46472bd2d454f9e763a458ddd172689e179b17054262507bb4fc8\",\"imagePullPolicy\":\"IfNotPresent\",\"name\":\"kotsadm-api\",\"ports\":[{\"containerPort\":3000,\"name\":\"http\"},{\"containerPort\":9229,\"name\":\"debug\"}],\"readinessProbe\":{\"httpGet\":{\"path\":\"/healthz\",\"port\":3000},\"initialDelaySeconds\":2,\"periodSeconds\":2},\"volumeMounts\":[{\"mountPath\":\"/keys/github\",\"name\":\"github-app-private-key\",\"readOnly\":true}]}],\"restartPolicy\":\"Always\",\"securityContext\":{\"runAsUser\":0},\"serviceAccount\":\"kotsadm-api\",\"volumes\":[{\"name\":\"github-app-private-key\",\"secret\":{\"secretName\":\"github-app-private-key\"}}]}}}}\n"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "kotsadm-api"
{
"kind": "DeploymentList",
"apiVersion": "apps/v1",
"metadata": {
"resourceVersion": "27195651"
},
"items": [
{
"metadata": {
"name": "kotsadm-api",
"namespace": "default",
"selfLink": "/apis/apps/v1/namespaces/default/deployments/kotsadm-api",
"uid": "56526035-cd29-4d08-8375-291503b1a006",
"resourceVersion": "1583068",
"generation": 1,
"creationTimestamp": "2019-11-07T00:34:32Z",
"labels": {
"app.kubernetes.io/managed-by": "skaffold-v0.41.0"
},
"annotations": {
"deployment.kubernetes.io/revision": "1",
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"labels\":{\"app.kubernetes.io/managed-by\":\"skaffold-v0.41.0\",\"skaffold.dev/builder\":\"local\",\"skaffold.dev/cleanup\":\"true\",\"skaffold.dev/deployer\":\"kustomize\",\"skaffold.dev/docker-api-version\":\"1.40\",\"skaffold.dev/run-id\":\"98f0a02b-9739-4d94-ba11-3e4d273c743e\",\"skaffold.dev/tag-policy\":\"git-commit\",\"skaffold.dev/tail\":\"true\"},\"name\":\"kotsadm-api\",\"namespace\":\"default\"},\"spec\":{\"selector\":{\"matchLabels\":{\"app\":\"kotsadm-api\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"kotsadm-api\",\"app.kubernetes.io/managed-by\":\"skaffold-v0.41.0\",\"skaffold.dev/builder\":\"local\",\"skaffold.dev/cleanup\":\"true\",\"skaffold.dev/deployer\":\"kustomize\",\"skaffold.dev/docker-api-version\":\"1.40\",\"skaffold.dev/run-id\":\"98f0a02b-9739-4d94-ba11-3e4d273c743e\",\"skaffold.dev/tag-policy\":\"git-commit\",\"skaffold.dev/tail\":\"true\"}},\"spec\":{\"affinity\":{\"podAffinity\":{\"preferredDuringSchedulingIgnoredDuringExecution\":[{\"podAffinityTerm\":{\"labelSelector\":{\"matchExpressions\":[{\"key\":\"app\",\"operator\":\"In\",\"values\":[\"ship-www\"]}]},\"topologyKey\":\"kubernetes.io/hostname\"},\"weight\":1}]},\"podAntiAffinity\":{\"preferredDuringSchedulingIgnoredDuringExecution\":[{\"podAffinityTerm\":{\"labelSelector\":{\"matchExpressions\":[{\"key\":\"app\",\"operator\":\"In\",\"values\":[\"kotsadm-api\"]}]},\"topologyKey\":\"kubernetes.io/hostname\"},\"weight\":2}]}},\"containers\":[{\"env\":[{\"name\":\"DEV_NAMESPACE\",\"value\":\"test\"},{\"name\":\"LOG_LEVEL\",\"value\":\"debug\"},{\"name\":\"SESSION_KEY\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"key\",\"name\":\"session\"}}},{\"name\":\"POSTGRES_URI\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"uri\",\"name\":\"ship-postgres\"}}},{\"name\":\"API_ENCRYPTION_KEY\",\"value\":\"IvWItkB8+ezMisPjSMBknT1PdKjBx7Xc/txZqOP8Y2Oe7+Jy\"},{\"name\":\"INIT_SERVER_URI\",\"value\":\"http://init-server:3000\"},{\"name\":\"WATCH_SERVER_URI\",\"value\":\"http://watch-server:3000\"},{\"name\":\"PINO_LOG_PRETTY\",\"value\":\"1\"},{\"name\":\"S3_BUCKET_NAME\",\"value\":\"shipbucket\"},{\"name\":\"AIRGAP_BUNDLE_S3_BUCKET\",\"value\":\"airgap\"},{\"name\":\"S3_ENDPOINT\",\"value\":\"http://kotsadm-s3.default.svc.cluster.local:4569/\"},{\"name\":\"S3_ACCESS_KEY_ID\",\"value\":\"***HIDDEN***\"},{\"name\":\"S3_SECRET_ACCESS_KEY\",\"value\":\"***HIDDEN***\"},{\"name\":\"S3_BUCKET_ENDPOINT\",\"value\":\"true\"},{\"name\":\"GITHUB_CLIENT_ID\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"client-id\",\"name\":\"github-app\"}}},{\"name\":\"GITHUB_CLIENT_SECRET\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"client-secret\",\"name\":\"github-app\"}}},{\"name\":\"GITHUB_INTEGRATION_ID\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"integration-id\",\"name\":\"github-app\"}}},{\"name\":\"GITHUB_PRIVATE_KEY_FILE\",\"value\":\"/keys/github/private-key.pem\"},{\"name\":\"SHIP_API_ENDPOINT\",\"value\":\"http://kotsadm-api.default.svc.cluster.local:3000\"},{\"name\":\"SHIP_API_ADVERTISE_ENDPOINT\",\"value\":\"http://localhost:30065\"},{\"name\":\"GRAPHQL_PREM_ENDPOINT\",\"value\":\"http://graphql-api-prem:3000/graphql\"},{\"name\":\"AUTO_CREATE_CLUSTER\",\"value\":\"1\"},{\"name\":\"AUTO_CREATE_CLUSTER_NAME\",\"value\":\"microk8s\"},{\"name\":\"AUTO_CREATE_CLUSTER_TOKEN\",\"value\":\"***HIDDEN***\"},{\"name\":\"ENABLE_SHIP\",\"value\":\"1\"},{\"name\":\"ENABLE_KOTS\",\"value\":\"1\"},{\"name\":\"ENABLE_KURL\",\"value\":\"1\"},{\"name\":\"POD_NAMESPACE\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.namespace\"}}}],\"image\":\"localhost:32000/kotsadm-api:v1.0.1-30-g8fa13e34-dirty@sha256:4a0ca1a2eae46472bd2d454f9e763a458ddd172689e179b17054262507bb4fc8\",\"imagePullPolicy\":\"IfNotPresent\",\"name\":\"kotsadm-api\",\"ports\":[{\"containerPort\":3000,\"name\":\"http\"},{\"containerPort\":9229,\"name\":\"debug\"}],\"readinessProbe\":{\"httpGet\":{\"path\":\"/healthz\",\"port\":3000},\"initialDelaySeconds\":2,\"periodSeconds\":2},\"volumeMounts\":[{\"mountPath\":\"/keys/github\",\"name\":\"github-app-private-key\",\"readOnly\":true}]}],\"restartPolicy\":\"Always\",\"securityContext\":{\"runAsUser\":0},\"serviceAccount\":\"kotsadm-api\",\"volumes\":[{\"name\":\"github-app-private-key\",\"secret\":{\"secretName\":\"github-app-private-key\"}}]}}}}\n"
}
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "kotsadm-api"
}
},
"spec": {
"containers": [
{
"name": "kotsadm-api",
"image": "localhost:32000/kotsadm-api:v1.0.1-30-g8fa13e34-dirty@sha256:4a0ca1a2eae46472bd2d454f9e763a458ddd172689e179b17054262507bb4fc8",
"ports": [
{
"name": "http",
"containerPort": 3000,
"protocol": "TCP"
}
],
"env": [
{
"name": "DEV_NAMESPACE",
"value": "test"
},
{
"name": "POD_NAMESPACE",
"valueFrom": {
"fieldRef": {
"apiVersion": "v1",
"fieldPath": "metadata.namespace"
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"app": "kotsadm-api"
}
},
"spec": {
"containers": [
{
"name": "kotsadm-api",
"image": "localhost:32000/kotsadm-api:v1.0.1-30-g8fa13e34-dirty@sha256:4a0ca1a2eae46472bd2d454f9e763a458ddd172689e179b17054262507bb4fc8",
"ports": [
{
"name": "http",
"containerPort": 3000,
"protocol": "TCP"
}
],
"env": [
{
"name": "DEV_NAMESPACE",
"value": "test"
},
{
"name": "POD_NAMESPACE",
"valueFrom": {
"fieldRef": {
"apiVersion": "v1",
"fieldPath": "metadata.namespace"
}
}
}
}
],
"resources": {},
"readinessProbe": {
"httpGet": {
"path": "/healthz",
"port": 3000,
"scheme": "HTTP"
],
"resources": {},
"readinessProbe": {
"httpGet": {
"path": "/healthz",
"port": 3000,
"scheme": "HTTP"
},
"initialDelaySeconds": 2,
"timeoutSeconds": 1,
"periodSeconds": 2,
"successThreshold": 1,
"failureThreshold": 3
},
"initialDelaySeconds": 2,
"timeoutSeconds": 1,
"periodSeconds": 2,
"successThreshold": 1,
"failureThreshold": 3
},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"serviceAccountName": "kotsadm-api",
"serviceAccount": "kotsadm-api",
"schedulerName": "default-scheduler"
}
},
"strategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": "25%",
"maxSurge": "25%"
}
},
"revisionHistoryLimit": 10,
"progressDeadlineSeconds": 600
},
"status": {
"observedGeneration": 1,
"replicas": 1,
"updatedReplicas": 1,
"readyReplicas": 1,
"availableReplicas": 1,
"conditions": [
{
"type": "Available",
"status": "True",
"lastUpdateTime": "2019-11-07T00:35:23Z",
"lastTransitionTime": "2019-11-07T00:35:23Z",
"reason": "MinimumReplicasAvailable",
"message": "Deployment has minimum availability."
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"serviceAccountName": "kotsadm-api",
"serviceAccount": "kotsadm-api",
"schedulerName": "default-scheduler"
}
},
{
"type": "Progressing",
"status": "True",
"lastUpdateTime": "2019-11-07T00:35:23Z",
"lastTransitionTime": "2019-11-07T00:34:32Z",
"reason": "NewReplicaSetAvailable",
"message": "ReplicaSet \"kotsadm-api-6f4b994bd5\" has successfully progressed."
}
]
}
},
{
"metadata": {
"name": "kotsadm-operator",
"namespace": "default",
"selfLink": "/apis/apps/v1/namespaces/default/deployments/kotsadm-operator",
"uid": "cfae9877-eef4-44c9-acac-0bf0d1aa547e",
"resourceVersion": "1583379",
"generation": 2,
"creationTimestamp": "2019-11-07T00:34:32Z",
"labels": {
"app.kubernetes.io/managed-by": "skaffold-v0.41.0"
"strategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": "25%",
"maxSurge": "25%"
}
},
"revisionHistoryLimit": 10,
"progressDeadlineSeconds": 600
},
"annotations": {
"deployment.kubernetes.io/revision": "2",
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"labels\":{\"app.kubernetes.io/managed-by\":\"skaffold-v0.41.0\",\"skaffold.dev/builder\":\"local\",\"skaffold.dev/cleanup\":\"true\",\"skaffold.dev/deployer\":\"kustomize\",\"skaffold.dev/docker-api-version\":\"1.40\",\"skaffold.dev/run-id\":\"98f0a02b-9739-4d94-ba11-3e4d273c743e\",\"skaffold.dev/tag-policy\":\"git-commit\",\"skaffold.dev/tail\":\"true\"},\"name\":\"kotsadm-operator\",\"namespace\":\"default\"},\"spec\":{\"selector\":{\"matchLabels\":{\"app\":\"kotsadm-operator\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"kotsadm-operator\",\"app.kubernetes.io/managed-by\":\"skaffold-v0.41.0\",\"skaffold.dev/builder\":\"local\",\"skaffold.dev/cleanup\":\"true\",\"skaffold.dev/deployer\":\"kustomize\",\"skaffold.dev/docker-api-version\":\"1.40\",\"skaffold.dev/run-id\":\"98f0a02b-9739-4d94-ba11-3e4d273c743e\",\"skaffold.dev/tag-policy\":\"git-commit\",\"skaffold.dev/tail\":\"true\"}},\"spec\":{\"containers\":[{\"env\":[{\"name\":\"KOTSADM_API_ENDPOINT\",\"value\":\"http://kotsadm-api:3000\"},{\"name\":\"KOTSADM_TOKEN\",\"value\":\"***HIDDEN***\"},{\"name\":\"KOTSADM_TARGET_NAMESPACE\",\"value\":\"test\"}],\"image\":\"localhost:32000/kotsadm-operator:v1.0.1-30-g8fa13e34-dirty@sha256:177c15b6399717048e9355bc8fd8b8ed213be90615c7c6ee7b7fdcee50aca6c5\",\"imagePullPolicy\":\"Always\",\"name\":\"kotsadm-operator\",\"resources\":{\"limits\":{\"cpu\":\"200m\",\"memory\":\"1000Mi\"},\"requests\":{\"cpu\":\"100m\",\"memory\":\"500Mi\"}}}],\"restartPolicy\":\"Always\"}}}}\n"
"status": {
"observedGeneration": 1,
"replicas": 1,
"updatedReplicas": 1,
"readyReplicas": 1,
"availableReplicas": 1,
"conditions": [
{
"type": "Available",
"status": "True",
"lastUpdateTime": "2019-11-07T00:35:23Z",
"lastTransitionTime": "2019-11-07T00:35:23Z",
"reason": "MinimumReplicasAvailable",
"message": "Deployment has minimum availability."
},
{
"type": "Progressing",
"status": "True",
"lastUpdateTime": "2019-11-07T00:35:23Z",
"lastTransitionTime": "2019-11-07T00:34:32Z",
"reason": "NewReplicaSetAvailable",
"message": "ReplicaSet \"kotsadm-api-6f4b994bd5\" has successfully progressed."
}
]
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "kotsadm-operator"
{
"metadata": {
"name": "kotsadm-operator",
"namespace": "default",
"selfLink": "/apis/apps/v1/namespaces/default/deployments/kotsadm-operator",
"uid": "cfae9877-eef4-44c9-acac-0bf0d1aa547e",
"resourceVersion": "1583379",
"generation": 2,
"creationTimestamp": "2019-11-07T00:34:32Z",
"labels": {
"app.kubernetes.io/managed-by": "skaffold-v0.41.0"
},
"annotations": {
"deployment.kubernetes.io/revision": "2",
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"labels\":{\"app.kubernetes.io/managed-by\":\"skaffold-v0.41.0\",\"skaffold.dev/builder\":\"local\",\"skaffold.dev/cleanup\":\"true\",\"skaffold.dev/deployer\":\"kustomize\",\"skaffold.dev/docker-api-version\":\"1.40\",\"skaffold.dev/run-id\":\"98f0a02b-9739-4d94-ba11-3e4d273c743e\",\"skaffold.dev/tag-policy\":\"git-commit\",\"skaffold.dev/tail\":\"true\"},\"name\":\"kotsadm-operator\",\"namespace\":\"default\"},\"spec\":{\"selector\":{\"matchLabels\":{\"app\":\"kotsadm-operator\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"kotsadm-operator\",\"app.kubernetes.io/managed-by\":\"skaffold-v0.41.0\",\"skaffold.dev/builder\":\"local\",\"skaffold.dev/cleanup\":\"true\",\"skaffold.dev/deployer\":\"kustomize\",\"skaffold.dev/docker-api-version\":\"1.40\",\"skaffold.dev/run-id\":\"98f0a02b-9739-4d94-ba11-3e4d273c743e\",\"skaffold.dev/tag-policy\":\"git-commit\",\"skaffold.dev/tail\":\"true\"}},\"spec\":{\"containers\":[{\"env\":[{\"name\":\"KOTSADM_API_ENDPOINT\",\"value\":\"http://kotsadm-api:3000\"},{\"name\":\"KOTSADM_TOKEN\",\"value\":\"***HIDDEN***\"},{\"name\":\"KOTSADM_TARGET_NAMESPACE\",\"value\":\"test\"}],\"image\":\"localhost:32000/kotsadm-operator:v1.0.1-30-g8fa13e34-dirty@sha256:177c15b6399717048e9355bc8fd8b8ed213be90615c7c6ee7b7fdcee50aca6c5\",\"imagePullPolicy\":\"Always\",\"name\":\"kotsadm-operator\",\"resources\":{\"limits\":{\"cpu\":\"200m\",\"memory\":\"1000Mi\"},\"requests\":{\"cpu\":\"100m\",\"memory\":\"500Mi\"}}}],\"restartPolicy\":\"Always\"}}}}\n"
}
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "kotsadm-operator"
}
},
"spec": {
"containers": [
{
"name": "kotsadm-operator",
"image": "localhost:32000/kotsadm-operator:v1.0.1-30-g8fa13e34-dirty@sha256:177c15b6399717048e9355bc8fd8b8ed213be90615c7c6ee7b7fdcee50aca6c5",
"env": [
{
"name": "KOTSADM_API_ENDPOINT",
"value": "http://kotsadm-api:3000"
},
{
"name": "KOTSADM_TOKEN",
"value": "***HIDDEN***"
},
{
"name": "KOTSADM_TARGET_NAMESPACE",
"value": "test"
}
],
"resources": {
"limits": {
"cpu": "200m",
"memory": "1000Mi"
},
"requests": {
"cpu": "100m",
"memory": "500Mi"
}
},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "Always"
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"app": "kotsadm-operator"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
},
"strategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": "25%",
"maxSurge": "25%"
}
},
"revisionHistoryLimit": 10,
"progressDeadlineSeconds": 600
},
"status": {
"observedGeneration": 2,
"replicas": 1,
"updatedReplicas": 1,
"readyReplicas": 1,
"availableReplicas": 1,
"conditions": [
{
"type": "Available",
"status": "True",
"lastUpdateTime": "2019-11-07T00:34:37Z",
"lastTransitionTime": "2019-11-07T00:34:37Z",
"reason": "MinimumReplicasAvailable",
"message": "Deployment has minimum availability."
},
"spec": {
"containers": [
{
"name": "kotsadm-operator",
"image": "localhost:32000/kotsadm-operator:v1.0.1-30-g8fa13e34-dirty@sha256:177c15b6399717048e9355bc8fd8b8ed213be90615c7c6ee7b7fdcee50aca6c5",
"env": [
{
"name": "KOTSADM_API_ENDPOINT",
"value": "http://kotsadm-api:3000"
},
{
"name": "KOTSADM_TOKEN",
"value": "***HIDDEN***"
},
{
"name": "KOTSADM_TARGET_NAMESPACE",
"value": "test"
}
],
"resources": {
"limits": {
"cpu": "200m",
"memory": "1000Mi"
},
"requests": {
"cpu": "100m",
"memory": "500Mi"
}
},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "Always"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
},
{
"type": "Progressing",
"status": "True",
"lastUpdateTime": "2019-11-07T00:36:34Z",
"lastTransitionTime": "2019-11-07T00:34:32Z",
"reason": "NewReplicaSetAvailable",
"message": "ReplicaSet \"kotsadm-operator-5b5c977699\" has successfully progressed."
}
]
}
},
{
"metadata": {
"name": "kotsadm-postgres-watch",
"namespace": "default",
"selfLink": "/apis/apps/v1/namespaces/default/deployments/kotsadm-postgres-watch",
"uid": "ec195b07-4fd2-4bbe-8b01-4cbdfbe0e79d",
"resourceVersion": "1582762",
"generation": 1,
"creationTimestamp": "2019-11-07T00:34:39Z",
"annotations": {
"deployment.kubernetes.io/revision": "1"
"strategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": "25%",
"maxSurge": "25%"
}
},
"revisionHistoryLimit": 10,
"progressDeadlineSeconds": 600
},
"ownerReferences": [
{
"apiVersion": "databases.schemahero.io/v1alpha2",
"kind": "Database",
"name": "kotsadm-postgres",
"uid": "e6d51ce6-c4c1-428f-9e8e-56f1a3a43588",
"controller": true,
"blockOwnerDeletion": true
}
]
"status": {
"observedGeneration": 2,
"replicas": 1,
"updatedReplicas": 1,
"readyReplicas": 1,
"availableReplicas": 1,
"conditions": [
{
"type": "Available",
"status": "True",
"lastUpdateTime": "2019-11-07T00:34:37Z",
"lastTransitionTime": "2019-11-07T00:34:37Z",
"reason": "MinimumReplicasAvailable",
"message": "Deployment has minimum availability."
},
{
"type": "Progressing",
"status": "True",
"lastUpdateTime": "2019-11-07T00:36:34Z",
"lastTransitionTime": "2019-11-07T00:34:32Z",
"reason": "NewReplicaSetAvailable",
"message": "ReplicaSet \"kotsadm-operator-5b5c977699\" has successfully progressed."
}
]
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"deployment": "kotsadm-postgreswatch"
}
{
"metadata": {
"name": "kotsadm-postgres-watch",
"namespace": "default",
"selfLink": "/apis/apps/v1/namespaces/default/deployments/kotsadm-postgres-watch",
"uid": "ec195b07-4fd2-4bbe-8b01-4cbdfbe0e79d",
"resourceVersion": "1582762",
"generation": 1,
"creationTimestamp": "2019-11-07T00:34:39Z",
"annotations": {
"deployment.kubernetes.io/revision": "1"
},
"ownerReferences": [
{
"apiVersion": "databases.schemahero.io/v1alpha2",
"kind": "Database",
"name": "kotsadm-postgres",
"uid": "e6d51ce6-c4c1-428f-9e8e-56f1a3a43588",
"controller": true,
"blockOwnerDeletion": true
}
]
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"deployment": "kotsadm-postgreswatch"
}
},
"spec": {
"containers": [
{
"name": "schemahero",
"image": "schemahero/schemahero:alpha",
"args": [
"watch",
"--driver",
"postgres",
"--uri",
"postgres://shipcloud:password@postgres.default.svc.cluster.local:5432/shipcloud?sslmode=disable",
"--namespace",
"default",
"--instance",
"kotsadm-postgres"
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "Always"
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"deployment": "kotsadm-postgreswatch"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"serviceAccountName": "kotsadm-postgres",
"serviceAccount": "kotsadm-postgres",
"securityContext": {},
"schedulerName": "default-scheduler"
}
},
"strategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": "25%",
"maxSurge": "25%"
}
},
"revisionHistoryLimit": 10,
"progressDeadlineSeconds": 600
},
"status": {
"observedGeneration": 1,
"replicas": 1,
"updatedReplicas": 1,
"readyReplicas": 1,
"availableReplicas": 1,
"conditions": [
{
"type": "Available",
"status": "True",
"lastUpdateTime": "2019-11-07T00:35:00Z",
"lastTransitionTime": "2019-11-07T00:35:00Z",
"reason": "MinimumReplicasAvailable",
"message": "Deployment has minimum availability."
},
{
"type": "Progressing",
"status": "True",
"lastUpdateTime": "2019-11-07T00:35:00Z",
"lastTransitionTime": "2019-11-07T00:34:39Z",
"reason": "NewReplicaSetAvailable",
"message": "ReplicaSet \"kotsadm-postgres-watch-5cf76f4c45\" has successfully progressed."
}
]
}
},
{
"metadata": {
"name": "kotsadm-web",
"namespace": "default",
"selfLink": "/apis/apps/v1/namespaces/default/deployments/kotsadm-web",
"uid": "4e657f8a-5edb-498b-9402-1f93f51f5dda",
"resourceVersion": "1582354",
"generation": 1,
"creationTimestamp": "2019-11-07T00:34:32Z",
"labels": {
"app.kubernetes.io/managed-by": "skaffold-v0.41.0",
"skaffold.dev/builder": "local",
"skaffold.dev/cleanup": "true",
"skaffold.dev/deployer": "kustomize",
"skaffold.dev/docker-api-version": "1.40",
"skaffold.dev/run-id": "98f0a02b-9739-4d94-ba11-3e4d273c743e",
"skaffold.dev/tag-policy": "git-commit",
"skaffold.dev/tail": "true"
},
"annotations": {
"deployment.kubernetes.io/revision": "1",
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"labels\":{\"app.kubernetes.io/managed-by\":\"skaffold-v0.41.0\",\"skaffold.dev/builder\":\"local\",\"skaffold.dev/cleanup\":\"true\",\"skaffold.dev/deployer\":\"kustomize\",\"skaffold.dev/docker-api-version\":\"1.40\",\"skaffold.dev/run-id\":\"98f0a02b-9739-4d94-ba11-3e4d273c743e\",\"skaffold.dev/tag-policy\":\"git-commit\",\"skaffold.dev/tail\":\"true\"},\"name\":\"kotsadm-web\",\"namespace\":\"default\"},\"spec\":{\"selector\":{\"matchLabels\":{\"app\":\"kotsadm-web\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"kotsadm-web\",\"app.kubernetes.io/managed-by\":\"skaffold-v0.41.0\",\"skaffold.dev/builder\":\"local\",\"skaffold.dev/cleanup\":\"true\",\"skaffold.dev/deployer\":\"kustomize\",\"skaffold.dev/docker-api-version\":\"1.40\",\"skaffold.dev/run-id\":\"98f0a02b-9739-4d94-ba11-3e4d273c743e\",\"skaffold.dev/tag-policy\":\"git-commit\",\"skaffold.dev/tail\":\"true\"}},\"spec\":{\"containers\":[{\"env\":[{\"name\":\"GITHUB_CLIENT_ID\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"client-id\",\"name\":\"github-app\"}}},{\"name\":\"GITHUB_INSTALL_URL\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"install-url\",\"name\":\"github-app\"}}},{\"name\":\"SHIP_CLUSTER_API_SERVER\",\"value\":\"http://localhost:30065\"},{\"name\":\"SHIP_CLUSTER_WEB_URI\",\"value\":\"http://localhost:8000\"}],\"image\":\"localhost:32000/kotsadm-web:v1.0.1-30-g8fa13e34@sha256:5b5b5b640b6e09d8b3185d4ae15ac4dc558d4e2ea034ac3e567d8cce04eadb9c\",\"imagePullPolicy\":\"IfNotPresent\",\"name\":\"kotsadm-web\",\"ports\":[{\"containerPort\":8000,\"name\":\"http\"}]}]}}}}\n"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "kotsadm-web"
}
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"app": "kotsadm-web",
"app.kubernetes.io/managed-by": "skaffold-v0.41.0",
"skaffold.dev/builder": "local",
"skaffold.dev/cleanup": "true",
"skaffold.dev/deployer": "kustomize",
"skaffold.dev/docker-api-version": "1.40",
"skaffold.dev/run-id": "98f0a02b-9739-4d94-ba11-3e4d273c743e",
"skaffold.dev/tag-policy": "git-commit",
"skaffold.dev/tail": "true"
},
"spec": {
"containers": [
{
"name": "schemahero",
"image": "schemahero/schemahero:alpha",
"args": [
"watch",
"--driver",
"postgres",
"--uri",
"postgres://shipcloud:password@postgres.default.svc.cluster.local:5432/shipcloud?sslmode=disable",
"--namespace",
"default",
"--instance",
"kotsadm-postgres"
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "Always"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"serviceAccountName": "kotsadm-postgres",
"serviceAccount": "kotsadm-postgres",
"securityContext": {},
"schedulerName": "default-scheduler"
}
},
"spec": {
"containers": [
{
"name": "kotsadm-web",
"image": "localhost:32000/kotsadm-web:v1.0.1-30-g8fa13e34@sha256:5b5b5b640b6e09d8b3185d4ae15ac4dc558d4e2ea034ac3e567d8cce04eadb9c",
"ports": [
{
"name": "http",
"containerPort": 8000,
"protocol": "TCP"
}
],
"env": [
{
"name": "GITHUB_CLIENT_ID",
"valueFrom": {
"secretKeyRef": {
"name": "github-app",
"key": "client-id"
"strategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": "25%",
"maxSurge": "25%"
}
},
"revisionHistoryLimit": 10,
"progressDeadlineSeconds": 600
},
"status": {
"observedGeneration": 1,
"replicas": 1,
"updatedReplicas": 1,
"readyReplicas": 1,
"availableReplicas": 1,
"conditions": [
{
"type": "Available",
"status": "True",
"lastUpdateTime": "2019-11-07T00:35:00Z",
"lastTransitionTime": "2019-11-07T00:35:00Z",
"reason": "MinimumReplicasAvailable",
"message": "Deployment has minimum availability."
},
{
"type": "Progressing",
"status": "True",
"lastUpdateTime": "2019-11-07T00:35:00Z",
"lastTransitionTime": "2019-11-07T00:34:39Z",
"reason": "NewReplicaSetAvailable",
"message": "ReplicaSet \"kotsadm-postgres-watch-5cf76f4c45\" has successfully progressed."
}
]
}
},
{
"metadata": {
"name": "kotsadm-web",
"namespace": "default",
"selfLink": "/apis/apps/v1/namespaces/default/deployments/kotsadm-web",
"uid": "4e657f8a-5edb-498b-9402-1f93f51f5dda",
"resourceVersion": "1582354",
"generation": 1,
"creationTimestamp": "2019-11-07T00:34:32Z",
"labels": {
"app.kubernetes.io/managed-by": "skaffold-v0.41.0",
"skaffold.dev/builder": "local",
"skaffold.dev/cleanup": "true",
"skaffold.dev/deployer": "kustomize",
"skaffold.dev/docker-api-version": "1.40",
"skaffold.dev/run-id": "98f0a02b-9739-4d94-ba11-3e4d273c743e",
"skaffold.dev/tag-policy": "git-commit",
"skaffold.dev/tail": "true"
},
"annotations": {
"deployment.kubernetes.io/revision": "1",
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"labels\":{\"app.kubernetes.io/managed-by\":\"skaffold-v0.41.0\",\"skaffold.dev/builder\":\"local\",\"skaffold.dev/cleanup\":\"true\",\"skaffold.dev/deployer\":\"kustomize\",\"skaffold.dev/docker-api-version\":\"1.40\",\"skaffold.dev/run-id\":\"98f0a02b-9739-4d94-ba11-3e4d273c743e\",\"skaffold.dev/tag-policy\":\"git-commit\",\"skaffold.dev/tail\":\"true\"},\"name\":\"kotsadm-web\",\"namespace\":\"default\"},\"spec\":{\"selector\":{\"matchLabels\":{\"app\":\"kotsadm-web\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"kotsadm-web\",\"app.kubernetes.io/managed-by\":\"skaffold-v0.41.0\",\"skaffold.dev/builder\":\"local\",\"skaffold.dev/cleanup\":\"true\",\"skaffold.dev/deployer\":\"kustomize\",\"skaffold.dev/docker-api-version\":\"1.40\",\"skaffold.dev/run-id\":\"98f0a02b-9739-4d94-ba11-3e4d273c743e\",\"skaffold.dev/tag-policy\":\"git-commit\",\"skaffold.dev/tail\":\"true\"}},\"spec\":{\"containers\":[{\"env\":[{\"name\":\"GITHUB_CLIENT_ID\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"client-id\",\"name\":\"github-app\"}}},{\"name\":\"GITHUB_INSTALL_URL\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"install-url\",\"name\":\"github-app\"}}},{\"name\":\"SHIP_CLUSTER_API_SERVER\",\"value\":\"http://localhost:30065\"},{\"name\":\"SHIP_CLUSTER_WEB_URI\",\"value\":\"http://localhost:8000\"}],\"image\":\"localhost:32000/kotsadm-web:v1.0.1-30-g8fa13e34@sha256:5b5b5b640b6e09d8b3185d4ae15ac4dc558d4e2ea034ac3e567d8cce04eadb9c\",\"imagePullPolicy\":\"IfNotPresent\",\"name\":\"kotsadm-web\",\"ports\":[{\"containerPort\":8000,\"name\":\"http\"}]}]}}}}\n"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app": "kotsadm-web"
}
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"app": "kotsadm-web",
"app.kubernetes.io/managed-by": "skaffold-v0.41.0",
"skaffold.dev/builder": "local",
"skaffold.dev/cleanup": "true",
"skaffold.dev/deployer": "kustomize",
"skaffold.dev/docker-api-version": "1.40",
"skaffold.dev/run-id": "98f0a02b-9739-4d94-ba11-3e4d273c743e",
"skaffold.dev/tag-policy": "git-commit",
"skaffold.dev/tail": "true"
}
},
"spec": {
"containers": [
{
"name": "kotsadm-web",
"image": "localhost:32000/kotsadm-web:v1.0.1-30-g8fa13e34@sha256:5b5b5b640b6e09d8b3185d4ae15ac4dc558d4e2ea034ac3e567d8cce04eadb9c",
"ports": [
{
"name": "http",
"containerPort": 8000,
"protocol": "TCP"
}
],
"env": [
{
"name": "GITHUB_CLIENT_ID",
"valueFrom": {
"secretKeyRef": {
"name": "github-app",
"key": "client-id"
}
}
}
}
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
},
"strategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": "25%",
"maxSurge": "25%"
}
},
"revisionHistoryLimit": 10,
"progressDeadlineSeconds": 600
},
"status": {
"observedGeneration": 1,
"replicas": 2,
"updatedReplicas": 1,
"readyReplicas": 1,
"availableReplicas": 1,
"conditions": [
{
"type": "Available",
"status": "True",
"lastUpdateTime": "2019-11-07T00:34:39Z",
"lastTransitionTime": "2019-11-07T00:34:39Z",
"reason": "MinimumReplicasAvailable",
"message": "Deployment has minimum availability."
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
},
{
"type": "Progressing",
"status": "True",
"lastUpdateTime": "2019-11-07T00:34:39Z",
"lastTransitionTime": "2019-11-07T00:34:32Z",
"reason": "NewReplicaSetAvailable",
"message": "ReplicaSet \"kotsadm-web-79bfb95c48\" has successfully progressed."
}
]
"strategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxUnavailable": "25%",
"maxSurge": "25%"
}
},
"revisionHistoryLimit": 10,
"progressDeadlineSeconds": 600
},
"status": {
"observedGeneration": 1,
"replicas": 2,
"updatedReplicas": 1,
"readyReplicas": 1,
"availableReplicas": 1,
"conditions": [
{
"type": "Available",
"status": "True",
"lastUpdateTime": "2019-11-07T00:34:39Z",
"lastTransitionTime": "2019-11-07T00:34:39Z",
"reason": "MinimumReplicasAvailable",
"message": "Deployment has minimum availability."
},
{
"type": "Progressing",
"status": "True",
"lastUpdateTime": "2019-11-07T00:34:39Z",
"lastTransitionTime": "2019-11-07T00:34:32Z",
"reason": "NewReplicaSetAvailable",
"message": "ReplicaSet \"kotsadm-web-79bfb95c48\" has successfully progressed."
}
]
}
}
}
]
]
}
@@ -1,4 +1,10 @@
[
{
"kind": "DeploymentList",
"apiVersion": "apps/v1",
"metadata": {
"resourceVersion": "27195652"
},
"items": [
{
"metadata": {
"name": "coredns",
@@ -658,4 +664,4 @@
}
}
]
}
@@ -1,4 +1,10 @@
[
{
"kind": "DeploymentList",
"apiVersion": "apps/v1",
"metadata": {
"resourceVersion": "27195653"
},
"items": [
{
"metadata": {
"name": "grafana",
@@ -1640,5 +1646,5 @@
]
}
}
]
]
}
+8 -2
View File
@@ -1,4 +1,10 @@
[
{
"kind": "JobList",
"apiVersion": "batch/v1",
"metadata": {
"resourceVersion": "27195661"
},
"items": [
{
"metadata": {
"name": "contour-certgen-v1.19.1",
@@ -195,4 +201,4 @@
}
}
]
}
+309 -302
View File
@@ -1,318 +1,325 @@
[
{
"metadata": {
"name": "pre-install-job",
"namespace": "test",
"uid": "4545c8ba-0462-45a6-96c3-793a545dfcf6",
"resourceVersion": "8303004",
"creationTimestamp": "2021-10-05T19:11:43Z",
"labels": {
"kots.io/app-slug": "test",
"kots.io/backup": "velero"
},
"annotations": {
"helm.sh/hook": "pre-install",
"helm.sh/hook-weight": "2",
"kots.io/app-slug": "test",
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"batch/v1\",\"kind\":\"Job\",\"metadata\":{\"annotations\":{\"helm.sh/hook\":\"pre-install\",\"helm.sh/hook-weight\":\"2\",\"kots.io/app-slug\":\"test\"},\"labels\":{\"kots.io/app-slug\":\"test\",\"kots.io/backup\":\"velero\"},\"name\":\"pre-install-job\",\"namespace\":\"test\"},\"spec\":{\"backoffLimit\":3,\"template\":{\"metadata\":{\"annotations\":{\"kots.io/app-slug\":\"test\"},\"labels\":{\"kots.io/app-slug\":\"test\",\"kots.io/backup\":\"velero\"},\"name\":\"security-test\"},\"spec\":{\"containers\":[{\"command\":[\"sh\",\"-c\",\"sleep 10\"],\"image\":\"alpine\",\"imagePullPolicy\":\"IfNotPresent\",\"name\":\"hook-test\"}],\"restartPolicy\":\"Never\"}}}}\n"
},
"managedFields": [
{
"manager": "kubectl-client-side-apply",
"operation": "Update",
"apiVersion": "batch/v1",
"time": "2021-10-05T19:11:43Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:annotations": {
".": {},
"f:helm.sh/hook": {},
"f:helm.sh/hook-weight": {},
"f:kots.io/app-slug": {},
"f:kubectl.kubernetes.io/last-applied-configuration": {}
},
"f:labels": {
".": {},
"f:kots.io/app-slug": {},
"f:kots.io/backup": {}
}
},
"f:spec": {
"f:backoffLimit": {},
"f:completions": {},
"f:parallelism": {},
"f:template": {
"f:metadata": {
"f:annotations": {
".": {},
"f:kots.io/app-slug": {}
},
"f:labels": {
".": {},
"f:kots.io/app-slug": {},
"f:kots.io/backup": {}
},
"f:name": {}
},
"f:spec": {
"f:containers": {
"k:{\"name\":\"hook-test\"}": {
".": {},
"f:command": {},
"f:image": {},
"f:imagePullPolicy": {},
"f:name": {},
"f:resources": {},
"f:terminationMessagePath": {},
"f:terminationMessagePolicy": {}
}
},
"f:dnsPolicy": {},
"f:restartPolicy": {},
"f:schedulerName": {},
"f:securityContext": {},
"f:terminationGracePeriodSeconds": {}
}
}
}
}
},
{
"manager": "k3s",
"operation": "Update",
"apiVersion": "batch/v1",
"time": "2021-10-05T19:11:55Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:status": {
"f:completionTime": {},
"f:conditions": {},
"f:startTime": {},
"f:succeeded": {}
}
}
}
]
},
"spec": {
"parallelism": 1,
"completions": 1,
"backoffLimit": 3,
"selector": {
"matchLabels": {
"controller-uid": "4545c8ba-0462-45a6-96c3-793a545dfcf6"
}
},
"template": {
"metadata": {
"name": "security-test",
"creationTimestamp": null,
"labels": {
"controller-uid": "4545c8ba-0462-45a6-96c3-793a545dfcf6",
"job-name": "pre-install-job",
"kots.io/app-slug": "test",
"kots.io/backup": "velero"
},
"annotations": {
"kots.io/app-slug": "test"
}
},
"spec": {
"containers": [
{
"name": "hook-test",
"image": "alpine",
"command": [
"sh",
"-c",
"sleep 10"
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Never",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
}
},
"status": {
"conditions": [
{
"type": "Complete",
"status": "True",
"lastProbeTime": "2021-10-05T19:11:55Z",
"lastTransitionTime": "2021-10-05T19:11:55Z"
}
],
"startTime": "2021-10-05T19:11:43Z",
"completionTime": "2021-10-05T19:11:55Z",
"succeeded": 1
}
{
"kind": "JobList",
"apiVersion": "batch/v1",
"metadata": {
"resourceVersion": "27195662"
},
{
"metadata": {
"name": "post-install-job",
"namespace": "test",
"uid": "13844969-d21a-4514-8bed-66157f216af7",
"resourceVersion": "8303007",
"creationTimestamp": "2021-10-05T19:11:43Z",
"labels": {
"kots.io/app-slug": "test",
"kots.io/backup": "velero"
},
"annotations": {
"helm.sh/hook": "post-install",
"helm.sh/hook-weight": "2",
"kots.io/app-slug": "test",
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"batch/v1\",\"kind\":\"Job\",\"metadata\":{\"annotations\":{\"helm.sh/hook\":\"post-install\",\"helm.sh/hook-weight\":\"2\",\"kots.io/app-slug\":\"test\"},\"labels\":{\"kots.io/app-slug\":\"test\",\"kots.io/backup\":\"velero\"},\"name\":\"post-install-job\",\"namespace\":\"test\"},\"spec\":{\"backoffLimit\":3,\"template\":{\"metadata\":{\"annotations\":{\"kots.io/app-slug\":\"test\"},\"labels\":{\"kots.io/app-slug\":\"test\",\"kots.io/backup\":\"velero\"},\"name\":\"security-test\"},\"spec\":{\"containers\":[{\"command\":[\"sh\",\"-c\",\"sleep 10\"],\"image\":\"alpine\",\"imagePullPolicy\":\"IfNotPresent\",\"name\":\"hook-test\"}],\"restartPolicy\":\"Never\"}}}}\n"
},
"managedFields": [
{
"manager": "kubectl-client-side-apply",
"operation": "Update",
"apiVersion": "batch/v1",
"time": "2021-10-05T19:11:43Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:annotations": {
".": {},
"f:helm.sh/hook": {},
"f:helm.sh/hook-weight": {},
"f:kots.io/app-slug": {},
"f:kubectl.kubernetes.io/last-applied-configuration": {}
},
"f:labels": {
".": {},
"f:kots.io/app-slug": {},
"f:kots.io/backup": {}
}
},
"f:spec": {
"f:backoffLimit": {},
"f:completions": {},
"f:parallelism": {},
"f:template": {
"f:metadata": {
"f:annotations": {
".": {},
"f:kots.io/app-slug": {}
},
"f:labels": {
".": {},
"f:kots.io/app-slug": {},
"f:kots.io/backup": {}
},
"f:name": {}
"items": [
{
"metadata": {
"name": "pre-install-job",
"namespace": "test",
"uid": "4545c8ba-0462-45a6-96c3-793a545dfcf6",
"resourceVersion": "8303004",
"creationTimestamp": "2021-10-05T19:11:43Z",
"labels": {
"kots.io/app-slug": "test",
"kots.io/backup": "velero"
},
"annotations": {
"helm.sh/hook": "pre-install",
"helm.sh/hook-weight": "2",
"kots.io/app-slug": "test",
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"batch/v1\",\"kind\":\"Job\",\"metadata\":{\"annotations\":{\"helm.sh/hook\":\"pre-install\",\"helm.sh/hook-weight\":\"2\",\"kots.io/app-slug\":\"test\"},\"labels\":{\"kots.io/app-slug\":\"test\",\"kots.io/backup\":\"velero\"},\"name\":\"pre-install-job\",\"namespace\":\"test\"},\"spec\":{\"backoffLimit\":3,\"template\":{\"metadata\":{\"annotations\":{\"kots.io/app-slug\":\"test\"},\"labels\":{\"kots.io/app-slug\":\"test\",\"kots.io/backup\":\"velero\"},\"name\":\"security-test\"},\"spec\":{\"containers\":[{\"command\":[\"sh\",\"-c\",\"sleep 10\"],\"image\":\"alpine\",\"imagePullPolicy\":\"IfNotPresent\",\"name\":\"hook-test\"}],\"restartPolicy\":\"Never\"}}}}\n"
},
"managedFields": [
{
"manager": "kubectl-client-side-apply",
"operation": "Update",
"apiVersion": "batch/v1",
"time": "2021-10-05T19:11:43Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:annotations": {
".": {},
"f:helm.sh/hook": {},
"f:helm.sh/hook-weight": {},
"f:kots.io/app-slug": {},
"f:kubectl.kubernetes.io/last-applied-configuration": {}
},
"f:spec": {
"f:containers": {
"k:{\"name\":\"hook-test\"}": {
"f:labels": {
".": {},
"f:kots.io/app-slug": {},
"f:kots.io/backup": {}
}
},
"f:spec": {
"f:backoffLimit": {},
"f:completions": {},
"f:parallelism": {},
"f:template": {
"f:metadata": {
"f:annotations": {
".": {},
"f:command": {},
"f:image": {},
"f:imagePullPolicy": {},
"f:name": {},
"f:resources": {},
"f:terminationMessagePath": {},
"f:terminationMessagePolicy": {}
}
"f:kots.io/app-slug": {}
},
"f:labels": {
".": {},
"f:kots.io/app-slug": {},
"f:kots.io/backup": {}
},
"f:name": {}
},
"f:dnsPolicy": {},
"f:restartPolicy": {},
"f:schedulerName": {},
"f:securityContext": {},
"f:terminationGracePeriodSeconds": {}
"f:spec": {
"f:containers": {
"k:{\"name\":\"hook-test\"}": {
".": {},
"f:command": {},
"f:image": {},
"f:imagePullPolicy": {},
"f:name": {},
"f:resources": {},
"f:terminationMessagePath": {},
"f:terminationMessagePolicy": {}
}
},
"f:dnsPolicy": {},
"f:restartPolicy": {},
"f:schedulerName": {},
"f:securityContext": {},
"f:terminationGracePeriodSeconds": {}
}
}
}
}
}
},
{
"manager": "k3s",
"operation": "Update",
"apiVersion": "batch/v1",
"time": "2021-10-05T19:11:55Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:status": {
"f:completionTime": {},
"f:conditions": {},
"f:startTime": {},
"f:succeeded": {}
},
{
"manager": "k3s",
"operation": "Update",
"apiVersion": "batch/v1",
"time": "2021-10-05T19:11:55Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:status": {
"f:completionTime": {},
"f:conditions": {},
"f:startTime": {},
"f:succeeded": {}
}
}
}
}
]
},
"spec": {
"parallelism": 1,
"completions": 1,
"backoffLimit": 3,
"selector": {
"matchLabels": {
"controller-uid": "13844969-d21a-4514-8bed-66157f216af7"
]
},
"spec": {
"parallelism": 1,
"completions": 1,
"backoffLimit": 3,
"selector": {
"matchLabels": {
"controller-uid": "4545c8ba-0462-45a6-96c3-793a545dfcf6"
}
},
"template": {
"metadata": {
"name": "security-test",
"creationTimestamp": null,
"labels": {
"controller-uid": "4545c8ba-0462-45a6-96c3-793a545dfcf6",
"job-name": "pre-install-job",
"kots.io/app-slug": "test",
"kots.io/backup": "velero"
},
"annotations": {
"kots.io/app-slug": "test"
}
},
"spec": {
"containers": [
{
"name": "hook-test",
"image": "alpine",
"command": [
"sh",
"-c",
"sleep 10"
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Never",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
}
},
"template": {
"metadata": {
"name": "security-test",
"creationTimestamp": null,
"labels": {
"controller-uid": "13844969-d21a-4514-8bed-66157f216af7",
"job-name": "post-install-job",
"kots.io/app-slug": "test",
"kots.io/backup": "velero"
},
"annotations": {
"kots.io/app-slug": "test"
"status": {
"conditions": [
{
"type": "Complete",
"status": "True",
"lastProbeTime": "2021-10-05T19:11:55Z",
"lastTransitionTime": "2021-10-05T19:11:55Z"
}
},
"spec": {
"containers": [
{
"name": "hook-test",
"image": "alpine",
"command": [
"sh",
"-c",
"sleep 10"
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Never",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
],
"startTime": "2021-10-05T19:11:43Z",
"completionTime": "2021-10-05T19:11:55Z",
"succeeded": 1
}
},
"status": {
"conditions": [
{
"type": "Failed",
"status": "True",
"lastProbeTime": "2021-10-05T19:11:55Z",
"lastTransitionTime": "2021-10-05T19:11:55Z",
"message": "Job has reached the specified backoff limit",
"reason": "BackoffLimitExceeded"
{
"metadata": {
"name": "post-install-job",
"namespace": "test",
"uid": "13844969-d21a-4514-8bed-66157f216af7",
"resourceVersion": "8303007",
"creationTimestamp": "2021-10-05T19:11:43Z",
"labels": {
"kots.io/app-slug": "test",
"kots.io/backup": "velero"
},
"annotations": {
"helm.sh/hook": "post-install",
"helm.sh/hook-weight": "2",
"kots.io/app-slug": "test",
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"batch/v1\",\"kind\":\"Job\",\"metadata\":{\"annotations\":{\"helm.sh/hook\":\"post-install\",\"helm.sh/hook-weight\":\"2\",\"kots.io/app-slug\":\"test\"},\"labels\":{\"kots.io/app-slug\":\"test\",\"kots.io/backup\":\"velero\"},\"name\":\"post-install-job\",\"namespace\":\"test\"},\"spec\":{\"backoffLimit\":3,\"template\":{\"metadata\":{\"annotations\":{\"kots.io/app-slug\":\"test\"},\"labels\":{\"kots.io/app-slug\":\"test\",\"kots.io/backup\":\"velero\"},\"name\":\"security-test\"},\"spec\":{\"containers\":[{\"command\":[\"sh\",\"-c\",\"sleep 10\"],\"image\":\"alpine\",\"imagePullPolicy\":\"IfNotPresent\",\"name\":\"hook-test\"}],\"restartPolicy\":\"Never\"}}}}\n"
},
"managedFields": [
{
"manager": "kubectl-client-side-apply",
"operation": "Update",
"apiVersion": "batch/v1",
"time": "2021-10-05T19:11:43Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:annotations": {
".": {},
"f:helm.sh/hook": {},
"f:helm.sh/hook-weight": {},
"f:kots.io/app-slug": {},
"f:kubectl.kubernetes.io/last-applied-configuration": {}
},
"f:labels": {
".": {},
"f:kots.io/app-slug": {},
"f:kots.io/backup": {}
}
},
"f:spec": {
"f:backoffLimit": {},
"f:completions": {},
"f:parallelism": {},
"f:template": {
"f:metadata": {
"f:annotations": {
".": {},
"f:kots.io/app-slug": {}
},
"f:labels": {
".": {},
"f:kots.io/app-slug": {},
"f:kots.io/backup": {}
},
"f:name": {}
},
"f:spec": {
"f:containers": {
"k:{\"name\":\"hook-test\"}": {
".": {},
"f:command": {},
"f:image": {},
"f:imagePullPolicy": {},
"f:name": {},
"f:resources": {},
"f:terminationMessagePath": {},
"f:terminationMessagePolicy": {}
}
},
"f:dnsPolicy": {},
"f:restartPolicy": {},
"f:schedulerName": {},
"f:securityContext": {},
"f:terminationGracePeriodSeconds": {}
}
}
}
}
},
{
"manager": "k3s",
"operation": "Update",
"apiVersion": "batch/v1",
"time": "2021-10-05T19:11:55Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:status": {
"f:completionTime": {},
"f:conditions": {},
"f:startTime": {},
"f:succeeded": {}
}
}
}
]
},
"spec": {
"parallelism": 1,
"completions": 1,
"backoffLimit": 3,
"selector": {
"matchLabels": {
"controller-uid": "13844969-d21a-4514-8bed-66157f216af7"
}
},
"template": {
"metadata": {
"name": "security-test",
"creationTimestamp": null,
"labels": {
"controller-uid": "13844969-d21a-4514-8bed-66157f216af7",
"job-name": "post-install-job",
"kots.io/app-slug": "test",
"kots.io/backup": "velero"
},
"annotations": {
"kots.io/app-slug": "test"
}
},
"spec": {
"containers": [
{
"name": "hook-test",
"image": "alpine",
"command": [
"sh",
"-c",
"sleep 10"
],
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "IfNotPresent"
}
],
"restartPolicy": "Never",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {},
"schedulerName": "default-scheduler"
}
}
],
"startTime": "2021-10-05T19:11:43Z",
"completionTime": "2021-10-05T19:11:55Z",
"failed": 1
},
"status": {
"conditions": [
{
"type": "Failed",
"status": "True",
"lastProbeTime": "2021-10-05T19:11:55Z",
"lastTransitionTime": "2021-10-05T19:11:55Z",
"message": "Job has reached the specified backoff limit",
"reason": "BackoffLimitExceeded"
}
],
"startTime": "2021-10-05T19:11:43Z",
"completionTime": "2021-10-05T19:11:55Z",
"failed": 1
}
}
}
]
]
}
+2858 -107
View File
File diff suppressed because it is too large Load Diff
+8 -2
View File
@@ -1,4 +1,10 @@
[
{
"kind": "ReplicaSetList",
"apiVersion": "apps/v1",
"metadata": {
"resourceVersion": "27195657"
},
"items": [
{
"metadata": {
"name": "kotsadm-f98ff7d75",
@@ -1440,4 +1446,4 @@
}
}
]
}

Some files were not shown because too many files have changed in this diff Show More