-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Added db password in cassandra-integration-test #5644
Changes from all commits
a7f5918
ead85a5
cb5fdd3
a0e9811
24adfbd
27aeaed
6338bf9
1c7f5c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ services: | |
ports: | ||
- "9042:9042" | ||
- "9160:9160" | ||
environment: | ||
- DB_PASSWORD=${DB_PASSWORD} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what about username? |
||
networks: | ||
- cassandra-net | ||
healthcheck: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ services: | |
ports: | ||
- "9042:9042" | ||
- "9160:9160" | ||
environment: | ||
- DB_PASSWORD=${DB_PASSWORD} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why |
||
networks: | ||
- cassandra-net | ||
healthcheck: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ package integration | |
|
||
import ( | ||
"context" | ||
"os" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
@@ -54,16 +55,26 @@ func (*CassandraStorageIntegration) initializeCassandraFactory(t *testing.T, fla | |
logger := zaptest.NewLogger(t, zaptest.WrapOptions(zap.AddCaller())) | ||
f := cassandra.NewFactory() | ||
v, command := config.Viperize(f.AddFlags) | ||
|
||
// Modify to fetch password from environment variable | ||
password := os.Getenv("DB_PASSWORD") | ||
require.NotEmpty(t, password, "DB_PASSWORD environment variable must be set") | ||
|
||
// Add the Cassandra password flag | ||
flags = append(flags, "--cassandra.password="+password) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is already set in the next function, why is it here again? |
||
|
||
require.NoError(t, command.ParseFlags(flags)) | ||
f.InitFromViper(v, logger) | ||
require.NoError(t, f.Initialize(metrics.NullFactory, logger)) | ||
return f | ||
} | ||
|
||
func (s *CassandraStorageIntegration) initializeCassandra(t *testing.T) { | ||
password := os.Getenv("DB_PASSWORD") | ||
|
||
f := s.initializeCassandraFactory(t, []string{ | ||
"--cassandra.basic.allowed-authenticators=", | ||
"--cassandra.password=password", | ||
"--cassandra.password=" + password, | ||
"--cassandra.username=username", | ||
"--cassandra.keyspace=jaeger_v1_dc1", | ||
"--cassandra-archive.keyspace=jaeger_v1_dc1_archive", | ||
|
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.
exclude this file from the PR, since it's not changing (
git checkout main <file>
)