Skip to content

Commit

Permalink
new schema for copy in RunPod and Exec collector
Browse files Browse the repository at this point in the history
  • Loading branch information
nvanthao committed Nov 10, 2024
1 parent 197f6de commit edc3d23
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 7 deletions.
18 changes: 18 additions & 0 deletions config/crds/troubleshoot.sh_collectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,15 @@ spec:
type: array
containerName:
type: string
copy:
properties:
containerName:
type: string
containerPath:
type: string
required:
- containerPath
type: object
exclude:
type: BoolString
name:
Expand Down Expand Up @@ -8841,6 +8850,15 @@ spec:
type: object
collectorName:
type: string
copy:
properties:
containerName:
type: string
containerPath:
type: string
required:
- containerPath
type: object
exclude:
type: BoolString
imagePullSecret:
Expand Down
18 changes: 18 additions & 0 deletions config/crds/troubleshoot.sh_preflights.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2059,6 +2059,15 @@ spec:
type: array
containerName:
type: string
copy:
properties:
containerName:
type: string
containerPath:
type: string
required:
- containerPath
type: object
exclude:
type: BoolString
name:
Expand Down Expand Up @@ -10570,6 +10579,15 @@ spec:
type: object
collectorName:
type: string
copy:
properties:
containerName:
type: string
containerPath:
type: string
required:
- containerPath
type: object
exclude:
type: BoolString
imagePullSecret:
Expand Down
18 changes: 18 additions & 0 deletions config/crds/troubleshoot.sh_supportbundles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2090,6 +2090,15 @@ spec:
type: array
containerName:
type: string
copy:
properties:
containerName:
type: string
containerPath:
type: string
required:
- containerPath
type: object
exclude:
type: BoolString
name:
Expand Down Expand Up @@ -10601,6 +10610,15 @@ spec:
type: object
collectorName:
type: string
copy:
properties:
containerName:
type: string
containerPath:
type: string
required:
- containerPath
type: object
exclude:
type: BoolString
imagePullSecret:
Expand Down
21 changes: 14 additions & 7 deletions pkg/apis/troubleshoot/v1beta2/collector_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ type RunPod struct {
ImagePullSecret *ImagePullSecrets `json:"imagePullSecret,omitempty" yaml:"imagePullSecret,omitempty"`
PodSpec corev1.PodSpec `json:"podSpec,omitempty" yaml:"podSpec,omitempty"`
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
CopyDetail *CopyDetail `json:"copy,omitempty" yaml:"copy,omitempty"`
}

type RunDaemonSet struct {
Expand All @@ -131,13 +132,14 @@ type ImagePullSecrets struct {

type Exec struct {
CollectorMeta `json:",inline" yaml:",inline"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Selector []string `json:"selector" yaml:"selector"`
Namespace string `json:"namespace" yaml:"namespace"`
ContainerName string `json:"containerName,omitempty" yaml:"containerName,omitempty"`
Command []string `json:"command,omitempty" yaml:"command,omitempty"`
Args []string `json:"args,omitempty" yaml:"args,omitempty"`
Timeout string `json:"timeout,omitempty" yaml:"timeout,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Selector []string `json:"selector" yaml:"selector"`
Namespace string `json:"namespace" yaml:"namespace"`
ContainerName string `json:"containerName,omitempty" yaml:"containerName,omitempty"`
Command []string `json:"command,omitempty" yaml:"command,omitempty"`
Args []string `json:"args,omitempty" yaml:"args,omitempty"`
Timeout string `json:"timeout,omitempty" yaml:"timeout,omitempty"`
CopyDetail *CopyDetail `json:"copy,omitempty" yaml:"copy,omitempty"`
}

type Copy struct {
Expand Down Expand Up @@ -315,6 +317,11 @@ type Etcd struct {
Image string `json:"image" yaml:"image"`
}

type CopyDetail struct {
ContainerPath string `json:"containerPath" yaml:"containerPath"`
ContainerName string `json:"containerName,omitempty" yaml:"containerName,omitempty"`
}

type Collect struct {
ClusterInfo *ClusterInfo `json:"clusterInfo,omitempty" yaml:"clusterInfo,omitempty"`
ClusterResources *ClusterResources `json:"clusterResources,omitempty" yaml:"clusterResources,omitempty"`
Expand Down
25 changes: 25 additions & 0 deletions pkg/apis/troubleshoot/v1beta2/zz_generated.deepcopy.go

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

28 changes: 28 additions & 0 deletions schemas/collector-troubleshoot-v1beta2.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,20 @@
"containerName": {
"type": "string"
},
"copy": {
"type": "object",
"required": [
"containerPath"
],
"properties": {
"containerName": {
"type": "string"
},
"containerPath": {
"type": "string"
}
}
},
"exclude": {
"oneOf": [{"type": "string"},{"type": "boolean"}]
},
Expand Down Expand Up @@ -7782,6 +7796,20 @@
"collectorName": {
"type": "string"
},
"copy": {
"type": "object",
"required": [
"containerPath"
],
"properties": {
"containerName": {
"type": "string"
},
"containerPath": {
"type": "string"
}
}
},
"exclude": {
"oneOf": [{"type": "string"},{"type": "boolean"}]
},
Expand Down
28 changes: 28 additions & 0 deletions schemas/preflight-troubleshoot-v1beta2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3116,6 +3116,20 @@
"containerName": {
"type": "string"
},
"copy": {
"type": "object",
"required": [
"containerPath"
],
"properties": {
"containerName": {
"type": "string"
},
"containerPath": {
"type": "string"
}
}
},
"exclude": {
"oneOf": [{"type": "string"},{"type": "boolean"}]
},
Expand Down Expand Up @@ -10446,6 +10460,20 @@
"collectorName": {
"type": "string"
},
"copy": {
"type": "object",
"required": [
"containerPath"
],
"properties": {
"containerName": {
"type": "string"
},
"containerPath": {
"type": "string"
}
}
},
"exclude": {
"oneOf": [{"type": "string"},{"type": "boolean"}]
},
Expand Down
28 changes: 28 additions & 0 deletions schemas/supportbundle-troubleshoot-v1beta2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3162,6 +3162,20 @@
"containerName": {
"type": "string"
},
"copy": {
"type": "object",
"required": [
"containerPath"
],
"properties": {
"containerName": {
"type": "string"
},
"containerPath": {
"type": "string"
}
}
},
"exclude": {
"oneOf": [{"type": "string"},{"type": "boolean"}]
},
Expand Down Expand Up @@ -10492,6 +10506,20 @@
"collectorName": {
"type": "string"
},
"copy": {
"type": "object",
"required": [
"containerPath"
],
"properties": {
"containerName": {
"type": "string"
},
"containerPath": {
"type": "string"
}
}
},
"exclude": {
"oneOf": [{"type": "string"},{"type": "boolean"}]
},
Expand Down

0 comments on commit edc3d23

Please sign in to comment.