-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use consumption to influence topology #777
Conversation
if err != nil { | ||
return val, err | ||
} | ||
val, err = TransformToPropertyValue(res, c.PropertyPath, val, ctx, DynamicValueData{Resource: res}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The double convert is very weird, why doesn't TransformtToPropertyValue
do this? I think it would violate the contract of what that function should do if it doesn't return a fully valid, transformed value.
What's the use-case for why this won't work in one shot with the current implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we pass it a json string, it doesnt work in one shot. Thats what im running into now, because it converts the json string to map(string,string) but it doesnt evaluate the value to see if its a property ref or resource id. We can likely fix this function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, looks like it isn't doing the right thing in MapPropertyType.Parse
. After decoding the string, it immediately returns instead of checking the sub properties.
@@ -545,3 +547,101 @@ func (r *ResourcePropertyType) ZeroValue() any { | |||
func (p *PropertyRefPropertyType) ZeroValue() any { | |||
return construct.PropertyRef{} | |||
} | |||
|
|||
func (m *MapPropertyType) Contains(value any, contains any) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is more of a subset than contains. Needs documentation too given that func(any, any)
doesn't really give any signature-related hints to what should be passed in or valid types.
uses the consumption to influence topology yaml for this point in time
Standard checks