mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Update CRI API to support Evented PLEG
Signed-off-by: Harshal Patil <harpatil@redhat.com>
This commit is contained in:
parent
7bcd739851
commit
668b2440c5
@ -332,3 +332,7 @@ func (f *RemoteRuntime) CheckpointContainer(ctx context.Context, req *kubeapi.Ch
|
|||||||
|
|
||||||
return &kubeapi.CheckpointContainerResponse{}, nil
|
return &kubeapi.CheckpointContainerResponse{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (f *RemoteRuntime) GetContainerEvents(req *kubeapi.GetEventsRequest, ces kubeapi.RuntimeService_GetContainerEventsServer) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
@ -1208,3 +1208,7 @@ func (r *remoteRuntimeService) CheckpointContainer(options *runtimeapi.Checkpoin
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *remoteRuntimeService) GetContainerEvents(containerEventsCh chan *runtimeapi.ContainerEventResponse) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
@ -333,3 +333,12 @@ func (in instrumentedRuntimeService) CheckpointContainer(options *runtimeapi.Che
|
|||||||
recordError(operation, err)
|
recordError(operation, err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (in instrumentedRuntimeService) GetContainerEvents(containerEventsCh chan *runtimeapi.ContainerEventResponse) error {
|
||||||
|
const operation = "get_container_events"
|
||||||
|
defer recordOperation(operation, time.Now())
|
||||||
|
|
||||||
|
err := in.service.GetContainerEvents(containerEventsCh)
|
||||||
|
recordError(operation, err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -117,6 +117,10 @@ service RuntimeService {
|
|||||||
|
|
||||||
// CheckpointContainer checkpoints a container
|
// CheckpointContainer checkpoints a container
|
||||||
rpc CheckpointContainer(CheckpointContainerRequest) returns (CheckpointContainerResponse) {}
|
rpc CheckpointContainer(CheckpointContainerRequest) returns (CheckpointContainerResponse) {}
|
||||||
|
|
||||||
|
// GetContainerEvents gets container events from the CRI runtime
|
||||||
|
rpc GetContainerEvents(GetEventsRequest) returns (stream ContainerEventResponse) {}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ImageService defines the public APIs for managing images.
|
// ImageService defines the public APIs for managing images.
|
||||||
@ -758,7 +762,7 @@ message SELinuxOption {
|
|||||||
|
|
||||||
// Capability contains the container capabilities to add or drop
|
// Capability contains the container capabilities to add or drop
|
||||||
// Dropping a capability will drop it from all sets.
|
// Dropping a capability will drop it from all sets.
|
||||||
// If a capability is added to only the add_capabilities list then it gets added to permitted,
|
// If a capability is added to only the add_capabilities list then it gets added to permitted,
|
||||||
// inheritable, effective and bounding sets, i.e. all sets except the ambient set.
|
// inheritable, effective and bounding sets, i.e. all sets except the ambient set.
|
||||||
// If a capability is added to only the add_ambient_capabilities list then it gets added to all sets, i.e permitted
|
// If a capability is added to only the add_ambient_capabilities list then it gets added to all sets, i.e permitted
|
||||||
// inheritable, effective, bounding and ambient sets.
|
// inheritable, effective, bounding and ambient sets.
|
||||||
@ -1559,3 +1563,33 @@ message CheckpointContainerRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message CheckpointContainerResponse {}
|
message CheckpointContainerResponse {}
|
||||||
|
|
||||||
|
message GetEventsRequest {}
|
||||||
|
|
||||||
|
message ContainerEventResponse {
|
||||||
|
// ID of the container
|
||||||
|
string container_id = 1;
|
||||||
|
|
||||||
|
// Type of the container event
|
||||||
|
ContainerEventType container_event_type = 2;
|
||||||
|
|
||||||
|
// Creation timestamp of this event
|
||||||
|
int64 created_at = 3;
|
||||||
|
|
||||||
|
// ID of the sandbox container
|
||||||
|
PodSandboxMetadata pod_sandbox_metadata = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum ContainerEventType {
|
||||||
|
// Container created
|
||||||
|
CONTAINER_CREATED_EVENT = 0;
|
||||||
|
|
||||||
|
// Container started
|
||||||
|
CONTAINER_STARTED_EVENT = 1;
|
||||||
|
|
||||||
|
// Container stopped
|
||||||
|
CONTAINER_STOPPED_EVENT = 2;
|
||||||
|
|
||||||
|
// Container deleted
|
||||||
|
CONTAINER_DELETED_EVENT = 3;
|
||||||
|
}
|
||||||
|
@ -58,6 +58,8 @@ type ContainerManager interface {
|
|||||||
ReopenContainerLog(ContainerID string) error
|
ReopenContainerLog(ContainerID string) error
|
||||||
// CheckpointContainer checkpoints a container
|
// CheckpointContainer checkpoints a container
|
||||||
CheckpointContainer(options *runtimeapi.CheckpointContainerRequest) error
|
CheckpointContainer(options *runtimeapi.CheckpointContainerRequest) error
|
||||||
|
// GetContainerEvents gets container events from the CRI runtime
|
||||||
|
GetContainerEvents(containerEventsCh chan *runtimeapi.ContainerEventResponse) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// PodSandboxManager contains methods for operating on PodSandboxes. The methods
|
// PodSandboxManager contains methods for operating on PodSandboxes. The methods
|
||||||
|
@ -708,3 +708,7 @@ func (r *FakeRuntimeService) CheckpointContainer(options *runtimeapi.CheckpointC
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (f *FakeRuntimeService) GetContainerEvents(containerEventsCh chan *runtimeapi.ContainerEventResponse) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user