Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 30, 2025

When make test-e2e-local runs without Docker available, kind get clusters produces a confusing stack trace instead of indicating Docker is missing.

Changes

  • Added check_docker function in test/e2e/setup.sh that validates Docker is installed and the daemon is running before cluster operations
  • Modified create_cluster to call check_docker upfront
  • Suppressed stderr from kind get clusters to prevent duplicate error messages

Error messages

Before:

ERROR: failed to list clusters: command "docker ps -a ..." failed with error: exit status 1
Command Output: Cannot connect to the Docker daemon at unix:///Users/.../.docker/run/docker.sock
Stack Trace: [lengthy stack trace]

After:

Error: Docker daemon is not running. Please start Docker to run e2e tests.
Make sure Docker Desktop is running or start the Docker daemon.
Original prompt

This section details on the original issue you should resolve

<issue_title>Unable to run make test-e2e-local</issue_title>
<issue_description>### What broke? What's expected?

When I run make test-e2e-local it should create a clean kind cluster and run the e2e tests under test/e2e.

Reproducing this issue

camilam@Camilas-MacBook-Pro ~/go/src/sigs.k8s.io/kubebuilder (master) $ make test-e2e-local
## To keep the same kind cluster between test runs, use `SKIP_KIND_CLEANUP=1 make test-e2e-local`
./test/e2e/local.sh
Building kubebuilder
Installing e2e tools with setup-envtest
Version: 1.34.0
OS/Arch: darwin/arm64
sha512: b841e5ffa351b2ea1748093b612bc63e23a36362c90304cec498f1ee29c2858b63c146012a562f39d92031dba68a819a381d71c348b567c9de986c069edfce04
Path: /Users/camilam/Library/Application Support/io.kubebuilder.envtest/k8s/1.34.0-darwin-arm64
Getting kind config...
ERROR: failed to list clusters: command "docker ps -a --filter label=io.x-k8s.kind.cluster --format '{{.Label "io.x-k8s.kind.cluster"}}'" failed with error: exit status 1
Command Output: Cannot connect to the Docker daemon at unix:///Users/camilam/.docker/run/docker.sock. Is the docker daemon running?
Creating cluster...
ERROR: failed to create cluster: failed to list nodes: command "docker ps -a --filter label=io.x-k8s.kind.cluster=local-kubebuilder-e2e --format '{{.Names}}'" failed with error: exit status 1
Command Output: Cannot connect to the Docker daemon at unix:///Users/camilam/.docker/run/docker.sock. Is the docker daemon running?
Stack Trace: 
sigs.k8s.io/kind/pkg/errors.WithStack
	sigs.k8s.io/kind/pkg/errors/errors.go:59
sigs.k8s.io/kind/pkg/exec.(*LocalCmd).Run
	sigs.k8s.io/kind/pkg/exec/local.go:124
sigs.k8s.io/kind/pkg/exec.OutputLines
	sigs.k8s.io/kind/pkg/exec/helpers.go:81
sigs.k8s.io/kind/pkg/cluster/internal/providers/docker.(*provider).ListNodes
	sigs.k8s.io/kind/pkg/cluster/internal/providers/docker/provider.go:124
sigs.k8s.io/kind/pkg/cluster/internal/create.alreadyExists
	sigs.k8s.io/kind/pkg/cluster/internal/create/create.go:177
sigs.k8s.io/kind/pkg/cluster/internal/create.Cluster
	sigs.k8s.io/kind/pkg/cluster/internal/create/create.go:80
sigs.k8s.io/kind/pkg/cluster.(*Provider).Create
	sigs.k8s.io/kind/pkg/cluster/provider.go:192
sigs.k8s.io/kind/pkg/cmd/kind/create/cluster.runE
	sigs.k8s.io/kind/pkg/cmd/kind/create/cluster/createcluster.go:110
sigs.k8s.io/kind/pkg/cmd/kind/create/cluster.NewCommand.func1
	sigs.k8s.io/kind/pkg/cmd/kind/create/cluster/createcluster.go:54
github.com/spf13/cobra.(*Command).execute
	github.com/spf13/[email protected]/command.go:983
github.com/spf13/cobra.(*Command).ExecuteC
	github.com/spf13/[email protected]/command.go:1115
github.com/spf13/cobra.(*Command).Execute
	github.com/spf13/[email protected]/command.go:1039
sigs.k8s.io/kind/cmd/kind/app.Run
	sigs.k8s.io/kind/cmd/kind/app/main.go:53
sigs.k8s.io/kind/cmd/kind/app.Main
	sigs.k8s.io/kind/cmd/kind/app/main.go:35
main.main
	sigs.k8s.io/kind/main.go:25
runtime.main
	runtime/proc.go:283
runtime.goexit
	runtime/asm_arm64.s:1223
make: *** [test-e2e-local] Error 1

KubeBuilder (CLI) Version

master

PROJECT version

No response

Plugin versions

Other versions

No response

Extra Labels

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 30, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @Copilot. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Copilot
Once this PR has been reviewed and has the lgtm label, please ask for approval from camilamacedo86. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Copilot
Once this PR has been reviewed and has the lgtm label, please ask for approval from camilamacedo86. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 30, 2025
Copilot AI changed the title [WIP] Fix issue with running make test-e2e-local 🐛: Add Docker availability check before kind cluster creation Oct 30, 2025
Copilot AI requested a review from camilamacedo86 October 30, 2025 22:32
Copilot finished work on behalf of camilamacedo86 October 30, 2025 22:32
@camilamacedo86
Copy link
Member

@copilot

it still not fixed:

Error: Docker daemon is not running. Please start Docker to run e2e tests.
Make sure Docker Desktop is running or start the Docker daemon.

The acceptance criteria here is that the command make test-e2e-local should run without issues.

Copy link
Contributor Author

Copilot AI commented Oct 31, 2025

@copilot

it still not fixed:
...

I want to clarify the expected behavior.

The error message you're seeing indicates that Docker daemon is not running. The original issue was about getting a confusing stack trace when Docker isn't available - my fix provides a clear error message instead.

Are you saying:

  1. Docker IS running on your system but the check incorrectly says it's not? (bug in my check)
  2. Docker is NOT running and you'd like the script to provide instructions or automation to start it?
  3. Or something else?

The e2e tests require Docker/kind to run - they cannot work without it. Could you confirm if Docker Desktop is running when you see this error?

Copilot finished work on behalf of camilamacedo86 October 31, 2025 17:23
@camilamacedo86
Copy link
Member

Could not solve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to run make test-e2e-local

3 participants