2022-07-24 01:49:01 +03:00
|
|
|
//go:build kube
|
2021-01-19 13:49:50 +03:00
|
|
|
// +build kube
|
|
|
|
|
|
|
|
/*
|
|
|
|
Copyright 2020 Docker Compose CLI authors
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package kube
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2021-01-29 16:22:22 +03:00
|
|
|
"fmt"
|
|
|
|
"strings"
|
2021-01-19 13:49:50 +03:00
|
|
|
|
|
|
|
"github.com/compose-spec/compose-go/types"
|
2021-08-31 20:08:07 +03:00
|
|
|
"github.com/docker/compose/v2/pkg/api"
|
|
|
|
"github.com/docker/compose/v2/pkg/progress"
|
|
|
|
utils2 "github.com/docker/compose/v2/pkg/utils"
|
2021-01-27 00:42:49 +03:00
|
|
|
|
2021-01-29 16:22:22 +03:00
|
|
|
apicontext "github.com/docker/compose-cli/api/context"
|
|
|
|
"github.com/docker/compose-cli/api/context/store"
|
2021-02-04 17:36:57 +03:00
|
|
|
"github.com/docker/compose-cli/kube/client"
|
2021-01-29 16:22:22 +03:00
|
|
|
"github.com/docker/compose-cli/kube/helm"
|
|
|
|
"github.com/docker/compose-cli/kube/resources"
|
2021-02-04 12:04:42 +03:00
|
|
|
"github.com/docker/compose-cli/utils"
|
2021-01-19 13:49:50 +03:00
|
|
|
)
|
|
|
|
|
2021-01-29 16:22:22 +03:00
|
|
|
type composeService struct {
|
2021-02-04 17:36:57 +03:00
|
|
|
sdk *helm.Actions
|
|
|
|
client *client.KubeClient
|
2021-01-29 16:22:22 +03:00
|
|
|
}
|
|
|
|
|
2021-06-14 17:26:14 +03:00
|
|
|
// NewComposeService create a kubernetes implementation of the api.Service API
|
|
|
|
func NewComposeService() (api.Service, error) {
|
2021-03-11 13:43:40 +03:00
|
|
|
contextStore := store.Instance()
|
|
|
|
currentContext := apicontext.Current()
|
2021-01-29 16:22:22 +03:00
|
|
|
var kubeContext store.KubeContext
|
|
|
|
|
|
|
|
if err := contextStore.GetEndpoint(currentContext, &kubeContext); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
config, err := resources.LoadConfig(kubeContext)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
actions, err := helm.NewActions(config)
|
2021-02-04 18:57:06 +03:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2021-02-04 17:36:57 +03:00
|
|
|
apiClient, err := client.NewKubeClient(config)
|
2021-01-19 13:49:50 +03:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2021-02-04 17:36:57 +03:00
|
|
|
|
2021-01-19 13:49:50 +03:00
|
|
|
return &composeService{
|
2021-02-04 17:36:57 +03:00
|
|
|
sdk: actions,
|
|
|
|
client: apiClient,
|
2021-01-19 13:49:50 +03:00
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Up executes the equivalent to a `compose up`
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Up(ctx context.Context, project *types.Project, options api.UpOptions) error {
|
2021-09-17 20:26:24 +03:00
|
|
|
if err := checkUnsupportedUpOptions(ctx, options); err != nil {
|
2021-09-16 18:19:05 +03:00
|
|
|
return err
|
|
|
|
}
|
2021-06-07 15:21:55 +03:00
|
|
|
return progress.Run(ctx, func(ctx context.Context) error {
|
|
|
|
return s.up(ctx, project)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2021-09-17 20:26:24 +03:00
|
|
|
func checkUnsupportedUpOptions(ctx context.Context, o api.UpOptions) error {
|
2021-09-16 18:19:05 +03:00
|
|
|
var errs error
|
|
|
|
checks := []struct {
|
|
|
|
toCheck, expected interface{}
|
|
|
|
option string
|
|
|
|
}{
|
|
|
|
{o.Create.Inherit, true, "renew-anon-volumes"},
|
|
|
|
{o.Create.RemoveOrphans, false, "remove-orphans"},
|
|
|
|
{o.Create.QuietPull, false, "quiet-pull"},
|
|
|
|
{o.Create.Recreate, api.RecreateDiverged, "force-recreate"},
|
|
|
|
{o.Create.RecreateDependencies, api.RecreateDiverged, "always-recreate-deps"},
|
|
|
|
{len(o.Start.AttachTo), 0, "attach-dependencies"},
|
|
|
|
{len(o.Start.ExitCodeFrom), 0, "exit-code-from"},
|
|
|
|
{o.Create.Timeout, nil, "timeout"},
|
|
|
|
}
|
|
|
|
for _, c := range checks {
|
2021-09-17 20:26:24 +03:00
|
|
|
errs = utils.CheckUnsupported(ctx, errs, c.toCheck, c.expected, "up", c.option)
|
2021-09-16 18:19:05 +03:00
|
|
|
}
|
|
|
|
return errs
|
|
|
|
}
|
|
|
|
|
2021-06-07 15:21:55 +03:00
|
|
|
func (s *composeService) up(ctx context.Context, project *types.Project) error {
|
2021-01-29 16:22:22 +03:00
|
|
|
w := progress.ContextWriter(ctx)
|
|
|
|
|
2021-04-20 12:55:29 +03:00
|
|
|
eventName := "Convert Compose file to Helm charts"
|
2021-01-29 16:22:22 +03:00
|
|
|
w.Event(progress.CreatingEvent(eventName))
|
|
|
|
|
|
|
|
chart, err := helm.GetChartInMemory(project)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
w.Event(progress.NewEvent(eventName, progress.Done, ""))
|
|
|
|
|
2021-04-20 12:55:29 +03:00
|
|
|
stack, err := s.sdk.Get(project.Name)
|
|
|
|
if err != nil || stack == nil {
|
|
|
|
// install stack
|
|
|
|
eventName = "Install Compose stack"
|
|
|
|
w.Event(progress.CreatingEvent(eventName))
|
|
|
|
|
|
|
|
err = s.sdk.InstallChart(project.Name, chart, func(format string, v ...interface{}) {
|
|
|
|
message := fmt.Sprintf(format, v...)
|
|
|
|
w.Event(progress.NewEvent(eventName, progress.Done, message))
|
|
|
|
})
|
|
|
|
|
|
|
|
} else {
|
2021-06-28 15:56:17 +03:00
|
|
|
// update stack
|
2021-04-20 12:55:29 +03:00
|
|
|
eventName = "Updating Compose stack"
|
|
|
|
w.Event(progress.CreatingEvent(eventName))
|
|
|
|
|
|
|
|
err = s.sdk.UpdateChart(project.Name, chart, func(format string, v ...interface{}) {
|
|
|
|
message := fmt.Sprintf(format, v...)
|
|
|
|
w.Event(progress.NewEvent(eventName, progress.Done, message))
|
|
|
|
})
|
|
|
|
}
|
2021-03-02 18:19:19 +03:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2021-04-20 12:55:29 +03:00
|
|
|
|
2021-01-29 16:22:22 +03:00
|
|
|
w.Event(progress.NewEvent(eventName, progress.Done, ""))
|
2021-02-19 22:10:28 +03:00
|
|
|
|
2021-04-27 10:55:43 +03:00
|
|
|
return s.client.WaitForPodState(ctx, client.WaitForStatusOptions{
|
2021-02-23 14:46:55 +03:00
|
|
|
ProjectName: project.Name,
|
|
|
|
Services: project.ServiceNames(),
|
2021-06-14 17:26:14 +03:00
|
|
|
Status: api.RUNNING,
|
2021-02-23 15:26:45 +03:00
|
|
|
Log: func(pod string, stateReached bool, message string) {
|
|
|
|
state := progress.Done
|
|
|
|
if !stateReached {
|
|
|
|
state = progress.Working
|
|
|
|
}
|
|
|
|
w.Event(progress.NewEvent(pod, state, message))
|
|
|
|
},
|
2021-02-23 14:46:55 +03:00
|
|
|
})
|
2021-01-19 13:49:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Down executes the equivalent to a `compose down`
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Down(ctx context.Context, projectName string, options api.DownOptions) error {
|
2021-09-17 20:26:24 +03:00
|
|
|
if err := checkUnsupportedDownOptions(ctx, options); err != nil {
|
2021-09-16 18:19:05 +03:00
|
|
|
return err
|
2021-06-07 12:21:57 +03:00
|
|
|
}
|
|
|
|
return progress.Run(ctx, func(ctx context.Context) error {
|
|
|
|
return s.down(ctx, projectName, options)
|
|
|
|
})
|
|
|
|
}
|
2021-01-29 16:22:22 +03:00
|
|
|
|
2021-09-17 20:26:24 +03:00
|
|
|
func checkUnsupportedDownOptions(ctx context.Context, o api.DownOptions) error {
|
2021-09-16 18:19:05 +03:00
|
|
|
var errs error
|
|
|
|
checks := []struct {
|
|
|
|
toCheck, expected interface{}
|
|
|
|
option string
|
|
|
|
}{
|
|
|
|
{o.Volumes, false, "volumes"},
|
|
|
|
{o.Images, "", "images"},
|
|
|
|
{o.RemoveOrphans, false, "remove-orphans"},
|
|
|
|
}
|
|
|
|
for _, c := range checks {
|
2021-09-17 20:26:24 +03:00
|
|
|
errs = utils.CheckUnsupported(ctx, errs, c.toCheck, c.expected, "down", c.option)
|
2021-09-16 18:19:05 +03:00
|
|
|
}
|
|
|
|
return errs
|
|
|
|
}
|
|
|
|
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) down(ctx context.Context, projectName string, options api.DownOptions) error {
|
2021-06-07 12:21:57 +03:00
|
|
|
w := progress.ContextWriter(ctx)
|
2021-01-29 16:22:22 +03:00
|
|
|
eventName := fmt.Sprintf("Remove %s", projectName)
|
|
|
|
w.Event(progress.CreatingEvent(eventName))
|
|
|
|
|
|
|
|
logger := func(format string, v ...interface{}) {
|
|
|
|
message := fmt.Sprintf(format, v...)
|
|
|
|
if strings.Contains(message, "Starting delete") {
|
|
|
|
action := strings.Replace(message, "Starting delete for", "Delete", 1)
|
|
|
|
|
|
|
|
w.Event(progress.CreatingEvent(action))
|
|
|
|
w.Event(progress.NewEvent(action, progress.Done, ""))
|
|
|
|
return
|
|
|
|
}
|
|
|
|
w.Event(progress.NewEvent(eventName, progress.Working, message))
|
|
|
|
}
|
|
|
|
err := s.sdk.Uninstall(projectName, logger)
|
2021-02-23 14:46:55 +03:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2021-01-29 16:22:22 +03:00
|
|
|
|
2021-02-23 14:46:55 +03:00
|
|
|
events := []string{}
|
|
|
|
err = s.client.WaitForPodState(ctx, client.WaitForStatusOptions{
|
|
|
|
ProjectName: projectName,
|
|
|
|
Services: nil,
|
2021-06-14 17:26:14 +03:00
|
|
|
Status: api.REMOVING,
|
2021-02-23 15:26:45 +03:00
|
|
|
Timeout: options.Timeout,
|
|
|
|
Log: func(pod string, stateReached bool, message string) {
|
|
|
|
state := progress.Done
|
|
|
|
if !stateReached {
|
|
|
|
state = progress.Working
|
|
|
|
}
|
|
|
|
w.Event(progress.NewEvent(pod, state, message))
|
2021-06-15 10:57:38 +03:00
|
|
|
if !utils2.StringContains(events, pod) {
|
2021-02-23 15:26:45 +03:00
|
|
|
events = append(events, pod)
|
|
|
|
}
|
|
|
|
},
|
2021-02-23 14:46:55 +03:00
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
for _, e := range events {
|
|
|
|
w.Event(progress.NewEvent(e, progress.Done, ""))
|
|
|
|
}
|
|
|
|
w.Event(progress.NewEvent(eventName, progress.Done, ""))
|
|
|
|
return nil
|
2021-01-19 13:49:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// List executes the equivalent to a `docker stack ls`
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) List(ctx context.Context, opts api.ListOptions) ([]api.Stack, error) {
|
2021-09-17 20:26:24 +03:00
|
|
|
if err := checkUnsupportedListOptions(ctx, opts); err != nil {
|
2021-09-16 18:19:05 +03:00
|
|
|
return nil, err
|
|
|
|
}
|
2021-01-29 16:22:22 +03:00
|
|
|
return s.sdk.ListReleases()
|
2021-01-19 13:49:50 +03:00
|
|
|
}
|
|
|
|
|
2021-09-17 20:26:24 +03:00
|
|
|
func checkUnsupportedListOptions(ctx context.Context, o api.ListOptions) error {
|
|
|
|
return utils.CheckUnsupported(ctx, nil, o.All, false, "ls", "all")
|
2021-09-16 18:19:05 +03:00
|
|
|
}
|
|
|
|
|
2021-01-19 13:49:50 +03:00
|
|
|
// Build executes the equivalent to a `compose build`
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Build(ctx context.Context, project *types.Project, options api.BuildOptions) error {
|
|
|
|
return api.ErrNotImplemented
|
2021-01-19 13:49:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Push executes the equivalent ot a `compose push`
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Push(ctx context.Context, project *types.Project, options api.PushOptions) error {
|
|
|
|
return api.ErrNotImplemented
|
2021-01-19 13:49:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Pull executes the equivalent of a `compose pull`
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Pull(ctx context.Context, project *types.Project, options api.PullOptions) error {
|
|
|
|
return api.ErrNotImplemented
|
2021-01-19 13:49:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Create executes the equivalent to a `compose create`
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Create(ctx context.Context, project *types.Project, opts api.CreateOptions) error {
|
|
|
|
return api.ErrNotImplemented
|
2021-01-19 13:49:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Start executes the equivalent to a `compose start`
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Start(ctx context.Context, project *types.Project, options api.StartOptions) error {
|
|
|
|
return api.ErrNotImplemented
|
2021-01-19 13:49:50 +03:00
|
|
|
}
|
|
|
|
|
2021-03-10 00:09:45 +03:00
|
|
|
// Restart executes the equivalent to a `compose restart`
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Restart(ctx context.Context, project *types.Project, options api.RestartOptions) error {
|
|
|
|
return api.ErrNotImplemented
|
2021-03-10 00:09:45 +03:00
|
|
|
}
|
|
|
|
|
2021-01-26 20:20:00 +03:00
|
|
|
// Stop executes the equivalent to a `compose stop`
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Stop(ctx context.Context, project *types.Project, options api.StopOptions) error {
|
|
|
|
return api.ErrNotImplemented
|
2021-01-26 20:20:00 +03:00
|
|
|
}
|
|
|
|
|
2021-05-02 04:20:52 +03:00
|
|
|
// Copy copies a file/folder between a service container and the local filesystem
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Copy(ctx context.Context, project *types.Project, options api.CopyOptions) error {
|
|
|
|
return api.ErrNotImplemented
|
2021-05-02 04:20:52 +03:00
|
|
|
}
|
|
|
|
|
2021-01-19 13:49:50 +03:00
|
|
|
// Logs executes the equivalent to a `compose logs`
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Logs(ctx context.Context, projectName string, consumer api.LogConsumer, options api.LogOptions) error {
|
2021-09-17 20:26:24 +03:00
|
|
|
if err := checkUnsupportedLogOptions(ctx, options); err != nil {
|
2021-09-16 18:19:05 +03:00
|
|
|
return err
|
|
|
|
}
|
2021-02-04 12:04:42 +03:00
|
|
|
if len(options.Services) > 0 {
|
|
|
|
consumer = utils.FilteredLogConsumer(consumer, options.Services)
|
|
|
|
}
|
|
|
|
return s.client.GetLogs(ctx, projectName, consumer, options.Follow)
|
2021-01-19 13:49:50 +03:00
|
|
|
}
|
|
|
|
|
2021-09-17 20:26:24 +03:00
|
|
|
func checkUnsupportedLogOptions(ctx context.Context, o api.LogOptions) error {
|
2021-09-16 18:19:05 +03:00
|
|
|
var errs error
|
|
|
|
checks := []struct {
|
|
|
|
toCheck, expected interface{}
|
|
|
|
option string
|
|
|
|
}{
|
|
|
|
{o.Since, "", "since"},
|
|
|
|
{o.Timestamps, false, "timestamps"},
|
|
|
|
{o.Until, "", "until"},
|
|
|
|
}
|
|
|
|
for _, c := range checks {
|
2021-09-17 20:26:24 +03:00
|
|
|
errs = utils.CheckUnsupported(ctx, errs, c.toCheck, c.expected, "logs", c.option)
|
2021-09-16 18:19:05 +03:00
|
|
|
}
|
|
|
|
return errs
|
|
|
|
}
|
|
|
|
|
2021-01-19 13:49:50 +03:00
|
|
|
// Ps executes the equivalent to a `compose ps`
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Ps(ctx context.Context, projectName string, options api.PsOptions) ([]api.ContainerSummary, error) {
|
2021-02-04 18:57:06 +03:00
|
|
|
return s.client.GetContainers(ctx, projectName, options.All)
|
2021-01-19 13:49:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Convert translate compose model into backend's native format
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Convert(ctx context.Context, project *types.Project, options api.ConvertOptions) ([]byte, error) {
|
2021-02-05 13:12:56 +03:00
|
|
|
chart, err := helm.GetChartInMemory(project)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2021-02-05 19:16:20 +03:00
|
|
|
|
|
|
|
if options.Output != "" {
|
2021-02-08 17:16:32 +03:00
|
|
|
_, err := helm.SaveChart(chart, options.Output)
|
|
|
|
return nil, err
|
2021-02-05 19:16:20 +03:00
|
|
|
}
|
|
|
|
|
2021-02-05 13:12:56 +03:00
|
|
|
buff := []byte{}
|
|
|
|
for _, f := range chart.Raw {
|
|
|
|
header := "\n" + f.Name + "\n" + strings.Repeat("-", len(f.Name)) + "\n"
|
|
|
|
buff = append(buff, []byte(header)...)
|
|
|
|
buff = append(buff, f.Data...)
|
|
|
|
buff = append(buff, []byte("\n")...)
|
|
|
|
}
|
|
|
|
return buff, nil
|
2021-01-19 13:49:50 +03:00
|
|
|
}
|
|
|
|
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Kill(ctx context.Context, project *types.Project, options api.KillOptions) error {
|
|
|
|
return api.ErrNotImplemented
|
2021-01-31 20:42:13 +03:00
|
|
|
}
|
|
|
|
|
2021-01-19 13:49:50 +03:00
|
|
|
// RunOneOffContainer creates a service oneoff container and starts its dependencies
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) RunOneOffContainer(ctx context.Context, project *types.Project, opts api.RunOptions) (int, error) {
|
|
|
|
return 0, api.ErrNotImplemented
|
2021-01-19 13:49:50 +03:00
|
|
|
}
|
2021-02-15 11:13:41 +03:00
|
|
|
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Remove(ctx context.Context, project *types.Project, options api.RemoveOptions) error {
|
|
|
|
return api.ErrNotImplemented
|
2021-02-15 11:13:41 +03:00
|
|
|
}
|
2021-02-15 11:56:34 +03:00
|
|
|
|
|
|
|
// Exec executes a command in a running service container
|
2021-10-27 09:10:53 +03:00
|
|
|
func (s *composeService) Exec(ctx context.Context, project string, opts api.RunOptions) (int, error) {
|
2021-09-17 20:26:24 +03:00
|
|
|
if err := checkUnsupportedExecOptions(ctx, opts); err != nil {
|
2021-09-16 18:19:05 +03:00
|
|
|
return 0, err
|
|
|
|
}
|
2021-10-27 09:10:53 +03:00
|
|
|
return 0, s.client.Exec(ctx, project, opts)
|
2021-02-15 11:56:34 +03:00
|
|
|
}
|
2021-02-22 12:25:40 +03:00
|
|
|
|
2021-09-17 20:26:24 +03:00
|
|
|
func checkUnsupportedExecOptions(ctx context.Context, o api.RunOptions) error {
|
2021-09-16 18:19:05 +03:00
|
|
|
var errs error
|
2021-09-17 20:26:24 +03:00
|
|
|
errs = utils.CheckUnsupported(ctx, errs, o.Index, 0, "exec", "index")
|
|
|
|
errs = utils.CheckUnsupported(ctx, errs, o.Privileged, false, "exec", "privileged")
|
|
|
|
errs = utils.CheckUnsupported(ctx, errs, o.WorkingDir, "", "exec", "workdir")
|
2021-09-16 18:19:05 +03:00
|
|
|
return errs
|
|
|
|
}
|
|
|
|
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Pause(ctx context.Context, project string, options api.PauseOptions) error {
|
|
|
|
return api.ErrNotImplemented
|
2021-02-22 12:25:40 +03:00
|
|
|
}
|
|
|
|
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) UnPause(ctx context.Context, project string, options api.PauseOptions) error {
|
|
|
|
return api.ErrNotImplemented
|
2021-02-22 12:25:40 +03:00
|
|
|
}
|
2021-03-05 14:40:56 +03:00
|
|
|
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Top(ctx context.Context, projectName string, services []string) ([]api.ContainerProcSummary, error) {
|
|
|
|
return nil, api.ErrNotImplemented
|
2021-03-05 14:40:56 +03:00
|
|
|
}
|
2021-03-08 12:22:24 +03:00
|
|
|
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Events(ctx context.Context, project string, options api.EventsOptions) error {
|
|
|
|
return api.ErrNotImplemented
|
2021-03-05 12:09:27 +03:00
|
|
|
}
|
2021-03-19 11:49:14 +03:00
|
|
|
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Port(ctx context.Context, project string, service string, port int, options api.PortOptions) (string, int, error) {
|
|
|
|
return "", 0, api.ErrNotImplemented
|
2021-03-19 11:49:14 +03:00
|
|
|
}
|
2021-04-07 14:16:22 +03:00
|
|
|
|
2021-06-14 17:26:14 +03:00
|
|
|
func (s *composeService) Images(ctx context.Context, projectName string, options api.ImagesOptions) ([]api.ImageSummary, error) {
|
|
|
|
return nil, api.ErrNotImplemented
|
2021-04-07 14:16:22 +03:00
|
|
|
}
|