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

be a bit more verbose on a required KUBECONFIG env var #404

Merged

Conversation

ArangoGutierrez
Copy link
Contributor

throw an error message before running e2e-test if KUBECONFIG is not defined

Signed-off-by: Carlos Eduardo Arango Gutierrez carangog@redhat.com

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 24, 2020
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 24, 2020
@ArangoGutierrez
Copy link
Contributor Author

/assign @marquiz

Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

Nit about the commit message subject: I'd suggest to start with a "context" (i.e. Makefile:) in order to better describe where this change applies to, i.e. have something like
Makefile: require KUBECONFIG to be specified for e2e-test target

Makefile Outdated
@@ -113,7 +113,8 @@ test:
$(GO_CMD) test ./cmd/... ./pkg/...

e2e-test:
$(GO_CMD) test -v ./test/e2e/ -args -nfd.repo=$(IMAGE_REPO) -nfd.tag=$(IMAGE_TAG_NAME) -kubeconfig=$(KUBECONFIG) -nfd.e2e-config=$(E2E_TEST_CONFIG) -ginkgo.focus="\[NFD\]"
@if [ -z ${KUBECONFIG} ]; then echo "[ERR] KUBECONFIG missing, must be defined" && exit 1; fi
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: use ; instead of && between echo and exit

@ArangoGutierrez
Copy link
Contributor Author

Also just noted, I got to do the 404 pun !!! PR not found LOL

Makefile Outdated
@@ -113,7 +113,8 @@ test:
$(GO_CMD) test ./cmd/... ./pkg/...

e2e-test:
$(GO_CMD) test -v ./test/e2e/ -args -nfd.repo=$(IMAGE_REPO) -nfd.tag=$(IMAGE_TAG_NAME) -kubeconfig=$(KUBECONFIG) -nfd.e2e-config=$(E2E_TEST_CONFIG) -ginkgo.focus="\[NFD\]"
@if [ -z ${KUBECONFIG} ]; then echo "[ERR] KUBECONFIG missing, must be defined"; exit 1; fi
$(GO_CMD) test -v ./test/e2e/ -args -nfd.repo=$(IMAGE_REPO) -nfd.tag=$(IMAGE_TAG_NAME) -kubeconfig=$(KUBECONFIG) -nfd.e2e-config=$(E2E_TEST_CONFIG) -ginkgo.focus="\[NFD\]"; \
Copy link
Contributor

Choose a reason for hiding this comment

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

Ach, I forgot this from the previous review: you shouldn't need to change this line (this ; \ is unnecessary)

Otherwise looks good

@ArangoGutierrez ArangoGutierrez force-pushed the kubeconfig_env_e2e branch 3 times, most recently from 5394f02 to 3b2b312 Compare November 24, 2020 19:03
Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

Some nits.

Plus drop bin/nfd-master and bin/nfd-worker from the patch(!) Maybe we should add bin/ to gitignore...

Makefile Outdated
@@ -113,7 +113,8 @@ test:
$(GO_CMD) test ./cmd/... ./pkg/...

e2e-test:
$(GO_CMD) test -v ./test/e2e/ -args -nfd.repo=$(IMAGE_REPO) -nfd.tag=$(IMAGE_TAG_NAME) -kubeconfig=$(KUBECONFIG) -nfd.e2e-config=$(E2E_TEST_CONFIG) -ginkgo.focus="\[NFD\]"
@if [ -z ${KUBECONFIG} ]; then echo "[ERR] KUBECONFIG missing, must be defined"; exit 1; fi
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: double-space before exit

Makefile Outdated
@@ -113,7 +113,8 @@ test:
$(GO_CMD) test ./cmd/... ./pkg/...

e2e-test:
$(GO_CMD) test -v ./test/e2e/ -args -nfd.repo=$(IMAGE_REPO) -nfd.tag=$(IMAGE_TAG_NAME) -kubeconfig=$(KUBECONFIG) -nfd.e2e-config=$(E2E_TEST_CONFIG) -ginkgo.focus="\[NFD\]"
@if [ -z ${KUBECONFIG} ]; then echo "[ERR] KUBECONFIG missing, must be defined"; exit 1; fi
$(GO_CMD) test -v ./test/e2e/ -args -nfd.repo=$(IMAGE_REPO) -nfd.tag=$(IMAGE_TAG_NAME) -kubeconfig=$(KUBECONFIG) -nfd.e2e-config=$(E2E_TEST_CONFIG) -ginkgo.focus="\[NFD\]"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove trailing whitespace from the end of the line

@marquiz
Copy link
Contributor

marquiz commented Nov 24, 2020

Maybe we should add bin/ to gitignore...

#405

Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

Please squash into one oneliner patch, and, rebase on top of latest master. Gitignore was already updated in #405 so no need to touch that

@ArangoGutierrez
Copy link
Contributor Author

Please squash into one oneliner patch, and, rebase on top of latest master. Gitignore was already updated in #405 so no need to touch that

Done

This Patch adds a check on make target e2e-test, to check if the
KUBECONFIG env var is set before running the test suite.

if not pressent return a valid error message.

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

Thanks @ArangoGutierrez

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ArangoGutierrez, marquiz

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 25, 2020
@k8s-ci-robot k8s-ci-robot merged commit 42d3fa1 into kubernetes-sigs:master Nov 25, 2020
@marquiz marquiz mentioned this pull request Dec 3, 2020
15 tasks
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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants