_id stringlengths 2 7 | title stringlengths 1 118 | partition stringclasses 3
values | text stringlengths 52 85.5k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q168900 | RotateSecret | validation | func (m *MockSecretsManagerAPI) RotateSecret(arg0 *secretsmanager.RotateSecretInput) (*secretsmanager.RotateSecretOutput, error) {
ret := m.ctrl.Call(m, "RotateSecret", arg0)
ret0, _ := ret[0].(*secretsmanager.RotateSecretOutput)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q168901 | RotateSecretRequest | validation | func (m *MockSecretsManagerAPI) RotateSecretRequest(arg0 *secretsmanager.RotateSecretInput) (*request.Request, *secretsmanager.RotateSecretOutput) {
ret := m.ctrl.Call(m, "RotateSecretRequest", arg0)
ret0, _ := ret[0].(*request.Request)
ret1, _ := ret[1].(*secretsmanager.RotateSecretOutput)
return ret0, ret1
} | go | {
"resource": ""
} |
q168902 | RotateSecretWithContext | validation | func (m *MockSecretsManagerAPI) RotateSecretWithContext(arg0 aws.Context, arg1 *secretsmanager.RotateSecretInput, arg2 ...request.Option) (*secretsmanager.RotateSecretOutput, error) {
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "RotateSecretWi... | go | {
"resource": ""
} |
q168903 | TagResource | validation | func (m *MockSecretsManagerAPI) TagResource(arg0 *secretsmanager.TagResourceInput) (*secretsmanager.TagResourceOutput, error) {
ret := m.ctrl.Call(m, "TagResource", arg0)
ret0, _ := ret[0].(*secretsmanager.TagResourceOutput)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q168904 | TagResourceRequest | validation | func (m *MockSecretsManagerAPI) TagResourceRequest(arg0 *secretsmanager.TagResourceInput) (*request.Request, *secretsmanager.TagResourceOutput) {
ret := m.ctrl.Call(m, "TagResourceRequest", arg0)
ret0, _ := ret[0].(*request.Request)
ret1, _ := ret[1].(*secretsmanager.TagResourceOutput)
return ret0, ret1
} | go | {
"resource": ""
} |
q168905 | UntagResource | validation | func (m *MockSecretsManagerAPI) UntagResource(arg0 *secretsmanager.UntagResourceInput) (*secretsmanager.UntagResourceOutput, error) {
ret := m.ctrl.Call(m, "UntagResource", arg0)
ret0, _ := ret[0].(*secretsmanager.UntagResourceOutput)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q168906 | UntagResourceRequest | validation | func (m *MockSecretsManagerAPI) UntagResourceRequest(arg0 *secretsmanager.UntagResourceInput) (*request.Request, *secretsmanager.UntagResourceOutput) {
ret := m.ctrl.Call(m, "UntagResourceRequest", arg0)
ret0, _ := ret[0].(*request.Request)
ret1, _ := ret[1].(*secretsmanager.UntagResourceOutput)
return ret0, ret1
} | go | {
"resource": ""
} |
q168907 | UntagResourceWithContext | validation | func (m *MockSecretsManagerAPI) UntagResourceWithContext(arg0 aws.Context, arg1 *secretsmanager.UntagResourceInput, arg2 ...request.Option) (*secretsmanager.UntagResourceOutput, error) {
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "UntagResour... | go | {
"resource": ""
} |
q168908 | UpdateSecret | validation | func (m *MockSecretsManagerAPI) UpdateSecret(arg0 *secretsmanager.UpdateSecretInput) (*secretsmanager.UpdateSecretOutput, error) {
ret := m.ctrl.Call(m, "UpdateSecret", arg0)
ret0, _ := ret[0].(*secretsmanager.UpdateSecretOutput)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q168909 | UpdateSecretRequest | validation | func (m *MockSecretsManagerAPI) UpdateSecretRequest(arg0 *secretsmanager.UpdateSecretInput) (*request.Request, *secretsmanager.UpdateSecretOutput) {
ret := m.ctrl.Call(m, "UpdateSecretRequest", arg0)
ret0, _ := ret[0].(*request.Request)
ret1, _ := ret[1].(*secretsmanager.UpdateSecretOutput)
return ret0, ret1
} | go | {
"resource": ""
} |
q168910 | UpdateSecretVersionStage | validation | func (m *MockSecretsManagerAPI) UpdateSecretVersionStage(arg0 *secretsmanager.UpdateSecretVersionStageInput) (*secretsmanager.UpdateSecretVersionStageOutput, error) {
ret := m.ctrl.Call(m, "UpdateSecretVersionStage", arg0)
ret0, _ := ret[0].(*secretsmanager.UpdateSecretVersionStageOutput)
ret1, _ := ret[1].(error)
... | go | {
"resource": ""
} |
q168911 | UpdateSecretVersionStageRequest | validation | func (m *MockSecretsManagerAPI) UpdateSecretVersionStageRequest(arg0 *secretsmanager.UpdateSecretVersionStageInput) (*request.Request, *secretsmanager.UpdateSecretVersionStageOutput) {
ret := m.ctrl.Call(m, "UpdateSecretVersionStageRequest", arg0)
ret0, _ := ret[0].(*request.Request)
ret1, _ := ret[1].(*secretsmanag... | go | {
"resource": ""
} |
q168912 | UpdateSecretVersionStageWithContext | validation | func (m *MockSecretsManagerAPI) UpdateSecretVersionStageWithContext(arg0 aws.Context, arg1 *secretsmanager.UpdateSecretVersionStageInput, arg2 ...request.Option) (*secretsmanager.UpdateSecretVersionStageOutput, error) {
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
r... | go | {
"resource": ""
} |
q168913 | UpdateSecretVersionStageWithContext | validation | func (mr *MockSecretsManagerAPIMockRecorder) UpdateSecretVersionStageWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call {
varargs := append([]interface{}{arg0, arg1}, arg2...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSecretVersionStageWithContext", reflect.TypeOf((*MockSecretsMa... | go | {
"resource": ""
} |
q168914 | UpdateSecretWithContext | validation | func (m *MockSecretsManagerAPI) UpdateSecretWithContext(arg0 aws.Context, arg1 *secretsmanager.UpdateSecretInput, arg2 ...request.Option) (*secretsmanager.UpdateSecretOutput, error) {
varargs := []interface{}{arg0, arg1}
for _, a := range arg2 {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "UpdateSecretWi... | go | {
"resource": ""
} |
q168915 | createBindsEnv | validation | func createBindsEnv(binds []string, env []string, dataDirOnHost string, metadataDirectoryPath string) ([]string, []string) {
randID := uuid.New()
instanceBind := fmt.Sprintf(`%s/%s:%s/%s`, dataDirOnHost, metadataDirectoryPath, mountPoint, randID)
metadataEnvVariable := fmt.Sprintf("%s=%s/%s/%s", metadataEnvironmentV... | go | {
"resource": ""
} |
q168916 | parseMetadataAtContainerCreate | validation | func (manager *metadataManager) parseMetadataAtContainerCreate(task *apitask.Task, containerName string) Metadata {
return Metadata{
cluster: manager.cluster,
taskMetadata: TaskMetadata{
containerName: containerName,
taskARN: task.Arn,
taskDefinitionFamily: task.Family,
taskDe... | go | {
"resource": ""
} |
q168917 | parseMetadata | validation | func (manager *metadataManager) parseMetadata(dockerContainer *types.ContainerJSON, task *apitask.Task, containerName string) Metadata {
dockerMD := parseDockerContainerMetadata(task.Arn, containerName, dockerContainer)
return Metadata{
cluster: manager.cluster,
taskMetadata: TaskMetadata{
containerName: ... | go | {
"resource": ""
} |
q168918 | parseDockerContainerMetadata | validation | func parseDockerContainerMetadata(taskARN string, containerName string, dockerContainer *types.ContainerJSON) DockerContainerMetadata {
if dockerContainer == nil {
seelog.Warnf("Failed to parse container metadata for task %s container %s: container metadata not available or does not exist", taskARN, containerName)
... | go | {
"resource": ""
} |
q168919 | parseNetworkMetadata | validation | func parseNetworkMetadata(settings *types.NetworkSettings, hostConfig *dockercontainer.HostConfig) (NetworkMetadata, error) {
// Network settings and Host configuration should not be missing except due to errors
if settings == nil {
err := fmt.Errorf("parse network metadata: could not find network settings")
retu... | go | {
"resource": ""
} |
q168920 | Initialize | validation | func (n *NvidiaGPUManager) Initialize() error {
if GPUInfoFileExists() {
// GPU info file found
gpuJSON, err := GetGPUInfoJSON()
if err != nil {
return errors.Wrapf(err, "could not read GPU file content")
}
var nvidiaGPUInfo NvidiaGPUManager
err = json.Unmarshal(gpuJSON, &nvidiaGPUInfo)
if err != nil ... | go | {
"resource": ""
} |
q168921 | SetGPUIDs | validation | func (n *NvidiaGPUManager) SetGPUIDs(gpuIDs []string) {
n.lock.Lock()
defer n.lock.Unlock()
n.GPUIDs = gpuIDs
} | go | {
"resource": ""
} |
q168922 | SetDriverVersion | validation | func (n *NvidiaGPUManager) SetDriverVersion(version string) {
n.lock.Lock()
defer n.lock.Unlock()
n.DriverVersion = version
} | go | {
"resource": ""
} |
q168923 | GetDriverVersion | validation | func (n *NvidiaGPUManager) GetDriverVersion() string {
n.lock.RLock()
defer n.lock.RUnlock()
return n.DriverVersion
} | go | {
"resource": ""
} |
q168924 | GetDevices | validation | func (n *NvidiaGPUManager) GetDevices() []*ecs.PlatformDevice {
n.lock.RLock()
defer n.lock.RUnlock()
return n.GPUDevices
} | go | {
"resource": ""
} |
q168925 | NewMockLicenseProvider | validation | func NewMockLicenseProvider(ctrl *gomock.Controller) *MockLicenseProvider {
mock := &MockLicenseProvider{ctrl: ctrl}
mock.recorder = &MockLicenseProviderMockRecorder{mock}
return mock
} | go | {
"resource": ""
} |
q168926 | GetText | validation | func (m *MockLicenseProvider) GetText() (string, error) {
ret := m.ctrl.Call(m, "GetText")
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q168927 | GetText | validation | func (mr *MockLicenseProviderMockRecorder) GetText() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetText", reflect.TypeOf((*MockLicenseProvider)(nil).GetText))
} | go | {
"resource": ""
} |
q168928 | NewMockBackoff | validation | func NewMockBackoff(ctrl *gomock.Controller) *MockBackoff {
mock := &MockBackoff{ctrl: ctrl}
mock.recorder = &MockBackoffMockRecorder{mock}
return mock
} | go | {
"resource": ""
} |
q168929 | Duration | validation | func (m *MockBackoff) Duration() time.Duration {
ret := m.ctrl.Call(m, "Duration")
ret0, _ := ret[0].(time.Duration)
return ret0
} | go | {
"resource": ""
} |
q168930 | Duration | validation | func (mr *MockBackoffMockRecorder) Duration() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Duration", reflect.TypeOf((*MockBackoff)(nil).Duration))
} | go | {
"resource": ""
} |
q168931 | UnmarshalText | validation | func (status *MetadataStatus) UnmarshalText(text []byte) error {
t := string(text)
switch t {
case MetadataInitialText:
*status = MetadataInitial
case MetadataReadyText:
*status = MetadataReady
default:
return fmt.Errorf("failed unmarshalling MetadataStatus %s", text)
}
return nil
} | go | {
"resource": ""
} |
q168932 | After | validation | func (*DefaultTime) After(d time.Duration) <-chan time.Time {
return time.After(d)
} | go | {
"resource": ""
} |
q168933 | AfterFunc | validation | func (*DefaultTime) AfterFunc(d time.Duration, f func()) Timer {
return time.AfterFunc(d, f)
} | go | {
"resource": ""
} |
q168934 | Since | validation | func Since(t time.Time) time.Duration {
return _time.Now().Sub(t)
} | go | {
"resource": ""
} |
q168935 | NewMockTaskResource | validation | func NewMockTaskResource(ctrl *gomock.Controller) *MockTaskResource {
mock := &MockTaskResource{ctrl: ctrl}
mock.recorder = &MockTaskResourceMockRecorder{mock}
return mock
} | go | {
"resource": ""
} |
q168936 | ApplyTransition | validation | func (m *MockTaskResource) ApplyTransition(arg0 status0.ResourceStatus) error {
ret := m.ctrl.Call(m, "ApplyTransition", arg0)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q168937 | Cleanup | validation | func (m *MockTaskResource) Cleanup() error {
ret := m.ctrl.Call(m, "Cleanup")
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q168938 | GetCreatedAt | validation | func (m *MockTaskResource) GetCreatedAt() time.Time {
ret := m.ctrl.Call(m, "GetCreatedAt")
ret0, _ := ret[0].(time.Time)
return ret0
} | go | {
"resource": ""
} |
q168939 | GetTerminalReason | validation | func (m *MockTaskResource) GetTerminalReason() string {
ret := m.ctrl.Call(m, "GetTerminalReason")
ret0, _ := ret[0].(string)
return ret0
} | go | {
"resource": ""
} |
q168940 | Initialize | validation | func (mr *MockTaskResourceMockRecorder) Initialize(arg0, arg1, arg2 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Initialize", reflect.TypeOf((*MockTaskResource)(nil).Initialize), arg0, arg1, arg2)
} | go | {
"resource": ""
} |
q168941 | KnownCreated | validation | func (m *MockTaskResource) KnownCreated() bool {
ret := m.ctrl.Call(m, "KnownCreated")
ret0, _ := ret[0].(bool)
return ret0
} | go | {
"resource": ""
} |
q168942 | MarshalJSON | validation | func (mr *MockTaskResourceMockRecorder) MarshalJSON() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarshalJSON", reflect.TypeOf((*MockTaskResource)(nil).MarshalJSON))
} | go | {
"resource": ""
} |
q168943 | NextKnownState | validation | func (m *MockTaskResource) NextKnownState() status0.ResourceStatus {
ret := m.ctrl.Call(m, "NextKnownState")
ret0, _ := ret[0].(status0.ResourceStatus)
return ret0
} | go | {
"resource": ""
} |
q168944 | SetAppliedStatus | validation | func (m *MockTaskResource) SetAppliedStatus(arg0 status0.ResourceStatus) bool {
ret := m.ctrl.Call(m, "SetAppliedStatus", arg0)
ret0, _ := ret[0].(bool)
return ret0
} | go | {
"resource": ""
} |
q168945 | SetAppliedStatus | validation | func (mr *MockTaskResourceMockRecorder) SetAppliedStatus(arg0 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAppliedStatus", reflect.TypeOf((*MockTaskResource)(nil).SetAppliedStatus), arg0)
} | go | {
"resource": ""
} |
q168946 | SetCreatedAt | validation | func (m *MockTaskResource) SetCreatedAt(arg0 time.Time) {
m.ctrl.Call(m, "SetCreatedAt", arg0)
} | go | {
"resource": ""
} |
q168947 | SetDesiredStatus | validation | func (m *MockTaskResource) SetDesiredStatus(arg0 status0.ResourceStatus) {
m.ctrl.Call(m, "SetDesiredStatus", arg0)
} | go | {
"resource": ""
} |
q168948 | SetKnownStatus | validation | func (m *MockTaskResource) SetKnownStatus(arg0 status0.ResourceStatus) {
m.ctrl.Call(m, "SetKnownStatus", arg0)
} | go | {
"resource": ""
} |
q168949 | StatusString | validation | func (m *MockTaskResource) StatusString(arg0 status0.ResourceStatus) string {
ret := m.ctrl.Call(m, "StatusString", arg0)
ret0, _ := ret[0].(string)
return ret0
} | go | {
"resource": ""
} |
q168950 | NewMockLoader | validation | func NewMockLoader(ctrl *gomock.Controller) *MockLoader {
mock := &MockLoader{ctrl: ctrl}
mock.recorder = &MockLoaderMockRecorder{mock}
return mock
} | go | {
"resource": ""
} |
q168951 | LoadImage | validation | func (mr *MockLoaderMockRecorder) LoadImage(arg0, arg1, arg2 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LoadImage", reflect.TypeOf((*MockLoader)(nil).LoadImage), arg0, arg1, arg2)
} | go | {
"resource": ""
} |
q168952 | Error | validation | func (cnferror ContainerNotFound) Error() string {
return fmt.Sprintf("Could not find container '%s' in task '%s'",
cnferror.ContainerName, cnferror.TaskArn)
} | go | {
"resource": ""
} |
q168953 | String | validation | func (event *DockerContainerChangeEvent) String() string {
res := fmt.Sprintf("Status: %s, DockerID: %s", event.Status.String(), event.DockerID)
res += ", health: " + event.Health.Status.String()
if event.ExitCode != nil {
res += fmt.Sprintf(", ExitCode: %d", aws.IntValue(event.ExitCode))
}
if len(event.PortBi... | go | {
"resource": ""
} |
q168954 | UnmarshalJSON | validation | func (tv *TaskVolume) UnmarshalJSON(b []byte) error {
// Format: {name: volumeName, host: HostVolume, dockerVolumeConfiguration {}}
intermediate := make(map[string]json.RawMessage)
if err := json.Unmarshal(b, &intermediate); err != nil {
return err
}
name, ok := intermediate["name"]
if !ok {
return errors.New... | go | {
"resource": ""
} |
q168955 | MarshalJSON | validation | func (tv *TaskVolume) MarshalJSON() ([]byte, error) {
result := make(map[string]interface{})
if len(tv.Type) == 0 {
tv.Type = HostVolumeType
}
result["name"] = tv.Name
result["type"] = tv.Type
switch tv.Type {
case DockerVolumeType:
result["dockerVolumeConfiguration"] = tv.Volume
case HostVolumeType:
r... | go | {
"resource": ""
} |
q168956 | NewSSMClient | validation | func (*ssmClientCreator) NewSSMClient(region string,
creds credentials.IAMRoleCredentials) ssmclient.SSMClient {
cfg := aws.NewConfig().
WithHTTPClient(httpclient.New(roundtripTimeout, false)).
WithRegion(region).
WithCredentials(
awscreds.NewStaticCredentials(creds.AccessKeyID, creds.SecretAccessKey,
cr... | go | {
"resource": ""
} |
q168957 | GetClient | validation | func (f *factory) GetClient(version dockerclient.DockerVersion) (sdkclient.Client, error) {
for _, v := range getWindowsReplaceableVersions() {
if v == version {
version = minDockerAPIVersion
break
}
}
return f.getClient(version)
} | go | {
"resource": ""
} |
q168958 | getWindowsReplaceableVersions | validation | func getWindowsReplaceableVersions() []dockerclient.DockerVersion {
return []dockerclient.DockerVersion{
dockerclient.Version_1_17,
dockerclient.Version_1_18,
dockerclient.Version_1_19,
dockerclient.Version_1_20,
dockerclient.Version_1_21,
dockerclient.Version_1_22,
dockerclient.Version_1_23,
}
} | go | {
"resource": ""
} |
q168959 | getWindowsSupportedVersions | validation | func getWindowsSupportedVersions() []dockerclient.DockerVersion {
return []dockerclient.DockerVersion{
dockerclient.Version_1_24,
dockerclient.Version_1_25,
dockerclient.Version_1_26,
dockerclient.Version_1_27,
dockerclient.Version_1_28,
dockerclient.Version_1_29,
dockerclient.Version_1_30,
}
} | go | {
"resource": ""
} |
q168960 | PortBindingFromDockerPortBinding | validation | func PortBindingFromDockerPortBinding(dockerPortBindings nat.PortMap) ([]PortBinding, apierrors.NamedError) {
portBindings := make([]PortBinding, 0, len(dockerPortBindings))
for port, bindings := range dockerPortBindings {
containerPort, err := nat.ParsePort(port.Port())
if err != nil {
return nil, &apierrors... | go | {
"resource": ""
} |
q168961 | NewASMAuthResource | validation | func NewASMAuthResource(taskARN string,
asmRequirements []*apicontainer.ASMAuthData,
executionCredentialsID string,
credentialsManager credentials.Manager,
asmClientCreator factory.ClientCreator) *ASMAuthResource {
c := &ASMAuthResource{
taskARN: taskARN,
requiredASMResources: asmRequirements... | go | {
"resource": ""
} |
q168962 | Create | validation | func (auth *ASMAuthResource) Create() error {
seelog.Infof("ASM Auth: Retrieving credentials for containers in task: [%s]", auth.taskARN)
if auth.dockerAuthData == nil {
auth.dockerAuthData = make(map[string]types.AuthConfig)
}
for _, a := range auth.GetRequiredASMResources() {
err := auth.retrieveASMDockerAuth... | go | {
"resource": ""
} |
q168963 | GetRequiredASMResources | validation | func (auth *ASMAuthResource) GetRequiredASMResources() []*apicontainer.ASMAuthData {
auth.lock.RLock()
defer auth.lock.RUnlock()
return auth.requiredASMResources
} | go | {
"resource": ""
} |
q168964 | GetExecutionCredentialsID | validation | func (auth *ASMAuthResource) GetExecutionCredentialsID() string {
auth.lock.RLock()
defer auth.lock.RUnlock()
return auth.executionCredentialsID
} | go | {
"resource": ""
} |
q168965 | clearASMDockerAuthConfig | validation | func (auth *ASMAuthResource) clearASMDockerAuthConfig() {
auth.lock.Lock()
defer auth.lock.Unlock()
for k := range auth.dockerAuthData {
delete(auth.dockerAuthData, k)
}
} | go | {
"resource": ""
} |
q168966 | GetASMDockerAuthConfig | validation | func (auth *ASMAuthResource) GetASMDockerAuthConfig(secretID string) (types.AuthConfig, bool) {
auth.lock.RLock()
defer auth.lock.RUnlock()
d, ok := auth.dockerAuthData[secretID]
return d, ok
} | go | {
"resource": ""
} |
q168967 | MarshalJSON | validation | func (auth *ASMAuthResource) MarshalJSON() ([]byte, error) {
if auth == nil {
return nil, errors.New("asm-auth resource is nil")
}
createdAt := auth.GetCreatedAt()
return json.Marshal(asmAuthResourceJSON{
TaskARN: auth.taskARN,
CreatedAt: &createdAt,
DesiredStatus: func() *ASMAuthStatus {
desiredState ... | go | {
"resource": ""
} |
q168968 | UnmarshalJSON | validation | func (auth *ASMAuthResource) UnmarshalJSON(b []byte) error {
temp := asmAuthResourceJSON{}
if err := json.Unmarshal(b, &temp); err != nil {
return err
}
if temp.DesiredStatus != nil {
auth.SetDesiredStatus(resourcestatus.ResourceStatus(*temp.DesiredStatus))
}
if temp.KnownStatus != nil {
auth.SetKnownStat... | go | {
"resource": ""
} |
q168969 | ContainerMetadataHandler | validation | func ContainerMetadataHandler(state dockerstate.TaskEngineState) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
containerID, err := getContainerIDByRequest(r, state)
if err != nil {
responseJSON, _ := json.Marshal(
fmt.Sprintf("V3 container metadata handler:... | go | {
"resource": ""
} |
q168970 | GetContainerResponse | validation | func GetContainerResponse(containerID string, state dockerstate.TaskEngineState) (*v2.ContainerResponse, error) {
containerResponse, err := v2.NewContainerResponse(containerID, state)
if err != nil {
return nil, errors.Errorf("Unable to generate metadata for container '%s'", containerID)
}
// fill in network deta... | go | {
"resource": ""
} |
q168971 | GetContainerNetworkMetadata | validation | func GetContainerNetworkMetadata(containerID string, state dockerstate.TaskEngineState) ([]containermetadata.Network, error) {
dockerContainer, ok := state.ContainerByID(containerID)
if !ok {
return nil, errors.Errorf("Unable to find container '%s'", containerID)
}
// the logic here has been reused from
// https... | go | {
"resource": ""
} |
q168972 | Initialize | validation | func (cgroup *CgroupResource) Initialize(resourceFields *taskresource.ResourceFields,
taskKnownStatus status.TaskStatus,
taskDesiredStatus status.TaskStatus) {
} | go | {
"resource": ""
} |
q168973 | StartDefaultTerminationHandler | validation | func StartDefaultTerminationHandler(saver statemanager.Saver, taskEngine engine.TaskEngine) {
signalChannel := make(chan os.Signal, 2)
signal.Notify(signalChannel, os.Interrupt, syscall.SIGTERM)
sig := <-signalChannel
seelog.Debugf("Termination handler received termination signal: %s", sig.String())
err := Final... | go | {
"resource": ""
} |
q168974 | FinalSave | validation | func FinalSave(saver statemanager.Saver, taskEngine engine.TaskEngine) error {
engineDisabled := make(chan error)
disableTimer := time.AfterFunc(engineDisableTimeout, func() {
engineDisabled <- errors.New("final save: timed out waiting for TaskEngine to settle")
})
go func() {
seelog.Debug("Shutting down task... | go | {
"resource": ""
} |
q168975 | String | validation | func (key *cacheKey) String() string {
return fmt.Sprintf("%s-%s-%s-%s", key.roleARN, key.region, key.registryID, key.endpointOverride)
} | go | {
"resource": ""
} |
q168976 | NewECRAuthProvider | validation | func NewECRAuthProvider(ecrFactory ecr.ECRFactory, cache async.Cache) DockerAuthProvider {
return &ecrAuthProvider{
tokenCache: cache,
factory: ecrFactory,
}
} | go | {
"resource": ""
} |
q168977 | getAuthConfigFromCache | validation | func (authProvider *ecrAuthProvider) getAuthConfigFromCache(key cacheKey) *types.AuthConfig {
token, ok := authProvider.tokenCache.Get(key.String())
if !ok {
return nil
}
cachedToken, ok := token.(*ecrapi.AuthorizationData)
if !ok {
log.Warnf("Reading ECR credentials from cache failed")
return nil
}
if a... | go | {
"resource": ""
} |
q168978 | getAuthConfigFromECR | validation | func (authProvider *ecrAuthProvider) getAuthConfigFromECR(image string, key cacheKey, authData *apicontainer.ECRAuthData) (types.AuthConfig, error) {
// Create ECR client to get the token
client, err := authProvider.factory.GetClient(authData)
if err != nil {
return types.AuthConfig{}, err
}
log.Debugf("Calling... | go | {
"resource": ""
} |
q168979 | IsTokenValid | validation | func (authProvider *ecrAuthProvider) IsTokenValid(authData *ecrapi.AuthorizationData) bool {
if authData == nil || authData.ExpiresAt == nil {
return false
}
refreshTime := aws.TimeValue(authData.ExpiresAt).
Add(-1 * retry.AddJitter(MinimumJitterDuration, MinimumJitterDuration))
return time.Now().Before(refre... | go | {
"resource": ""
} |
q168980 | createTaskResponse | validation | func createTaskResponse(task *apitask.Task, found bool, resourceID string, state dockerstate.TaskEngineState) ([]byte, int) {
var responseJSON []byte
status := http.StatusOK
if found {
containerMap, _ := state.ContainerMapByArn(task.Arn)
responseJSON, _ = json.Marshal(NewTaskResponse(task, containerMap))
} else... | go | {
"resource": ""
} |
q168981 | NewTaskStateChangeEvent | validation | func NewTaskStateChangeEvent(task *apitask.Task, reason string) (TaskStateChange, error) {
var event TaskStateChange
taskKnownStatus := task.GetKnownStatus()
if !taskKnownStatus.BackendRecognized() {
return event, errors.Errorf(
"create task state change event api: status not recognized by ECS: %v",
taskKnow... | go | {
"resource": ""
} |
q168982 | NewContainerStateChangeEvent | validation | func NewContainerStateChangeEvent(task *apitask.Task, cont *apicontainer.Container, reason string) (ContainerStateChange, error) {
var event ContainerStateChange
contKnownStatus := cont.GetKnownStatus()
if !contKnownStatus.ShouldReportToBackend(cont.GetSteadyStateStatus()) {
return event, errors.Errorf(
"create... | go | {
"resource": ""
} |
q168983 | SetTaskTimestamps | validation | func (change *TaskStateChange) SetTaskTimestamps() {
if change.Task == nil {
return
}
// Send the task timestamp if set
if timestamp := change.Task.GetPullStartedAt(); !timestamp.IsZero() {
change.PullStartedAt = aws.Time(timestamp.UTC())
}
if timestamp := change.Task.GetPullStoppedAt(); !timestamp.IsZero() ... | go | {
"resource": ""
} |
q168984 | ShouldBeReported | validation | func (change *TaskStateChange) ShouldBeReported() bool {
// Events that should be reported:
// 1. Normal task state change: RUNNING/STOPPED
// 2. Container state change, with task status in CREATED/RUNNING/STOPPED
// The task timestamp will be sent in both of the event type
// TODO Move the Attachment statechange ... | go | {
"resource": ""
} |
q168985 | GetIPV4Addresses | validation | func (eni *ENI) GetIPV4Addresses() []string {
var addresses []string
for _, addr := range eni.IPV4Addresses {
addresses = append(addresses, addr.Address)
}
return addresses
} | go | {
"resource": ""
} |
q168986 | GetIPV6Addresses | validation | func (eni *ENI) GetIPV6Addresses() []string {
var addresses []string
for _, addr := range eni.IPV6Addresses {
addresses = append(addresses, addr.Address)
}
return addresses
} | go | {
"resource": ""
} |
q168987 | String | validation | func (eni *ENI) String() string {
var ipv4Addresses []string
for _, addr := range eni.IPV4Addresses {
ipv4Addresses = append(ipv4Addresses, addr.Address)
}
var ipv6Addresses []string
for _, addr := range eni.IPV6Addresses {
ipv6Addresses = append(ipv6Addresses, addr.Address)
}
return fmt.Sprintf(
"eni id:%... | go | {
"resource": ""
} |
q168988 | ENIFromACS | validation | func ENIFromACS(acsenis []*ecsacs.ElasticNetworkInterface) (*ENI, error) {
err := ValidateTaskENI(acsenis)
if err != nil {
return nil, err
}
var ipv4 []*ENIIPV4Address
var ipv6 []*ENIIPV6Address
// Read ipv4 address information of the eni
for _, ec2Ipv4 := range acsenis[0].Ipv4Addresses {
ipv4 = append(ipv... | go | {
"resource": ""
} |
q168989 | ValidateTaskENI | validation | func ValidateTaskENI(acsenis []*ecsacs.ElasticNetworkInterface) error {
// Only one eni should be associated with the task
// Only one ipv4 should be associated with the eni
// No more than one ipv6 should be associated with the eni
if len(acsenis) != 1 {
return errors.Errorf("eni message validation: more than on... | go | {
"resource": ""
} |
q168990 | NewMockPlugins | validation | func NewMockPlugins(ctrl *gomock.Controller) *MockPlugins {
mock := &MockPlugins{ctrl: ctrl}
mock.recorder = &MockPluginsMockRecorder{mock}
return mock
} | go | {
"resource": ""
} |
q168991 | Scan | validation | func (m *MockPlugins) Scan() ([]string, error) {
ret := m.ctrl.Call(m, "Scan")
ret0, _ := ret[0].([]string)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q168992 | Scan | validation | func (mr *MockPluginsMockRecorder) Scan() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Scan", reflect.TypeOf((*MockPlugins)(nil).Scan))
} | go | {
"resource": ""
} |
q168993 | TaskFromACS | validation | func TaskFromACS(acsTask *ecsacs.Task, envelope *ecsacs.PayloadMessage) (*Task, error) {
data, err := jsonutil.BuildJSON(acsTask)
if err != nil {
return nil, err
}
task := &Task{}
err = json.Unmarshal(data, task)
if err != nil {
return nil, err
}
if task.GetDesiredStatus() == apitaskstatus.TaskRunning && en... | go | {
"resource": ""
} |
q168994 | initializeDockerVolumes | validation | func (task *Task) initializeDockerVolumes(sharedVolumeMatchFullConfig bool, dockerClient dockerapi.DockerClient, ctx context.Context) error {
for i, vol := range task.Volumes {
// No need to do this for non-docker volume, eg: host bind/empty volume
if vol.Type != DockerVolumeType {
continue
}
dockerVolume,... | go | {
"resource": ""
} |
q168995 | addTaskScopedVolumes | validation | func (task *Task) addTaskScopedVolumes(ctx context.Context, dockerClient dockerapi.DockerClient,
vol *TaskVolume) error {
volumeConfig := vol.Volume.(*taskresourcevolume.DockerVolumeConfig)
volumeResource, err := taskresourcevolume.NewVolumeResource(
ctx,
vol.Name,
task.volumeName(vol.Name),
volumeConfig.Sc... | go | {
"resource": ""
} |
q168996 | updateContainerVolumeDependency | validation | func (task *Task) updateContainerVolumeDependency(name string) {
// Find all the container that depends on the volume
for _, container := range task.Containers {
for _, mountpoint := range container.MountPoints {
if mountpoint.SourceVolume == name {
container.BuildResourceDependency(name,
resourcestatus... | go | {
"resource": ""
} |
q168997 | initializeCredentialsEndpoint | validation | func (task *Task) initializeCredentialsEndpoint(credentialsManager credentials.Manager) {
id := task.GetCredentialsID()
if id == "" {
// No credentials set for the task. Do not inject the endpoint environment variable.
return
}
taskCredentials, ok := credentialsManager.GetTaskCredentials(id)
if !ok {
// Task... | go | {
"resource": ""
} |
q168998 | initializeContainersV3MetadataEndpoint | validation | func (task *Task) initializeContainersV3MetadataEndpoint(uuidProvider utils.UUIDProvider) {
for _, container := range task.Containers {
v3EndpointID := container.GetV3EndpointID()
if v3EndpointID == "" { // if container's v3 endpoint has not been set
container.SetV3EndpointID(uuidProvider.New())
}
containe... | go | {
"resource": ""
} |
q168999 | requiresASMDockerAuthData | validation | func (task *Task) requiresASMDockerAuthData() bool {
for _, container := range task.Containers {
if container.ShouldPullWithASMAuth() {
return true
}
}
return false
} | go | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.