Skip to content

Commit 4aca54f

Browse files
authoredMar 6, 2018
Merge pull request #18714 from wozniakjan/diagnostics/logging/18705/missing_project_fatal
Automatic merge from submit-queue. diagnostics: missing logging project shouldn't be fatal error Fix for #18705 This still reports missing logging project as an error, but not a fatal error
2 parents eaf3a0a + c2d489d commit 4aca54f

File tree

1 file changed

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

1 file changed

+7
-2
lines changed
 

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

+7-2
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,22 @@ 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)
166+
d.Error("AGL0034", err, fmt.Sprintf("Fetching project %q returned with error", project))
167+
return nil
167168
}
168169

169170
d.Debug("AGL0033", fmt.Sprintf("Found default logging project %q", project))
170171
d.Project = project
171172
return nil
172173
}
173-
return fmt.Errorf("default logging project not found, use '--%s' to specify logging project", flagLoggingProject)
174+
//tried to complete here but no known logging project exists, will be checked in CanRun()
175+
return nil
174176
}
175177

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

0 commit comments

Comments
 (0)
Please sign in to comment.