-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat: envtest setup via target with docs (v3 only) #1626
Conversation
/test pull-kubebuilder-e2e-k8s-1-17-0 |
c/c @vincepri |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment, otherwise LGTM!
|
||
For projects built with `v3+`, these binaries and configuration is done via the `test` makefile target. It will create the `testbin/` directory where the binaries will be downloaded. | ||
|
||
You can use environment variables and/or flags to specify the `kubectl`,`api-server` and `etcd` setup within your integration tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @estroz,
I did not get what link should be added here? This text was not changed at all and it is added because bellow it has the envvar/flags details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The makefile target makes sense. Docs need some work though
@@ -40,6 +40,9 @@ const ( | |||
ControllerToolsVersion = "v0.3.0" | |||
// KustomizeVersion is the kubernetes-sigs/kustomize version to be used in the project | |||
KustomizeVersion = "v3.5.4" | |||
// todo: update the tag release when the next version of the project be released with this script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@estroz your suggestion is applied here ^
1681e74
to
bbf17a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some additional comments/mostly nits, let me know what you think!
docs/book/src/quick-start.md
Outdated
@@ -25,19 +25,29 @@ arch=$(go env GOARCH) | |||
|
|||
# download kubebuilder and extract it to tmp | |||
curl -L https://go.kubebuilder.io/dl/2.3.1/${os}/${arch} | tar -xz -C /tmp/ | |||
``` | |||
|
|||
You must configure the Kubernetes binaries required for the [envtest][envtest], run: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we move the The above setup is no longer required if you are using plugin version
v3+.` comment from below up here? E.g.
You must configure the Kubernetes binaries required for the [envtest][envtest], run: | |
If you are using a kubebuilder version less than version `v3+`, you must configure the Kubernetes binaries required for the [envtest][envtest], run: |
docs/book/src/quick-start.md
Outdated
<aside class="note"> | ||
<h1>Kubernetes binaries</h1> | ||
|
||
The above setup is no longer required if you are using plugin version `v3+. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the comment above, we could probably delete this new section.
docs/book/src/reference/envtest.md
Outdated
var err error | ||
cfg, err = testenv.Start() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: how do you feel about using the following instead, it's slightly less verbose
var err error | |
cfg, err = testenv.Start() | |
cfg, err := testenv.Start() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good cather.
d059329
to
8b593e4
Compare
8b593e4
to
22d9b48
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, pwittrock The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
scripts/setup_envtest_bins.sh
added in feat: add script in the repo to setup envtest #1608 in favor to use the https://github.com/kubernetes-sigs/controller-runtime/blob/master/hack/setup-envtest.sh Ignore test #1092Motivation
/usr/local/
since it is only used by it. (IMO not good requires by default root permission too to follow the quickstart )(*) It will just be 100% solved when the v2 is no longer supported since it shows that would be a breaking change for v2.