Skip to content

PTEUDO-1096 support crossplane CR tests in controller #259

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

Merged
merged 4 commits into from
Jul 15, 2024
Merged

Conversation

drewwells
Copy link
Contributor

installs the crossplane CRs db-controller depends on into envtest
and registers the schema. manage tagging test added to exercise
the funcionality.

    installs the crossplane CRs db-controller depends on into envtest
    and registers the schema. manage tagging test added to exercise
    the funcionality.
var dbClaimList v1.DatabaseClaimList
if err := cli.List(ctx, &dbClaimList, client.MatchingFields{instanceLableKey: dbClaim.Spec.InstanceLabel}); err != nil {
if err := r.Client.List(ctx, &dbClaimList, client.MatchingFields{instanceLableKey: dbClaim.Spec.InstanceLabel}); err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, this fieldkey index is no longer being tested. This was a really roundabout way to verify it though. If we think it deserves testing, a more clear test is suited here.

@drewwells drewwells enabled auto-merge (squash) July 15, 2024 23:12
@drewwells drewwells merged commit ce61a61 into main Jul 15, 2024
3 checks passed
@drewwells drewwells deleted the manageTagging branch July 15, 2024 23:39

// CanTagResources checks if there's claims matching the instance
// label of the dbClaim. If there's only one claim, it can tag
func CanTagResources(ctx context.Context, dbClaimList v1.DatabaseClaimList, dbClaim v1.DatabaseClaim) (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not use the ctx, do we need to keep it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants