Commit Graph

18 Commits

Author SHA1 Message Date
Daniel J Walsh 6565bde6e8
Add --no-hostname option
Fixes: https://github.com/containers/podman/issues/25002

Also add the ability to inspect containers for
UseImageHosts and UseImageHostname.

Finally fixed some bugs in handling of --no-hosts for Pods,
which I descovered.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2025-01-15 06:51:32 -05:00
fixomatic-ctrl 1dd90dbe20
feat(libpod): support kube play tar content-type (#24015)
feat(libpod): support kube play tar content-type

Signed-off-by: fixomatic-ctrl <180758136+fixomatic-ctrl@users.noreply.github.com>
2024-09-27 15:40:55 +02:00
Paul Holzinger 942f789a88
set !remote build tags where needed
The new golangci-lint version 1.60.1 has problems with typecheck when
linting remote files. We have certain pakcages that should never be
inlcuded in remote but the typecheck tries to compile all of them but
this never works and it seems to ignore the exclude files we gave it.

To fix this the proper way is to mark all packages we only use locally
with !remote tags. This is a bit ugly but more correct. I also moved the
DecodeChanges() code around as it is called from the client so the
handles package which should only be remote doesn't really fit anyway.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-08-19 11:41:28 +02:00
Matt Heon 72f1617fac Bump Go module to v5
Moving from Go module v4 to v5 prepares us for public releases.

Move done using gomove [1] as with the v3 and v4 moves.

[1] https://github.com/KSubedi/gomove

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-08 09:35:39 -05:00
Tsubasa Watanabe 4f94c96b9b 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>
2023-12-29 12:41:54 +09:00
Daniel J Walsh 91df369ae6
podman kube play --replace should force removal of pods and containers
Fixes: https://github.com/containers/podman/issues/20025

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-10-27 07:29:53 -04:00
Daniel J Walsh 3ce62d3cc4
Sort kube options alphabetically
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-10-27 07:25:44 -04:00
Toshiki Sonoda c6b5b9a02c remote: fix podman-remote play kube --userns
Fix `podman play kube --userns` to work in remote environment.

Related: #17392

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-07-12 18:47:36 +09:00
Jake Correnti 7b54fd84ec Add `--no-trunc` flag to maintain original annotation length
Adds a `--no-trunc` flag to `podman kube generate` preventing the
annotations from being trimmed at 63 characters. However, due to
the fact the annotations will not be trimmed, any annotation that is
longer than 63 characters means this YAML will no longer be Kubernetes
compatible. However, these YAML files can still be used with `podman
kube play` due to the addition of the new flag below.

Adds a `--no-trunc` flag to `podman kube play` supporting YAML files with
annotations that were not truncated to the Kubernetes maximum length of
63 characters.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-07-10 18:02:53 -04:00
Valentin Rothberg 1f3ae8a4fb system service: do not close Body
The standard lib states that server handlers don't need to close the
body, so let's not do that to avoid any unforeseen side effect.

[NO TESTS NEEDED] - existing tests should suffice.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-04 15:47:10 +02:00
Urvashi Mohnani 20a42d0e4f play kube: Add --wait option
Add a way to keep play kube running in the foreground and terminating all pods
after receiving a a SIGINT or SIGTERM signal. The pods will also be
cleaned up after the containers in it have exited.
If an error occurrs during kube play, any resources created till the
error point will be cleane up also.

Add tests for the various scenarios.

Fixes #14522

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-02-28 13:45:36 -05:00
Ygal Blum 07cc49efdb Kube Play - allow setting and overriding published host ports
Add a new flag --publish
Remote - Pass PublishPorts as a string array
ABI - translate the string array to Ports and merge with the ports in the spec
Add e2e tests
Add option to man doc

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-08 13:49:53 +02:00
Ygal Blum 1c8196a9ac kube play: update the handling of PersistentVolumeClaim
Up - do not fail if volume already exists, use the existing one
Down - allow the user to remove the volume by passing --force
Add tests
Update the documentation

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2022-11-08 11:08:50 +02:00
Urvashi Mohnani f6c74324bc Add podman kube apply command
Add the abilitiy to deploy the generated kube yaml to a
kubernetes cluster with the podman kube apply command.
Add support to directly apply containers, pods, or volumes
by passing in their names or ids to the command.
Use the kubernetes API endpoints and http requests to connect
to the cluster and deploy the various kubernetes object kinds.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2022-11-01 15:30:17 -04:00
Ygal Blum 0ce234425a play kube: Allow the user to import the contents of a tar file into a volume
Add a new annotation to allow the user to point to a local tar file
If the annotation is present, import the file's content into the volume
Add a flag to PlayKubeOptions to note remote requests
Fail when trying to import volume content in remote requests
Add the annotation to the documentation
Add an E2E test to the new annotation

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2022-10-25 15:11:25 +03:00
Daniel J Walsh 2c63b8439b
Fix stutters
Podman adds an Error: to every error message.  So starting an error
message with "error" ends up being reported to the user as

Error: error ...

This patch removes the stutter.

Also ioutil.ReadFile errors report the Path, so wrapping the err message
with the path causes a stutter.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-10 07:52:00 -04:00
Niall Crowe d856fb43e1 Add "podman kube generate" command
"podman kube generate" creates Kubernetes YAML from Podman containers,
pods or volumes. Users will still be able to use "podman generate
kube" as an alias of "kube generate".

Signed-off-by: Niall Crowe <nicrowe@redhat.com>
2022-08-11 16:58:24 +01:00
Niall Crowe e08a77ce64 Add "podman kube play" cmd
The "podman kube play" command is designed to be a replacement for the
"podman play kube" command.
It performs the same function as "play kube"  while also still working with the same flags and options.
The "podman play kube" command is still functional as an alias of "kube play".

Closes #12475
Signed-off-by: Niall Crowe <nicrowe@redhat.com>
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-07-13 15:27:03 +01:00