-
Notifications
You must be signed in to change notification settings - Fork 40k
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
add integration test for pod with pvc has node-affinity to non-existent/illegal nodes #124666
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @chengjoey. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
AccessModes([]v1.PersistentVolumeAccessMode{v1.ReadWriteOncePod}). | ||
Capacity(storage.Requests). | ||
HostPathVolumeSource(&v1.HostPathVolumeSource{Path: "/tmp", Type: &volType}). | ||
NodeAffinityIn("kubernetes.io/hostname", []string{"node-available", string(uuid.NewUUID()), string(uuid.NewUUID())}). // one node exist, two don't |
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.
Do we actually need to use UUID here? Won't a simple name like non-existing
work as expected?
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.
done
@@ -2036,6 +2037,53 @@ func TestUnschedulablePodBecomesSchedulable(t *testing.T) { | |||
return deletePod(cs, "pod-to-be-deleted", ns) | |||
}, | |||
}, | |||
{ | |||
name: "pod with pvc has node-affinity to non-existent/illegal nodes", |
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.
Can we also add a case which pod got scheduled after node updated its label?
Maybe sth like this:
- Pod with pv's affinity with
foo in bar
created - Node with label
foo = foo
created - Verify that the pod is not scheduled
- Update the node with label
foo = bar
- Verify that the pod is scheduled successfully.
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.
done
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, chengjoey The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Thanks, looks good! Only some nits about comments.
pkg/scheduler/testing/wrappers.go
Outdated
@@ -882,6 +882,20 @@ func (p *PersistentVolumeWrapper) HostPathVolumeSource(src *v1.HostPathVolumeSou | |||
return p | |||
} | |||
|
|||
// NodeAffinityIn creates a HARD node affinity (with the operator In) | |||
// // and injects into the pv. |
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.
// // and injects into the pv. | |
// and injects into the pv. |
AccessModes([]v1.PersistentVolumeAccessMode{v1.ReadWriteOncePod}). | ||
Capacity(storage.Requests). | ||
HostPathVolumeSource(&v1.HostPathVolumeSource{Path: "/tmp", Type: &volType}). | ||
NodeAffinityIn("kubernetes.io/hostname", []string{"node-available", "non-existing"}). // one node exist, two don't |
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.
NodeAffinityIn("kubernetes.io/hostname", []string{"node-available", "non-existing"}). // one node exist, two don't | |
NodeAffinityIn("kubernetes.io/hostname", []string{"node-available", "non-existing"}). // one node exists, one doesn't |
AccessModes([]v1.PersistentVolumeAccessMode{v1.ReadWriteOncePod}). | ||
Capacity(storage.Requests). | ||
HostPathVolumeSource(&v1.HostPathVolumeSource{Path: "/tmp", Type: &volType}). | ||
NodeAffinityIn("foo", []string{"bar"}). // one node exist, two don't |
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.
NodeAffinityIn("foo", []string{"bar"}). // one node exist, two don't | |
NodeAffinityIn("foo", []string{"bar"}). |
Think we can just delete this comment here.
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.
thanks @AxeZhan , done.
…nt/existent nodes Signed-off-by: joey <zchengjoey@gmail.com>
/lgtm |
LGTM label has been added. Git tree hash: 2a3cf94ca45feab6d83c4d511167e34c612a84c6
|
What type of PR is this?
/kind cleanup
/sig scheduling
What this PR does / why we need it:
an integration test for pod with pvc has node-affinity to non-existent/illegal nodes could be schduable
related pr #124559
related issue #123465
Special notes for your reviewer: @Huang-Wei @alculquicondor
Does this PR introduce a user-facing change?