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
64e07f7f
Commit
64e07f7f
authored
Nov 24, 2014
by
Brendan Burns
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2593 from GoogleCloudPlatform/revert-2586-cleanup
Revert "Using util.Time for ContainerStatus"
parents
fa84b621
a5bc6301
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
24 deletions
+38
-24
types.go
pkg/api/types.go
+5
-3
types.go
pkg/api/v1beta1/types.go
+12
-7
types.go
pkg/api/v1beta2/types.go
+12
-7
types.go
pkg/api/v1beta3/types.go
+5
-3
docker.go
pkg/kubelet/dockertools/docker.go
+3
-3
rest_test.go
pkg/registry/pod/rest_test.go
+1
-1
No files found.
pkg/api/types.go
View file @
64e07f7f
...
@@ -17,6 +17,8 @@ limitations under the License.
...
@@ -17,6 +17,8 @@ limitations under the License.
package
api
package
api
import
(
import
(
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
)
)
...
@@ -361,7 +363,7 @@ type ContainerStateWaiting struct {
...
@@ -361,7 +363,7 @@ type ContainerStateWaiting struct {
}
}
type
ContainerStateRunning
struct
{
type
ContainerStateRunning
struct
{
StartedAt
util
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty"`
StartedAt
time
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty"`
}
}
type
ContainerStateTerminated
struct
{
type
ContainerStateTerminated
struct
{
...
@@ -369,8 +371,8 @@ type ContainerStateTerminated struct {
...
@@ -369,8 +371,8 @@ type ContainerStateTerminated struct {
Signal
int
`json:"signal,omitempty" yaml:"signal,omitempty"`
Signal
int
`json:"signal,omitempty" yaml:"signal,omitempty"`
Reason
string
`json:"reason,omitempty" yaml:"reason,omitempty"`
Reason
string
`json:"reason,omitempty" yaml:"reason,omitempty"`
Message
string
`json:"message,omitempty" yaml:"message,omitempty"`
Message
string
`json:"message,omitempty" yaml:"message,omitempty"`
StartedAt
util
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty"`
StartedAt
time
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty"`
FinishedAt
util
.
Time
`json:"finishedAt,omitempty" yaml:"finishedAt,omitempty"`
FinishedAt
time
.
Time
`json:"finishedAt,omitempty" yaml:"finishedAt,omitempty"`
}
}
// ContainerState holds a possible state of container.
// ContainerState holds a possible state of container.
...
...
pkg/api/v1beta1/types.go
View file @
64e07f7f
...
@@ -17,6 +17,8 @@ limitations under the License.
...
@@ -17,6 +17,8 @@ limitations under the License.
package
v1beta1
package
v1beta1
import
(
import
(
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
)
)
...
@@ -326,16 +328,19 @@ type ContainerStateWaiting struct {
...
@@ -326,16 +328,19 @@ type ContainerStateWaiting struct {
}
}
type
ContainerStateRunning
struct
{
type
ContainerStateRunning
struct
{
StartedAt
util
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty" description:"time at which the container was last (re-)started"`
// TODO: change to util.Time
StartedAt
time
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty" description:"time at which the container was last (re-)started"`
}
}
type
ContainerStateTerminated
struct
{
type
ContainerStateTerminated
struct
{
ExitCode
int
`json:"exitCode" yaml:"exitCode" description:"exit status from the last termination of the container"`
ExitCode
int
`json:"exitCode" yaml:"exitCode" description:"exit status from the last termination of the container"`
Signal
int
`json:"signal,omitempty" yaml:"signal,omitempty" description:"signal from the last termination of the container"`
Signal
int
`json:"signal,omitempty" yaml:"signal,omitempty" description:"signal from the last termination of the container"`
Reason
string
`json:"reason,omitempty" yaml:"reason,omitempty" description:"(brief) reason from the last termination of the container"`
Reason
string
`json:"reason,omitempty" yaml:"reason,omitempty" description:"(brief) reason from the last termination of the container"`
Message
string
`json:"message,omitempty" yaml:"message,omitempty" description:"message regarding the last termination of the container"`
Message
string
`json:"message,omitempty" yaml:"message,omitempty" description:"message regarding the last termination of the container"`
StartedAt
util
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty" description:"time at which previous execution of the container started"`
// TODO: change to util.Time
FinishedAt
util
.
Time
`json:"finishedAt,omitempty" yaml:"finishedAt,omitempty" description:"time at which the container last terminated"`
StartedAt
time
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty" description:"time at which previous execution of the container started"`
// TODO: change to util.Time
FinishedAt
time
.
Time
`json:"finishedAt,omitempty" yaml:"finishedAt,omitempty" description:"time at which the container last terminated"`
}
}
// ContainerState holds a possible state of container.
// ContainerState holds a possible state of container.
...
...
pkg/api/v1beta2/types.go
View file @
64e07f7f
...
@@ -17,6 +17,8 @@ limitations under the License.
...
@@ -17,6 +17,8 @@ limitations under the License.
package
v1beta2
package
v1beta2
import
(
import
(
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
)
)
...
@@ -291,16 +293,19 @@ type ContainerStateWaiting struct {
...
@@ -291,16 +293,19 @@ type ContainerStateWaiting struct {
}
}
type
ContainerStateRunning
struct
{
type
ContainerStateRunning
struct
{
StartedAt
util
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty" description:"time at which the container was last (re-)started"`
// TODO: change to util.Time
StartedAt
time
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty" description:"time at which the container was last (re-)started"`
}
}
type
ContainerStateTerminated
struct
{
type
ContainerStateTerminated
struct
{
ExitCode
int
`json:"exitCode" yaml:"exitCode" description:"exit status from the last termination of the container"`
ExitCode
int
`json:"exitCode" yaml:"exitCode" description:"exit status from the last termination of the container"`
Signal
int
`json:"signal,omitempty" yaml:"signal,omitempty" description:"signal from the last termination of the container"`
Signal
int
`json:"signal,omitempty" yaml:"signal,omitempty" description:"signal from the last termination of the container"`
Reason
string
`json:"reason,omitempty" yaml:"reason,omitempty" description:"(brief) reason from the last termination of the container"`
Reason
string
`json:"reason,omitempty" yaml:"reason,omitempty" description:"(brief) reason from the last termination of the container"`
Message
string
`json:"message,omitempty" yaml:"message,omitempty" description:"message regarding the last termination of the container"`
Message
string
`json:"message,omitempty" yaml:"message,omitempty" description:"message regarding the last termination of the container"`
StartedAt
util
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty" description:"time at which previous execution of the container started"`
// TODO: change to util.Time
FinishedAt
util
.
Time
`json:"finishedAt,omitempty" yaml:"finishedAt,omitempty" description:"time at which the container last terminated"`
StartedAt
time
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty" description:"time at which previous execution of the container started"`
// TODO: change to util.Time
FinishedAt
time
.
Time
`json:"finishedAt,omitempty" yaml:"finishedAt,omitempty" description:"time at which the container last terminated"`
}
}
// ContainerState holds a possible state of container.
// ContainerState holds a possible state of container.
...
...
pkg/api/v1beta3/types.go
View file @
64e07f7f
...
@@ -17,6 +17,8 @@ limitations under the License.
...
@@ -17,6 +17,8 @@ limitations under the License.
package
v1beta3
package
v1beta3
import
(
import
(
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
)
)
...
@@ -390,7 +392,7 @@ type ContainerStateWaiting struct {
...
@@ -390,7 +392,7 @@ type ContainerStateWaiting struct {
}
}
type
ContainerStateRunning
struct
{
type
ContainerStateRunning
struct
{
StartedAt
util
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty"`
StartedAt
time
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty"`
}
}
type
ContainerStateTerminated
struct
{
type
ContainerStateTerminated
struct
{
...
@@ -398,8 +400,8 @@ type ContainerStateTerminated struct {
...
@@ -398,8 +400,8 @@ type ContainerStateTerminated struct {
Signal
int
`json:"signal,omitempty" yaml:"signal,omitempty"`
Signal
int
`json:"signal,omitempty" yaml:"signal,omitempty"`
Reason
string
`json:"reason,omitempty" yaml:"reason,omitempty"`
Reason
string
`json:"reason,omitempty" yaml:"reason,omitempty"`
Message
string
`json:"message,omitempty" yaml:"message,omitempty"`
Message
string
`json:"message,omitempty" yaml:"message,omitempty"`
StartedAt
util
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty"`
StartedAt
time
.
Time
`json:"startedAt,omitempty" yaml:"startedAt,omitempty"`
FinishedAt
util
.
Time
`json:"finishedAt,omitempty" yaml:"finishedAt,omitempty"`
FinishedAt
time
.
Time
`json:"finishedAt,omitempty" yaml:"finishedAt,omitempty"`
}
}
// ContainerState holds a possible state of container.
// ContainerState holds a possible state of container.
...
...
pkg/kubelet/dockertools/docker.go
View file @
64e07f7f
...
@@ -387,7 +387,7 @@ func inspectContainer(client DockerInterface, dockerID, containerName, tPath str
...
@@ -387,7 +387,7 @@ func inspectContainer(client DockerInterface, dockerID, containerName, tPath str
waiting
:=
true
waiting
:=
true
if
inspectResult
.
State
.
Running
{
if
inspectResult
.
State
.
Running
{
containerStatus
.
State
.
Running
=
&
api
.
ContainerStateRunning
{
containerStatus
.
State
.
Running
=
&
api
.
ContainerStateRunning
{
StartedAt
:
util
.
Time
{
inspectResult
.
State
.
StartedAt
}
,
StartedAt
:
inspectResult
.
State
.
StartedAt
,
}
}
if
containerName
==
"net"
&&
inspectResult
.
NetworkSettings
!=
nil
{
if
containerName
==
"net"
&&
inspectResult
.
NetworkSettings
!=
nil
{
containerStatus
.
PodIP
=
inspectResult
.
NetworkSettings
.
IPAddress
containerStatus
.
PodIP
=
inspectResult
.
NetworkSettings
.
IPAddress
...
@@ -398,8 +398,8 @@ func inspectContainer(client DockerInterface, dockerID, containerName, tPath str
...
@@ -398,8 +398,8 @@ func inspectContainer(client DockerInterface, dockerID, containerName, tPath str
containerStatus
.
State
.
Termination
=
&
api
.
ContainerStateTerminated
{
containerStatus
.
State
.
Termination
=
&
api
.
ContainerStateTerminated
{
ExitCode
:
inspectResult
.
State
.
ExitCode
,
ExitCode
:
inspectResult
.
State
.
ExitCode
,
Reason
:
""
,
Reason
:
""
,
StartedAt
:
util
.
Time
{
inspectResult
.
State
.
StartedAt
}
,
StartedAt
:
inspectResult
.
State
.
StartedAt
,
FinishedAt
:
util
.
Time
{
inspectResult
.
State
.
FinishedAt
}
,
FinishedAt
:
inspectResult
.
State
.
FinishedAt
,
}
}
if
tPath
!=
""
{
if
tPath
!=
""
{
path
,
found
:=
inspectResult
.
Volumes
[
tPath
]
path
,
found
:=
inspectResult
.
Volumes
[
tPath
]
...
...
pkg/registry/pod/rest_test.go
View file @
64e07f7f
...
@@ -578,7 +578,7 @@ func TestFillPodInfo(t *testing.T) {
...
@@ -578,7 +578,7 @@ func TestFillPodInfo(t *testing.T) {
"net"
:
{
"net"
:
{
State
:
api
.
ContainerState
{
State
:
api
.
ContainerState
{
Running
:
&
api
.
ContainerStateRunning
{
Running
:
&
api
.
ContainerStateRunning
{
StartedAt
:
util
.
Time
{
expectedTime
}
,
StartedAt
:
expectedTime
,
},
},
},
},
RestartCount
:
1
,
RestartCount
:
1
,
...
...
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