Skip to content

Commit

Permalink
fix: optional attr min and max validation generation (#91)
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <xpf6677@163.com>
  • Loading branch information
Peefy authored Jun 20, 2024
1 parent 9db7670 commit d8d845c
Show file tree
Hide file tree
Showing 12 changed files with 6,927 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ schema SourcesKnativeDevV1alpha1GitHubSourceSpecCeOverrides:


check:
all _, extensions in extensions {len(extensions) >= 1 }
all _, extensions in extensions {len(extensions) >= 1 if extensions not in [None, Undefined] }


schema SourcesKnativeDevV1alpha1GitHubSourceSpecSecretToken:
Expand Down Expand Up @@ -208,7 +208,7 @@ schema SourcesKnativeDevV1alpha1GitHubSourceSpecSinkRef:
len(apiVersion) >= 1
len(kind) >= 1
len(name) >= 1
len(namespace) >= 1
len(namespace) >= 1 if namespace


schema SourcesKnativeDevV1alpha1GitHubSourceStatus:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ schema KarpenterK8sAwsV1beta1EC2NodeClassSpec:


check:
len(amiSelectorTerms) <= 30
len(blockDeviceMappings) <= 50
len(amiSelectorTerms) <= 30 if amiSelectorTerms
len(blockDeviceMappings) <= 50 if blockDeviceMappings
len(securityGroupSelectorTerms) <= 30
len(subnetSelectorTerms) <= 30

Expand Down Expand Up @@ -239,8 +239,8 @@ schema KarpenterK8sAwsV1beta1EC2NodeClassSpecMetadataOptions:


check:
httpPutResponseHopLimit <= 64
httpPutResponseHopLimit >= 1
httpPutResponseHopLimit <= 64 if httpPutResponseHopLimit not in [None, Undefined]
httpPutResponseHopLimit >= 1 if httpPutResponseHopLimit not in [None, Undefined]


schema KarpenterK8sAwsV1beta1EC2NodeClassSpecSecurityGroupSelectorTermsItems0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ schema AcidZalanDoV1OperatorConfigurationConfiguration:


check:
max_instances >= -1
min_instances >= -1
workers >= 1
max_instances >= -1 if max_instances not in [None, Undefined]
min_instances >= -1 if min_instances not in [None, Undefined]
workers >= 1 if workers not in [None, Undefined]


schema AcidZalanDoV1OperatorConfigurationConfigurationAwsOrGcp:
Expand Down Expand Up @@ -298,7 +298,7 @@ schema AcidZalanDoV1OperatorConfigurationConfigurationConnectionPooler:
regex_match(str(connection_pooler_default_cpu_request), r"^(\d+m|\d+(\.\d{1,3})?)$") if connection_pooler_default_cpu_request
regex_match(str(connection_pooler_default_memory_limit), r"^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$") if connection_pooler_default_memory_limit
regex_match(str(connection_pooler_default_memory_request), r"^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$") if connection_pooler_default_memory_request
connection_pooler_number_of_instances >= 1
connection_pooler_number_of_instances >= 1 if connection_pooler_number_of_instances not in [None, Undefined]


schema AcidZalanDoV1OperatorConfigurationConfigurationDebug:
Expand Down
Loading

0 comments on commit d8d845c

Please sign in to comment.