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

Support setting addons from environmental variables #11469

Merged
merged 3 commits into from
May 26, 2021

Conversation

tangledbytes
Copy link
Contributor

Signed-off-by: Utkarsh Srivastava srivastavautkarsh8097@gmail.com

This PR fixes #11171

Description
This PR adds support for setting addons from environmental variables (along with flags).

Examples:

  1. minikube start --addons=registry,olm - will populate the addons list with "registry" and "olm" addons.
  2. MINIKUBE_ADDONS="registry olm" minikube start - will populate the addons list with "registry" and "olm" addons.
  3. MINIKUBE_ADDONS="registry olm" minikube start --addons=registry - will populate the addons list with "registry" addon only as the flag will take precedence.

Note For Reviewers
A global variable called addonList was removed as it was no longer getting referenced in the code. Instead of using the global variable, viper.GetStringSlice() is used.

Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com>
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 20, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @Utkarsh-pro!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @Utkarsh-pro. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 20, 2021
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com>
@@ -56,6 +56,8 @@ const (
AddonImages = "addon-images"
// AddonRegistries stores custom addon images config
AddonRegistries = "addon-registries"
// AddonList represents the key for addons parameter
AddonList = "addons"
Copy link
Member

Choose a reason for hiding this comment

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

lets change this to something obvious that it is the flag name how about "AddonListFlag"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that makes sense. Making the changes, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done @medyagh 😄

Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com>
@medyagh
Copy link
Member

medyagh commented May 21, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 21, 2021
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 11469) |
+----------------+----------+---------------------+
| minikube start | 47.2s    | 46.5s               |
| enable ingress | 37.1s    | 38.3s               |
+----------------+----------+---------------------+

Times for minikube start: 49.5s 45.7s 49.4s 45.9s 45.7s
Times for minikube (PR 11469) start: 46.7s 45.9s 45.8s 46.6s 47.3s

Times for minikube (PR 11469) ingress: 42.3s 35.2s 35.7s 35.3s 42.8s
Times for minikube ingress: 42.8s 36.7s 36.3s 33.8s 35.8s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 11469) |
+----------------+----------+---------------------+
| minikube start | 22.2s    | 21.5s               |
| enable ingress | 35.9s    | 34.2s               |
+----------------+----------+---------------------+

Times for minikube ingress: 37.5s 38.5s 34.5s 34.0s 35.0s
Times for minikube (PR 11469) ingress: 33.5s 34.0s 33.0s 35.5s 35.0s

Times for minikube start: 22.9s 21.5s 21.8s 22.3s 22.5s
Times for minikube (PR 11469) start: 22.3s 21.4s 21.8s 20.8s 21.4s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 11469) |
+----------------+----------+---------------------+
| minikube start | 43.3s    | 44.6s               |
| enable ingress |          |                     |
+----------------+----------+---------------------+

Times for minikube start: 31.2s 46.8s 44.1s 47.4s 47.2s
Times for minikube (PR 11469) start: 42.6s 47.4s 43.2s 42.1s 47.5s

@tangledbytes
Copy link
Contributor Author

@medyagh I am not sure why the test is failing. On checking the logs, it says that TestRunningBinaryUpgrade test failed however the same test is passing on my system (OS = linux).

I ran make integration -e TEST_ARGS="-test.run TestRunningBinaryUpgrade" and here are the logs:

go test -ldflags="-X k8s.io/minikube/pkg/version.version=v1.20.0 -X k8s.io/minikube/pkg/version.isoVersion=v1.20.0 -X k8s.io/minikube/pkg/version.gitCommitID="aa99526399ac54f1c96f9bbf4d038020b5590ada" -X k8s.io/minikube/pkg/version.storageProvisionerVersion=v5" -v -test.timeout=90m ./test/integration --tags="integration " -test.run TestRunningBinaryUpgrade 2>&1 | tee "./out/testout_aa9952639.txt"
Found 4 cores, limiting parallelism with --test.parallel=2
=== RUN   TestRunningBinaryUpgrade
=== PAUSE TestRunningBinaryUpgrade
=== CONT  TestRunningBinaryUpgrade
    version_upgrade_test.go:119: (dbg) Run:  /tmp/minikube-v1.6.2.755056463.exe start -p running-upgrade-20210522103803-5921 --memory=2200 
    version_upgrade_test.go:119: (dbg) Done: /tmp/minikube-v1.6.2.755056463.exe start -p running-upgrade-20210522103803-5921 --memory=2200 : (2m13.352172608s)
    version_upgrade_test.go:129: (dbg) Run:  out/minikube start -p running-upgrade-20210522103803-5921 --memory=2200 --alsologtostderr -v=1 
    version_upgrade_test.go:129: (dbg) Done: out/minikube start -p running-upgrade-20210522103803-5921 --memory=2200 --alsologtostderr -v=1 : (1m19.744563419s)
    helpers_test.go:171: Cleaning up "running-upgrade-20210522103803-5921" profile ...
    helpers_test.go:174: (dbg) Run:  out/minikube delete -p running-upgrade-20210522103803-5921
    helpers_test.go:174: (dbg) Done: out/minikube delete -p running-upgrade-20210522103803-5921: (1.495151825s)
--- PASS: TestRunningBinaryUpgrade (221.33s)
PASS
Tests completed in 3m41.33507884s (result code 0)
ok      k8s.io/minikube/test/integration        221.383s

@tangledbytes
Copy link
Contributor Author

/retest

@medyagh
Copy link
Member

medyagh commented May 24, 2021

@Utkarsh-pro failures dont seem to be related to your PR

@tangledbytes
Copy link
Contributor Author

@medyagh is there something that needs to be done to move this PR ahead?

@medyagh medyagh merged commit b1ce37b into kubernetes:master May 26, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh, utkarsh-pro

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 May 26, 2021
@medyagh
Copy link
Member

medyagh commented May 26, 2021

thank you @Utkarsh-pro for this PR look forward to see more more contributions form you ! maybe our other flags needs to be fixed too on ENV var?

@tangledbytes
Copy link
Contributor Author

thank you @Utkarsh-pro for this PR look forward to see more more contributions form you ! maybe our other flags needs to be fixed too on ENV var?

@medyagh, I would love to add support for environmental variables to other flags! Do we need this support in all of the flags?

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MINIKUBE_ADDONS environment variable ignored
5 participants