Skip to content

Commit

Permalink
Update readme on stdout support
Browse files Browse the repository at this point in the history
  • Loading branch information
jayanthvn committed Oct 12, 2020
1 parent 53350fd commit ccd6887
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
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 @@ -1044,6 +1044,9 @@ func (cache *EC2InstanceMetadataCache) DescribeAllENIs() (DescribeAllENIsResult,
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

0 comments on commit ccd6887

Please sign in to comment.