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
test/e2e/framework/node/:remove TODO and and make some functions private #88374
test/e2e/framework/node/:remove TODO and and make some functions private #88374
Conversation
@@ -67,51 +67,40 @@ func FirstAddress(nodelist *v1.NodeList, addrType v1.NodeAddressType) string { | |||
return "" | |||
} | |||
|
|||
// TODO: better to change to a easy read name |
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.
i think this name is ok,so i want to remove this TODO
// TODO: need to discuss wether to return bool and error type | ||
func IsNodeUntainted(node *v1.Node) bool { |
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.
this function is used only test/e2e/framework/node , so make it private.
@@ -138,8 +126,8 @@ func IsConditionSetAsExpectedSilent(node *v1.Node, conditionType v1.NodeConditio | |||
return isNodeConditionSetAsExpected(node, conditionType, wantTrue, true) | |||
} | |||
|
|||
// IsConditionUnset returns true if conditions of the given node do not have a match to the given conditionType, otherwise false. | |||
func IsConditionUnset(node *v1.Node, conditionType v1.NodeConditionType) bool { |
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.
this function is used only test/e2e/framework/node , so make it private.
test/e2e/framework/node/resource.go
Outdated
for _, cond := range node.Status.Conditions { | ||
// Ensure that the condition type and the status matches as desired. | ||
if cond.Type == conditionType { |
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.
For line 75 and 77, This looks a little weird.
function IsConditionSetAsExpected and IsConditionSetAsExpectedSilent use isNodeConditionSetAsExpected,
and all values passed to conditionType are "NodeReady"
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.
the two different function seem to wrap this one while passing silent=true/false
.
but the diff here removes the check against conditionType, which makes the name of the function invalid.
i suggest this function is kept like that for now and only try to remove this TODO:
// TODO: better to change to a easy read name
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 your review. The code implementation here always feels a bit weird i feel.
how about this change now?
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.
why modify the contents of the function?
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.
see https://github.com/kubernetes/kubernetes/blob/master/test/e2e/framework/node/resource.go#L75 ,
if cond.Type == conditionType is true and cond.Type == v1.NodeReady is true, https://github.com/kubernetes/kubernetes/blob/master/test/e2e/framework/node/resource.go#L114 never run。
I think it is possible to judge this condition in advance, so move this code. If you don't think need to change it, I can revert it.I can just try to remove this TODO.
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.
so in this PR i think we should only:
- removed the TODO
// TODO: better to change to a easy read name
. - make the functions
is....()
private.
leave this TODO:
// TODO: check if the Node is tainted once we enable NC notReady/unreachable taints by default
to SIG Node and not touch it.
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.
ok
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,updated
test/e2e/framework/node/resource.go
Outdated
} | ||
return false | ||
} | ||
if (wantTrue && (cond.Status == v1.ConditionTrue)) || (!wantTrue && (cond.Status != v1.ConditionTrue)) { | ||
// TODO: check if the Node is tainted once we enable NC notReady/unreachable taints by default |
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.
this TODO is for sig-node to resolve if they want to.
taint based eviction is enabled by default in 1.13:
https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/#taint-based-evictions
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.
yes,i want to resolve this if i can in later.
/retest |
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
/lgtm
/approve
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: neolit123, tanjunchen 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 |
/retest Review the full test history for this PR. Silence the bot with an |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Which issue(s) this PR fixes:
ref:#86763
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: