execcmd

package
v0.0.0-...-41d593c Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 24 Imported by: 3

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 (
	ContainerConfigDirName = "config"

	ExecAgentLogConfigFileName = "seelog.xml"
)
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"

	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
	ContainerLogConfigFile = "configuration/" + ExecAgentLogConfigFileName
)
View Source
const (
	HostBinDir = hostExecDepsDir + "/bin"
)

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 (
	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