Merge pull request #111642 from harche/evented_pleg_cri_changes

Update CRI API to support Evented PLEG
This commit is contained in:
Kubernetes Prow Robot 2022-08-02 13:59:16 -07:00 committed by GitHub
commit 8f3b2813dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 981 additions and 366 deletions

View File

@ -332,3 +332,7 @@ func (f *RemoteRuntime) CheckpointContainer(ctx context.Context, req *kubeapi.Ch
return &kubeapi.CheckpointContainerResponse{}, nil
}
func (f *RemoteRuntime) GetContainerEvents(req *kubeapi.GetEventsRequest, ces kubeapi.RuntimeService_GetContainerEventsServer) error {
return nil
}

View File

@ -1225,3 +1225,7 @@ func (r *remoteRuntimeService) CheckpointContainer(options *runtimeapi.Checkpoin
return nil
}
func (r *remoteRuntimeService) GetContainerEvents(containerEventsCh chan *runtimeapi.ContainerEventResponse) error {
return nil
}

View File

@ -333,3 +333,12 @@ func (in instrumentedRuntimeService) CheckpointContainer(options *runtimeapi.Che
recordError(operation, 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

View File

@ -117,6 +117,10 @@ service RuntimeService {
// CheckpointContainer checkpoints a container
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.
@ -758,7 +762,7 @@ message SELinuxOption {
// Capability contains the container capabilities to add or drop
// 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.
// 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.
@ -1559,3 +1563,33 @@ message CheckpointContainerRequest {
}
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;
}

View File

@ -58,6 +58,8 @@ type ContainerManager interface {
ReopenContainerLog(ContainerID string) error
// CheckpointContainer checkpoints a container
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

View File

@ -708,3 +708,7 @@ func (r *FakeRuntimeService) CheckpointContainer(options *runtimeapi.CheckpointC
return nil
}
func (f *FakeRuntimeService) GetContainerEvents(containerEventsCh chan *runtimeapi.ContainerEventResponse) error {
return nil
}