Skip to content

Commit

Permalink
fix create peer handler
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Mar 12, 2024
1 parent 19f5750 commit db6b2b3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions flow/cmd/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,7 @@ func (h *FlowRequestHandler) CreatePeer(
return wrongConfigResponse, nil
}
pgConfig := pgConfigObject.PostgresConfig

encodedConfig, encodingErr = proto.Marshal(pgConfig)

case protos.DBType_SNOWFLAKE:
sfConfigObject, ok := config.(*protos.Peer_SnowflakeConfig)
if !ok {
Expand Down Expand Up @@ -566,13 +564,18 @@ func (h *FlowRequestHandler) CreatePeer(
encodedConfig, encodingErr = proto.Marshal(s3Config)
case protos.DBType_CLICKHOUSE:
chConfigObject, ok := config.(*protos.Peer_ClickhouseConfig)

if !ok {
return wrongConfigResponse, nil
}

chConfig := chConfigObject.ClickhouseConfig
encodedConfig, encodingErr = proto.Marshal(chConfig)
case protos.DBType_KAFKA:
kaConfigObject, ok := config.(*protos.Peer_KafkaConfig)
if !ok {
return wrongConfigResponse, nil
}
kaConfig := kaConfigObject.KafkaConfig
encodedConfig, encodingErr = proto.Marshal(kaConfig)
default:
return wrongConfigResponse, nil
}
Expand Down

0 comments on commit db6b2b3

Please sign in to comment.