Skip to content

Commit d2c4e25

Browse files
author
Jan Wozniak
committed
diagnostics: missing logging project shouldn't be fatal error
Fix for #18705
1 parent 1552371 commit d2c4e25

File tree

1 file changed

+5
-2
lines changed
  • pkg/oc/admin/diagnostics/diagnostics/cluster/aggregated_logging

1 file changed

+5
-2
lines changed

pkg/oc/admin/diagnostics/diagnostics/cluster/aggregated_logging/diagnostic.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,20 @@ func (d *AggregatedLogging) Complete(logger *log.Logger) error {
163163
d.Debug("AGL0032", fmt.Sprintf("Project %q not found", project))
164164
continue
165165
}
166-
return fmt.Errorf("failed fetching one of the default logging projects %q: %v", project, err)
167166
}
168167

169168
d.Debug("AGL0033", fmt.Sprintf("Found default logging project %q", project))
170169
d.Project = project
171170
return nil
172171
}
173-
return fmt.Errorf("default logging project not found, use '--%s' to specify logging project", flagLoggingProject)
172+
//tried to complete() here but no known logging project exists
173+
return nil
174174
}
175175

176176
func (d *AggregatedLogging) CanRun() (bool, error) {
177+
if len(d.Project) == 0 {
178+
return false, errors.New("Logging project does not exist")
179+
}
177180
if d.OAuthClientClient == nil || d.ProjectClient == nil || d.RouteClient == nil || d.CRBClient == nil || d.DCClient == nil {
178181
return false, errors.New("Config must include a cluster-admin context to run this diagnostic")
179182
}

0 commit comments

Comments
 (0)