Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherrypick #1251 #1301

Merged
merged 1 commit into from
Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,10 @@ Type: String

Default: `/var/log/aws-routed-eni/plugin.log`

Valid Values: `stdout` or a file path
Valid Values: `stderr` or a file path

Specifies where to write the logging output for `aws-cni` plugin. Either to stdout or to override the default file (i.e., `/var/log/aws-routed-eni/plugin.log`).
Specifies where to write the logging output for `aws-cni` plugin. Either to `stderr` or to override the default file (i.e., `/var/log/aws-routed-eni/plugin.log`).
`Stdout` cannot be supported for plugin log, please refer to #1248 for more details.

---

Expand Down
3 changes: 3 additions & 0 deletions pkg/awsutils/awsutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,9 @@ func (cache *EC2InstanceMetadataCache) DescribeAllENIs() (eniMetadata []ENIMetad
eniID := aws.StringValue(ec2res.NetworkInterfaceId)
eniMetadata := eniMap[eniID]
interfaceType := aws.StringValue(ec2res.InterfaceType)

log.Infof("%s is of type: %s", eniID, interfaceType)

// This assumes we only have one trunk attached to the node..
if interfaceType == "trunk" {
trunkENI = eniID
Expand Down
11 changes: 11 additions & 0 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ log_in_json()
printf '{"level":"%s","ts":"%s","caller":"%s","msg":"%s"}\n' "$LOGTYPE" "$TIMESTAMP" "$FILENAME" "$MSG"
}

validate_env_var()
{
log_in_json info "Validating env variables ..."
if [[ "${AWS_VPC_K8S_PLUGIN_LOG_FILE,,}" == "stdout" ]]; then
log_in_json error "AWS_VPC_K8S_PLUGIN_LOG_FILE cannot be set to stdout"
exit 1
fi
}

# Check for all the required binaries before we go forward
if [ ! -f aws-k8s-agent ]; then
log_in_json error "Required aws-k8s-agent executable not found."
Expand All @@ -55,6 +64,8 @@ AWS_VPC_K8S_PLUGIN_LOG_LEVEL=${AWS_VPC_K8S_PLUGIN_LOG_LEVEL:-"Debug"}

AWS_VPC_K8S_CNI_CONFIGURE_RPFILTER=${AWS_VPC_K8S_CNI_CONFIGURE_RPFILTER:-"true"}

validate_env_var

# Check for ipamd connectivity on localhost port 50051
wait_for_ipam() {
while :
Expand Down