Commit graph

22 commits

Author SHA1 Message Date
Peter Hunt 834107c82e Add capability functionality to play kube
Take capabilities written in a kube and add to a container
adapt test suite and write cap-add/drop tests

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-08-01 15:47:45 -04:00
Peter Hunt 3acfcb3062 Deduplicate capabilities in generate kube
capabilities that were added and dropped were several times duplicated. Fix this

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-08-01 14:12:36 -04:00
baude db826d5d75 golangci-lint round #3
this is the third round of preparing to use the golangci-lint on our
code base.

Signed-off-by: baude <bbaude@redhat.com>
2019-07-21 14:22:39 -05:00
baude a78c885397 golangci-lint pass number 2
clean up and prepare to migrate to the golangci-linter

Signed-off-by: baude <bbaude@redhat.com>
2019-07-11 09:13:06 -05:00
baude 1d36501f96 code cleanup
clean up code identified as problematic by golands inspection

Signed-off-by: baude <bbaude@redhat.com>
2019-07-08 09:18:11 -05:00
Peter Hunt aeabc45cce Improve parsing of mounts
Specifically, we were needlessly doing a double lookup to find which config mounts were user volumes. Improve this by refactoring a bit of code from inspect

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-02 15:18:44 -04:00
Peter Hunt db2cc36033 Deduplicate volumes
for containers that share volumes, so the pod section doesn't list copies

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-02 14:08:09 -04:00
Peter Hunt aa9de67452 Pass along volumes to pod yaml
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-01 16:58:53 -04:00
Peter Hunt 1307e96d5e Configure container volumes for generate kube
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-01 16:07:25 -04:00
OpenShift Merge Robot c9078936dd
Merge pull request #3419 from baude/removelibpodfrommainphase1
remove libpod from main
2019-06-26 02:36:06 +02:00
baude dd81a44ccf remove libpod from main
the compilation demands of having libpod in main is a burden for the
remote client compilations.  to combat this, we should move the use of
libpod structs, vars, constants, and functions into the adapter code
where it will only be compiled by the local client.

this should result in cleaner code organization and smaller binaries. it
should also help if we ever need to compile the remote client on
non-Linux operating systems natively (not cross-compiled).

Signed-off-by: baude <bbaude@redhat.com>
2019-06-25 13:51:24 -05:00
Matthew Heon ebf48ff459 Only include ports in one container in Kube YAML
This likely broke when we made containers able to detect that
they shared a network namespace and grab ports from the
dependency container - prior to that, we could grab ports without
concern for conflict, only the infra container had them. Now, all
containers in a pod will return the same ports, so we have to
work around this.

Fixes #3408

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-06-24 14:27:47 -04:00
Matthew Heon 968bcbc86b Remove unused return statement in kube volume code
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-21 23:08:39 -04:00
Matthew Heon 03824e04fd Fix a 'generate kube' bug on ctrs with named volumes
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-21 13:52:55 -04:00
Matthew Heon f7951c8776 Use GetContainer instead of LookupContainer for full ID
All IDs in libpod are stored as a full container ID. We can get a
container by full ID faster with GetContainer (which directly
retrieves) than LookupContainer (which finds a match, then
retrieves). No reason to use Lookup when we have full IDs present
and available.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-04-12 10:59:00 -04:00
baude dd74467fd8 show container ports of network namespace
in cases where a container is part of a network namespace, we should
show the network namespace's ports when dealing with ports. this
impacts ps, kube, and port.

fixes: #846

Signed-off-by: baude <bbaude@redhat.com>
2019-02-13 13:51:23 -06:00
baude 440dd8c2ed lock and sync container before checking mountpoint
when checking for a container's mountpoint, you must lock and sync
the container or the result may be "".

Fixes: #2304

Signed-off-by: baude <bbaude@redhat.com>
2019-02-11 09:20:30 -06:00
baude 9b03cacc87 Add Play
podman play kube adds the ability for the user to recreate pods and containers
from a Kubernetes YAML file in libpod.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-19 14:20:55 -06:00
baude 48d1d846f0 Add capabilities to generate kube
Using the default capabilities, we can determine which caps were
added and dropped.  Now added them to the security context structure.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-10 14:20:49 -06:00
baude c8436b4912 generate kube
add the ability to generate kubernetes pod and service yaml representations
of libpod containers and pods.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-04 08:03:49 -06:00
baude 61d4db4806 Fix golang formatting issues
Whe running unittests on newer golang versions, we observe failures with some
formatting types when no declared correctly.

Signed-off-by: baude <bbaude@redhat.com>
2018-11-28 09:26:24 -06:00
baude f11a74e715 output libpod container to kubernetes yaml
scope out new kube subcommand where we can add generate. you can now generate kubernetes
YAML that will allow you to run the container in a kubernetes environment.  When
The YAML description will always "wrap" a container in a simple v1.Pod description.

Tests and further documentation will be added in additional PRs.

This function should be considered very much "under heavy development" at
this point.

Signed-off-by: baude <bbaude@redhat.com>
2018-11-19 09:05:24 -06:00