Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
Fix issue with panic on function not resolving (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen Rumney authored Nov 11, 2021
1 parent 2c71997 commit 411f34c
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions internal/app/cfsec/parser/intrinsics.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,24 @@ var intrinsicFuncs map[string]func(property *Property) (*Property, bool)

func init() {
intrinsicFuncs = map[string]func(property *Property) (*Property, bool){
"Ref": ResolveReference,
"Fn::Base64": ResolveBase64,
"Fn::Equals": ResolveEquals,
"Fn::Join": ResolveJoin,
"Fn::Split": ResolveSplit,
"Fn::Sub": ResolveSub,
"Fn::FindInMap": ResolveFindInMap,
"Fn::Select": ResolveSelect,
"Fn::GetAtt": ResolveGetAtt,
"Fn::GetAZs": GetAzs,
"Fn::Cidr": GetCidr,
"Ref": ResolveReference,
"Fn::Base64": ResolveBase64,
"Fn::Equals": ResolveEquals,
"Fn::Join": ResolveJoin,
"Fn::Split": ResolveSplit,
"Fn::Sub": ResolveSub,
"Fn::FindInMap": ResolveFindInMap,
"Fn::Select": ResolveSelect,
"Fn::GetAtt": ResolveGetAtt,
"Fn::GetAZs": GetAzs,
"Fn::Cidr": GetCidr,
"Fn::ImportValue": PassthroughResolution,
// "Fn::If": PassthroughResolution,
}
}

func PassthroughResolution(property *Property) (*Property, bool) {
return property, true
return property, false
}

func IsIntrinsicFunc(node *yaml.Node) bool {
Expand Down

0 comments on commit 411f34c

Please sign in to comment.