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

fixes: properly reject containers with invalid/unparsable affinity annotations. #743

Merged
merged 2 commits into from Dec 16, 2021

Conversation

klihub
Copy link
Contributor

@klihub klihub commented Dec 15, 2021

The current implementation fails to parse affinity annotations properly. In the worst case this can lead to the misinterpretation of annotations. This PR updates affinity handling to fix this.

  • cache:
    • parse affinity annotations with a strict YAML parser
    • propagate parse errors back to the entity querying affinities (a policy)
    • add minimal test case to verify parsing/failing valid/invalid affinity annotations
  • topology-aware policy:
    • properly fail allocations for containers with invalid affinity annotations

Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks good, just two small nits. We might want to address the other one (the one about return values)(?)

pkg/cri/resource-manager/cache/pod.go Show resolved Hide resolved
Parse affinity annotation with strict YAML parseri and reject
any annotation that fails parsing. Add minimal test cases for
verifying parsing of valid and invalid annotations.
@klihub klihub force-pushed the fixes/reject-invalid-annotations branch from da26707 to a1590e2 Compare December 16, 2021 08:44
@klihub klihub requested a review from marquiz December 16, 2021 15:06
Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

pkg/cri/resource-manager/cache/pod.go Show resolved Hide resolved
@klihub klihub merged commit 60337e0 into intel:master Dec 16, 2021
@klihub klihub deleted the fixes/reject-invalid-annotations branch April 17, 2023 07:04
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.

None yet

2 participants