Merge pull request #23083 from janetkuo/rollout-undo-paused-check

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot
2016-03-17 06:28:39 -07:00
2 changed files with 12 additions and 1 deletions

View File

@@ -49,6 +49,10 @@ type DeploymentRollbacker struct {
}
func (r *DeploymentRollbacker) Rollback(namespace, name string, updatedAnnotations map[string]string, toRevision int64, obj runtime.Object) (string, error) {
d := obj.(*extensions.Deployment)
if d.Spec.Paused {
return "", fmt.Errorf("you cannot rollback a paused deployment; resume it first with 'kubectl rollout resume' and try again")
}
deploymentRollback := &extensions.DeploymentRollback{
Name: name,
UpdatedAnnotations: updatedAnnotations,