Issue #426 - Support public not-connected repo in app creation UI (#675)

This commit is contained in:
Alexander Matyushentsev 2018-10-04 12:46:39 -04:00 committed by GitHub
parent 7f84f7d541
commit f491540636
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,7 +62,13 @@ func (s *Server) ListApps(ctx context.Context, q *RepoAppsQuery) (*RepoAppsRespo
}
repo, err := s.db.GetRepository(ctx, q.Repo)
if err != nil {
return nil, err
if errStatus, ok := status.FromError(err); ok && errStatus.Code() == codes.NotFound {
repo = &appsv1.Repository{
Repo: q.Repo,
}
} else {
return nil, err
}
}
// Test the repo
@ -115,7 +121,13 @@ func (s *Server) GetAppDetails(ctx context.Context, q *RepoAppDetailsQuery) (*Re
}
repo, err := s.db.GetRepository(ctx, q.Repo)
if err != nil {
return nil, err
if errStatus, ok := status.FromError(err); ok && errStatus.Code() == codes.NotFound {
repo = &appsv1.Repository{
Repo: q.Repo,
}
} else {
return nil, err
}
}
// Test the repo