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

envtest: expose CRDInstallOptions via Environment #541

Closed
rajathagasthya opened this issue Jul 26, 2019 · 0 comments · Fixed by #544
Closed

envtest: expose CRDInstallOptions via Environment #541

rajathagasthya opened this issue Jul 26, 2019 · 0 comments · Fixed by #544

Comments

@rajathagasthya
Copy link
Contributor

This is related to #481. Currently, there is no way to specify CRDInstallOptions using envtest.Environment, which means you need to workaround like this:

cfg, _ := t.Start()

_, err := envtest.InstallCRDs(cfg, envtest.CRDInstallOptions{
	Paths: []string{
		filepath.Join("..", "..", "..", "test", "integration", "crds"),
	},
	ErrorIfPathMissing: true,
})

But even with this workaround there is no way to control CRD install timeout/interval fields that are part of CRDInstallOptions since they are not exported (hitting an error with CRD install timing out and default timeout is too small):

// maxTime is the max time to wait
maxTime time.Duration
// pollInterval is the interval to check
pollInterval time.Duration

So at the very least making those fields exported would be good. Another (better?) solution would be to just include CRDInstallOptions as a field of Environment struct and deprecate CRDs and CRDDirectoryPaths fields since they are already part of CRDInstallOptions struct.

I'm happy to help with a PR if you think this is feasible!

@rajathagasthya rajathagasthya changed the title envtest: export CRDInstallOptions via Environment envtest: expose CRDInstallOptions via Environment Jul 26, 2019
rajathagasthya added a commit to rajathagasthya/controller-runtime that referenced this issue Jul 28, 2019
This change provides better control for installing CRDs in `envtest`.

Fixes kubernetes-sigs#541
rajathagasthya added a commit to rajathagasthya/controller-runtime that referenced this issue Jul 28, 2019
This change provides better control for installing CRDs in `envtest`.

Fixes kubernetes-sigs#541
rajathagasthya added a commit to rajathagasthya/controller-runtime that referenced this issue Jul 28, 2019
This change provides better control for installing CRDs in `envtest`.

Closes kubernetes-sigs#541
rajathagasthya added a commit to rajathagasthya/controller-runtime that referenced this issue Jul 28, 2019
This change provides better control for installing CRDs in `envtest`.

Addresses kubernetes-sigs#541
rajathagasthya added a commit to rajathagasthya/controller-runtime that referenced this issue Aug 19, 2019
This change provides better control for installing CRDs in `envtest`.

Addresses kubernetes-sigs#541
rajathagasthya added a commit to rajathagasthya/controller-runtime that referenced this issue Aug 20, 2019
This change provides better control for installing CRDs in `envtest`.

Addresses kubernetes-sigs#541
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant