- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.1k
Remove viper calls outside of cmd - part2 #21790
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
base: master
Are you sure you want to change the base?
Conversation
| Skipping CI for Draft Pull Request. | 
| [APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nirs 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  | 
| /ok-to-test | 
| @nirs: The following tests failed, say  
 Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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-sigs/prow repository. I understand the commands that are listed here. | 
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
af05322    to
    d4c33ed      
    Compare
  
    
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
      
        
              This comment has been minimized.
        
        
      
    
  This comment has been minimized.
Add run.CommandOptions.ProfileName and use it to replace most of the
following calls:
- viper.GetString("profile")
- viper.GetString(config.ProfileName)
- viper.GetString(ProfileName)
- viper.Set("profile", ...)
- viper.Set(config.ProfileName, ...)
- viper.Set(ProfileName, ...)
The ProfileName constant is in minikube/config package, so we use the
existing constants instead of adding cmd/flags.ProfileName.
This is change is little bit bigger because the existing code was messy,
the tests mocks were broken, and one test was wrong. I should probably
split this change to smaller commits.
The minikube/provision package is still using
viper.GetString(config.ProfileName). I could not find a way to remove
this usage because libmachine API does not allow passing the options.
    Add run.CommandOptions.Force option and use it to replace calls to
viper.GetBool("force") outside the cmd package, and call to
viper.GetBool(force) in the cmd package.
    d4c33ed    to
    0500345      
    Compare
  
    | kvm2 driver with docker runtime Times for minikube (PR 21790) start: 41.1s 42.0s 42.0s 39.3s 42.7s Times for minikube ingress: 44.7s 16.8s 15.8s 19.8s 30.8s docker driver with docker runtime Times for minikube start: 23.3s 23.1s 22.2s 22.8s 23.0s Times for minikube ingress: 12.7s 10.6s 14.6s 13.6s 17.6s docker driver with containerd runtime Times for minikube start: 22.1s 19.9s 19.9s 20.5s 21.3s Times for minikube (PR 21790) ingress: 25.1s 37.1s 22.1s 23.1s 42.1s | 
| Here are the number of top 10 failed tests in each environments with lowest flake rate. 
 Besides the following environments also have failed tests: To see the flake rates of all tests by environment, click here. | 
| if d.BaseDriver.IPAddress != "" { | ||
| return d.BaseDriver.IPAddress, nil | ||
| if d.IPAddress != "" { | ||
| return d.IPAddress, nil | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these lints unrelated to the PR ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not required for this change, cleaned up while reading this code. I'll split these changes to separate commit or defer them to later since we probably have more instances of this.
This is the second part, removing more viper calls outside of cmd and replacing some viper calls that use a string instead of the constant.
profile
force
Remaning viper calls in pkg
viper.Get*
viper.Set