-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Suggestion: Add image name to kafka preset #656
Conversation
Hi @johanhugg, I like this idea very much 😼 If yes, and if that image is compatible with the existing preset behavior (healthchecks, ports, all that), I'd like to use it on arm64 architecture even without a custom option, and the regular image on any other architecture. If the image exists but is not compatible with whatever we have in this preset, we can have 2 separate preset implementations, one for arm64 and one for everything else (again, only in case that the entire preset needs to be reimplemented for that other image). What do you think? |
Codecov ReportBase: 85.97% // Head: 85.78% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #656 +/- ##
==========================================
- Coverage 85.97% 85.78% -0.19%
==========================================
Files 49 49
Lines 2267 2272 +5
==========================================
Hits 1949 1949
- Misses 165 169 +4
- Partials 153 154 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Hi, The image I used to test is this one linked in the PR: lensesio/fast-data-dev#185 |
I basically got it working with creating a wrapper around the default Preset interface used by kafka preset and then implementing custom image function that returns the Apple M1 compatible image until this PR is merged. type CustomKafkaPreset struct {
k gnomock.Preset
}
func NewCustomKafkaPreset(p gnomock.Preset) *CustomKafkaPreset {
return &CustomKafkaPreset{k: p}
}
func (c *CustomKafkaPreset) Image() string {
return "docker.io/dougdonohoe/fast-data-dev:latest"
}
func (c *CustomKafkaPreset) Ports() gnomock.NamedPorts {
return c.k.Ports()
}
func (c *CustomKafkaPreset) Options() []gnomock.Option {
return c.k.Options()
}
func TestConfluentPlatformStart(t *testing.T) {
const kafkaContainerName = "kafka"
const kafkaTopicName = "kafka-topic"
kc, err := gnomock.Start(
NewCustomKafkaPreset(
kafka.Preset(kafka.WithTopics(kafkaTopicName))),
gnomock.WithDebugMode(), gnomock.WithLogWriter(os.Stdout),
gnomock.WithContainerName(kafkaContainerName),
)
require.NoError(t, err)
defer func() {
require.NoError(t, gnomock.Stop(kc))
}()
} |
@johanhugg, I agree that there is no point in using that image by default, and in this case it also makes little sense to make the image configurable externally. I like the way @ahjashish suggests to solve the issue by wrapping the preset and only changing the returned image. Do you think this solution can work for you, or do you still think that making the image easily configurable would be much better? Regardless of what we choose to do, I'm glad you brought it up, because now people that struggle with Kafka preset on arm64 instances/macbooks will have a solution😼 |
Yeah the solution @ahjashish did will work for us just fine, nice way of solving it! |
Since this image for kafka doesn't really work with M1 (yet) there has been a need to override the default image name
Good idea or not to have this in the main repo?