Open tylerreidwaze opened 1 year ago
/cc @karlkfi since he has expertise in this area.
Sounds like it’s working as intended. The error message is even pretty clear. ;)
I don’t think there’s really any way to do what you’re trying to do with the current design.
Ironically, I initially proposed yq as a parser, which would have allowed this. The jsonPath code can’t easily be modified to add this kind of thing.
We could hypothetically add another field to describe how to process the value, but it’d probably need to support more than just substring operations by index. Regex might work.
pattern: “(.+):\d+” value: “\1”
Regex by pattern would work for us. Anyway to extract some of the value instead of all of it really
Describe your problem
I am trying to create a Memcached Instance and a DNS Entry for that instance in a single package
I'm trying to use apply-time-mutation which will get the discoveryEndpoint of the memcached and create a DNS record for it in DNS.
The problem is the result includes the port:
And I can't find a way to split it as jsonPath doesnt let me index strings (strings aren't arrays I suppose?)
The whole object we tried as reference
This is not a massive blocker for us as Apply Time Mutations aren't supported yet in Config Sync which is the eventual consumer of this output.
Let us know if you need more information or want us to test something out. Or, if there is a more kpt native way to do this.
Thanks in advance!