-
Notifications
You must be signed in to change notification settings - Fork 247
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 comma sep. string to set install binaries #341
Use comma sep. string to set install binaries #341
Conversation
I'm thinking this new env variable should specify the binaries to not install. In the future when new binaries are added or current ones renamed the current proposed list will mean that any upgrades will result in a broken setup. If it was a list of binaries to exclude then new ones can be added without the need to update the env var. |
@tmjd |
I understand that, but I'm thinking if calico or calico-ipam were renamed or began to depend on a 3rd binary then a setup with INSTALL_CNI_BINARIES would break on upgrade. If a new binary was added to the installer that was not needed in some setups, then not having it listed in SKIP_CNI_BINARIES would, I think, more than likely not break the setup. I'm asking the question, which configuration is more likely to break on upgrade? Or maybe this setting is a specific corner case, and that it breaking during an upgrade is too small to be concerned with. |
@tmjd Good point. The use case we have is not to override some binaries provided by 3rdparty. So |
@caseydavenport @tmjd @yifan-gu If everybody agrees that |
env variable INSTALL_CNI_BINARIES Signed-off-by: Abhinav Dahiya <abhinav.dahiya@coreos.com>
Signed-off-by: Abhinav Dahiya <abhinav.dahiya@coreos.com>
b1b742c
to
b75b7fa
Compare
@yifan-gu @tmjd @caseydavenport |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just the one comment that applies twice.
k8s-install/scripts/install-cni.sh
Outdated
do | ||
filename=$(basename $path) | ||
tmp=",$filename," | ||
if [ ! "${SKIP_CNI_BINARIES#*$tmp}" != "$SKIP_CNI_BINARIES" ] && [ ! -f /host/opt/cni/bin/$filename ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for the double negative? [ ! x != y ]
If not please switch to equality check, otherwise please add a comment.
k8s-install/scripts/install-cni.sh
Outdated
do | ||
filename=$(basename $path) | ||
tmp=",$filename," | ||
if [ ! "${SKIP_CNI_BINARIES#*$tmp}" != "$SKIP_CNI_BINARIES" ] && [ ! -f /host/opt/cni/bin/$filename ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double negative
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmjd changed the double negative to equality check. Thanks!
3df6496
to
af08ccb
Compare
Signed-off-by: Abhinav Dahiya <abhinav.dahiya@coreos.com>
af08ccb
to
1570085
Compare
@abhinavdahiya Before we can merge this could you describe the testing you have done for this change? |
I pulled down the changes and built a new calico/cni container and then did two runs with it. The first with no SKIP_CNI_BINARIES value set and the second run with |
I ran following test-cases locally: -2: -3: -4: -5: I think these cover most of the cases..? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abhinavdahiya @tmjd this LGTM.
We'll need to submit a docs PR for this change. Looking at our docs, I don't think we have a reference section for the install-cni container.
@tmjd could you run with that?
addresses #339
Update the install-cni.sh to loop through /opt/cni/bin/* and copy only binaries that are requested in comma string as env variable INSTALL_CNI_BINARIES
Default value set to "calico,calico-ipam,flannel,loopback,host-local" to keep backward compatibility.
/cc: @yifan-gu
Release Note