diff --git a/config/crds/troubleshoot.sh_collectors.yaml b/config/crds/troubleshoot.sh_collectors.yaml index 931b53d68..de9d5ae9b 100644 --- a/config/crds/troubleshoot.sh_collectors.yaml +++ b/config/crds/troubleshoot.sh_collectors.yaml @@ -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: @@ -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: diff --git a/config/crds/troubleshoot.sh_preflights.yaml b/config/crds/troubleshoot.sh_preflights.yaml index 27eef2914..f601d7efb 100644 --- a/config/crds/troubleshoot.sh_preflights.yaml +++ b/config/crds/troubleshoot.sh_preflights.yaml @@ -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: @@ -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: diff --git a/config/crds/troubleshoot.sh_supportbundles.yaml b/config/crds/troubleshoot.sh_supportbundles.yaml index e0dc56819..50203f84f 100644 --- a/config/crds/troubleshoot.sh_supportbundles.yaml +++ b/config/crds/troubleshoot.sh_supportbundles.yaml @@ -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: @@ -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: diff --git a/pkg/apis/troubleshoot/v1beta2/collector_shared.go b/pkg/apis/troubleshoot/v1beta2/collector_shared.go index 554f732e4..65d35db3c 100644 --- a/pkg/apis/troubleshoot/v1beta2/collector_shared.go +++ b/pkg/apis/troubleshoot/v1beta2/collector_shared.go @@ -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 { @@ -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 { @@ -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"` diff --git a/pkg/apis/troubleshoot/v1beta2/zz_generated.deepcopy.go b/pkg/apis/troubleshoot/v1beta2/zz_generated.deepcopy.go index 7f40bc835..b13d83cb2 100644 --- a/pkg/apis/troubleshoot/v1beta2/zz_generated.deepcopy.go +++ b/pkg/apis/troubleshoot/v1beta2/zz_generated.deepcopy.go @@ -1212,6 +1212,21 @@ func (in *Copy) DeepCopy() *Copy { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CopyDetail) DeepCopyInto(out *CopyDetail) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CopyDetail. +func (in *CopyDetail) DeepCopy() *CopyDetail { + if in == nil { + return nil + } + out := new(CopyDetail) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CopyFromHost) DeepCopyInto(out *CopyFromHost) { *out = *in @@ -1530,6 +1545,11 @@ func (in *Exec) DeepCopyInto(out *Exec) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.CopyDetail != nil { + in, out := &in.CopyDetail, &out.CopyDetail + *out = new(CopyDetail) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Exec. @@ -4603,6 +4623,11 @@ func (in *RunPod) DeepCopyInto(out *RunPod) { (*out)[key] = val } } + if in.CopyDetail != nil { + in, out := &in.CopyDetail, &out.CopyDetail + *out = new(CopyDetail) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunPod. diff --git a/schemas/collector-troubleshoot-v1beta2.json b/schemas/collector-troubleshoot-v1beta2.json index bd5d00b34..fa0840f27 100644 --- a/schemas/collector-troubleshoot-v1beta2.json +++ b/schemas/collector-troubleshoot-v1beta2.json @@ -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"}] }, @@ -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"}] }, diff --git a/schemas/preflight-troubleshoot-v1beta2.json b/schemas/preflight-troubleshoot-v1beta2.json index 02e7687e8..40e682868 100644 --- a/schemas/preflight-troubleshoot-v1beta2.json +++ b/schemas/preflight-troubleshoot-v1beta2.json @@ -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"}] }, @@ -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"}] }, diff --git a/schemas/supportbundle-troubleshoot-v1beta2.json b/schemas/supportbundle-troubleshoot-v1beta2.json index 387e23727..b83854726 100644 --- a/schemas/supportbundle-troubleshoot-v1beta2.json +++ b/schemas/supportbundle-troubleshoot-v1beta2.json @@ -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"}] }, @@ -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"}] },