Skip to content
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

fix(bulk): fixing bulk loader when encryption + mtls is enabled #7154

Merged
merged 3 commits into from
Dec 16, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dgraph/cmd/bulk/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"bytes"
"compress/gzip"
"context"
"crypto/tls"
"fmt"
"hash/adler32"
"io"
Expand Down Expand Up @@ -64,6 +65,7 @@ type options struct {
Version bool
StoreXids bool
ZeroAddr string
ClientTLSConfig *tls.Config `json:"-"`
HttpAddr string
IgnoreErrors bool
CustomTokenizers string
Expand Down
1 change: 1 addition & 0 deletions dgraph/cmd/bulk/reduce.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ func (r *reducer) createBadgerInternal(dir string, compression bool) *badger.DB
if r.opt.EncryptionKey != nil {
// Need to set zero addr in WorkerConfig before checking the license.
x.WorkerConfig.ZeroAddr = []string{r.opt.ZeroAddr}
x.WorkerConfig.TLSClientConfig = r.opt.ClientTLSConfig

if !worker.EnterpriseEnabled() {
// Crash since the enterprise license is not enabled..
Expand Down
3 changes: 3 additions & 0 deletions dgraph/cmd/bulk/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ func init() {

func run() {
ctype, clevel := x.ParseCompression(Bulk.Conf.GetString("badger.compression"))
tlsConf, err := x.LoadClientTLSConfigForInternalPort(Bulk.Conf)
x.Check(err)
opt := options{
DataFiles: Bulk.Conf.GetString("files"),
DataFormat: Bulk.Conf.GetString("format"),
Expand All @@ -142,6 +144,7 @@ func run() {
Version: Bulk.Conf.GetBool("version"),
StoreXids: Bulk.Conf.GetBool("store_xids"),
ZeroAddr: Bulk.Conf.GetString("zero"),
ClientTLSConfig: tlsConf,
HttpAddr: Bulk.Conf.GetString("http"),
IgnoreErrors: Bulk.Conf.GetBool("ignore_errors"),
MapShards: Bulk.Conf.GetInt("map_shards"),
Expand Down