Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions acto/input/k8s_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ def match(self, schema) -> bool:
return any(
self.match(sub_schema) for sub_schema in schema.possibilities
)
elif (
"format" in self.schema_spec
and self.schema_spec["format"] == "int-or-string"
):
return isinstance(schema, (StringSchema, IntegerSchema))
else:
return isinstance(schema, StringSchema)

Expand Down
8 changes: 8 additions & 0 deletions acto/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@

if "type" not in schema:
if "properties" in schema:
return ObjectSchema(path, schema)

Check warning on line 27 in acto/schema/schema.py

View workflow job for this annotation

GitHub Actions / coverage-report

Missing coverage

Missing coverage on line 27
elif (
"x-kubernetes-int-or-string" in schema
and schema["x-kubernetes-int-or-string"]
):
# Special case for Kubernetes int-or-string type
# Treated with integer semantics
# The K8s schema matcher also specifically handles this case
return IntegerSchema(path, schema)
else:
logger.warning("No type found in schema: %s", str(schema))
return OpaqueSchema(path, schema)
Expand Down
Loading
Loading