Skip to content

Commit 454a4b1

Browse files
committed
add additional CRD CEL String length validations
1 parent 1f7bd23 commit 454a4b1

6 files changed

Lines changed: 7 additions & 7 deletions

File tree

operator/src/main/java/it/aboutbits/postgresql/core/ClusterReference.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
public class ClusterReference {
1414
@Required
1515
@ValidationRule(
16-
value = "self.size() > 0",
16+
value = "self.trim().size() > 0",
1717
message = "The ClusterReference name must not be empty."
1818
)
1919
private String name = "";

operator/src/main/java/it/aboutbits/postgresql/core/SecretRef.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
public class SecretRef {
1414
@Required
1515
@ValidationRule(
16-
value = "self.size() > 0",
16+
value = "self.trim().size() > 0",
1717
message = "The SecretRef name must not be empty."
1818
)
1919
private String name = "";

operator/src/main/java/it/aboutbits/postgresql/crd/clusterconnection/ClusterConnectionSpec.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
public class ClusterConnectionSpec {
1919
@Required
2020
@ValidationRule(
21-
value = "self.size() > 0",
21+
value = "self.trim().size() > 0",
2222
message = "The ClusterConnection host must not be empty."
2323
)
2424
private String host = "";
@@ -30,7 +30,7 @@ public class ClusterConnectionSpec {
3030

3131
@Required
3232
@ValidationRule(
33-
value = "self.size() > 0",
33+
value = "self.trim().size() > 0",
3434
message = "The ClusterConnection database must not be empty."
3535
)
3636
private String database = "postgres";

operator/src/main/java/it/aboutbits/postgresql/crd/database/DatabaseSpec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class DatabaseSpec {
2222
message = "The Database name is immutable. Allowing to rename the Database name using 'alter database <old_name> rename to <new_name>' would add unwanted side-effects to the Operator."
2323
)
2424
@ValidationRule(
25-
value = "self.size() > 0",
25+
value = "self.trim().size() > 0",
2626
message = "The Database name must not be empty."
2727
)
2828
private String name = "";

operator/src/main/java/it/aboutbits/postgresql/crd/role/RoleSpec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class RoleSpec {
2727
message = "The Role name is immutable. Allowing to rename the Role name using 'alter role <old_name> rename to <new_name>' would add unwanted side-effects to the Operator."
2828
)
2929
@ValidationRule(
30-
value = "self.size() > 0",
30+
value = "self.trim().size() > 0",
3131
message = "The Role name must not be empty."
3232
)
3333
private String name = "";

operator/src/main/java/it/aboutbits/postgresql/crd/schema/SchemaSpec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class SchemaSpec {
2222
message = "The Schema name is immutable. Allowing to rename the Schema name using 'alter schema <old_name> rename to <new_name>' would add unwanted side-effects to the Operator."
2323
)
2424
@ValidationRule(
25-
value = "self.size() > 0",
25+
value = "self.trim().size() > 0",
2626
message = "The Schema name must not be empty."
2727
)
2828
private String name = "";

0 commit comments

Comments
 (0)