Skip to content

Commit

Permalink
Merge branch 'main' into create-pull-request/maintenance-v1
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong authored Oct 3, 2024
2 parents 128bb73 + 1ed6d41 commit b9d6db6
Show file tree
Hide file tree
Showing 12 changed files with 385 additions and 126 deletions.
1 change: 1 addition & 0 deletions scripts/update_snapshot_results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cfn-lint test/fixtures/templates/integration/dynamic-references.yaml -e -c I --f
cfn-lint test/fixtures/templates/integration/resources-cloudformation-init.yaml -e -c I --format json > test/fixtures/results/integration/resources-cloudformation-init.json
cfn-lint test/fixtures/templates/integration/ref-no-value.yaml -e -c I --format json > test/fixtures/results/integration/ref-no-value.json
cfn-lint test/fixtures/templates/integration/availability-zones.yaml -e -c I --format json > test/fixtures/results/integration/availability-zones.json
cfn-lint test/fixtures/templates/integration/getatt-types.yaml -e -c I --format json > test/fixtures/results/integration/getatt-types.json
cfn-lint test/fixtures/templates/integration/aws-ec2-networkinterface.yaml -e -c I --format json > test/fixtures/results/integration/aws-ec2-networkinterface.json
cfn-lint test/fixtures/templates/integration/aws-ec2-instance.yaml -e -c I --format json > test/fixtures/results/integration/aws-ec2-instance.json
cfn-lint test/fixtures/templates/integration/aws-ec2-launchtemplate.yaml -e -c I --format json > test/fixtures/results/integration/aws-ec2-launchtemplate.json
Expand Down
3 changes: 3 additions & 0 deletions src/cfnlint/data/schemas/other/resources/update_policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@
"MaxBatchSize": {
"type": "integer"
},
"MinActiveInstancesPercent": {
"type": "integer"
},
"MinInstancesInService": {
"type": "integer"
},
Expand Down
24 changes: 12 additions & 12 deletions src/cfnlint/data/schemas/other/step_functions/statemachine.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
"properties": {
"ErrorEquals": {
"items": {
"types": "string"
"type": "string"
},
"type": "array"
},
Expand All @@ -303,7 +303,7 @@
"ErrorEquals",
"Next"
],
"types": "object"
"type": "object"
},
"type": "array"
},
Expand Down Expand Up @@ -418,7 +418,7 @@
},
"ErrorEquals": {
"items": {
"types": "string"
"type": "string"
},
"type": "array"
},
Expand All @@ -434,7 +434,7 @@
"required": [
"ErrorEquals"
],
"types": "object"
"type": "object"
},
"type": "array"
},
Expand Down Expand Up @@ -481,7 +481,7 @@
"properties": {
"ErrorEquals": {
"items": {
"types": "string"
"type": "string"
},
"type": "array"
},
Expand All @@ -494,7 +494,7 @@
"ErrorEquals",
"Next"
],
"types": "object"
"type": "object"
},
"type": "array"
},
Expand Down Expand Up @@ -540,7 +540,7 @@
},
"ErrorEquals": {
"items": {
"types": "string"
"type": "string"
},
"type": "array"
},
Expand All @@ -556,7 +556,7 @@
"required": [
"ErrorEquals"
],
"types": "object"
"type": "object"
},
"type": "array"
},
Expand Down Expand Up @@ -799,7 +799,7 @@
"properties": {
"ErrorEquals": {
"items": {
"types": "string"
"type": "string"
},
"type": "array"
},
Expand All @@ -812,7 +812,7 @@
"ErrorEquals",
"Next"
],
"types": "object"
"type": "object"
},
"type": "array"
},
Expand Down Expand Up @@ -880,7 +880,7 @@
},
"ErrorEquals": {
"items": {
"types": "string"
"type": "string"
},
"type": "array"
},
Expand All @@ -896,7 +896,7 @@
"required": [
"ErrorEquals"
],
"types": "object"
"type": "object"
},
"type": "array"
},
Expand Down
4 changes: 2 additions & 2 deletions src/cfnlint/jsonschema/_resolvers_cfn.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ def join(validator: Validator, instance: Any) -> ResolutionResult:
continue
try:
for value in _join_expansion(values_v, values):
yield delimiter.join(value), values_v, None
except ValueError:
yield delimiter.join([str(v) for v in value]), values_v, None
except (ValueError, TypeError):
return


Expand Down
10 changes: 7 additions & 3 deletions src/cfnlint/rules/functions/GetAtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,13 @@ def _resolve_getatt(
schema_types = ensure_list(getatt_schema.get("type"))
types = ensure_list(s.get("type"))

if is_types_compatible(
types, schema_types, validator.context.strict_types
):
# GetAtt type checking is strict.
# It must match in all cases
if any(t in ["boolean", "integer", "boolean"] for t in types):
# this should be switched to validate the value of the
# property if it was available
continue
if is_types_compatible(types, schema_types, True):
continue

reprs = ", ".join(repr(type) for type in types)
Expand Down
5 changes: 1 addition & 4 deletions src/cfnlint/rules/outputs/Value.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ def validate(self, validator: Validator, _: Any, instance: Any, schema: Any):
for err in validator.descend(
value,
schema={
"type": ["array", "string"],
"items": {
"type": "string",
},
"type": ["string"],
},
path=key,
property_path=key,
Expand Down
Loading

0 comments on commit b9d6db6

Please sign in to comment.