Skip to content

Commit

Permalink
revise container status stream API
Browse files Browse the repository at this point in the history
  • Loading branch information
CMGS committed Nov 28, 2019
1 parent 938ff59 commit 573dc1f
Show file tree
Hide file tree
Showing 12 changed files with 965 additions and 927 deletions.
6 changes: 3 additions & 3 deletions cluster/calcium/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (c *Calcium) SetContainersStatus(ctx context.Context, status map[string][]b
return nil
}

// DeployStatusStream watch deploy status
func (c *Calcium) DeployStatusStream(ctx context.Context, appname, entrypoint, nodename string) chan *types.DeployStatus {
return c.store.WatchDeployStatus(ctx, appname, entrypoint, nodename)
// ContainerStatusStream stream container status
func (c *Calcium) ContainerStatusStream(ctx context.Context, appname, entrypoint, nodename string, labels map[string]string) chan *types.ContainerStatus {
return c.store.ContainerStatusStream(ctx, appname, entrypoint, nodename, labels)
}
3 changes: 1 addition & 2 deletions cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,14 @@ type Cluster interface {
ListContainers(ctx context.Context, opts *types.ListContainersOptions) ([]*types.Container, error)
ListNodeContainers(ctx context.Context, nodename string) ([]*types.Container, error)
SetContainersStatus(ctx context.Context, status map[string][]byte, ttls map[string]int64) error
ContainerStatusStream(ctx context.Context, appname, entrypoint, nodename string, labels map[string]string) chan *types.ContainerStatus
// cluster methods
Copy(ctx context.Context, opts *types.CopyOptions) (chan *types.CopyMessage, error)
Send(ctx context.Context, opts *types.SendOptions) (chan *types.SendMessage, error)
// image methods
BuildImage(ctx context.Context, opts *enginetypes.BuildOptions) (chan *types.BuildImageMessage, error)
CacheImage(ctx context.Context, podname, nodenmae string, images []string, step int) (chan *types.CacheImageMessage, error)
RemoveImage(ctx context.Context, podname, nodename string, images []string, step int, prune bool) (chan *types.RemoveImageMessage, error)
// for watch
DeployStatusStream(ctx context.Context, appname, entrypoint, nodename string) chan *types.DeployStatus
// container methods
CreateContainer(ctx context.Context, opts *types.DeployOptions) (chan *types.CreateContainerMessage, error)
ReplaceContainer(ctx context.Context, opts *types.ReplaceOptions) (chan *types.ReplaceContainerMessage, error)
Expand Down
32 changes: 16 additions & 16 deletions cluster/mocks/Cluster.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 573dc1f

Please sign in to comment.