Skip to content

Commit a27d30c

Browse files
authored
Bump Go version to 1.19.1 (#3398)
* Bump Go version to 1.19.1 pickup the fix for https://nvd.nist.gov/vuln/detail/CVE-2022-27664 * make goimports * make goimports -f init_Makefile * fix seelog xml * deprecate ioutil
1 parent e2c05f5 commit a27d30c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1023
-1041
lines changed

GO_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.18.3
1+
1.19.1

GO_VERSION_WINDOWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.18.3
1+
1.19.1

agent/api/container/container_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func TestIsInternal(t *testing.T) {
138138
}
139139

140140
// TestSetupExecutionRoleFlag tests whether or not the container appropriately
141-
//sets the flag for using execution roles
141+
// sets the flag for using execution roles
142142
func TestSetupExecutionRoleFlag(t *testing.T) {
143143
testCases := []struct {
144144
container *Container

agent/api/task/task_linux.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,12 @@ func buildCgroupV1Root(taskID string) string {
9898
// buildCgroupV2Root creates a root cgroup using the systemd driver's special "-"
9999
// character. The "-" specifies a parent slice, so tasks and their containers end up
100100
// looking like this in the cgroup directory:
101-
// /sys/fs/cgroup/ecstasks.slice/
102-
// ├── ecstasks-XXXXf406f70c4c678073ae96944fXXXX.slice
103-
// │ └── docker-XXXX7c6dc81f2e9a8bf1c566dc769733ccba594b3007dd289a0f50ad7923XXXX.scope
104-
// └── ecstasks-XXXX30467358463ab6bbba4e73afXXXX.slice
105-
// └── docker-XXXX7ef4e942552437c96051356859c1df169f16e1cf9a9fc96fd30614e6XXXX.scope
101+
//
102+
// /sys/fs/cgroup/ecstasks.slice/
103+
// ├── ecstasks-XXXXf406f70c4c678073ae96944fXXXX.slice
104+
// │ └── docker-XXXX7c6dc81f2e9a8bf1c566dc769733ccba594b3007dd289a0f50ad7923XXXX.scope
105+
// └── ecstasks-XXXX30467358463ab6bbba4e73afXXXX.slice
106+
// └── docker-XXXX7ef4e942552437c96051356859c1df169f16e1cf9a9fc96fd30614e6XXXX.scope
106107
func buildCgroupV2Root(taskID string) string {
107108
return fmt.Sprintf("%s-%s.slice", config.DefaultTaskCgroupV2Prefix, taskID)
108109
}

agent/app/agent_capability.go

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -129,53 +129,53 @@ var (
129129
// capabilities returns the supported capabilities of this agent / docker-client pair.
130130
// Currently, the following capabilities are possible:
131131
//
132-
// com.amazonaws.ecs.capability.privileged-container
133-
// com.amazonaws.ecs.capability.docker-remote-api.1.17
134-
// com.amazonaws.ecs.capability.docker-remote-api.1.18
135-
// com.amazonaws.ecs.capability.docker-remote-api.1.19
136-
// com.amazonaws.ecs.capability.docker-remote-api.1.20
137-
// com.amazonaws.ecs.capability.logging-driver.json-file
138-
// com.amazonaws.ecs.capability.logging-driver.syslog
139-
// com.amazonaws.ecs.capability.logging-driver.fluentd
140-
// com.amazonaws.ecs.capability.logging-driver.journald
141-
// com.amazonaws.ecs.capability.logging-driver.gelf
142-
// com.amazonaws.ecs.capability.logging-driver.none
143-
// com.amazonaws.ecs.capability.selinux
144-
// com.amazonaws.ecs.capability.apparmor
145-
// com.amazonaws.ecs.capability.ecr-auth
146-
// com.amazonaws.ecs.capability.task-iam-role
147-
// com.amazonaws.ecs.capability.task-iam-role-network-host
148-
// ecs.capability.docker-volume-driver.${driverName}
149-
// ecs.capability.task-eni
150-
// ecs.capability.task-eni-block-instance-metadata
151-
// ecs.capability.execution-role-ecr-pull
152-
// ecs.capability.execution-role-awslogs
153-
// ecs.capability.container-health-check
154-
// ecs.capability.private-registry-authentication.secretsmanager
155-
// ecs.capability.secrets.ssm.environment-variables
156-
// ecs.capability.secrets.ssm.bootstrap.log-driver
157-
// ecs.capability.pid-ipc-namespace-sharing
158-
// ecs.capability.ecr-endpoint
159-
// ecs.capability.secrets.asm.environment-variables
160-
// ecs.capability.secrets.asm.bootstrap.log-driver
161-
// ecs.capability.aws-appmesh
162-
// ecs.capability.task-eia
163-
// ecs.capability.task-eni-trunking
164-
// ecs.capability.task-eia.optimized-cpu
165-
// ecs.capability.firelens.fluentd
166-
// ecs.capability.firelens.fluentbit
167-
// ecs.capability.efs
168-
// com.amazonaws.ecs.capability.logging-driver.awsfirelens
169-
// ecs.capability.logging-driver.awsfirelens.log-driver-buffer-limit
170-
// ecs.capability.firelens.options.config.file
171-
// ecs.capability.firelens.options.config.s3
172-
// ecs.capability.full-sync
173-
// ecs.capability.gmsa
174-
// ecs.capability.efsAuth
175-
// ecs.capability.env-files.s3
176-
// ecs.capability.fsxWindowsFileServer
177-
// ecs.capability.execute-command
178-
// ecs.capability.external
132+
// com.amazonaws.ecs.capability.privileged-container
133+
// com.amazonaws.ecs.capability.docker-remote-api.1.17
134+
// com.amazonaws.ecs.capability.docker-remote-api.1.18
135+
// com.amazonaws.ecs.capability.docker-remote-api.1.19
136+
// com.amazonaws.ecs.capability.docker-remote-api.1.20
137+
// com.amazonaws.ecs.capability.logging-driver.json-file
138+
// com.amazonaws.ecs.capability.logging-driver.syslog
139+
// com.amazonaws.ecs.capability.logging-driver.fluentd
140+
// com.amazonaws.ecs.capability.logging-driver.journald
141+
// com.amazonaws.ecs.capability.logging-driver.gelf
142+
// com.amazonaws.ecs.capability.logging-driver.none
143+
// com.amazonaws.ecs.capability.selinux
144+
// com.amazonaws.ecs.capability.apparmor
145+
// com.amazonaws.ecs.capability.ecr-auth
146+
// com.amazonaws.ecs.capability.task-iam-role
147+
// com.amazonaws.ecs.capability.task-iam-role-network-host
148+
// ecs.capability.docker-volume-driver.${driverName}
149+
// ecs.capability.task-eni
150+
// ecs.capability.task-eni-block-instance-metadata
151+
// ecs.capability.execution-role-ecr-pull
152+
// ecs.capability.execution-role-awslogs
153+
// ecs.capability.container-health-check
154+
// ecs.capability.private-registry-authentication.secretsmanager
155+
// ecs.capability.secrets.ssm.environment-variables
156+
// ecs.capability.secrets.ssm.bootstrap.log-driver
157+
// ecs.capability.pid-ipc-namespace-sharing
158+
// ecs.capability.ecr-endpoint
159+
// ecs.capability.secrets.asm.environment-variables
160+
// ecs.capability.secrets.asm.bootstrap.log-driver
161+
// ecs.capability.aws-appmesh
162+
// ecs.capability.task-eia
163+
// ecs.capability.task-eni-trunking
164+
// ecs.capability.task-eia.optimized-cpu
165+
// ecs.capability.firelens.fluentd
166+
// ecs.capability.firelens.fluentbit
167+
// ecs.capability.efs
168+
// com.amazonaws.ecs.capability.logging-driver.awsfirelens
169+
// ecs.capability.logging-driver.awsfirelens.log-driver-buffer-limit
170+
// ecs.capability.firelens.options.config.file
171+
// ecs.capability.firelens.options.config.s3
172+
// ecs.capability.full-sync
173+
// ecs.capability.gmsa
174+
// ecs.capability.efsAuth
175+
// ecs.capability.env-files.s3
176+
// ecs.capability.fsxWindowsFileServer
177+
// ecs.capability.execute-command
178+
// ecs.capability.external
179179
func (agent *ecsAgent) capabilities() ([]*ecs.Attribute, error) {
180180
var capabilities []*ecs.Attribute
181181

agent/app/data.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@ type savedData struct {
4646
// load from boltdb, and if it doesn't get anything, it tries to load from state file and then save data it loaded to
4747
// boltdb. Behavior of three cases are considered:
4848
//
49-
// 1. Agent starts from fresh instance (no previous state):
50-
// (1) Try to load from boltdb, get nothing;
51-
// (2) Try to load from state file, get nothing;
52-
// (3) Return empty data.
49+
// 1. Agent starts from fresh instance (no previous state):
50+
// (1) Try to load from boltdb, get nothing;
51+
// (2) Try to load from state file, get nothing;
52+
// (3) Return empty data.
5353
//
54-
// 2. Agent starts with previous state stored in boltdb:
55-
// (1) Try to load from boltdb, get the data;
56-
// (2) Return loaded data.
54+
// 2. Agent starts with previous state stored in boltdb:
55+
// (1) Try to load from boltdb, get the data;
56+
// (2) Return loaded data.
5757
//
58-
// 3. Agent starts with previous state stored in state file (i.e. it was just upgraded from an old agent that uses state file):
59-
// (1) Try to load from boltdb, get nothing;
60-
// (2) Try to load from state file, get something;
61-
// (3) Save loaded data to boltdb;
62-
// (4) Return loaded data.
58+
// 3. Agent starts with previous state stored in state file (i.e. it was just upgraded from an old agent that uses state file):
59+
// (1) Try to load from boltdb, get nothing;
60+
// (2) Try to load from state file, get something;
61+
// (3) Save loaded data to boltdb;
62+
// (4) Return loaded data.
6363
func (agent *ecsAgent) loadData(containerChangeEventStream *eventstream.EventStream,
6464
credentialsManager credentials.Manager,
6565
state dockerstate.TaskEngineState,

agent/config/conditional.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ type BooleanDefaultFalse struct {
7171
Value Conditional
7272
}
7373

74-
/// Enabled is a convenience function for when consumers don't care if the value is implicit or explicit
74+
// / Enabled is a convenience function for when consumers don't care if the value is implicit or explicit
7575
func (b BooleanDefaultFalse) Enabled() bool {
7676
return b.Value == ExplicitlyEnabled
7777
}

agent/config/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
Package config handles loading configuration data, warning on missing data,
1616
and setting sane defaults.
1717
18-
Configuration Sources
18+
# Configuration Sources
1919
2020
Configuration data is loaded from two sources currently: the environment and
2121
a json config file.

agent/credentials/instancecreds/instancecreds_linux.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ import (
2525
// GetCredentials returns the instance credentials chain. This is the default chain
2626
// credentials plus the "rotating shared credentials provider", so credentials will
2727
// be checked in this order:
28-
// 1. Env vars (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY).
29-
// 2. Shared credentials file (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/create-shared-credentials-file.html) (file at ~/.aws/credentials containing access key id and secret access key).
30-
// 3. EC2 role credentials. This is an IAM role that the user specifies when they launch their EC2 container instance (ie ecsInstanceRole (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/instance_IAM_role.html)).
31-
// 4. Rotating shared credentials file located at /rotatingcreds/credentials
28+
// 1. Env vars (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY).
29+
// 2. Shared credentials file (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/create-shared-credentials-file.html) (file at ~/.aws/credentials containing access key id and secret access key).
30+
// 3. EC2 role credentials. This is an IAM role that the user specifies when they launch their EC2 container instance (ie ecsInstanceRole (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/instance_IAM_role.html)).
31+
// 4. Rotating shared credentials file located at /rotatingcreds/credentials
3232
func GetCredentials(isExternal bool) *credentials.Credentials {
3333
mu.Lock()
3434
if credentialChain == nil {

agent/credentials/instancecreds/instancecreds_unsupported.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import (
2323
// GetCredentials returns the instance credentials chain. This is the default chain
2424
// credentials plus the "rotating shared credentials provider", so credentials will
2525
// be checked in this order:
26-
// 1. Env vars (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY).
27-
// 2. Shared credentials file (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/create-shared-credentials-file.html) (file at ~/.aws/credentials containing access key id and secret access key).
28-
// 3. EC2 role credentials. This is an IAM role that the user specifies when they launch their EC2 container instance (ie ecsInstanceRole (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/instance_IAM_role.html)).
29-
// 4. Rotating shared credentials file located at /rotatingcreds/credentials
26+
// 1. Env vars (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY).
27+
// 2. Shared credentials file (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/create-shared-credentials-file.html) (file at ~/.aws/credentials containing access key id and secret access key).
28+
// 3. EC2 role credentials. This is an IAM role that the user specifies when they launch their EC2 container instance (ie ecsInstanceRole (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/instance_IAM_role.html)).
29+
// 4. Rotating shared credentials file located at /rotatingcreds/credentials
3030
func GetCredentials(isExternal bool) *credentials.Credentials {
3131
return nil
3232
}

0 commit comments

Comments
 (0)