Ignore the error if test route already exists (#383)

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
pull/384/head
Anatolii Bazko 2020-08-04 14:39:43 +03:00 committed by GitHub
parent 9575530284
commit 08c51a4e11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -119,8 +119,10 @@ func GetEndpointTLSCrtChain(instance *orgv1.CheCluster, endpointURL string, prox
routeSpec.SetOwnerReferences(nil)
// Create route manually
if err := clusterAPI.Client.Create(context.TODO(), routeSpec); err != nil {
logrus.Errorf("Failed to create test route 'test': %s", err)
return nil, err
if !errors.IsAlreadyExists(err) {
logrus.Errorf("Failed to create test route 'test': %s", err)
return nil, err
}
}
// Schedule test route cleanup after the job done.