-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(connector): create destination as soon as possible #3384
Conversation
b93b4c7
to
803a585
Compare
803a585
to
4c4ec4e
Compare
@@ -297,23 +297,26 @@ func httpTransportFromOptions(opts ServerOptions) *http.Transport { | |||
func syncDestination(con connector) error { | |||
endpoint, err := getEndpointHostPort(con.k8s, con.options) | |||
if err != nil { | |||
return err | |||
logging.L.Warn().Err(err).Msg("could not get host") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe some more info here on why not getting the host could be happening would be useful, looks like something that is unexpected otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The err from getEndpointHostPort has more context which will be outputted through Err(err)
@@ -30,7 +30,7 @@ type DestinationConnection struct { | |||
|
|||
func (r DestinationConnection) ValidationRules() []validate.ValidationRule { | |||
return []validate.ValidationRule{ | |||
validate.Required("url", r.URL), | |||
validate.Required("ca", r.CA), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this requirement break old connectors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, current connection already consistently pass Connection.CA so this doesn't really do anything. Alternatively, I can remove the validation rules entirely.
4c4ec4e
to
9321a7a
Compare
Update the connector to create itself as quickly as possible instead of waiting for a valid connection. This is mainly due to LoadBalancer potentially taking a significant amount of time to initialize. Creating the destination quickly allows the user to continue without waiting. Update UI and CLI to output status == "Pending" when the destination is disconnected and does not have a connection URL.
3c93f17
to
fb6d8ee
Compare
for _, uniqueID := range []string{"space", "moon", "maintain"} { | ||
// set client.Headers so each destination becomes connected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had this problem as well in #3391, I thought it might make sense to have CreateDestination
mark it as "last seen at", like this: https://github.com/infrahq/infra/pull/3391/files#diff-487038165470a56e27ec73856c4cffb0b0808e9d00fd6a3481dd59d24f4e150c
Summary
Update the connector to create itself as quickly as possible instead of waiting for a valid connection. This is mainly due to LoadBalancer potentially taking a significant amount of time to initialize. Creating the destination quickly allows the user to continue without waiting.
Update UI and CLI to output status == "Pending" when the destination is disconnected and does not have a connection URL. Omit pending and disconnected destinations when syncing kubeconfig