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

Use sed as a stream editor and redirect to file #1069

Merged
merged 5 commits into from
Jul 9, 2020
Merged
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
12 changes: 7 additions & 5 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ log_in_json info "Copying CNI plugin binary and config file ... "

install aws-cni "$HOST_CNI_BIN_PATH"

sed -i s~__VETHPREFIX__~"${AWS_VPC_K8S_CNI_VETHPREFIX}"~g 10-aws.conflist
sed -i s~__MTU__~"${AWS_VPC_ENI_MTU}"~g 10-aws.conflist
sed -i s~__PLUGINLOGFILE__~"${AWS_VPC_K8S_PLUGIN_LOG_FILE}"~g 10-aws.conflist
sed -i s~__PLUGINLOGLEVEL__~"${AWS_VPC_K8S_PLUGIN_LOG_LEVEL}"~g 10-aws.conflist
cp 10-aws.conflist "$HOST_CNI_CONFDIR_PATH"
# modify the static config to populate it with the env vars
sed \
-e s~__VETHPREFIX__~"${AWS_VPC_K8S_CNI_VETHPREFIX}"~g \
-e s~__MTU__~"${AWS_VPC_ENI_MTU}"~g \
-e s~__PLUGINLOGFILE__~"${AWS_VPC_K8S_PLUGIN_LOG_FILE}"~g \
-e s~__PLUGINLOGLEVEL__~"${AWS_VPC_K8S_PLUGIN_LOG_LEVEL}"~g \
10-aws.conflist > "$HOST_CNI_CONFDIR_PATH/10-aws.conflist"

log_in_json info "Successfully copied CNI plugin binary and config file."

Expand Down