Skip to content

Commit eff25f8

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

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
@@ -181,6 +181,9 @@ func playFlags(cmd *cobra.Command) {
181181
noPodPrefix := "no-pod-prefix"
182182
flags.BoolVar(&playOptions.NoPodPrefix, noPodPrefix, false, "Do not prefix container name with pod name")
183183

184+
replicas := "replicas"
185+
flags.BoolVar(&playOptions.Replicas, replicas, false, "Replicas allows multiple Pods creation")
186+
184187
if !registry.IsRemote() {
185188
certDirFlagName := "cert-dir"
186189
flags.StringVar(&playOptions.CertDir, certDirFlagName, "", "`Pathname` of a directory containing TLS certificates and keys")
@@ -210,9 +213,6 @@ func playFlags(cmd *cobra.Command) {
210213
exitFlagName := "service-exit-code-propagation"
211214
flags.StringVar(&playOptions.ExitCodePropagation, exitFlagName, "", "Exit-code propagation of the service container")
212215
_ = flags.MarkHidden(exitFlagName)
213-
214-
replicas := "replicas"
215-
flags.BoolVar(&playOptions.Replicas, replicas, false, "Replicas allows multiple Pods creation")
216216
}
217217
}
218218

pkg/api/handlers/libpod/kube.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ func KubePlay(w http.ResponseWriter, r *http.Request) {
124124
Wait bool `schema:"wait"`
125125
Build bool `schema:"build"`
126126
NoPodPrefix bool `schema:"noPodPrefix"`
127+
Replicas bool `schema:"replicas"`
127128
}{
128129
TLSVerify: true,
129130
Start: true,
@@ -200,6 +201,7 @@ func KubePlay(w http.ResponseWriter, r *http.Request) {
200201
Wait: query.Wait,
201202
ContextDir: contextDirectory,
202203
NoPodPrefix: query.NoPodPrefix,
204+
Replicas: query.Replicas,
203205
}
204206
if _, found := r.URL.Query()["build"]; found {
205207
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
@@ -64,6 +64,8 @@ type PlayOptions struct {
6464
Wait *bool
6565
ServiceContainer *bool
6666
NoPodPrefix *bool
67+
// Replicas allows multiple Pods creation
68+
Replicas *bool
6769
}
6870

6971
// 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
@@ -76,6 +76,7 @@ func (ic *ContainerEngine) PlayKube(_ context.Context, body io.Reader, opts enti
7676
options.WithPublishAllPorts(opts.PublishAllPorts)
7777
options.WithNoTrunc(opts.UseLongAnnotations)
7878
options.WithNoPodPrefix(opts.NoPodPrefix)
79+
options.WithReplicas(opts.Replicas)
7980
return play.KubeWithBody(ic.ClientCtx, body, options)
8081
}
8182

0 commit comments

Comments
 (0)