Commit Graph

80 Commits

Author SHA1 Message Date
e5e0d5e117 Generate template placeholders charts and support init containers and jobs (#1)
Part of https://plan.wireit.in/deepstack/browse/VUL-265/

Reviewed-on: LaconicNetwork/kompose#1
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2025-12-04 06:04:04 +00:00
houpo-bob
2d736157ab
refactor: use slices.Equal to simplify code (#2036)
Signed-off-by: houpo-bob <houpocun@outlook.com>
2025-08-11 09:38:17 -04:00
yuefanxiao
22d9233f8b fix: resolve env_file variable interpolation issues by adding support for and default syntax 2025-05-08 01:23:08 +08:00
Charlie Drage
55b077ab04
cleanup: removes uneeded annotation when not using network policy (#1884)
#### What type of PR is this?

<!--
Add one of the following kinds:
/kind bug
/kind documentation
/kind feature
-->

/kind cleanup

#### What this PR does / why we need it:

Removes the network policy annotation which is not needed (we are not
generating network policy)

#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes https://github.com/kubernetes/kompose/issues/1759

#### Special notes for your reviewer:
2024-06-02 20:46:57 +02:00
TessaIO
3bf98301f7
fix: expose container to host only with labels (#1880)
Signed-off-by: ahmed.g <ahmed.g@adjoe.io>
Signed-off-by: TessaIO <ahmedgrati1999@gmail.com>
2024-05-29 16:05:04 -04:00
Kubernetes Prow Robot
601900d660
Merge pull request #1852 from sosan/feature-1794-auto-configmaps
add configmaps derived from file and dir
2024-04-25 05:56:20 -07:00
cuiyourong
d274f9947d
chore: fix some typos in comments (#1863)
Signed-off-by: cuiyourong <cuiyourong@gmail.com>
2024-04-25 08:41:58 -04:00
jose luis
bbd91be049
Merge branch 'main' into feature-1794-auto-configmaps
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
2024-04-22 13:37:00 +02:00
jose luis
e9f64cfd81
added more e2e, more tests
fallback to skip volume mount and log warning when path cannot be resolved, as /sys, /root, /var/lib/docker

in e2e TestMultipleContainersInPod directory /data replaced with /data-dir

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
2024-04-10 00:33:57 +02:00
Ambrose Chua
ea485a7806
chore(deps): bump github.com/compose-spec/compose-go 2024-03-19 14:34:58 +08:00
Jose Luis
c0f7e910c8
in case /run/secrets/MARIADB_PASSWORD and secrets: MARIADB_PASSWORD are in uppercase, reformat the value of MARIADB_PASSWORD to mariadb-password. Also, reformat the secretconfig of the secrets. getSecretPathsLegacy returns secretSubPath. (#1826)
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
2024-02-20 23:35:18 -05:00
jose luis
6ce08bb234
merged from main and dummy coments 2024-02-07 19:40:53 +01:00
jose luis
b095982ddf
adds a unit test for the TestKubernetes_CreateSecrets function where secrets are created in Kubernetes from a KomposeObject, and secrets are taken from a CNAME file. Also, a newSecrets function is added to generate secrets from the provided configuration
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
2024-02-07 18:29:33 +01:00
jose luis
b544c17472
fix issue 1778
* fix issue https://github.com/kubernetes/kompose/issues/1778
*add tests with hardcoded values to mokup file access

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
2024-01-27 18:47:54 +01:00
Charlie Drage
09dc978e8e
only add namespace if specified (#1731)
#### What type of PR is this?

<!--
Add one of the following kinds:
/kind cleanup
/kind documentation
/kind feature
-->

/kind bug

#### What this PR does / why we need it:

When we generate the YAML, we should NOT add namespace by default,
namespace should only be added if it has been specified via the command
line.

#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->

Fixes https://github.com/kubernetes/kompose/issues/1729

#### Special notes for your reviewer:

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
2023-10-11 10:29:55 -04:00
AhmedGrati
b6b708b637
Feat add ns generation (#1667)
* feat: add ns generation for k8s

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* feat: add ns generation for openshift

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* test: add functional tests

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* fix: remove some code nits

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

---------

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-07-16 22:59:16 +01:00
AhmedGrati
7255eb5923 fix missing image pull secrets
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-07-13 12:22:02 +01:00
AhmedGrati
f7bee839ce
feat: disable network policies generation by default (#1629)
* feat: disable network policies default generation

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* docs: add the generate-network-policies flag to user guide

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* test: add unit tests of the network policies generation

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

---------

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-07-05 11:26:37 +01:00
AhmedGrati
485cd2f163
feat: support container volume mount subpath (#1628)
* feat: support volumes subpath

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* docs: add the kompose.volume.sub-path label

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* fix: update e2e tests

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

---------

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-07-05 10:47:01 +01:00
AhmedGrati
8f0a6684ca
Feat support security fsgroup (#1613)
* feat: support security context fsgroup

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* test: add unit test to security group fsgroup

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* test: add functional test to security group fsgroup

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

* docs: add documentation of the new label of security group fsgroup

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>

---------

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-04-05 14:11:10 -04:00
AhmedGrati
6be6fdd165 feat: support external traffic policy
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-02-13 14:59:46 +01:00
AhmedGrati
9ab4ef3a9c
Feat: Add hostPort and protocol to containers (#1558)
* feat: add the host port to containers

* test(unit): add unit tests for host port and protocol

* test(functional): add functional tests of host port and protocol

* test(functional): add functional tests of host port and protocol for openshift
2023-02-08 15:46:13 -05:00
Lctrs
2ad5745d58
feat: migrate from libcompose to compose-go (#1547)
* feat: migrate from libcompose to compose-go

libcompose has been deprecated since summer 2021 in favor of https://github.com/compose-spec/compose-go.
Kompose should now be able to load all versions of compose.

* chore: replace golint with staticcheck

golint has been deprecated. Recommended replacement is staticcheck.
2023-01-12 15:17:22 -05:00
AhmedGrati
849c229aad
Fix(CI Pipeline): Update Kubernetes unit tests and CI Pipeline configuration files (#1531)
* fix: update kubernetes unit tests

* fix: check whether selectors are present or not

* fix: update golang-lint yaml file

* fix: downgrade the version of fsouza go docker-client
2022-11-12 21:46:18 +08:00
AhmedGrati
6512dd3dd4
fix: change the port ID definition in kubernetes.go file (#1515) 2022-08-16 07:57:43 -04:00
ichx
8cb1b0599e
Add support for placement preferences docker-compose v3.3+ (#1425) 2021-11-04 08:28:45 +08:00
Shivam Sandbhor
c921643705
Add support for statefulset controller. (#1452)
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
2021-11-04 08:24:12 +08:00
ichx
d55071e9d6
Support tcp/http liveness/readiness probe (#1449) 2021-11-03 23:30:38 +08:00
Hang Yan
72ea6a3c24
Support group service by shared volumes (#1439)
Signed-off-by: Hang Yan <hang.yan@hotmail.com>
2021-10-03 23:07:41 +08:00
Hang Yan
5d7ed192a4
Code Refactor (#1438)
* Code refactor
Signed-off-by: Hang Yan <hang.yan@hotmail.com>
2021-10-03 17:33:43 +08:00
ichx
2f081075a8
Fix misuse in struct kobject.ServiceConfig.Port (#1423) 2021-08-29 21:37:22 +08:00
ichx
e82fe96c38
Add support for negated placement constraint (#1419) 2021-08-27 22:49:55 +08:00
xingjianhui
e8966d9e2c
Fix kompose.image-pull-secret invalid issue when use compose configs (#1414) 2021-08-23 20:39:17 +08:00
w4v3
b2dee807a2
Add storageClassName label to pvc manifest(#1413) 2021-08-15 15:05:01 +08:00
Kubernetes Prow Robot
94bff75a15
Merge pull request #1401 from tk42/service_account
Add ServiceAccountName
2021-08-12 07:15:47 -07:00
cnbailian
5a17ee46c3 fix the selector field of service resource 2021-08-06 15:04:23 +08:00
tk42
f7f987de49 Add ServiceAccountName
The label `kompose.service.accountname` defines the service account name
to provide the credential info of the pod.
2021-07-24 08:44:07 +09:00
tk42
deb00f3407
support multiple containers in a pod (#1394) 2021-07-08 09:48:05 +08:00
Rémy Léone
395d99fb7d
add support for golangci-lint (#1373) 2021-04-07 11:10:56 +08:00
Rémy Léone
d1e538e2d4
fix goimports (#1372) 2021-04-03 11:50:28 +08:00
Hang Yan
2dc6037cce
Allow controller flag to override restart policy (#1340) 2020-11-02 18:17:12 +08:00
Hang Yan
525b68f027
Go mod (#1305)
* Use go mod instead of glide
* Add `--with-kompose-annotation` flag to allow us to switch it off for tests
* Remove hostpid support (since the newest sdk does not support it)
* Create new test script and fixtures
* Remove replicationcontroller support
2020-08-07 17:25:52 +08:00
Hang Yan
bc28ffc675
Upgrade deployment/daemonset to apps/v1 (#1207) 2019-12-26 16:36:11 +08:00
Mudit Verma
ac2b852955 Network Key Translation Feature and test cases (#1195) 2019-12-01 10:19:23 +08:00
Kamil Kieliszczyk
66ac4aff4f Add kompose.image-pull-secret and kompose.image-pull-policy (#1091)
* Add kompose.image-pull-secret

* Add kompose.image-pull-secret tests

* Add kompose.image-pull-policy

* Add kompose.image-pull-policy tests

* ignore .coverprofile

* Fix typo
2019-02-07 09:50:53 -05:00
Li Yi
6eb1aed7ab Fix invalid port name with uppercase characters (#1029)
* Fix invalid port name with uppercase characters

Signed-off-by: Li Yi <denverdino@gmail.com>
2018-06-05 14:18:40 +08:00
Suraj Narwade
ec5c4d8550 Adding save command to annotation
This command will add `kompose command` used to generate artifacts as well as `kompose version`,
for ex,

```
metadata:
    annotations:
      kompose.cmd: kompose convert -f /home/snarwade --stdout
      kompose.version: 1.0.0 (HEAD)
```

For functional test, Now each test has template like,

```
 "annotations": {
           "kompose.cmd": "%CMD%",
           "kompose.version": "%VERSION%"
```

Because, for every machine these values will be different.

Updated functional test with new annotations
2017-08-14 12:22:33 +05:30
Suraj Narwade
641f8f8932 Added support for group_add key
This PR will add support for `group_add` key which will map to
supplemental group in pod security context.
2017-08-10 11:54:35 +05:30
Suraj Narwade
d5a5f42d8b Handling Volume at early stage
It will resolve #544 as well as refactor volume handling part.
2017-07-26 19:59:05 +05:30
Charlie Drage
796313f626 Merge pull request #704 from cdrage/graduate-from-incubator
kubernetes-incubator -> kubernetes
2017-07-12 16:49:55 -04:00