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

move delete logic to a pkg #5693

Closed
wants to merge 38 commits into from
Closed

move delete logic to a pkg #5693

wants to merge 38 commits into from

Conversation

mschwrz
Copy link
Contributor

@mschwrz mschwrz commented Oct 22, 2019

As in #4780 discussed, I moved the logic for the deletion of profiles and machines to the pkg folder, to decouple the command logic from the delete logic.
For this I introduced a new folder named delete, where I moved all the logic and testdata. I'm not happy with the name of the folder and created it because of import cycles, but we can discuss the name or the place where the logic sits if you want.
While doing this had to move the getClusterBootstrapper-Method from root.go to cluster.go.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 22, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @marekschwarz. 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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 22, 2019
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@codecov-io
Copy link

codecov-io commented Oct 22, 2019

Codecov Report

Merging #5693 into master will decrease coverage by 0.12%.
The diff coverage is 23.86%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5693      +/-   ##
==========================================
- Coverage   36.54%   36.41%   -0.13%     
==========================================
  Files         110      111       +1     
  Lines        8114     8107       -7     
==========================================
- Hits         2965     2952      -13     
- Misses       4760     4765       +5     
- Partials      389      390       +1
Impacted Files Coverage Δ
cmd/minikube/cmd/root.go 58.51% <ø> (+4.4%) ⬆️
cmd/minikube/cmd/mount.go 8.54% <0%> (ø) ⬆️
pkg/minikube/cluster/cluster.go 35.59% <0%> (-2.02%) ⬇️
pkg/minikube/cluster/machine.go 45.31% <0%> (-5.57%) ⬇️
cmd/minikube/cmd/status.go 7.69% <0%> (ø) ⬆️
cmd/minikube/cmd/logs.go 11.11% <0%> (ø) ⬆️
pkg/minikube/cluster/mount.go 37.03% <0%> (-22.97%) ⬇️
cmd/minikube/cmd/stop.go 0% <0%> (ø) ⬆️
cmd/minikube/cmd/delete.go 9.3% <0%> (-19.85%) ⬇️
cmd/minikube/cmd/start.go 20% <0%> (ø) ⬆️
... and 3 more

@sharifelgamal
Copy link
Collaborator

@minikube-bot OK to test

@medyagh
Copy link
Member

medyagh commented Oct 23, 2019

@marekschwarz can you please provide a PR description of what it does and how it will affect other things?

@RA489
Copy link

RA489 commented Oct 23, 2019

/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 Oct 23, 2019
@mschwrz
Copy link
Contributor Author

mschwrz commented Oct 23, 2019

@marekschwarz can you please provide a PR description of what it does and how it will affect other things?

Done

@medyagh
Copy link
Member

medyagh commented Oct 23, 2019

while I didn't study the PR, but a quick look I noticed it doesn't Read well

for example delete.RemoveProfiles() doesn't read natural to me.
I don't know what would be a better name to suggest since I haven't studied it. but I believe the code should read nice and not stutter.

for example
action.DeleteAll()
or
profile.DeleteAll()

@TravisBuddy
Copy link

Travis tests have failed

Hey @marekschwarz,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

1st Build

View build log

make test
which go-bindata || GO111MODULE=off GOBIN="/home/travis/gopath/bin" go get github.com/jteeuwen/go-bindata/...
PATH="/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.12.12.linux.amd64/bin:/home/travis/bin:/home/travis/bin:/home/travis/.local/bin:/usr/local/lib/jvm/openjdk11/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.12.0/bin:/home/travis/.rvm/gems/ruby-2.5.3/bin:/home/travis/.rvm/gems/ruby-2.5.3@global/bin:/home/travis/.rvm/rubies/ruby-2.5.3/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.11.1.linux.amd64/bin:/usr/local/maven-3.6.0/bin:/usr/local/cmake-3.12.4/bin:/usr/local/clang-7.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin:/home/travis/gopath/bin" go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...
gofmt -s -w pkg/minikube/assets/assets.go
which go-bindata || GO111MODULE=off GOBIN="/home/travis/gopath/bin" go get github.com/jteeuwen/go-bindata/...
/home/travis/gopath/bin/go-bindata
PATH="/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.12.12.linux.amd64/bin:/home/travis/bin:/home/travis/bin:/home/travis/.local/bin:/usr/local/lib/jvm/openjdk11/bin:/opt/pyenv/shims:/home/travis/.phpenv/shims:/home/travis/perl5/perlbrew/bin:/home/travis/.nvm/versions/node/v8.12.0/bin:/home/travis/.rvm/gems/ruby-2.5.3/bin:/home/travis/.rvm/gems/ruby-2.5.3@global/bin:/home/travis/.rvm/rubies/ruby-2.5.3/bin:/home/travis/gopath/bin:/home/travis/.gimme/versions/go1.11.1.linux.amd64/bin:/usr/local/maven-3.6.0/bin:/usr/local/cmake-3.12.4/bin:/usr/local/clang-7.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/travis/.rvm/bin:/home/travis/.phpenv/bin:/opt/pyenv/bin:/home/travis/.yarn/bin:/home/travis/gopath/bin" go-bindata -nomemcopy -o pkg/minikube/translate/translations.go -pkg translate translations/...
gofmt -s -w pkg/minikube/translate/translations.go
./test.sh
= make lint =============================================================
golangci/golangci-lint info checking GitHub for tag 'v1.20.0'
golangci/golangci-lint info found version: 1.20.0 for v1.20.0/linux/amd64
golangci/golangci-lint info installed out/linters/golangci-lint
cmd/minikube/cmd/delete.go:20: File is not `goimports`-ed (goimports)
	"k8s.io/minikube/pkg/minikube/profile"
cmd/minikube/cmd/mount.go:21: File is not `goimports`-ed (goimports)
	"k8s.io/minikube/pkg/minikube/profile"
cmd/minikube/cmd/stop.go:20: File is not `goimports`-ed (goimports)
	profile2 "k8s.io/minikube/pkg/minikube/profile"
Makefile:341: recipe for target 'lint-ci' failed
make[1]: *** [lint-ci] Error 1
= go mod ================================================================
ok
Makefile:245: recipe for target 'test' failed
make: *** [test] Error 4
TravisBuddy Request Identifier: b2f1b7f0-f5cc-11e9-a1fe-396a3052531f

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

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

minor changes requested

cmd/minikube/cmd/start.go Outdated Show resolved Hide resolved
cmd/minikube/cmd/logs.go Outdated Show resolved Hide resolved
pkg/minikube/cluster/mount.go Show resolved Hide resolved
@minikube-bot
Copy link
Collaborator

Old binary: [180.365082364 170.932122883 180.425103299]
New binary: [171.581173364 163.22752629 185.423275946]
Average Old: 177.240770
Average New: 173.410659

@mschwrz
Copy link
Contributor Author

mschwrz commented Nov 5, 2019

/assign @medyagh

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: marekschwarz
To complete the pull request process, please assign medyagh
You can assign the PR to them by writing /assign @medyagh in a comment when ready.

The full list of commands accepted by this bot can be found 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

@minikube-bot
Copy link
Collaborator

Old binary: [186.533519105 175.746501642 180.046910261]
New binary: [192.234230559 172.547649495 172.524845534]
Average Old: 180.775644
Average New: 179.102242

@medyagh
Copy link
Member

medyagh commented Nov 25, 2019

@marekschwarz sorry for the delay can u plz rebase

@tstromberg
Copy link
Contributor

Do you mind resolving the merge conflicts?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 9, 2019
@mschwrz
Copy link
Contributor Author

mschwrz commented Dec 16, 2019

Do you mind resolving the merge conflicts?

I will take care of it this week :-)

@medyagh
Copy link
Member

medyagh commented Dec 21, 2019

/retest this please

# Conflicts:
#	cmd/minikube/cmd/delete.go
#	cmd/minikube/cmd/root.go
#	cmd/minikube/cmd/start.go
#	cmd/minikube/cmd/stop.go
#	pkg/minikube/cluster/cluster.go
#	pkg/minikube/machine/machine.go
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 23, 2019
@TravisBuddy
Copy link

Travis tests have failed

Hey @marekschwarz,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 4a5c7090-258d-11ea-8c31-f79bb2699b7f

@minikube-bot
Copy link
Collaborator

All Times minikube: [ 123.302119 126.979365 123.297754]
All Times Minikube (PR 5693): [ 197.269070 196.444170 197.530789]

Average minikube: 124.526413
Average Minikube (PR 5693): 197.081343

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 5693) |
+----------------------+-----------+--------------------+
| minikube v           |  0.397416 |           0.264217 |
| Creating kvm2        | 47.677672 |          40.306184 |
| Preparing Kubernetes | 49.891975 |          54.116033 |
| Pulling images       |  2.970122 |           2.647821 |
| Launching Kubernetes | 20.783975 |          20.979480 |
| Waiting for cluster  |  2.757686 |                    |
+----------------------+-----------+--------------------+

@medyagh
Copy link
Member

medyagh commented Dec 24, 2019

@marekschwarz please make sure to run make test to see the test failures and make lint to see lint issues locally

@minikube-bot
Copy link
Collaborator

All Times minikube: [ 128.996987 132.344816 133.932775]
All Times Minikube (PR 5693): [ 200.793334 194.728134 188.542909]

Average minikube: 131.758193
Average Minikube (PR 5693): 194.688125

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 5693) |
+----------------------+-----------+--------------------+
| minikube v           |  0.434149 |           0.373043 |
| Creating kvm2        | 50.693711 |          44.419174 |
| Preparing Kubernetes | 51.966699 |          53.616097 |
| Pulling images       |  3.038614 |           2.197745 |
| Launching Kubernetes | 22.824704 |          21.223334 |
| Waiting for cluster  |  2.744661 |                    |
| Done                 |           |                    |
|                      |  0.058713 |          72.909395 |
+----------------------+-----------+--------------------+

@medyagh
Copy link
Member

medyagh commented Jan 13, 2020

@marekschwarz are you still working on this ?

@minikube-pr-bot
Copy link

All Times minikube: [ 96.511587 96.447060 96.683337]
All Times Minikube (PR 5693): [ 202.063067 167.858721 187.369475]

Average minikube: 96.547328
Average Minikube (PR 5693): 185.763754

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 5693) |
+----------------------+-----------+--------------------+
| minikube v           |  0.238506 |           0.357990 |
| Creating kvm2        | 20.030817 |          41.428169 |
| Preparing Kubernetes | 49.273888 |          51.880981 |
| Pulling images       |  3.769051 |           2.309576 |
| Launching Kubernetes | 20.117193 |          19.953306 |
| Waiting for cluster  |  2.559414 |                    |
+----------------------+-----------+--------------------+

@k8s-ci-robot
Copy link
Contributor

@marekschwarz: PR needs rebase.

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 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 25, 2020
@medyagh
Copy link
Member

medyagh commented Jan 28, 2020

@marekschwarz I close this PR for now, please feel free to re-open when ready

@medyagh medyagh closed this Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants