-
-
Notifications
You must be signed in to change notification settings - Fork 590
chore(etcd)!: use Run function #3409
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
Conversation
Summary by CodeRabbit
WalkthroughRefactors etcd module to build container via testcontainers.Run with option-based configuration, introduces error-returning options, adds data-dir post-start chmod via exec, updates cluster node creation to reuse Run, and adds a test validating WithDataDir behavior. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User code
participant E as etcd.Run
participant TC as testcontainers.Run
participant EX as tcexec (PostStarts)
participant N as Network
U->>E: Run(ctx, img, options...)
E->>E: Build moduleOpts (WithCmd, With... options)
E->>N: Append WithNetwork(...)
alt WithDataDir
E->>E: Add PostStarts hook (chmod data dir)
end
E->>TC: Run(ctx, img, moduleOpts...)
TC-->>E: Container or error
opt Cluster nodes > 1
loop For each additional node
E->>E: Update cluster options (node index, names)
E->>TC: Run(ctx, img, moduleOpts...)
end
end
note over EX,E: On start, exec chmod to set data dir perms
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code graph analysis (3)modules/etcd/etcd_test.go (4)
modules/etcd/etcd.go (5)
modules/etcd/options.go (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
What does this PR do?
Use the Run function in the etcd module
It also adds a breaking change in the etcd module by changing the signature of the etcd options.
Only those users of the module assigning the options to a variable are affected.
If you're just passing them as arguments, you don't have to do anything with this BC.
Why is it important?
Migrate modules to the new API
Related issues