Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
4ba8ecd1
Commit
4ba8ecd1
authored
Feb 15, 2015
by
Mike Danese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move api.Probe timeout default to central defaults
parent
6f84bdab
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
9 deletions
+17
-9
defaults.go
pkg/api/v1beta1/defaults.go
+5
-0
defaults.go
pkg/api/v1beta2/defaults.go
+5
-0
defaults.go
pkg/api/v1beta3/defaults.go
+5
-0
probe.go
pkg/kubelet/probe.go
+2
-9
No files found.
pkg/api/v1beta1/defaults.go
View file @
4ba8ecd1
...
@@ -75,5 +75,10 @@ func init() {
...
@@ -75,5 +75,10 @@ func init() {
obj
.
DNSPolicy
=
DNSClusterFirst
obj
.
DNSPolicy
=
DNSClusterFirst
}
}
},
},
func
(
obj
*
LivenessProbe
)
{
if
obj
.
TimeoutSeconds
==
0
{
obj
.
TimeoutSeconds
=
1
}
},
)
)
}
}
pkg/api/v1beta2/defaults.go
View file @
4ba8ecd1
...
@@ -75,5 +75,10 @@ func init() {
...
@@ -75,5 +75,10 @@ func init() {
obj
.
DNSPolicy
=
DNSClusterFirst
obj
.
DNSPolicy
=
DNSClusterFirst
}
}
},
},
func
(
obj
*
LivenessProbe
)
{
if
obj
.
TimeoutSeconds
==
0
{
obj
.
TimeoutSeconds
=
1
}
},
)
)
}
}
pkg/api/v1beta3/defaults.go
View file @
4ba8ecd1
...
@@ -70,5 +70,10 @@ func init() {
...
@@ -70,5 +70,10 @@ func init() {
obj
.
DNSPolicy
=
DNSClusterFirst
obj
.
DNSPolicy
=
DNSClusterFirst
}
}
},
},
func
(
obj
*
Probe
)
{
if
obj
.
TimeoutSeconds
==
0
{
obj
.
TimeoutSeconds
=
1
}
},
)
)
}
}
pkg/kubelet/probe.go
View file @
4ba8ecd1
...
@@ -36,10 +36,7 @@ import (
...
@@ -36,10 +36,7 @@ import (
"github.com/golang/glog"
"github.com/golang/glog"
)
)
const
(
const
maxProbeRetries
=
3
defaultProbeTimeout
=
1
*
time
.
Second
maxProbeRetries
=
3
)
// probeContainer executes the given probe on a container and returns the result.
// probeContainer executes the given probe on a container and returns the result.
// If the probe is nil this returns Success. If the probe's initial delay has not passed
// If the probe is nil this returns Success. If the probe's initial delay has not passed
...
@@ -71,11 +68,7 @@ func (kl *Kubelet) probeContainer(p *api.Probe,
...
@@ -71,11 +68,7 @@ func (kl *Kubelet) probeContainer(p *api.Probe,
}
}
func
(
kl
*
Kubelet
)
runProbe
(
p
*
api
.
Probe
,
podFullName
string
,
podUID
types
.
UID
,
status
api
.
PodStatus
,
container
api
.
Container
)
(
probe
.
Result
,
error
)
{
func
(
kl
*
Kubelet
)
runProbe
(
p
*
api
.
Probe
,
podFullName
string
,
podUID
types
.
UID
,
status
api
.
PodStatus
,
container
api
.
Container
)
(
probe
.
Result
,
error
)
{
timeout
:=
defaultProbeTimeout
timeout
:=
time
.
Duration
(
p
.
TimeoutSeconds
)
*
time
.
Second
secs
:=
p
.
TimeoutSeconds
if
secs
>
0
{
timeout
=
time
.
Duration
(
secs
)
*
time
.
Second
}
if
p
.
Exec
!=
nil
{
if
p
.
Exec
!=
nil
{
return
kl
.
prober
.
exec
.
Probe
(
kl
.
newExecInContainer
(
podFullName
,
podUID
,
container
))
return
kl
.
prober
.
exec
.
Probe
(
kl
.
newExecInContainer
(
podFullName
,
podUID
,
container
))
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment