Skip to content

Commit 9f527ee

Browse files
Merge branch 'main' into diamonwiggins/sc-44286/run-pod-spec
2 parents 6cdcb36 + 2c9a37a commit 9f527ee

File tree

18 files changed

+422
-242
lines changed

18 files changed

+422
-242
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: troubleshoot.sh/v1beta2
2+
kind: SupportBundle
3+
metadata:
4+
name: mysql
5+
spec:
6+
collectors:
7+
- mysql:
8+
collectorName: mysql
9+
uri: 'root:my-secret-pw@tcp(localhost:3306)/mysql'
10+
parameters:
11+
- character_set_server
12+
- collation_server
13+
- init_connect
14+
- innodb_file_format
15+
- innodb_large_prefix
16+
- innodb_strict_mode
17+
- log_bin_trust_function_creators

pkg/analyze/analyzer.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ type AnalyzeResult struct {
2828
type getCollectedFileContents func(string) ([]byte, error)
2929
type getChildCollectedFileContents func(string) (map[string][]byte, error)
3030

31-
func isExcluded(excludeVal multitype.BoolOrString) (bool, error) {
31+
func isExcluded(excludeVal *multitype.BoolOrString) (bool, error) {
32+
if excludeVal == nil {
33+
return false, nil
34+
}
35+
3236
if excludeVal.Type == multitype.Bool {
3337
return excludeVal.BoolVal, nil
3438
}

pkg/apis/troubleshoot/v1beta1/analyzer_shared.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ type DatabaseAnalyze struct {
116116
}
117117

118118
type AnalyzeMeta struct {
119-
CheckName string `json:"checkName,omitempty" yaml:"checkName,omitempty"`
120-
Exclude multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
119+
CheckName string `json:"checkName,omitempty" yaml:"checkName,omitempty"`
120+
Exclude *multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
121121
}
122122

123123
type Analyze struct {

pkg/apis/troubleshoot/v1beta1/collector_shared.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
type CollectorMeta struct {
1212
CollectorName string `json:"collectorName,omitempty" yaml:"collectorName,omitempty"`
1313
// +optional
14-
Exclude multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
14+
Exclude *multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
1515
}
1616

1717
type ClusterInfo struct {

pkg/apis/troubleshoot/v1beta1/zz_generated.deepcopy.go

Lines changed: 41 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/troubleshoot/v1beta2/analyzer_shared.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ type SysctlAnalyze struct {
175175
}
176176

177177
type AnalyzeMeta struct {
178-
CheckName string `json:"checkName,omitempty" yaml:"checkName,omitempty"`
179-
Exclude multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
180-
Strict multitype.BoolOrString `json:"strict,omitempty" yaml:"strict,omitempty"`
178+
CheckName string `json:"checkName,omitempty" yaml:"checkName,omitempty"`
179+
Exclude *multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
180+
Strict *multitype.BoolOrString `json:"strict,omitempty" yaml:"strict,omitempty"`
181181
}
182182

183183
type Analyze struct {

pkg/apis/troubleshoot/v1beta2/collector_shared.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
type CollectorMeta struct {
1414
CollectorName string `json:"collectorName,omitempty" yaml:"collectorName,omitempty"`
1515
// +optional
16-
Exclude multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
16+
Exclude *multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
1717
}
1818

1919
type ClusterInfo struct {
@@ -166,7 +166,8 @@ type Put struct {
166166

167167
type Database struct {
168168
CollectorMeta `json:",inline" yaml:",inline"`
169-
URI string `json:"uri" yaml:"uri"`
169+
URI string `json:"uri" yaml:"uri"`
170+
Parameters []string `json:"parameters,omitempty"`
170171
}
171172

172173
type Collectd struct {

pkg/apis/troubleshoot/v1beta2/hostcollector_shared.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
type HostCollectorMeta struct {
88
CollectorName string `json:"collectorName,omitempty" yaml:"collectorName,omitempty"`
99
// +optional
10-
Exclude multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
10+
Exclude *multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
1111
}
1212

1313
type CPU struct {

pkg/apis/troubleshoot/v1beta2/remote_collector_shared.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
type RemoteCollectorMeta struct {
1111
CollectorName string `json:"collectorName,omitempty" yaml:"collectorName,omitempty"`
1212
// +optional
13-
Exclude multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
13+
Exclude *multitype.BoolOrString `json:"exclude,omitempty" yaml:"exclude,omitempty"`
1414
}
1515

1616
type RemoteCPU struct {

0 commit comments

Comments
 (0)