execcmd

package
v1.50.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

http://aws.amazon.com/apache2.0/

or in the "license" file accompanying this file. This file 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.

Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

http://aws.amazon.com/apache2.0/

or in the "license" file accompanying this file. This file 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.

Index

Constants

View Source
const (
	ContainerDepsDirPrefix = "/ecs-execute-command-"

	SSMAgentBinName       = "amazon-ssm-agent"
	SSMAgentWorkerBinName = "ssm-agent-worker"
	SessionWorkerBinName  = "ssm-session-worker"

	HostLogDir         = "/var/log/ecs/exec"
	ContainerLogDir    = "/var/log/amazon/ssm"
	ECSAgentExecLogDir = "/log/exec"

	HostCertFile            = "/var/lib/ecs/deps/execute-command/certs/tls-ca-bundle.pem"
	ContainerCertFileSuffix = "certs/amazon-ssm-agent.crt"

	ContainerConfigDirName    = "config"
	ContainerConfigFileSuffix = "configuration/" + containerConfigFileName

	// ECSAgentExecConfigDir is the directory where ECS Agent will write the ExecAgent config files to
	ECSAgentExecConfigDir = ecsAgentExecDepsDir + "/" + ContainerConfigDirName
	// HostExecConfigDir is the dir where ExecAgents Config files will live
	HostExecConfigDir          = hostExecDepsDir + "/" + ContainerConfigDirName
	ExecAgentLogConfigFileName = "seelog.xml"
	ContainerLogConfigFile     = "configuration/" + ExecAgentLogConfigFileName
)

Variables

View Source
var GetExecAgentConfigFileName = getAgentConfigFileName
View Source
var GetExecAgentLogConfigFile = getAgentLogConfigFile

Functions

func IsExecEnabledContainer

func IsExecEnabledContainer(container *apicontainer.Container) bool

func IsExecEnabledTask

func IsExecEnabledTask(task *apitask.Task) bool

func NewManager

func NewManager() *manager

func NewManagerWithBinDir

func NewManagerWithBinDir(hostBinDir string) *manager

Types

type AgentMetadata

type AgentMetadata struct {
	PID          string `json:"PID"`
	DockerExecID string `json:"DockerExecID"`
	CMD          string `json:"CMD"`
}

AgentMetadata holds metadata about the exec agent running inside the container (i.e. SSM Agent).

func MapToAgentMetadata

func MapToAgentMetadata(md map[string]interface{}) AgentMetadata

func (*AgentMetadata) String

func (md *AgentMetadata) String() string

func (*AgentMetadata) ToMap

func (md *AgentMetadata) ToMap() map[string]interface{}

type Manager

type Manager interface {
	InitializeContainer(taskId string, container *apicontainer.Container, hostConfig *dockercontainer.HostConfig) error
	StartAgent(ctx context.Context, client dockerapi.DockerClient, task *apitask.Task, container *apicontainer.Container, containerId string) error
	RestartAgentIfStopped(ctx context.Context, client dockerapi.DockerClient, task *apitask.Task, container *apicontainer.Container, containerId string) (RestartStatus, error)
}

type RestartStatus

type RestartStatus int
const (
	HostBinDir = hostExecDepsDir + "/bin"

	ExecuteCommandAgentName = ecs.ManagedAgentNameExecuteCommandAgent

	Restarted RestartStatus = iota
	NotRestarted
	Unknown
)

func (RestartStatus) String

func (rs RestartStatus) String() string

type StartError

type StartError struct {
	// contains filtered or unexported fields
}

func (StartError) Retry

func (e StartError) Retry() bool

Directories

Path Synopsis
Package mock_execcmd is a generated GoMock package.
Package mock_execcmd is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL