-
Notifications
You must be signed in to change notification settings - Fork 22
Fix spec fetching for Compliance API #175
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
Fix spec fetching for Compliance API #175
Conversation
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.
LGTM! I have some comments to consider about the test.
Eventually(func(g Gomega) interface{} { | ||
plc = utils.GetWithTimeout( | ||
clientHubDynamic, gvrPolicy, testNamespace+"."+case3PolicyName, "managed2", true, defaultTimeoutSeconds, | ||
) | ||
|
||
utils.RemovePolicyTemplateDBAnnotations(g, plc) | ||
|
||
return plc.Object["spec"] | ||
}, defaultTimeoutSeconds, 1).Should(utils.SemanticEqual(rootPlc.Object["spec"])) |
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.
(Optional) This seems so common it could be part of a new util
function that wraps both functions and returns the spec, something like:
Eventually(
utils.GetCleanPolicy(
clientHubDynamic,
gvrPolicy,
testNamespace+"."+case3PolicyName,
"managed2",
true,
defaultTimeoutSeconds,
), defaultTimeoutSeconds, 1).Should(utils.SemanticEqual(rootPlc.Object["spec"]))
With that, you can return spec and the error and Ginkgo will fail the test accordingly on error: https://onsi.github.io/gomega/#category-2-making-codeeventuallycode-assertions-on-functions
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 decided to skip this suggestion since time is tight.
This was also incorrectly setting the replicated policy annotations on the policy template's annotations. Co-authored-by: Dale Haiducek <[email protected]> Signed-off-by: mprahl <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dhaiducek, mprahl 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 |
This was also incorrectly setting the replicated policy annotations on the policy template's annotations.
Built from #174