Skip to content

cluster delete: remove dead --container-engine flag #3979

Description

@gauron99

Context

PR #3856 migrated the dev cluster registry from a host-side container to an in-cluster Kubernetes deployment. This removed teardownRegistry, which was the only consumer of ContainerEngineOverride in the delete path.

Problem

The --container-engine flag on func cluster delete (cmd/cluster.go:233-234) is now dead code. It parses and stores a value in ContainerEngineOverride, but nothing in Delete() reads it.

Evidence:

  • Delete() (pkg/cluster/delete.go:21-55) uses cfg.Kubeconfig(), cfg.kind(), cfg.Name, and cfg.SkipRegistryConfig. It never calls cfg.ContainerEngine().
  • The only callsite of ContainerEngine() in the cluster package is getKindNodeIPs (kubernetes.go:143), which runs during create, not delete.
  • revertHostRegistry() auto-detects engines via hasCommand(), completely ignoring the override.

Tested empirically: func cluster delete --container-engine=podman behaves identically to func cluster delete — the flag is silently ignored.

Suggested fix

Remove the --container-engine flag and ContainerEngineOverride from newClusterDeleteConfig() in cmd/cluster.go. Also remove it from the PreRunE: bindEnv(...) call and the usage template.

/kind cleanup

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions