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

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
7.16.x 2.3.0.GA
Anatolii Bazko 2020-08-05 09:20:37 +03:00 committed by GitHub
parent ef006472aa
commit 4828ea3a90
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.