Skip to content

Commit 291b60b

Browse files
committed
move DefaultWait,DefaultInterval to service #5375
1 parent ea60470 commit 291b60b

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Diff for: cmd/minikube/cmd/config/open.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"github.com/spf13/cobra"
2323
"k8s.io/minikube/pkg/minikube/assets"
2424
"k8s.io/minikube/pkg/minikube/cluster"
25-
"k8s.io/minikube/pkg/minikube/constants"
2625
"k8s.io/minikube/pkg/minikube/exit"
2726
"k8s.io/minikube/pkg/minikube/machine"
2827
"k8s.io/minikube/pkg/minikube/out"
@@ -103,8 +102,8 @@ You can add one by annotating a service with the label {{.labelName}}:{{.addonNa
103102
func init() {
104103
addonsOpenCmd.Flags().BoolVar(&addonsURLMode, "url", false, "Display the kubernetes addons URL in the CLI instead of opening it in the default browser")
105104
addonsOpenCmd.Flags().BoolVar(&https, "https", false, "Open the addons URL with https instead of http")
106-
addonsOpenCmd.Flags().IntVar(&wait, "wait", constants.DefaultWait, "Amount of time to wait for service in seconds")
107-
addonsOpenCmd.Flags().IntVar(&interval, "interval", constants.DefaultInterval, "The time interval for each check that wait performs in seconds")
105+
addonsOpenCmd.Flags().IntVar(&wait, "wait", service.DefaultWait, "Amount of time to wait for service in seconds")
106+
addonsOpenCmd.Flags().IntVar(&interval, "interval", service.DefaultInterval, "The time interval for each check that wait performs in seconds")
108107
addonsOpenCmd.PersistentFlags().StringVar(&addonsURLFormat, "format", defaultAddonsFormatTemplate, "Format to output addons URL in. This format will be applied to each url individually and they will be printed one at a time.")
109108
AddonsCmd.AddCommand(addonsOpenCmd)
110109
}

Diff for: cmd/minikube/cmd/service.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121

2222
"github.com/spf13/cobra"
2323
"k8s.io/minikube/pkg/minikube/cluster"
24-
"k8s.io/minikube/pkg/minikube/constants"
2524
"k8s.io/minikube/pkg/minikube/exit"
2625
"k8s.io/minikube/pkg/minikube/machine"
2726
"k8s.io/minikube/pkg/minikube/service"
@@ -78,8 +77,8 @@ func init() {
7877
serviceCmd.Flags().StringVarP(&namespace, "namespace", "n", "default", "The service namespace")
7978
serviceCmd.Flags().BoolVar(&serviceURLMode, "url", false, "Display the kubernetes service URL in the CLI instead of opening it in the default browser")
8079
serviceCmd.Flags().BoolVar(&https, "https", false, "Open the service URL with https instead of http")
81-
serviceCmd.Flags().IntVar(&wait, "wait", constants.DefaultWait, "Amount of time to wait for a service in seconds")
82-
serviceCmd.Flags().IntVar(&interval, "interval", constants.DefaultInterval, "The initial time interval for each check that wait performs in seconds")
80+
serviceCmd.Flags().IntVar(&wait, "wait", service.DefaultWait, "Amount of time to wait for a service in seconds")
81+
serviceCmd.Flags().IntVar(&interval, "interval", service.DefaultInterval, "The initial time interval for each check that wait performs in seconds")
8382

8483
serviceCmd.PersistentFlags().StringVar(&serviceURLFormat, "format", defaultServiceFormatTemplate, "Format to output service URL in. This format will be applied to each url individually and they will be printed one at a time.")
8584

Diff for: pkg/minikube/constants/constants.go

-4
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ var MountProcessFileName = ".mount-process"
8383
const (
8484
// SHASuffix is the suffix of a SHA-256 checksum file
8585
SHASuffix = ".sha256"
86-
// DefaultWait is the default wait time, in seconds
87-
DefaultWait = 20
88-
// DefaultInterval is the default interval, in seconds
89-
DefaultInterval = 6
9086
)
9187

9288
// DefaultISOURL is the default location of the minikube.iso file

Diff for: pkg/minikube/service/service.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ import (
4646
"k8s.io/minikube/pkg/util/retry"
4747
)
4848

49-
const defaultK8sClientTimeout = 60 * time.Second
49+
const (
50+
defaultK8sClientTimeout = 60 * time.Second
51+
// DefaultWait is the default wait time, in seconds
52+
DefaultWait = 20
53+
// DefaultInterval is the default interval, in seconds
54+
DefaultInterval = 6
55+
)
5056

5157
// K8sClient represents a kubernetes client
5258
type K8sClient interface {

0 commit comments

Comments
 (0)