Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Only set ConstraintTemplate's status.created on success (#2208)
* fix: clean up error consts in constrainttemplate controller Signed-off-by: Viktor Oreshkin <imselfish@stek29.rocks> * fix: only set CT status.created on success Only set ConstraintTemplate status.created to true if at least one ConstraintTemplatePodStatus had no errors Fixes #2053 Signed-off-by: Viktor Oreshkin <imselfish@stek29.rocks> * fix: add tests for CT status.created Signed-off-by: Viktor Oreshkin <imselfish@stek29.rocks> * style: const for a constraint name in tests Signed-off-by: Viktor Oreshkin <imselfish@stek29.rocks>
- Loading branch information
Showing
4 changed files
with
100 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
package constrainttemplate | ||
|
||
// ErrCreateCode indicates a problem creating a ConstraintTemplate. | ||
const ErrCreateCode = "create_error" | ||
|
||
// ErrIngestCode indicates a problem creating a ConstraintTemplate. | ||
const ErrIngestCode = "ingest_error" | ||
const ( | ||
// ErrCreateCode indicates a problem creating a ConstraintTemplate CRD. | ||
ErrCreateCode = "create_error" | ||
// ErrUpdateCode indicates a problem updating a ConstraintTemplate CRD. | ||
ErrUpdateCode = "update_error" | ||
// ErrConversionCode indicates a problem converting a ConstraintTemplate CRD. | ||
ErrConversionCode = "conversion_error" | ||
// ErrIngestCode indicates a problem ingesting a ConstraintTemplate Rego code. | ||
ErrIngestCode = "ingest_error" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters