Skip to content

Commit

Permalink
Merge pull request #11316 from kargakis/make-deploy-latest-suggest-ro…
Browse files Browse the repository at this point in the history
…llout

Merged by openshift-bot
  • Loading branch information
OpenShift Bot committed Oct 14, 2016
2 parents ebcc568 + 02a2d62 commit dbdc2f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pkg/cmd/cli/cmd/deploy.go
Expand Up @@ -259,6 +259,9 @@ func (o DeployOptions) deploy(config *deployapi.DeploymentConfig) error {
dc, err = o.osClient.DeploymentConfigs(config.Namespace).Update(config)
}
if err != nil {
if kerrors.IsBadRequest(err) {
err = fmt.Errorf("%v - try 'oc rollout latest dc/%s'", err, config.Name)
}
return err
}
fmt.Fprintf(o.out, "Started deployment #%d\n", dc.Status.LatestVersion)
Expand Down
4 changes: 2 additions & 2 deletions pkg/deploy/registry/instantiate/rest.go
Expand Up @@ -47,7 +47,7 @@ func (s *REST) New() runtime.Object {
func (r *REST) Create(ctx kapi.Context, obj runtime.Object) (runtime.Object, error) {
req, ok := obj.(*deployapi.DeploymentRequest)
if !ok {
return nil, errors.NewBadRequest(fmt.Sprintf("wrong object passed for requesting a new deployment: %#v", obj))
return nil, errors.NewInternalError(fmt.Errorf("wrong object passed for requesting a new rollout: %#v", obj))
}

configObj, err := r.store.Get(ctx, req.Name)
Expand Down Expand Up @@ -266,7 +266,7 @@ func decodeFromLatestDeployment(config *deployapi.DeploymentConfig, rn kclient.R
}
decoded, err := deployutil.DecodeDeploymentConfig(deployment, decoder)
if err != nil {
return nil, errors.NewBadRequest(err.Error())
return nil, errors.NewInternalError(err)
}
return decoded, nil
}
Expand Down

0 comments on commit dbdc2f8

Please sign in to comment.