-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Description
We want to use envtest against an existing cluster and are having issues when installing CRDs. Envtest will fail on the second running of the tests because the CRDs already exist in the cluster. This is only an issue when using an existing cluster because normally envtest starts a new control plane each time.
Example setup we want to use:
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crds")},
UseExistingCluster: true,
}
And error we get:
Expected error:
<*errors.StatusError | 0xc00012a2d0>: {
ErrStatus: {
TypeMeta: {Kind: "", APIVersion: ""},
ListMeta: {SelfLink: "", ResourceVersion: "", Continue: ""},
Status: "Failure",
Message: "customresourcedefinitions.apiextensions.k8s.io \"mycrd.meep.io\" already exists",
Reason: "AlreadyExists",
Details: {
Name: "mycrd.meep.io",
Group: "apiextensions.k8s.io",
Kind: "customresourcedefinitions",
UID: "",
Causes: nil,
RetryAfterSeconds: 0,
},
Code: 409,
},
}
customresourcedefinitions.apiextensions.k8s.io "mycrd.meep.io" already exists
not to have occurred
Is it possible to have envtest reinstall CRDs on every run rather than fail?
Metadata
Metadata
Assignees
Labels
kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.Important over the long term, but may not be staffed and/or may need multiple releases to complete.