Skip to content

Disable deployment config detail message updates #5713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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: 8 additions & 9 deletions pkg/deploy/controller/deploymentconfig/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,19 @@ func (e transientError) Error() string {

// Handle processes config and creates a new deployment if necessary.
func (c *DeploymentConfigController) Handle(config *deployapi.DeploymentConfig) error {
// Inspect a deployment configuration every time the controller reconciles it
details, existingDeployments, latestDeploymentExists, err := c.findDetails(config)
if err != nil {
return err
}
config, err = c.updateDetails(config, details)
if err != nil {
return transientError(err.Error())
}
// TODO(danmace): Don't use findDetails yet. See: https://github.com/openshift/origin/pull/5530

// Only deploy when the version has advanced past 0.
if config.LatestVersion == 0 {
glog.V(5).Infof("Waiting for first version of %s", deployutil.LabelForDeploymentConfig(config))
return nil
}

existingDeployments, err := c.deploymentClient.listDeploymentsForConfig(config.Namespace, config.Name)
if err != nil {
return err
}

var inflightDeployment *kapi.ReplicationController
for _, deployment := range existingDeployments.Items {

Expand Down Expand Up @@ -104,6 +101,7 @@ func (c *DeploymentConfigController) Handle(config *deployapi.DeploymentConfig)
}

// if the latest deployment exists then nothing else needs to be done
latestDeploymentExists, _ := deployutil.LatestDeploymentInfo(config, existingDeployments)
if latestDeploymentExists {
return nil
}
Expand Down Expand Up @@ -184,6 +182,7 @@ func (i *deploymentClientImpl) updateDeployment(namespace string, deployment *ka

// findDetails inspects the given deployment configuration for any failure causes
// and returns any found details about it
// TODO(danmace): Don't use findDetails yet. See: https://github.com/openshift/origin/pull/5530
func (c *DeploymentConfigController) findDetails(config *deployapi.DeploymentConfig) (string, *kapi.ReplicationControllerList, bool, error) {
// Check if any existing inflight deployments (any non-terminal state).
existingDeployments, err := c.deploymentClient.listDeploymentsForConfig(config.Namespace, config.Name)
Expand Down