Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions cmd/openshift-install/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,20 @@ var (

timer.StartTimer("Bootstrap Complete")
if err := waitForBootstrapComplete(ctx, config); err != nil {
if err2 := logClusterOperatorConditions(ctx, config); err2 != nil {
logrus.Error("Attempted to gather ClusterOperator status after installation failure: ", err2)
bundlePath, gatherErr := runGatherBootstrapCmd(rootOpts.dir)
if gatherErr != nil {
logrus.Error("Attempted to gather debug logs after installation failure: ", gatherErr)
}
bundlePath, err2 := runGatherBootstrapCmd(rootOpts.dir)
if err2 != nil {
logrus.Error("Attempted to gather debug logs after installation failure: ", err2)
if err := logClusterOperatorConditions(ctx, config); err != nil {
logrus.Error("Attempted to gather ClusterOperator status after installation failure: ", err)
}
logrus.Error("Bootstrap failed to complete: ", err.Unwrap())
logrus.Error(err.Error())
if err2 := service.AnalyzeGatherBundle(bundlePath); err2 != nil {
logrus.Error("Attempted to analyze the debug logs after installation failure: ", err2)
if gatherErr == nil {
if err := service.AnalyzeGatherBundle(bundlePath); err != nil {
logrus.Error("Attempted to analyze the debug logs after installation failure: ", err)
}
logrus.Infof("Bootstrap gather logs captured here %q", bundlePath)
}
logrus.Fatal("Bootstrap failed to complete")
}
Expand Down
8 changes: 5 additions & 3 deletions cmd/openshift-install/gather.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,14 @@ func newGatherBootstrapCmd() *cobra.Command {
if err != nil {
logrus.Fatal(err)
}

if !gatherBootstrapOpts.skipAnalysis {
if err := service.AnalyzeGatherBundle(bundlePath); err != nil {
logrus.Fatal(err)
}
}

logrus.Infof("Bootstrap gather logs captured here %q", bundlePath)
},
}
cmd.PersistentFlags().StringVar(&gatherBootstrapOpts.bootstrap, "bootstrap", "", "Hostname or IP of the bootstrap host")
Expand Down Expand Up @@ -135,10 +138,10 @@ func runGatherBootstrapCmd(directory string) (string, error) {
return "", errors.New("must provide both bootstrap host address and at least one control plane host address when providing one")
}

return logGatherBootstrap(bootstrap, port, masters, directory)
return gatherBootstrap(bootstrap, port, masters, directory)
}

func logGatherBootstrap(bootstrap string, port int, masters []string, directory string) (string, error) {
func gatherBootstrap(bootstrap string, port int, masters []string, directory string) (string, error) {
logrus.Info("Pulling debug logs from the bootstrap machine")
client, err := ssh.NewClient("core", net.JoinHostPort(bootstrap, strconv.Itoa(port)), gatherBootstrapOpts.sshKeys)
if err != nil {
Expand All @@ -160,7 +163,6 @@ func logGatherBootstrap(bootstrap string, port int, masters []string, directory
if err != nil {
return "", errors.Wrap(err, "failed to stat log file")
}
logrus.Infof("Bootstrap gather logs captured here %q", path)
return path, nil
}

Expand Down