Commit Graph

149 Commits

Author SHA1 Message Date
1ff8edfaf0 Add support for init containers and mounting secrets 2025-12-01 16:16:16 +05:30
c82b499b01 Skip docs workflow 2025-12-01 14:07:38 +05:30
11bed62f52 Fix service name handling in generated templates 2025-11-27 16:34:48 +05:30
408cd36ad3 Inject templates while building the chart 2025-11-27 12:23:38 +05:30
3074b5451d Generate template placeholders for env vars and images in charts 2025-11-27 10:52:57 +05:30
yuefanxiao
22d9233f8b fix: resolve env_file variable interpolation issues by adding support for and default syntax 2025-05-08 01:23:08 +08:00
robertaistleitner
1b29e031e3
Fix ConfigMap name clash if env_file name is equal (#2001)
* Fix ConfigMap name clash if env_file name is equal #2000

* Generate envFrom instead of single env entries from env_file entries #1999

* Fix failing test fixture outputs
2025-04-15 11:39:45 -04:00
João Vitor Paes de Barros do Carmo
1c7c63f1e7 refactor: changed the deploy label to use the convention 2024-10-04 00:06:43 +01:00
João Vitor Paes de Barros do Carmo
3ec739017d feat(deploy): support ephemeral storage requests limits labels 2024-09-27 01:02:46 +01:00
favonia
0ace11079e
feature: support UID:GID in the user key 2024-08-30 13:57:58 -05: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
jose luis
3c189aaff1
Merge branch 'main' into feature-1846-network_mode-service
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
2024-04-25 17:31:49 +02:00
jose luis
8ee944c2be
Merge branch 'main' into feature-1846-network_mode-service 2024-04-22 15:46:45 +02: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
Kubernetes Prow Robot
cdcb0e7f61
Merge pull request #1847 from sosan/feature-1631-add-hpa
Feature 1635 - added labels to generate HPA
2024-04-19 05:24:52 -07:00
Kubernetes Prow Robot
1015e59eac
Merge pull request #1838 from microsec-ambrose/upgrade-compose-go
chore(deps): bump Go version and github.com/compose-spec/compose-go
2024-04-18 05:58:12 -07:00
jose luis
d43e210f04
Merge branch 'main' into feature-1846-network_mode-service
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
2024-04-10 18:21:25 +02:00
jose luis
405ab61479
Merge branch 'main' into feature-1631-add-hpa 2024-04-10 13:24:35 +02:00
jose luis
1010e1a916
Merge branch 'main' into feature-1794-auto-configmaps 2024-04-10 00:50:37 +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
Jose Luis
c9c1080306
adds a label for initContainers, test and user-guide (#1840)
* adds a label for initContainers, test and user-guide

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>

* solved suggestion version from 2 to 3, coments

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>

* test e2e

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>

* add target to kompose build

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>

* chore(deps)(deps): bump golang.org/x/tools from 0.16.1 to 0.19.0 (#1836)

Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.16.1 to 0.19.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.16.1...v0.19.0)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* changed var names contaers to containers
changed labels to kompose.init.container.name, kompose.init.container.image, kompose.init.container.command
fixed documentation, tests and e2e
also merged main with new commits to this branch

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>

---------

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kubernetes Prow Robot <20407524+k8s-ci-robot@users.noreply.github.com>
2024-04-08 08:49:09 -04:00
jose luis
4cd0b268fc
add configmaps derived from file and dir
add tests and e2e
function isconfigfile check if we need to use configmap and mount in readonly
readonly not asigned because not fail e2e

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
2024-04-07 21:18:01 +02:00
jose luis
8ff0f334eb
fix EOF, DefaultMaxReplicas set to 3, extended user guide about hpa, more tests
add warning in situations like:
- maxreplicas < minreplicas
- value from label < 0
- validate percentage in cpu, memory metrics
2024-04-04 20:21:00 +02:00
jose luis
04acbf111f
added tests
add e2e
2024-04-03 19:31:46 +02:00
jose luis
58974092a5
add networkmode service:
added tests
fixNetworkModeToService is responsible for adjusting the network mode of services in docker compose (services:) and generate a mapping of deployments based on the network mode of each service merging containers into the destination deployment, and removing transferred deployments

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
2024-03-30 21:17:47 +01:00
jose luis
a38f7f9ea3
added this labels:
kompose.hpa.minreplicas
kompose.hpa.maxreplicas
kompose.hpa.cpu
kompose.hpa.memory

documentated labels user_guide.md

generate custom metrics from cpu, memory and set min/max replicas

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
2024-03-26 20:58:57 +01:00
Ambrose Chua
ea485a7806
chore(deps): bump github.com/compose-spec/compose-go 2024-03-19 14:34:58 +08:00
Kubernetes Prow Robot
b2514e1c81
Merge pull request #1831 from realgam3/fix-configmap-volumes
fix issues #1829, #1830
2024-02-20 20:45:04 -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
Tomer Zait
db6a4d7ce1 fix issues #1829, #1830 2024-02-18 10:50:15 +02:00
Jose Luis
182e0ce294
Merge branch 'kubernetes:main' into fix-issue-1778 2024-02-07 18:35:28 +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
jose luis
578fa72a9a
fix issue 1793
* fix issue 1793  https://github.com/kubernetes/kompose/issues/1793
*add tests

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>

formated k8utils_test.go

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>

labels formatted as name"-"envName to match fixtures when performing the gitHub action

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>

removed this piece code because apply it later, and it is redundant

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>

Refactor test in k8sutils_test.go to extract the last 63 characters. This addresses the impact of the removed code that previously truncated the input with if len(envName) > 63 { envName = envName[len(envName)-63:] }

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>

changed to name function to getUsableNameEnvFile

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>

fix issue 1793

* fix issue 1793  https://github.com/kubernetes/kompose/issues/1793
*add tests

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>

labels formatted as name"-"envName to match fixtures when performing the gitHub action

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>

changed to name function to getUsableNameEnvFile

Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
2024-01-24 23:41:01 +01:00
Martin Jirku
f80ad97307
feat(1765): update tests, move unit test to proper file, improve removeEmptyInterfaces algo
Signed-off-by: Martin Jirku <martin@jirku.sk>
2024-01-01 12:07:44 +01:00
Martin Jirku
3a818f4b01
feat(1765): remove useless keys from the outpu yml
Signed-off-by: Martin Jirku <martin@jirku.sk>
2023-12-07 08:30:32 +01:00
AhmedGrati
d633c31e15 test: add unit-tests for FormatEnvName function
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-11-05 13:20:25 +01:00
AhmedGrati
771e564645 test: add unit-tests for FormatEnvName function
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-11-05 13:20:25 +01:00
Thijs Broersen
7826534666
fix: env_file configmap name length (#1743)
* fix: env_file configmap name length

fix filename to configmap name transformer

* fix configmap names in tests

* add env-multiple fixture and test

* adjust to test

* disable env-multiple suite
2023-10-27 10:48:55 +01:00
AhmedGrati
53de2c44fd fix failing unit tests
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-10-24 23:08:34 +01:00
AhmedGrati
0a3b1897c0 fix: remove e2e flakiness by making the loop deterministic
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-10-24 16:31:22 +01:00
AhmedGrati
3172bc05b5 fix: remove e2e flakiness by making the loop deterministic
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-10-24 16:19:22 +01:00
AhmedGrati
1f1fc20204
Fix loading env file (#1679)
* fix: update loading 'env_file' of docker_compose

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

* test: add functional tests for loading env_file

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

---------

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-07-26 14:03:15 -04:00
AhmedGrati
4a08d41242 feat: add read only fs support
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-07-14 15:56:04 +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
Manuel Rüger
b3d4aec3ee
k8sutils: Update helm template to use apiVersion v2 (#1567)
https://helm.sh/docs/topics/charts/#the-apiversion-field
2023-02-01 10:37:57 -05:00
Lctrs
cb41c16bf4
chore: require go >=1.18, bump deps and get rid of replace directives (#1552) 2023-01-13 08:50:28 -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
91391eb84f
Fix: Make the out flag print to one file using seperator (#1541)
* fix: make the out flag print to one file using seperator

* fix: comment an unused function

* fix: update test script

* fix: update output k8s

* fix: update the json output error condition

* fix: update envvars interpolation tests

* chore: update e2e tests to support yaml generation instead of JSON format

* fix: update e2e tests according to ci environment

* fix: apply PR changes
2022-12-01 09:47:50 +01:00
AhmedGrati
acb8046f84
Fix environment variables interpolation (#1524) 2022-11-19 10:35:33 +08:00
AhmedGrati
fd7b751564
Fix container name (#1528)
* fix: update get container name function
* test: add a test for the introduced fix
2022-11-13 21:33:47 +08:00