Skip to content

Commit

Permalink
Merge pull request #6788 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…6740-to-release-4.12

[release-4.12] OCPBUGS-6087: Warn if agent assets detected when using non-agent waitfor
  • Loading branch information
openshift-merge-robot committed Feb 28, 2023
2 parents 9d0d76d + cecb705 commit fd9e75e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmd/openshift-install/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
configclient "github.com/openshift/client-go/config/clientset/versioned"
routeclient "github.com/openshift/client-go/route/clientset/versioned"
"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/asset/agent/agentconfig"
"github.com/openshift/installer/pkg/asset/cluster"
"github.com/openshift/installer/pkg/asset/installconfig"
"github.com/openshift/installer/pkg/asset/logging"
Expand Down Expand Up @@ -377,6 +378,11 @@ func waitForBootstrapComplete(ctx context.Context, config *rest.Config) *cluster
silenceRemaining := logDownsample
previousErrorSuffix := ""
timer.StartTimer("API")

if assetStore, err := assetstore.NewStore(rootOpts.dir); err == nil {
checkIfAgentCommand(assetStore)
}

var lastErr error
wait.Until(func() {
version, err := discovery.ServerVersion()
Expand Down Expand Up @@ -476,6 +482,8 @@ func waitForInitializedCluster(ctx context.Context, config *rest.Config) error {
timeout = 60 * time.Minute
}
}

checkIfAgentCommand(assetStore)
}

untilTime := time.Now().Add(timeout)
Expand Down Expand Up @@ -639,3 +647,9 @@ The cluster should be accessible for troubleshooting as detailed in the document
https://docs.openshift.com/container-platform/latest/support/troubleshooting/troubleshooting-installations.html
The 'wait-for install-complete' subcommand can then be used to continue the installation`)
}

func checkIfAgentCommand(assetStore asset.Store) {
if agentConfig, err := assetStore.Load(&agentconfig.AgentConfig{}); err == nil && agentConfig != nil {
logrus.Warning("An agent configuration was detected but this command is not the agent wait-for command")
}
}

0 comments on commit fd9e75e

Please sign in to comment.