Skip to content

Commit e1e355c

Browse files
refactor: address reviewer feedback by removing podman binary detection
1 parent bfcdf26 commit e1e355c

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

cmd/minikube/cmd/podman-env.go

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ var podmanUnset bool
7070
// podmanShellCfgSet generates context variables for "podman-env"
7171
func podmanShellCfgSet(ec PodmanEnvConfig, envMap map[string]string) *PodmanShellConfig {
7272
profile := ec.profile
73-
const usgPlz = "To point your shell to minikube's podman docker-compatible service, run:"
73+
const usgPlz = "To point your shell to minikube's Podman Docker-compatible service, run:"
7474
usgCmd := fmt.Sprintf("minikube -p %s podman-env", profile)
7575
s := &PodmanShellConfig{
7676
Config: *shell.CfgSet(ec.EnvConfig, usgPlz, usgCmd),
@@ -86,20 +86,13 @@ func podmanShellCfgSet(ec PodmanEnvConfig, envMap map[string]string) *PodmanShel
8686
return s
8787
}
8888

89-
// isPodmanAvailable checks if podman command is available
90-
func isPodmanAvailable(r command.Runner) bool {
91-
if _, err := r.RunCmd(exec.Command("which", "podman")); err != nil {
92-
return false
93-
}
94-
95-
return true
96-
}
9789

9890
// podmanEnvCmd represents the podman-env command
9991
var podmanEnvCmd = &cobra.Command{
10092
Use: "podman-env",
101-
Short: "Configure environment to use minikube's Podman service",
102-
Long: `Sets up Docker client env variables to use minikube's Podman Docker-compatible service.`,
93+
Short: "Configure environment to use minikube's Podman Docker-compatible service",
94+
Long: `Sets up Docker client env variables to use minikube's Podman Docker-compatible service.
95+
Uses Docker client against Podman's Docker API compatibility - no podman binary required.`,
10396
Run: func(_ *cobra.Command, _ []string) {
10497
sh := shell.EnvConfig{
10598
Shell: shell.ForceShell,
@@ -136,14 +129,11 @@ var podmanEnvCmd = &cobra.Command{
136129
}
137130

138131
r := co.CP.Runner
139-
if ok := isPodmanAvailable(r); !ok {
140-
exit.Message(reason.EnvPodmanUnavailable, `The podman service within '{{.cluster}}' is not active`, out.V{"cluster": cname})
141-
}
142132

143133
d := co.CP.Host.Driver
144134
hostIP := co.CP.IP.String()
145135

146-
// Use Docker API compatibility - podman supports Docker API on port 2376
136+
// Use Docker API compatibility - Docker client connects to Docker-compatible API
147137
port := constants.DockerDaemonPort
148138
noProxy := false
149139

cmd/minikube/cmd/podman-env_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export DOCKER_TLS_VERIFY="1"
4040
export DOCKER_CERT_PATH="/certs"
4141
export MINIKUBE_ACTIVE_PODMAN="bash"
4242
43-
# To point your shell to minikube's podman docker-compatible service, run:
43+
# To point your shell to minikube's Podman Docker-compatible service, run:
4444
# eval $(minikube -p bash podman-env)
4545
`,
4646
`unset DOCKER_HOST;
@@ -58,7 +58,7 @@ export DOCKER_TLS_VERIFY="1"
5858
export DOCKER_CERT_PATH="/certs"
5959
export MINIKUBE_ACTIVE_PODMAN="bash"
6060
61-
# To point your shell to minikube's podman docker-compatible service, run:
61+
# To point your shell to minikube's Podman Docker-compatible service, run:
6262
# eval $(minikube -p bash podman-env)
6363
`,
6464
`unset DOCKER_HOST;

site/content/en/docs/commands/podman-env.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: >
66

77
## Requirements
88

9-
- **Podman version 4.9.2 or newer is required.**
9+
- **Recent Podman version with Docker API compatibility is required.**
1010
- **Docker client is required** - `podman-env` uses Docker's client to communicate with Podman's Docker-compatible API.
1111
- The `podman-env` command configures Docker client environment variables to connect to minikube's Podman service via its Docker-compatible API.
1212

0 commit comments

Comments
 (0)