Skip to content
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

Add specific DecodeURL function in decoder package #474

Closed
dmvolod opened this issue Jan 5, 2025 · 3 comments · Fixed by #475
Closed

Add specific DecodeURL function in decoder package #474

dmvolod opened this issue Jan 5, 2025 · 3 comments · Fixed by #475
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@dmvolod
Copy link
Contributor

dmvolod commented Jan 5, 2025

What do you want to see?

As developer, I would like to have out-of the-box solution to stream documents from the URL and decode them.
Yes, most of the functions utilize io.Reader and can be wrapped, but separate specific function is much better to use.
This will help in situations where we need to install components from URL, such as Prometheus or CertManager in examples.

Extra Labels

No response

@dmvolod dmvolod added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 5, 2025
@dmvolod
Copy link
Contributor Author

dmvolod commented Jan 5, 2025

/assign

@dmvolod dmvolod changed the title Add specific DecodeURL function in decode package Add specific DecodeURL function in decoder package Jan 5, 2025
@vladimirvivien
Copy link
Contributor

Hi @dmvolod can you provide a concrete code example to help with this issue?

@dmvolod
Copy link
Contributor Author

dmvolod commented Jan 15, 2025

Hi @vladimirvivien

I would like to utilize this function in controller tests and examples as well to replace kubectl binary involving for installing/removing CertManager and Prometheus.
It would be nice to avoid using third-party tools in e2e test when possible to reduce CI images size and reduce number of problems when binaries are not found there or locally.

The code will look like this

	r, err := resources.New(cfg.Client().RESTConfig())
	if err != nil {
		return ctx, err
	}
	err = decoder.DecodeURL(
		ctx,
		certMgrUrl,
		decoder.CreateHandler(r),
	)
	if err != nil {
		return ctx, err
       }

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants