Skip to content

Commit

Permalink
Cleanup validation errors (#967)
Browse files Browse the repository at this point in the history
* Simplify validation error handling (use native errors)
* bump chart versoin to 1.44.
* rename errors to match best practice

---------

Co-authored-by: Richard Hagen <[email protected]>
  • Loading branch information
Richard87 and Richard87 authored Nov 7, 2023
1 parent 829f390 commit 15c20d5
Show file tree
Hide file tree
Showing 9 changed files with 698 additions and 680 deletions.
4 changes: 2 additions & 2 deletions charts/radix-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: radix-operator
version: 1.24.0
appVersion: 1.44.0
version: 1.24.1
appVersion: 1.44.1
kubeVersion: ">=1.24.0"
description: Radix Operator
keywords:
Expand Down
6 changes: 3 additions & 3 deletions pipeline-runner/steps/apply_radixconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ func CreateRadixApplication(radixClient radixclient.Interface,
ra.Name = strings.ToLower(ra.Name)
}

isRAValid, errs := validate.CanRadixApplicationBeInsertedErrors(radixClient, ra)
if !isRAValid {
err = validate.CanRadixApplicationBeInserted(radixClient, ra)
if err != nil {
log.Errorf("Radix config not valid.")
return nil, errorUtils.Concat(errs)
return nil, err
}
return ra, nil
}
Expand Down
4 changes: 2 additions & 2 deletions pipeline-runner/steps/promotion.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ func (cli *PromoteStepImplementation) Run(pipelineInfo *model.PipelineInfo) erro
return err
}

isValid, err := radixvalidators.CanRadixDeploymentBeInserted(cli.GetRadixclient(), radixDeployment)
if !isValid {
err = radixvalidators.CanRadixDeploymentBeInserted(radixDeployment)
if err != nil {
return err
}

Expand Down
568 changes: 321 additions & 247 deletions pkg/apis/radixvalidators/errors.go

Large diffs are not rendered by default.

Loading

0 comments on commit 15c20d5

Please sign in to comment.