Closed selim5 closed 4 years ago
Thanks @selim5 for getting this first bits in. Some nits to address. Also, I think I'd rather put all the secret and connection to the database logic inside a helper method. Something like
func checkConnection(ctx context.Context, src *v1alpha1.MongoDbSource) error
which will return nil if all goes ok, otherwise will log as you are doing, and return an error... In the caller code you should check for err != nil, if it's not nil, then we call a method in our lifecycle, which we can call MarkConnectionFailed(err error), and you mark false a new condition that we can call "ConnectionEstablished" or something like that, and add the error there. If the connection succeeds, then you call MarkConnectionSuccess, and set that condition to true...
does it make sense?
Nice! Thanks @selim5 !!!
Helps with #7 #8
Proposed Changes