Skip to content

Conversation

@sbernauer
Copy link
Member

@sbernauer sbernauer commented Feb 16, 2023

Description

For stackabletech/issues#323

Review Checklist

- [x] Code contains useful comments - [x] CRD change approved (or not applicable) - [x] (Integration-)Test cases added (or not applicable) - [x] Documentation added (or not applicable) - [x] Changelog updated (or not applicable) - [x] Cargo.toml only contains references to git tags (not specific commits or branches) - [x] Helm chart can be installed and deployed operator works (or not applicable) 

Once the review is done, comment bors r+ (or bors merge) to merge. Further information

@sbernauer sbernauer changed the title Add affinity structs Deploy default and support custom affinities Feb 16, 2023
@sbernauer sbernauer self-assigned this Feb 16, 2023
@sbernauer sbernauer marked this pull request as ready for review February 16, 2023 14:48
@razvan razvan self-requested a review February 17, 2023 09:32
Copy link
Member

@razvan razvan left a comment

Choose a reason for hiding this comment

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

A changelog entry is missing and probably an integration test.

Cargo.toml Outdated
"rust/crd", "rust/operator", "rust/operator-binary"
]

[patch."https://github.com/stackabletech/operator-rs.git"]
Copy link
Member

Choose a reason for hiding this comment

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

Reminder to update this file before merging.

@sbernauer
Copy link
Member Author

Regarding kuttl test: All we would do is assert on some field (affinity) on the scheduled Pod.
I personally think it's not worth having a kuttl test wasting k8s resources and taking time when we can check the contents in a unit-test. I tried my best writing unit tests, they can be improved in the future with the mechanism @vsupalov described yesterday. The only "untested" part is throwing the StackableAffinity struct into the PodBuilder as of now.
What do you think?

@razvan
Copy link
Member

razvan commented Feb 17, 2023

I'm fine with only unit testing it but we are missing actual tests for user defined affinities. Only two cases are covered:

  • default affinities
  • legacy node selector
@sbernauer
Copy link
Member Author

The merge mechanism with custom user provided affinities is tested here https://github.com/stackabletech/operator-rs/blob/5aab38f9cdd96b98f483ee3834a9cc74d002c0f0/src/commons/affinities.rs#L160
I would rather not copy/paste the same test in all operators, especially as the tested codepath lives within operator-rs

@sbernauer
Copy link
Member Author

The defaults and legacy behavior is operator-specific

@razvan
Copy link
Member

razvan commented Feb 20, 2023

bors merge

bors bot pushed a commit that referenced this pull request Feb 20, 2023
# Description For stackabletech/issues#323 Co-authored-by: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com>
@bors
Copy link
Contributor

bors bot commented Feb 20, 2023

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Deploy default and support custom affinities [Merged by Bors] - Deploy default and support custom affinities Feb 20, 2023
@bors bors bot closed this Feb 20, 2023
@bors bors bot deleted the feature/affinity branch February 20, 2023 16:25
@lfrancke
Copy link
Member

Added to the Feature Tracker

@sbernauer
Copy link
Member Author

Thx for adding the docs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants