Skip to content

Commit

Permalink
Merge branch 'main' into diamonwiggins/sc-44286/run-pod-spec
Browse files Browse the repository at this point in the history
  • Loading branch information
diamonwiggins authored May 6, 2022
2 parents 6cdcb36 + 2c9a37a commit 9f527ee
Show file tree
Hide file tree
Showing 18 changed files with 422 additions and 242 deletions.
17 changes: 17 additions & 0 deletions examples/support-bundle/mysql-collector.yaml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 5 additions & 1 deletion pkg/analyze/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/troubleshoot/v1beta1/analyzer_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ type DatabaseAnalyze struct {
}

type AnalyzeMeta struct {
CheckName string `json:"checkName,omitempty" yaml:"checkName,omitempty"`
Exclude multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
CheckName string `json:"checkName,omitempty" yaml:"checkName,omitempty"`
Exclude *multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
}

type Analyze struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/troubleshoot/v1beta1/collector_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
type CollectorMeta struct {
CollectorName string `json:"collectorName,omitempty" yaml:"collectorName,omitempty"`
// +optional
Exclude multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
Exclude *multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
}

type ClusterInfo struct {
Expand Down
73 changes: 41 additions & 32 deletions pkg/apis/troubleshoot/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/apis/troubleshoot/v1beta2/analyzer_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ type SysctlAnalyze struct {
}

type AnalyzeMeta struct {
CheckName string `json:"checkName,omitempty" yaml:"checkName,omitempty"`
Exclude multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
Strict multitype.BoolOrString `json:"strict,omitempty" yaml:"strict,omitempty"`
CheckName string `json:"checkName,omitempty" yaml:"checkName,omitempty"`
Exclude *multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
Strict *multitype.BoolOrString `json:"strict,omitempty" yaml:"strict,omitempty"`
}

type Analyze struct {
Expand Down
5 changes: 3 additions & 2 deletions pkg/apis/troubleshoot/v1beta2/collector_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
type CollectorMeta struct {
CollectorName string `json:"collectorName,omitempty" yaml:"collectorName,omitempty"`
// +optional
Exclude multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
Exclude *multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
}

type ClusterInfo struct {
Expand Down Expand Up @@ -166,7 +166,8 @@ type Put struct {

type Database struct {
CollectorMeta `json:",inline" yaml:",inline"`
URI string `json:"uri" yaml:"uri"`
URI string `json:"uri" yaml:"uri"`
Parameters []string `json:"parameters,omitempty"`
}

type Collectd struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/troubleshoot/v1beta2/hostcollector_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
type HostCollectorMeta struct {
CollectorName string `json:"collectorName,omitempty" yaml:"collectorName,omitempty"`
// +optional
Exclude multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
Exclude *multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
}

type CPU struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/troubleshoot/v1beta2/remote_collector_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
type RemoteCollectorMeta struct {
CollectorName string `json:"collectorName,omitempty" yaml:"collectorName,omitempty"`
// +optional
Exclude multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
Exclude *multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
}

type RemoteCPU struct {
Expand Down
Loading

0 comments on commit 9f527ee

Please sign in to comment.