Change default connection state (#388)

This commit is contained in:
Andrew Merenbach 2018-07-12 14:25:34 -07:00 committed by GitHub
parent f65859bc25
commit 4915490cbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -55,6 +55,7 @@ func (s *Server) Create(ctx context.Context, q *ClusterCreateRequest) (*appv1.Cl
return nil, err
}
c.ConnectionState = appv1.ConnectionState{Status: appv1.ConnectionStatusSuccessful}
clust, err := s.db.CreateCluster(ctx, c)
if status.Convert(err).Code() == codes.AlreadyExists {
// act idempotent if existing spec matches new spec

View file

@ -121,6 +121,8 @@ func (s *Server) Create(ctx context.Context, q *RepoCreateRequest) (*appsv1.Repo
if err != nil {
return nil, err
}
r.ConnectionState = appsv1.ConnectionState{Status: appsv1.ConnectionStatusSuccessful}
repo, err := s.db.CreateRepository(ctx, r)
if status.Convert(err).Code() == codes.AlreadyExists {
// act idempotent if existing spec matches new spec