mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-02-14 18:29:53 +00:00
Change containers to containerNames to not break kustomize
This commit is contained in:
@@ -24,12 +24,12 @@ type LogLimits struct {
|
||||
}
|
||||
|
||||
type Logs struct {
|
||||
CollectorMeta `json:",inline" yaml:",inline"`
|
||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
Selector []string `json:"selector" yaml:"selector"`
|
||||
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
|
||||
Containers []string `json:"containers,omitempty" yaml:"containers,omitempty"`
|
||||
Limits *LogLimits `json:"limits,omitempty" yaml:"omitempty"`
|
||||
CollectorMeta `json:",inline" yaml:",inline"`
|
||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
Selector []string `json:"selector" yaml:"selector"`
|
||||
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
|
||||
ContainerNames []string `json:"containerNames,omitempty" yaml:"containerNames,omitempty"`
|
||||
Limits *LogLimits `json:"limits,omitempty" yaml:"omitempty"`
|
||||
}
|
||||
|
||||
type Run struct {
|
||||
|
||||
@@ -893,8 +893,8 @@ func (in *Logs) DeepCopyInto(out *Logs) {
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Containers != nil {
|
||||
in, out := &in.Containers, &out.Containers
|
||||
if in.ContainerNames != nil {
|
||||
in, out := &in.ContainerNames, &out.ContainerNames
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ func Logs(ctx *Context, logsCollector *troubleshootv1beta1.Logs) ([]byte, error)
|
||||
|
||||
if len(pods) > 0 {
|
||||
for _, pod := range pods {
|
||||
if len(logsCollector.Containers) == 0 {
|
||||
if len(logsCollector.ContainerNames) == 0 {
|
||||
podLogs, err := getPodLogs(client, pod, logsCollector.Name, "", logsCollector.Limits, false)
|
||||
if err != nil {
|
||||
key := fmt.Sprintf("%s/%s-errors.json", logsCollector.Name, pod.Name)
|
||||
@@ -50,7 +50,7 @@ func Logs(ctx *Context, logsCollector *troubleshootv1beta1.Logs) ([]byte, error)
|
||||
logsOutput[k] = v
|
||||
}
|
||||
} else {
|
||||
for _, container := range logsCollector.Containers {
|
||||
for _, container := range logsCollector.ContainerNames {
|
||||
containerLogs, err := getPodLogs(client, pod, logsCollector.Name, container, logsCollector.Limits, false)
|
||||
if err != nil {
|
||||
key := fmt.Sprintf("%s/%s/%s-errors.json", logsCollector.Name, pod.Name, container)
|
||||
|
||||
Reference in New Issue
Block a user