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

cannot specify ControlPlane in envtest.Environment #875

Closed
ixdy opened this issue Mar 25, 2020 · 11 comments · Fixed by #929
Closed

cannot specify ControlPlane in envtest.Environment #875

ixdy opened this issue Mar 25, 2020 · 11 comments · Fixed by #929
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Milestone

Comments

@ixdy
Copy link

ixdy commented Mar 25, 2020

I think this issue is similar to #841.

We have some code using envtest.Environment that has used the ControlPlane field to specify arguments for the APIServer and Etcd components:

After sigs.k8s.io/testing_frameworks/integration was moved into pkg/internal/testing/integration in #714, we can no longer do this:

use of internal package sigs.k8s.io/controller-runtime/pkg/internal/testing/integration not allowed

Is there a better way to be achieving this? Or was this unintentional?

@rajathagasthya
Copy link
Contributor

This just needs a release. It was fixed in #846.

cc @DirectXMan12

@ixdy
Copy link
Author

ixdy commented Mar 25, 2020

@rajathagasthya no, this issue is different; #846 doesn't fix it.

We explicitly want to specify things like the apiserver host/port and etcd host/port.

We had been doing something like

env := &envtest.Environment {
  ControlPlane: &integration.ControlPlane{
    APIServer: &integration.APIServer{
      URL: apiserverURL,
      EtcdURL: etcdURL,
    },
    Etcd: &integration.Etcd{
      URL: etcdURL,
    },
  },
}

etc.

We can no longer do that, since integration.ControlPlane, integration.APIServer, and integration.Etcd are all in an internal package now.

@ixdy
Copy link
Author

ixdy commented Mar 25, 2020

Or for another example, we can't do something like this anymore:

myEtcd, myAPIServer :=
&integration.Etcd{StartTimeout: 15 * time.Second},
&integration.APIServer{StopTimeout: 16 * time.Second}
controlPlane = &integration.ControlPlane{
Etcd: myEtcd,
APIServer: myAPIServer,
}

@rajathagasthya
Copy link
Contributor

Ah, sorry. I conflated this with the apiserver flags breakage. I don't think integration testing package should be in an internal package since many things there are customizable in an envtest environment. There are multiple breakages to envtest when testing framework was brought into controller-runtime and put into internal package.

@ixdy
Copy link
Author

ixdy commented Mar 27, 2020

cc @hoegaarden

Was this intentionally put under pkg/internal in #749?

@DirectXMan12
Copy link
Contributor

agreed here -- those types shouldn't be internal. Sorry about that. I think all the shuffling around got things lost in translation.

@DirectXMan12
Copy link
Contributor

FWIW, I think the intention was that some of the internal helpers were supposed to be in internal, while the public types stayed exposed externally. The goal was to eventually unify our Environment with th e testing-frameworks config to avoid duplication, but we're not there yet, so re-exposing those types seems like a good idea.

@DirectXMan12
Copy link
Contributor

/good-first-issue

should be an easy fix -- just re-export these types.

@k8s-ci-robot
Copy link
Contributor

@DirectXMan12:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

/good-first-issue

should be an easy fix -- just re-export these types.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Apr 20, 2020
@DirectXMan12
Copy link
Contributor

/priority critical-urgent
/kind bug

@k8s-ci-robot k8s-ci-robot added priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. kind/bug Categorizes issue or PR as related to a bug. labels Apr 20, 2020
@DirectXMan12 DirectXMan12 added this to the v0.6.0 milestone Apr 20, 2020
@dmvolod
Copy link
Contributor

dmvolod commented Apr 25, 2020

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Projects
None yet
5 participants