diff --git a/.github/workflows/lint_test.yml b/.github/workflows/lint_test.yml index ba4a8d1..9d561e5 100644 --- a/.github/workflows/lint_test.yml +++ b/.github/workflows/lint_test.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Run golangci-lint - uses: actions-contrib/golangci-lint@v1 + uses: golangci/golangci-lint-action@v2 test: name: Test diff --git a/CHANGELOG.md b/CHANGELOG.md index 023b86a..c89425c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Compatibility with new versions of `kubectl` by removing deprecated parameter from the command +- Replace `CMD` with `ENTRYPOINT` in Ubuntu Dockerfile to restore behavior documented in readme ## 1.17.0 - 2021-04-06 diff --git a/Dockerfile.Scratch b/Dockerfile.Scratch index 3ae2f51..99613c6 100644 --- a/Dockerfile.Scratch +++ b/Dockerfile.Scratch @@ -1,4 +1,4 @@ - + FROM alpine:latest as certs RUN apk --update --no-cache add ca-certificates && update-ca-certificates diff --git a/Dockerfile.Ubuntu b/Dockerfile.Ubuntu index 6ef1c53..20a0230 100644 --- a/Dockerfile.Ubuntu +++ b/Dockerfile.Ubuntu @@ -26,4 +26,4 @@ WORKDIR /home/kafkactl RUN chown -R kafkactl:kafkactl /home/kafkactl USER kafkactl -CMD ["kafkactl"] +ENTRYPOINT ["kafkactl"] diff --git a/operations/k8s/executor.go b/operations/k8s/executor.go index e92d1c3..6d7c821 100644 --- a/operations/k8s/executor.go +++ b/operations/k8s/executor.go @@ -96,7 +96,7 @@ func (kubectl *executor) SetKubectlBinary(bin string) { kubectl.kubectlBinary = bin } -func (kubectl *executor) Run(dockerImageType string, kafkactlArgs []string, podEnvironment []string) error { +func (kubectl *executor) Run(dockerImageType, entryPoint string, kafkactlArgs []string, podEnvironment []string) error { if KafkaCtlVersion == "" { KafkaCtlVersion = "latest" } @@ -124,7 +124,7 @@ func (kubectl *executor) Run(dockerImageType string, kafkactlArgs []string, podE kubectlArgs = append(kubectlArgs, kubectl.extra...) } - kubectlArgs = append(kubectlArgs, "--") + kubectlArgs = append(kubectlArgs, "--command", "--", entryPoint) kubectlArgs = append(kubectlArgs, kafkactlArgs...) return kubectl.exec(kubectlArgs) diff --git a/operations/k8s/k8s-operation.go b/operations/k8s/k8s-operation.go index 4ef52c8..6d30a0b 100644 --- a/operations/k8s/k8s-operation.go +++ b/operations/k8s/k8s-operation.go @@ -51,7 +51,7 @@ func (operation *K8sOperation) Attach() error { podEnvironment := parsePodEnvironment(operation.context) - return exec.Run("ubuntu", []string{"bash"}, podEnvironment) + return exec.Run("ubuntu", "bash", nil, podEnvironment) } func (operation *K8sOperation) TryRun(cmd *cobra.Command, args []string) bool { @@ -91,7 +91,7 @@ func (operation *K8sOperation) Run(cmd *cobra.Command, args []string) error { kafkaCtlCommand = append(kafkaCtlCommand, args...) kafkaCtlCommand = append(kafkaCtlCommand, kafkaCtlFlags...) - return exec.Run("scratch", kafkaCtlCommand, podEnvironment) + return exec.Run("scratch", "/kafkactl", kafkaCtlCommand, podEnvironment) } func parseFlags(cmd *cobra.Command) ([]string, error) {