Add Pod affinity to builds#344
Conversation
|
/assign @imjasonh |
test/e2e/simple_test.go
Outdated
| Spec: v1alpha1.BuildSpec{ | ||
| Affinity: &corev1.Affinity{ | ||
| NodeAffinity: &corev1.NodeAffinity{ | ||
| // PreferredDuringSchedulingIgnoredDuringExecution: [] |
| corev1.NodeSelectorTerm{ | ||
| MatchExpressions: []corev1.NodeSelectorRequirement{ | ||
| corev1.NodeSelectorRequirement{ | ||
| Key: "kubernetes.io/e2e-az-name", |
There was a problem hiding this comment.
Can you describe in words why this affinity makes the build unscheduleable?
|
@imjasonh : I have addressed your comments. |
|
is it also possible to add a test where the affinity rule matches any of the nodes, just to make sure that doesn't break anything in the future. |
|
I do not think its possible with existing test-infra scripts. We have to add a node to existing test cluster along with a label using some add-on scripts. If the goal is to test whether the test is failing for right reasons, alternatively we could consider using kubeclient to fetch pod status and verify the reason for "Unschedulable" . I think both #344 and #335 need this additional testing IMO. I am okay to follow up with a PR to add pod assertions once both are merged. |
|
yeah, maybe a future PR to |
b5deb96 to
4220576
Compare
|
/test pull-knative-build-integration-tests |
1 similar comment
|
/test pull-knative-build-integration-tests |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ImJasonH, shashwathi The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* Add pod affinity to container spec * Add e2e test * Update codegen
* Add pod affinity to container spec * Add e2e test * Update codegen
Fixes #237
Proposed Changes