Skip to content

Commit 2a9a086

Browse files
authored
Merge pull request #214 from 0x5d/rpk-fix-seeds
rpk/start: Check that the seeds env var isn't empty
2 parents 534076a + 6948527 commit 2a9a086

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/go/rpk/pkg/cli/cmd/start.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ func NewStartCommand(fs afero.Fs, mgr config.Manager) *cobra.Command {
102102
if len(seeds) == 0 {
103103
// If --seeds wasn't passed, fall back to the
104104
// env var.
105-
envSeeds := strings.Split(
106-
os.Getenv("REDPANDA_SEEDS"),
107-
",",
108-
)
109-
if len(envSeeds) != 0 {
110-
seeds = envSeeds
105+
envSeeds := os.Getenv("REDPANDA_SEEDS")
106+
if envSeeds != "" {
107+
seeds = strings.Split(
108+
envSeeds,
109+
",",
110+
)
111111
}
112112
}
113113
seedServers, err := parseSeeds(seeds)

0 commit comments

Comments
 (0)