context.go 518 B

123456789101112131415161718192021222324
  1. package backend
  2. import (
  3. "context"
  4. "github.com/docker/ecs-plugin/pkg/docker"
  5. )
  6. const (
  7. ContextParamRegion = "region"
  8. ContextParamProfile = "profile"
  9. )
  10. func (b *Backend) CreateContextData(ctx context.Context, params map[string]string) (contextData interface{}, description string, err error) {
  11. err = b.api.CheckRequirements(ctx)
  12. if err != nil {
  13. return "", "", err
  14. }
  15. return docker.AwsContext{
  16. Profile: params[ContextParamProfile],
  17. Region: params[ContextParamRegion],
  18. }, "Amazon ECS context", nil
  19. }