id stringlengths 2 7 | text stringlengths 17 51.2k | title stringclasses 1
value |
|---|---|---|
c169000 | resourceFields.ASMClientCreator)
task.AddResource(asmauth.ResourceName, asmAuthResource)
for _, container := range task.Containers {
if container.ShouldPullWithASMAuth() {
container.BuildResourceDependency(asmAuthResource.GetName(),
resourcestatus.ResourceStatus(asmauth.ASMAuthStatusCreated),
apicontain... | |
c169001 | if container.ShouldCreateWithSSMSecret() {
return true
}
}
return false
} | |
c169002 | ssmSecretResource)
// for every container that needs ssm secret vending as env, it needs to wait all secrets got retrieved
for _, container := range task.Containers {
if container.ShouldCreateWithSSMSecret() {
container.BuildResourceDependency(ssmSecretResource.GetName(),
resourcestatus.ResourceStatus(ssms... | |
c169003 | ok := reqs[secret.Region]; !ok {
reqs[secret.Region] = []apicontainer.Secret{}
}
reqs[secret.Region] = append(reqs[secret.Region], secret)
}
}
}
return reqs
} | |
c169004 | if container.ShouldCreateWithASMSecret() {
return true
}
}
return false
} | |
c169005 | to wait all secrets got retrieved
for _, container := range task.Containers {
if container.ShouldCreateWithASMSecret() {
container.BuildResourceDependency(asmSecretResource.GetName(),
resourcestatus.ResourceStatus(asmsecret.ASMSecretCreated),
apicontainerstatus.ContainerCreated)
}
}
} | |
c169006 | secretKey := secret.GetSecretResourceCacheKey()
if _, ok := reqs[secretKey]; !ok {
reqs[secretKey] = secret
}
}
}
}
return reqs
} | |
c169007 | it, unable to generate cni config")
}
cfg := &ecscni.Config{}
convertENIToCNIConfig(task.GetTaskENI(), cfg)
if task.GetAppMesh() != nil {
convertAppMeshToCNIConfig(task.GetAppMesh(), cfg)
}
return cfg, nil
} | |
c169008 | ipv4.Address
break
}
}
// If there is ipv6 assigned to eni then set it
if len(eni.IPV6Addresses) > 0 {
cfg.ENIIPV6Address = eni.IPV6Addresses[0].Address
}
} | |
c169009 | cfg.AppPorts = appMesh.AppPorts
cfg.EgressIgnoredIPs = appMesh.EgressIgnoredIPs
cfg.EgressIgnoredPorts = appMesh.EgressIgnoredPorts
} | |
c169010 |
if v.Name == name {
return v.Volume, true
}
}
return nil, false
} | |
c169011 | 0 ||
// /path/ -> /path or \path\ -> \path
strings.Compare(vol.Destination, strings.TrimRight(containerPath, string(filepath.Separator))) == 0 {
if hostVolume, exists := task.HostVolumeByName(mountPoint.SourceVolume); exists {
if empty, ok := hostVolume.(*taskresourcevolume.LocalDockerVolume); ok {
... | |
c169012 | (*dockercontainer.Config, *apierrors.DockerClientConfigError) {
return task.dockerConfig(container, apiVersion)
} | |
c169013 | apiVersion dockerclient.DockerVersion) (*dockercontainer.HostConfig, *apierrors.HostConfigError) {
return task.dockerHostConfig(container, dockerContainerMap, apiVersion)
} | |
c169014 | // credentialsId for the task after adding credentials to the
// credentials manager
return &apierrors.HostConfigError{Msg: "Unable to get execution role credentials for task"}
}
credentialsEndpointRelativeURI := executionRoleCredentials.IAMRoleCredentials.GenerateCredentialsEndpointRelativeURI()
hostConfig.Lo... | |
c169015 | task.Containers {
if cont.Type == apicontainer.ContainerCNIPause {
pauseContName = cont.Name
break
}
}
if pauseContName == "" {
seelog.Critical("Pause container required, but not found in the task: %s", task.String())
return false, ""
}
pauseContainer, ok := dockerContainerMap[pauseContName]
if !ok ... | |
c169016 | if hostname == "" {
return dockerConfig
}
dockerConfig.Hostname = hostname
return dockerConfig
} | |
c169017 | {
seelog.Criticalf("Namespace Pause container not found in the task: %s; Setting Task's Desired Status to Stopped", task.Arn)
task.SetDesiredStatus(apitaskstatus.TaskStopped)
return false, ""
}
pauseDockerID, ok := dockerContainerMap[pauseCont.Name]
if !ok || pauseDockerID == nil {
// Docker containe... | |
c169018 |
if !ok {
seelog.Criticalf("Namespace Pause container not found in the task: %s; Setting Task's Desired Status to Stopped", task.Arn)
task.SetDesiredStatus(apitaskstatus.TaskStopped)
return false, ""
}
pauseDockerID, ok := dockerContainerMap[pauseCont.Name]
if !ok || pauseDockerID == nil {
// Docker... | |
c169019 | task.UpdateDesiredStatus()
return change != apitaskstatus.TaskStatusNone
} | |
c169020 |
task.updateContainerDesiredStatusUnsafe(task.DesiredStatusUnsafe)
task.updateResourceDesiredStatusUnsafe(task.DesiredStatusUnsafe)
} | |
c169021 | task.setKnownStatus(status)
task.updateKnownStatusTime()
} | |
c169022 | defer task.lock.RUnlock()
return task.KnownStatusUnsafe
} | |
c169023 | task.lock.RUnlock()
return task.KnownStatusTimeUnsafe
} | |
c169024 | task.lock.Unlock()
task.credentialsID = id
} | |
c169025 | task.lock.RUnlock()
return task.credentialsID
} | |
c169026 | defer task.lock.Unlock()
task.ExecutionCredentialsID = id
} | |
c169027 | task.lock.RLock()
defer task.lock.RUnlock()
return task.ExecutionCredentialsID
} | |
c169028 | defer task.lock.RUnlock()
return task.DesiredStatusUnsafe
} | |
c169029 | defer task.lock.Unlock()
task.DesiredStatusUnsafe = status
} | |
c169030 | defer task.lock.RUnlock()
return task.SentStatusUnsafe
} | |
c169031 | defer task.lock.Unlock()
task.SentStatusUnsafe = status
} | |
c169032 | defer task.lock.Unlock()
task.ENI = eni
} | |
c169033 | task.lock.RUnlock()
return task.ENI
} | |
c169034 | defer task.lock.Unlock()
task.AppMesh = appMesh
} | |
c169035 | defer task.lock.RUnlock()
return task.AppMesh
} | |
c169036 | task.lock.RUnlock()
return task.StopSequenceNumber
} | |
c169037 | task.lock.Unlock()
task.StopSequenceNumber = seqnum
} | |
c169038 | is not set
if task.PullStartedAtUnsafe.IsZero() {
task.PullStartedAtUnsafe = timestamp
return true
}
return false
} | |
c169039 | task.lock.RUnlock()
return task.PullStartedAtUnsafe
} | |
c169040 | task.lock.Unlock()
task.PullStoppedAtUnsafe = timestamp
} | |
c169041 | task.lock.RUnlock()
return task.PullStoppedAtUnsafe
} | |
c169042 |
if task.ExecutionStoppedAtUnsafe.IsZero() {
task.ExecutionStoppedAtUnsafe = timestamp
return true
}
return false
} | |
c169043 | task.lock.RUnlock()
return task.ExecutionStoppedAtUnsafe
} | |
c169044 | fmt.Sprintf("%s (%s->%s),", container.Name, container.GetKnownStatus().String(), container.GetDesiredStatus().String())
}
if task.ENI != nil {
res += fmt.Sprintf(" ENI: [%s]", task.ENI.String())
}
return res + "]"
} | |
c169045 |
// ExecutionStoppedAt was already recorded. Nothing to left to do here
return
}
seelog.Infof("Task [%s]: recording execution stopped time. Essential container [%s] stopped at: %s",
task.Arn, container.Name, now.String())
} | |
c169046 | defer task.lock.RUnlock()
return task.getResourcesUnsafe()
} | |
c169047 | resourceList = append(resourceList, resources...)
}
return resourceList
} | |
c169048 | task.ResourcesMapUnsafe[resourceType] = append(task.ResourcesMapUnsafe[resourceType], resource)
} | |
c169049 | terminal reason into capital letter
words := strings.Fields(reason)
words[0] = strings.Title(words[0])
task.terminalReason = strings.Join(words, " ")
})
} | |
c169050 | task.lock.RUnlock()
return task.terminalReason
} | |
c169051 |
asmResource := resource[0].(*asmauth.ASMAuthResource)
dac, ok := asmResource.GetASMDockerAuthConfig(secretID)
if !ok {
return errors.Errorf("task auth data: unable to fetch docker auth config [%s]", secretID)
}
container.SetASMDockerAuthConfig(dac)
return nil
} | |
c169052 |
defer task.lock.RUnlock()
res, ok := task.ResourcesMapUnsafe[ssmsecret.ResourceName]
return res, ok
} | |
c169053 | := secret.GetSecretResourceCacheKey()
if secretValue, ok := asmRes.GetCachedSecretValue(k); ok {
secretVal = secretValue
}
}
if secret.Type == apicontainer.SecretTypeEnv {
envVars[secret.Name] = secretVal
continue
}
if secret.Target == apicontainer.SecretTargetLogDriver {
logDriverTokenName... | |
c169054 |
defer task.lock.RUnlock()
res, ok := task.ResourcesMapUnsafe[asmsecret.ResourceName]
return res, ok
} | |
c169055 | task.lock.RUnlock()
return task.PIDMode
} | |
c169056 | task.lock.RUnlock()
return task.IPCMode
} | |
c169057 | association.Containers {
if associatedContainerName == containerName {
associationNames = append(associationNames, association.Name)
}
}
}
}
return associationNames
} | |
c169058 |
if association.Type == associationType && association.Name == associationName {
return &association, true
}
}
return nil, false
} | |
c169059 | cancel,
cluster: aws.String(cluster),
containerInstance: aws.String(containerInstanceArn),
acsClient: acsClient,
state: taskEngineState,
saver: saver,
}
} | |
c169060 | *ecsacs.AttachTaskNetworkInterfacesMessage) {
attachENIHandler.messageBuffer <- message
}
} | |
c169061 | seelog.Warnf("Unable to handle ENI Attachment message [%s]: %v", message.String(), err)
}
case <-attachENIHandler.ctx.Done():
return
}
}
} | |
c169062 | messageID,
}); err != nil {
seelog.Warnf("Failed to ack request with messageId: %s, error: %v", aws.StringValue(messageID), err)
}
}(message.ClusterArn, message.ContainerInstanceArn, message.MessageId)
// Check if this is a duplicate message
mac := aws.StringValue(message.ElasticNetworkInterfaces[0].Mac... | |
c169063 |
ExpiresAt: receivedAt.Add(time.Duration(aws.Int64Value(message.WaitTimeoutMs)) * time.Millisecond),
}
eniAckTimeoutHandler := ackTimeoutHandler{mac: mac, state: handler.state}
if err := eniAttachment.StartTimer(eniAckTimeoutHandler.handle); err != nil {
return err
}
seelog.Infof("Adding eni info for task '%s'... | |
c169064 | "" {
return errors.Errorf("attach eni handler validation: containerInstanceArn not set in AttachTaskNetworkInterface message received from ECS")
}
enis := message.ElasticNetworkInterfaces
if len(enis) != 1 {
return errors.Errorf("attach eni handler validation: incorrect number of ENIs in AttachTaskNetworkInter... | |
c169065 | ret0, _ := ret[0].(error)
return ret0
} | |
c169066 | "ForceSave", reflect.TypeOf((*MockStateManager)(nil).ForceSave))
} | |
c169067 |
mock.recorder = &MockClientServerMockRecorder{mock}
return mock
} | |
c169068 | wsclient.RequestHandler) {
m.ctrl.Call(m, "AddRequestHandler", arg0)
} | |
c169069 | mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRequestHandler", reflect.TypeOf((*MockClientServer)(nil).AddRequestHandler), arg0)
} | |
c169070 | mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connect", reflect.TypeOf((*MockClientServer)(nil).Connect))
} | |
c169071 | a := range arg0 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "Disconnect", varargs...)
ret0, _ := ret[0].(error)
return ret0
} | |
c169072 | ret0, _ := ret[0].(bool)
return ret0
} | |
c169073 | m.ctrl.Call(m, "MakeRequest", arg0)
ret0, _ := ret[0].(error)
return ret0
} | |
c169074 | wsclient.RequestHandler) {
m.ctrl.Call(m, "SetAnyRequestHandler", arg0)
} | |
c169075 | wsconn.WebsocketConn) {
m.ctrl.Call(m, "SetConnection", arg0)
} | |
c169076 | m.ctrl.Call(m, "SetReadDeadline", arg0)
ret0, _ := ret[0].(error)
return ret0
} | |
c169077 | ContainerStatus) bool {
return *cs == steadyStateStatus || *cs == ContainerStopped
} | |
c169078 | == steadyStateStatus {
return ContainerRunning
}
if *cs == ContainerStopped {
return ContainerStopped
}
return ContainerStatusNone
} | |
c169079 | nil
}
if strStatus == "DEAD" {
*cs = ContainerStopped
return nil
}
stat, ok := containerStatusMap[strStatus]
if !ok {
*cs = ContainerStatusNone
return errors.New("container status unmarshal: unrecognized status")
}
*cs = stat
return nil
} | |
c169080 |
if cs == nil {
return nil, nil
}
return []byte(`"` + cs.String() + `"`), nil
} | |
c169081 |
case "HEALTHY":
*healthStatus = ContainerHealthy
case "UNHEALTHY":
*healthStatus = ContainerUnhealthy
default:
return errors.New("container health status unmarshal: unrecognized status: " + string(b))
}
return nil
} | |
c169082 |
if healthStatus == nil {
return nil, nil
}
return []byte(`"` + healthStatus.String() + `"`), nil
} | |
c169083 | // we can use promhttp.HandlerFor(customRegisterer, promhttp.HandlerOpts{})
http.Handle("/metrics", promhttp.Handler())
err := http.ListenAndServe(fmt.Sprintf(":%d", config.AgentPrometheusExpositionPort), nil)
if err != nil {
seelog.Errorf("Error publishing metrics: %s", err.Error())
}
}()
} | |
c169084 |
mock.recorder = &MockDockerClientMockRecorder{mock}
return mock
} | |
c169085 | _ := ret[0].(dockerclient.DockerVersion)
ret1, _ := ret[1].(error)
return ret0, ret1
} | |
c169086 | _ := ret[0].(<-chan dockerapi.DockerContainerChangeEvent)
ret1, _ := ret[1].(error)
return ret0, ret1
} | |
c169087 | mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerEvents", reflect.TypeOf((*MockDockerClient)(nil).ContainerEvents), arg0)
} | |
c169088 | arg0, arg1, arg2, arg3, arg4)
ret0, _ := ret[0].(dockerapi.DockerContainerMetadata)
return ret0
} | |
c169089 | dockerapi.SDKVolumeResponse {
ret := m.ctrl.Call(m, "CreateVolume", arg0, arg1, arg2, arg3, arg4, arg5)
ret0, _ := ret[0].(dockerapi.SDKVolumeResponse)
return ret0
} | |
c169090 | ret0, _ := ret[0].(status.ContainerStatus)
ret1, _ := ret[1].(dockerapi.DockerContainerMetadata)
return ret0, ret1
} | |
c169091 | arg2)
ret0, _ := ret[0].(*types.ContainerJSON)
ret1, _ := ret[1].(error)
return ret0, ret1
} | |
c169092 | := m.ctrl.Call(m, "InspectImage", arg0)
ret0, _ := ret[0].(*types.ImageInspect)
ret1, _ := ret[1].(error)
return ret0, ret1
} | |
c169093 | := ret[0].([]dockerclient.DockerVersion)
return ret0
} | |
c169094 | "KnownVersions", reflect.TypeOf((*MockDockerClient)(nil).KnownVersions))
} | |
c169095 | {
ret := m.ctrl.Call(m, "ListContainers", arg0, arg1, arg2)
ret0, _ := ret[0].(dockerapi.ListContainersResponse)
return ret0
} | |
c169096 | {
ret := m.ctrl.Call(m, "ListImages", arg0, arg1)
ret0, _ := ret[0].(dockerapi.ListImagesResponse)
return ret0
} | |
c169097 | {
ret := m.ctrl.Call(m, "ListPlugins", arg0, arg1, arg2)
ret0, _ := ret[0].(dockerapi.ListPluginsResponse)
return ret0
} | |
c169098 | arg1, arg2, arg3)
ret0, _ := ret[0].([]string)
ret1, _ := ret[1].(error)
return ret0, ret1
} | |
c169099 | time.Duration) dockerapi.DockerContainerMetadata {
ret := m.ctrl.Call(m, "PullImage", arg0, arg1, arg2, arg3)
ret0, _ := ret[0].(dockerapi.DockerContainerMetadata)
return ret0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.