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

feat: envtest setup via target with docs (v3 only) #1626

Merged
merged 1 commit into from
Aug 28, 2020

Conversation

camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented Aug 5, 2020

Description

Motivation

# move to a long-term location and put it on your path
# (you'll need to set the KUBEBUILDER_ASSETS env var if you put it somewhere else)
sudo mv /tmp/kubebuilder_2.3.1_${os}_${arch} /usr/local/kubebuilder
export PATH=$PATH:/usr/local/kubebuilder/bin

(*) It will just be 100% solved when the v2 is no longer supported since it shows that would be a breaking change for v2.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 5, 2020
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 5, 2020
@camilamacedo86 camilamacedo86 changed the title feat: envtest setup with docs per project wip: feat: envtest setup with docs per project Aug 5, 2020
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 5, 2020
@camilamacedo86
Copy link
Member Author

/test pull-kubebuilder-e2e-k8s-1-17-0

@camilamacedo86 camilamacedo86 changed the title wip: feat: envtest setup with docs per project feat: envtest setup with docs per project Aug 5, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 5, 2020
@camilamacedo86 camilamacedo86 changed the title feat: envtest setup with docs per project feat: envtest setup via target with docs (v3 only) Aug 5, 2020
@camilamacedo86
Copy link
Member Author

c/c @vincepri

Copy link
Contributor

@gabbifish gabbifish left a 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!

docs/book/src/quick-start.md Outdated Show resolved Hide resolved
docs/book/src/quick-start.md Outdated Show resolved Hide resolved

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link needed.

Copy link
Member Author

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.

docs/book/src/quick-start.md Outdated Show resolved Hide resolved
Copy link
Contributor

@estroz estroz left a 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
Copy link
Member Author

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 ^

Copy link
Contributor

@gabbifish gabbifish left a 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!

@@ -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:
Copy link
Contributor

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.

Suggested change
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:

<aside class="note">
<h1>Kubernetes binaries</h1>

The above setup is no longer required if you are using plugin version `v3+.
Copy link
Contributor

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.

Comment on lines 56 to 57
var err error
cfg, err = testenv.Start()
Copy link
Contributor

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

Suggested change
var err error
cfg, err = testenv.Start()
cfg, err := testenv.Start()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good cather.

@pwittrock
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 28, 2020
@k8s-ci-robot
Copy link
Contributor

[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:
  • OWNERS [camilamacedo86,pwittrock]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants