private boolean redundantUndeployment ( final Deployment deployment , final DeploymentGroup deploymentGroup ) { // This deployment was not created by this deployment group. if ( ! Objects . equals ( deployment . getDeploymentGroupName ( ) , deploymentGroup . getName ( ) ) ) { return false ; } // This deployment is not of the deployment group's job. if ( ! deployment . getJobId ( ) . equals ( deploymentGroup . getJobId ( ) ) ) { return false ; } // This deployment aims to do something other than start. if ( ! Goal . START . equals ( deployment . getGoal ( ) ) ) { return false ; } // Undeploying this deployment's job would be redundant because the next operation would simply // redeploy the same job. return true ; }
redundantDeployment determines whether or not rollingUpdateUndeploy should actually emit RollingUpdateOps to undeploy a job .