Repository navigation
add getHostByName function to resolve dns names to ips - #173
Conversation
|
Any chance I get feedback on this? |
mattfarina
left a comment
There was a problem hiding this comment.
Note, in the future if more network functions are created the file for them should be renamed.
mattfarina
left a comment
There was a problem hiding this comment.
Two pieces of feedback:
- Can you name the file
network.goandnetwork_test.go - Can you update the documentation to include this function
Thanks for the feedback!! Done! |
| @@ -0,0 +1,11 @@ | |||
| # Network Functions | |||
|
|
|||
| Sprig has a number of string manipulation functions. | |||
There was a problem hiding this comment.
Looks like a copy and paste error. This is the network functions not the string ones.
| "net" | ||
| ) | ||
|
|
||
| func getHostByName(name string) (string, error) { |
There was a problem hiding this comment.
I'm sorry I didn't catch this before but returning an error has some consequences. It stops execution of the template where it is at and returns an error from Execute. You can see an example with this function at https://play.golang.org/p/d1f0BridbDc.
For sprig v3 we are going to add error handling via #132 and expanding it to cover any others.
Would you mind ignoring the error for now and we'll add that back when we have a consistent setup for both with and without error handling at that level.
For what it's worth, v3 is coming this month.
There was a problem hiding this comment.
Sure no problem at all!! :). I'll ignore the error
There was a problem hiding this comment.
I'll remove error catching from the test as well
|
@mattfarina it seems one of the build steps failed due to a connectivity issue towards github.comm can we re-trigger the job? I didn't find the way to do it |
|
re-running that test |
|
The testing error is due to the |
|
Thanks @mattfarina!! |
Hi guys!
This is a proposal to add a function to resolve names to IPs. I'm a heavy user of helm and this is useful where you need to render an IP but you don't want to hardcode it in your templates.
What do you think?