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

Add addon enablement to start #6440

Merged
merged 11 commits into from
Feb 1, 2020

Conversation

tstromberg
Copy link
Contributor

@tstromberg tstromberg commented Jan 30, 2020

This PR explicitly enables addons on startup, in lieu of there being an addon-manager to do so.

There is a new line emitted during startup:

🚀  Launching Kubernetes ... 
🌟  Enabling addons: storage-provisioner, default-storageclass
⌛  Waiting for cluster to come online ...

Behavior changes

There is also a behavioral change: if an addon is enabled/disabled, and you attempt to enable it again, it will run the underlying kubectl command. It should still be idempotent.

I expect this will add ~1 second to our start time, but it does restore the previous behavior.

API changes

The addons package has a new function to handle startup logic: addons.Start(). This obsoletes what was in start.go:enableAddons() and files.go:AddAddons()

To improve testing, the following public functions now take a profile name:

  • addon.IsEnabled()
  • cluster.IsHostRunning()

Fixes #6363

@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 Jan 30, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tstromberg

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 Jan 30, 2020
@priyawadhwa
Copy link

LGTM, looks like there's a unit test failure:

--- FAIL: TestEnableAndDisableAddon (0.00s)
    --- FAIL: TestEnableAndDisableAddon/test_enable (0.00s)
        addons_test.go:100: Disable returned unexpected error: running callbacks: [get the addon status: stat /home/travis/.minikube/profiles/config.json: no such file or directory]
    --- FAIL: TestEnableAndDisableAddon/test_disable (0.00s)
        addons_test.go:100: Disable returned unexpected error: running callbacks: [get the addon status: stat /home/travis/.minikube/profiles/config.json: no such file or directory]

@medyagh
Copy link
Member

medyagh commented Jan 31, 2020

looks good after unit tests fix

@priyawadhwa
Copy link

travis caught another unit test:

--- FAIL: TestIsAddonAlreadySet (0.00s)
    addons_test.go:51: Did not get expected status, 
        
         expected ingress already disabled

and a lint error:

cmd/minikube/cmd/start.go:48: File is not `goimports`-ed (goimports)
	cmdcfg "k8s.io/minikube/cmd/minikube/cmd/config"

@codecov-io
Copy link

codecov-io commented Jan 31, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@b971242). Click here to learn what that means.
The diff coverage is 22.95%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #6440   +/-   ##
=========================================
  Coverage          ?   37.98%           
=========================================
  Files             ?      128           
  Lines             ?     8708           
  Branches          ?        0           
=========================================
  Hits              ?     3308           
  Misses            ?     4974           
  Partials          ?      426
Impacted Files Coverage Δ
cmd/minikube/cmd/config/profile_list.go 3.94% <0%> (ø)
cmd/minikube/cmd/config/addons_list.go 11.59% <0%> (ø)
cmd/minikube/cmd/config/open.go 13.2% <0%> (ø)
pkg/minikube/cluster/cluster.go 37.56% <0%> (ø)
pkg/addons/kubectl.go 56.52% <0%> (ø)
cmd/minikube/cmd/config/profile.go 0% <0%> (ø)
cmd/minikube/cmd/dashboard.go 1.69% <0%> (ø)
cmd/minikube/cmd/pause.go 8.1% <0%> (ø)
cmd/minikube/cmd/kubectl.go 0% <0%> (ø)
cmd/minikube/cmd/unpause.go 7.89% <0%> (ø)
... and 6 more

Copy link

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

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

LGTM! Just a couple nits, but they can be addressed in a separate PR if you prefer.

pkg/addons/addons.go Outdated Show resolved Hide resolved
pkg/addons/addons.go Outdated Show resolved Hide resolved
@priyawadhwa
Copy link

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jan 31, 2020
@minikube-pr-bot
Copy link

Error: running mkcmp: exit status 1

…aningful error messages and make them comparable
@minikube-pr-bot
Copy link

Error: running mkcmp: exit status 1

Copy link

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

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

nice!

@minikube-pr-bot
Copy link

All Times minikube: [ 96.361238 97.875949 96.325792]
All Times Minikube (PR 6440): [ 97.035521 102.032158 94.476924]

Average minikube: 96.854326
Average Minikube (PR 6440): 97.848201

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6440) |
+----------------------+-----------+--------------------+
| minikube v           |  0.287564 |           0.282742 |
| Creating kvm2        | 20.096272 |          20.326566 |
| Preparing Kubernetes | 49.828888 |          50.622562 |
| Pulling images       |  3.908831 |           3.484384 |
| Launching Kubernetes | 19.801032 |          20.187780 |
| Waiting for cluster  |  2.879825 |           1.058750 |
+----------------------+-----------+--------------------+

@tstromberg tstromberg merged commit e206b25 into kubernetes:master Feb 1, 2020
nirs added a commit to nirs/minikube that referenced this pull request Jan 4, 2023
This was reported in [1] and fixed in [2] in 2019, but later it was
broken by [3] in commit c3aafae.

`listProfiles()` can return `os.ErrNotExist` from `os.ReadDir()` so it
must be tested with `os.IsNotExist()`.

[1] kubernetes#5898
[2] kubernetes#5955
[3] kubernetes#6440
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/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.

TestFunctional Failure PersistentVolumeClaim
6 participants