-
Notifications
You must be signed in to change notification settings - Fork 43
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
Get URL via Sonolark #141
Comments
Consider using https://github.com/pcj/starlark-go-nethttp |
That package seems like it would do what we need; it also would be the first case where we are pulling in another starlark module that uses Once we do that we'd be ready to repeat for other libs. The question would be do we want to translate to the k14s ones or vice versa? I think at first we can translate to k14s since thats less work (since we use that type currently) but if we find we keep pulling in more libraries then we can consider switching. |
I'm going to try and take this on now. Right now working on this but the main problem is that the repo above uses the default starlark go but we use the ytt fork. When importing it, I was hoping I could use the go.mod replace directive to tell it to use the ytt starlark library (and my IDE actually likes this OK) but the other go tools for build/tidy wont work. This is a known issue golang/go#26904 and may be resolved in go 1.19 Going to have to think how to work around this. We may need to manually copy the code and edit the import paths. |
- Incorporates a new library for http calls - Library uses core sonolark instead of ytt sonolark types so a new set of types/functions made to wrap them appropriately. - Consider extracting out these types into their own repo in the future since it would be of benefit to other starlark/ytt users Fixes #141 Signed-off-by: John Schnake <[email protected]>
In my case I want to check a response code, but you may also want to just GET a resource too.
You can do this in python in general with the requests package but requires exception handling and importing a package. This should be easier on users so they can simply write:
The text was updated successfully, but these errors were encountered: