mirror of
https://github.com/containers/podman.git
synced 2025-10-17 11:14:40 +08:00
remote: fix podman-remote kube play --publish-all
Fix `podman kube play --publish-all` to work in remote environment. Signed-off-by: Tsubasa Watanabe <w.tsubasa@fujitsu.com>
This commit is contained in:
@ -27,6 +27,7 @@ func KubePlay(w http.ResponseWriter, r *http.Request) {
|
||||
NoTrunc bool `schema:"noTrunc"`
|
||||
Replace bool `schema:"replace"`
|
||||
PublishPorts []string `schema:"publishPorts"`
|
||||
PublishAllPorts bool `schema:"publishAllPorts"`
|
||||
ServiceContainer bool `schema:"serviceContainer"`
|
||||
Start bool `schema:"start"`
|
||||
StaticIPs []string `schema:"staticIPs"`
|
||||
@ -97,6 +98,7 @@ func KubePlay(w http.ResponseWriter, r *http.Request) {
|
||||
NoHosts: query.NoHosts,
|
||||
Password: password,
|
||||
PublishPorts: query.PublishPorts,
|
||||
PublishAllPorts: query.PublishAllPorts,
|
||||
Quiet: true,
|
||||
Replace: query.Replace,
|
||||
ServiceContainer: query.ServiceContainer,
|
||||
|
@ -53,6 +53,10 @@ func (s *APIServer) registerKubeHandlers(r *mux.Router) error {
|
||||
// items:
|
||||
// type: string
|
||||
// - in: query
|
||||
// name: publishAllPorts
|
||||
// type: boolean
|
||||
// description: Whether to publish all ports defined in the K8S YAML file (containerPort, hostPort), if false only hostPort will be published
|
||||
// - in: query
|
||||
// name: replace
|
||||
// type: boolean
|
||||
// default: false
|
||||
|
@ -5644,6 +5644,18 @@ spec:
|
||||
testHTTPServer("19003", false, "podman rulez")
|
||||
})
|
||||
|
||||
It("podman play kube should publish containerPort with --publish-all", func() {
|
||||
SkipIfRootless("rootlessport can't expose privileged port 80")
|
||||
err := writeYaml(publishPortsPodWithContainerPort, kubeYaml)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
kube := podmanTest.Podman([]string{"kube", "play", "--publish-all=true", kubeYaml})
|
||||
kube.WaitWithDefaultTimeout()
|
||||
Expect(kube).Should(Exit(0))
|
||||
|
||||
testHTTPServer("80", false, "podman rulez")
|
||||
})
|
||||
|
||||
It("with Host Ports - curl should succeed", func() {
|
||||
err := writeYaml(publishPortsPodWithContainerHostPort, kubeYaml)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
Reference in New Issue
Block a user