Skip to content

Commit

Permalink
fix error message if invalid value for topologySpreadConstraints flag…
Browse files Browse the repository at this point in the history
…s passed (cockroachdb#980)
  • Loading branch information
himanshu-cockroach authored Jun 20, 2023
1 parent 1c13e91 commit abd3f78
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# [Unreleased](https://github.com/cockroachdb/cockroach-operator/compare/v2.10.0...master)

* Bug fix to return correct error message if value passed for `whenUnsatisfiable` under `topologySpreadConstraints` field is invalid.

# [v2.10.0](https://github.com/cockroachdb/cockroach-operator/compare/v2.9.0...v2.10.0)

## Added
Expand Down
14 changes: 8 additions & 6 deletions pkg/actor/validate_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type versionChecker struct {
action
}

//GetActionType returns api.VersionCheckerAction action used to set the cluster status errors
// GetActionType returns api.VersionCheckerAction action used to set the cluster status errors
func (v *versionChecker) GetActionType() api.ActionType {
return api.VersionCheckerAction
}
Expand Down Expand Up @@ -126,12 +126,14 @@ func (v *versionChecker) Act(ctx context.Context, cluster *resource.Cluster, log
Owner: owner,
Scheme: v.scheme,
}).Reconcile()
if err != nil && kube.IgnoreNotFound(err) == nil {
err := errors.Wrap(err, "failed to reconcile job not found")
log.Error(err, "failed to reconcile job")
if err != nil {
if kube.IgnoreNotFound(err) == nil {
err := errors.Wrap(err, "failed to reconcile job not found")
log.Error(err, "failed to reconcile job")
return err
}
log.Error(err, "failed to reconcile job only err: ", err.Error())
return err
} else if err != nil {
log.Error(err, "failed to reconcile job only err")
}

if changed {
Expand Down

0 comments on commit abd3f78

Please sign in to comment.