Skip to content

test/e2e: move all resource creation to resource_creator #370

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

Conversation

AlexNPavel
Copy link
Contributor

This moves all the resource creation (which is currently the
CreateFromYAML and namespace functions) into resource_creator.go.
This allows these functions to be called under TestCtx, which now
stores the namespace and a CRClient that can be retrieved by these
functions when needed instead of being regenerated. The functions
also now have access the Global framework variable and thus don't
need to have a kubeclient and kubeconfig be passed as arguments
when called.

This moves all the resource creation (which is currently the
CreateFromYAML and namespace functions) into resource_creator.go.
This allows these functions to be called under TestCtx, which now
stores the namespace and a CRClient that can be retrieved by these
functions when needed instead of being regenerated. The functions
also now have access the Global framework variable and thus don't
need to have a kubeclient and kubeconfig be passed as arguments
when called.
@AlexNPavel AlexNPavel requested review from hasbro17 and fanminshi July 30, 2018 23:09
@fanminshi
Copy link
Contributor

lgtm

}
return nil
})
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

We should ignore the error if the CRD already exists:

if apierrors.IsAlreadyExists(err) {
    return nil
}

@hasbro17
Copy link
Contributor

LGTM

@AlexNPavel AlexNPavel merged commit f7627c6 into operator-framework:master Jul 31, 2018
@AlexNPavel AlexNPavel deleted the e2e-resource-modularize branch July 31, 2018 22:24
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