Fix a flaky test on changing namespace annotation #636
/assign @adrianludwin
cc @sophieliu15 , @adrianchung
I see that the end result here is that we end up with an api conflict. However, I'm unclear how this ties into the test name because I don't see anything in here about annotations anymore. Could you clarify please?
Nit.. grammar. "Even though "baz" namespace already exists"
Less flaky tests = great :D Thanks for doing this Yiqi!
Maybe specify why the owner annotation is wrong, e.g., IIUC,
"should set the hns.status.state to Conflict if a namespace of the same name already exists"
Ah right, I will make it clearer in the code and comment that baz namespace has an empty owner annotation since it's not created by HNS reconciler. Therefore, the baz hns instance in foo namespace should have a conflict since the owner annotation of baz doesn't point to foo.
Thanks will update it!
Yes, for the hns instance perspective, the conflict is only when the annotation doesn't match. It could be the reason you mentioned or someone with higher privileges changes the owner annotation. Here I wanted to introduce a mismatch to trigger the conflict.
Thanks for the reviews! I overthought about it in my first commit. Now I just simplified the comments and it should be easy to explain or understand now. @sophieliu15 @adrianchung
/lgtm
/approve
Ugh, I can't Git today
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: <a href="https://github.com/kubernetes-sigs/multi-tenancy/pull/636#issuecomment-611689615" title="Approved">adrianludwin</a>, <a href="https://github.com/kubernetes-sigs/multi-tenancy/pull/636#" title="Author self-approved">yiqigao217</a>
The full list of commands accepted by this bot can be found here.
The pull request process is described here
<details >
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
</details>
<!-- META={"approvers":[]} -->
adrianchung
yiqigao217
Instead of changing the annotation of the namespace created by the hns
instance, this PR creates a conflict hns instance with the name of an
already-existing namespace.
Tested by 'make test'.
Fixes #560