-
Notifications
You must be signed in to change notification settings - Fork 594
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
Skips checking for readiness on CNI DEL #1235
Skips checking for readiness on CNI DEL #1235
Conversation
1db7e61
to
a71a6bf
Compare
3197182
to
89c64fd
Compare
return false, fmt.Errorf("failed to get absolute path of readinessIndicatorFile: %v", err) | ||
} | ||
|
||
_, err = os.Stat(readinessIndicatorFile) |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
user-provided value
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.
I tried to read up on this, and I think it wants you to limit it to a subset of directories given a "base path", but, that doesn't work here, and it's just a presence indicator, and not a destructive action, so it should be fine.
pkg/multus/multus.go
Outdated
readinessfileexists, err := types.ReadinessIndicatorExistsNow(in.ReadinessIndicatorFile) | ||
if err != nil { | ||
return cmdErr(k8sArgs, "error checking readinessindicatorfile on CNI DEL @ %v: %v", in.ReadinessIndicatorFile, err) | ||
} else { |
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.
As of test warning message in https://github.com/k8snetworkplumbingwg/multus-cni/pull/1235/files#annotation_18379130107 you can remove else block (because if clause ends with return, hence we don't need else block.
97a5552
to
6659929
Compare
Because deletes should favor a successful path, the readiness check should be skipped for pod removals. This can cause an issue where there's pods pending deletes and that might impact scheduling of a pod that may be necessary in order to set the readiness indicator. Adds a new method to check for readiness indicator alone in order to immediately log a warning.
6659929
to
a1915e1
Compare
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.
Looks good to me. So let's check e2e tests and merged.
Because deletes should favor a successful path, the readiness check should be skipped for pod removals.
This can cause an issue where there's pods pending deletes and that might impact scheduling of a pod that may be necessary in order to set the readiness indicator.