Skip to content

Commit 82cb99a

Browse files
committed
fix remote API for multiple pod replicas
Signed-off-by: Oleksandr Krutko <alexander.krutko@gmail.com>
1 parent 2f804ce commit 82cb99a

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

cmd/podman/kube/play.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ func playFlags(cmd *cobra.Command) {
176176
flags.BoolVar(&playOptions.UseLongAnnotations, noTruncFlagName, false, "Use annotations that are not truncated to the Kubernetes maximum length of 63 characters")
177177
_ = flags.MarkHidden(noTruncFlagName)
178178

179+
replicas := "replicas"
180+
flags.BoolVar(&playOptions.Replicas, replicas, false, "Replicas allows multiple Pods creation")
181+
179182
if !registry.IsRemote() {
180183
certDirFlagName := "cert-dir"
181184
flags.StringVar(&playOptions.CertDir, certDirFlagName, "", "`Pathname` of a directory containing TLS certificates and keys")
@@ -205,9 +208,6 @@ func playFlags(cmd *cobra.Command) {
205208
exitFlagName := "service-exit-code-propagation"
206209
flags.StringVar(&playOptions.ExitCodePropagation, exitFlagName, "", "Exit-code propagation of the service container")
207210
_ = flags.MarkHidden(exitFlagName)
208-
209-
replicas := "replicas"
210-
flags.BoolVar(&playOptions.Replicas, replicas, false, "Replicas allows multiple Pods creation")
211211
}
212212
}
213213

pkg/api/handlers/libpod/kube.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ func KubePlay(w http.ResponseWriter, r *http.Request) {
123123
Userns string `schema:"userns"`
124124
Wait bool `schema:"wait"`
125125
Build bool `schema:"build"`
126+
Replicas bool `schema:"replicas"`
126127
}{
127128
TLSVerify: true,
128129
Start: true,
@@ -198,6 +199,7 @@ func KubePlay(w http.ResponseWriter, r *http.Request) {
198199
Userns: query.Userns,
199200
Wait: query.Wait,
200201
ContextDir: contextDirectory,
202+
Replicas: query.Replicas,
201203
}
202204
if _, found := r.URL.Query()["build"]; found {
203205
options.Build = types.NewOptionalBool(query.Build)

pkg/bindings/kube/types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ type PlayOptions struct {
6363
// Wait - indicates whether to return after having created the pods
6464
Wait *bool
6565
ServiceContainer *bool
66+
// Replicas allows multiple Pods creation
67+
Replicas *bool
6668
}
6769

6870
// ApplyOptions are optional options for applying kube YAML files to a k8s cluster

pkg/bindings/kube/types_play_options.go

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/domain/infra/tunnel/kube.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ func (ic *ContainerEngine) PlayKube(ctx context.Context, body io.Reader, opts en
7575
options.WithPublishPorts(opts.PublishPorts)
7676
options.WithPublishAllPorts(opts.PublishAllPorts)
7777
options.WithNoTrunc(opts.UseLongAnnotations)
78+
options.WithReplicas(opts.Replicas)
7879
return play.KubeWithBody(ic.ClientCtx, body, options)
7980
}
8081

0 commit comments

Comments
 (0)