Skip to content

Commit 617ddf1

Browse files
fix: Use namespace from the collector spec for Ceph (#1042)
use namespace from the collector spec for ceph
1 parent 3419a9b commit 617ddf1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/collect/ceph.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ func (c *CollectCeph) IsExcluded() (bool, error) {
128128
func (c *CollectCeph) Collect(progressChan chan<- interface{}) (CollectorResult, error) {
129129
ctx := context.TODO()
130130

131-
if c.Namespace == "" {
132-
c.Namespace = DefaultCephNamespace
131+
if c.Collector.Namespace == "" {
132+
c.Collector.Namespace = DefaultCephNamespace
133133
}
134134

135-
pod, err := findRookCephToolsPod(ctx, c, c.Namespace)
135+
pod, err := findRookCephToolsPod(ctx, c, c.Collector.Namespace)
136136
if err != nil {
137137
return nil, err
138138
}
@@ -142,7 +142,7 @@ func (c *CollectCeph) Collect(progressChan chan<- interface{}) (CollectorResult,
142142
for _, command := range CephCommands {
143143
err := cephCommandExec(ctx, progressChan, c, c.Collector, pod, command, output)
144144
if err != nil {
145-
pathPrefix := GetCephCollectorFilepath(c.Collector.CollectorName, c.Namespace)
145+
pathPrefix := GetCephCollectorFilepath(c.Collector.CollectorName, c.Collector.Namespace)
146146
dstFileName := path.Join(pathPrefix, fmt.Sprintf("%s.%s-error", command.ID, command.Format))
147147
output.SaveResult(c.BundlePath, dstFileName, strings.NewReader(err.Error()))
148148
}

0 commit comments

Comments
 (0)