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: add suffix to fluentbit configurator #2567

Merged
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ import (
"bytes"
"context"
"fmt"
"text/template"
"time"

"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_impls/docker/docker_manager"
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/uuid_generator"
"github.com/kurtosis-tech/stacktrace"
"github.com/sirupsen/logrus"
"text/template"
"time"
)

const (
// We use this image and version because we already are using this in other projects so there is a high probability
// that the image is in the local machine's cache
configuratorContainerImage = "alpine:3.17"
configuratorContainerName = "kurtosis-fluentbit-configurator"
configuratorContainerImage = "alpine:3.17"
configuratorContainerNamePrefix = "kurtosis-fluentbit-configurator"

shBinaryFilepath = "/bin/sh"
shCmdFlag = "-c"
Expand Down Expand Up @@ -54,9 +56,16 @@ func (fluent *fluentbitConfigurationCreator) CreateConfiguration(
volumeName: configDirpathInContainer,
}

uuid, err := uuid_generator.GenerateUUIDString()
if err != nil {
return stacktrace.Propagate(err, "An error occurred generating a UUID for the configurator container name")
}

containerName := fmt.Sprintf("%s-%s", configuratorContainerNamePrefix, uuid)

createAndStartArgs := docker_manager.NewCreateAndStartContainerArgsBuilder(
configuratorContainerImage,
configuratorContainerName,
containerName,
targetNetworkId,
).WithEntrypointArgs(
entrypointArgs,
Expand Down
Loading