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

Skips checking for readiness on CNI DEL #1235

Merged

Conversation

dougbtv
Copy link
Member

@dougbtv dougbtv commented Feb 20, 2024

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.

@coveralls
Copy link

coveralls commented Feb 20, 2024

Coverage Status

coverage: 62.916% (-0.1%) from 63.051%
when pulling a1915e1 on dougbtv:remove-readiness-check-on-del
into 53a68c3 on k8snetworkplumbingwg:master.

pkg/multus/multus.go Show resolved Hide resolved
@dougbtv dougbtv force-pushed the remove-readiness-check-on-del branch 3 times, most recently from 1db7e61 to a71a6bf Compare February 21, 2024 20:49
pkg/types/conf.go Fixed Show fixed Hide fixed
@dougbtv dougbtv force-pushed the remove-readiness-check-on-del branch 2 times, most recently from 3197182 to 89c64fd Compare February 21, 2024 21:19
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

This path depends on a
user-provided value
.
Copy link
Member Author

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.

readinessfileexists, err := types.ReadinessIndicatorExistsNow(in.ReadinessIndicatorFile)
if err != nil {
return cmdErr(k8sArgs, "error checking readinessindicatorfile on CNI DEL @ %v: %v", in.ReadinessIndicatorFile, err)
} else {
Copy link
Member

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.

pkg/types/conf.go Show resolved Hide resolved
@dougbtv dougbtv force-pushed the remove-readiness-check-on-del branch 2 times, most recently from 97a5552 to 6659929 Compare February 22, 2024 14:08
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.
@dougbtv dougbtv force-pushed the remove-readiness-check-on-del branch from 6659929 to a1915e1 Compare February 22, 2024 14:15
Copy link
Member

@s1061123 s1061123 left a 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.

@s1061123 s1061123 merged commit 5f0b4cd into k8snetworkplumbingwg:master Feb 22, 2024
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants