Skip to content

Commit

Permalink
Merge pull request #166 from deviceinsight/feature/random-pod-name
Browse files Browse the repository at this point in the history
Kubernetes pod name now always includes random suffix
  • Loading branch information
d-rk authored Sep 25, 2023
2 parents 35144d3 + 4ab29e0 commit 15d5fe3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- [#165](https://github.com/deviceinsight/kafkactl/issues/165) Kubernetes pod name now always includes random suffix

## 3.3.0 - 2023-09-05
### Fixed
- [#162](https://github.com/deviceinsight/kafkactl/pull/162) Fix `consumer-group` crashes when a group member has no assignment
Expand Down
6 changes: 1 addition & 5 deletions internal/k8s/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,7 @@ func (kubectl *executor) Run(dockerImageType, entryPoint string, kafkactlArgs []
return err
}

podName := "kafkactl-" + randomString(10)

if kubectl.clientID != "" {
podName = "kafkactl-" + strings.ToLower(kubectl.clientID)
}
podName := fmt.Sprintf("kafkactl-%s-%s", strings.ToLower(kubectl.clientID), randomString(4))

kubectlArgs := []string{
"run", "--rm", "-i", "--tty", "--restart=Never", podName,
Expand Down

0 comments on commit 15d5fe3

Please sign in to comment.