Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding support for --profile cmd option #1709

Merged
merged 7 commits into from
Sep 26, 2023

Conversation

axel7083
Copy link
Contributor

@axel7083 axel7083 commented Sep 17, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

When using docker compose we can use the profiles attribute.

profiles defines a list of named profiles for the service to be enabled under. If unassigned, the service is always started but if assigned, it is only started if the profile is activated.

In the current behaviour of kompose, if the compose file is using profiles, it will not process the services. This PR allows to add the --profile cmd command (repeatable) to send a list of string to the loader, that will be able to process the file and enable the services.

Which issue(s) this PR fixes:

Fixes #1708 #1458 #1448

Special notes for your reviewer:

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 17, 2023
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 17, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Sep 17, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @axel7083!

It looks like this is your first PR to kubernetes/kompose 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kompose has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Sep 17, 2023
@axel7083
Copy link
Contributor Author

@cdrage To follow up on the message you post on podman-desktop/podman-desktop#3970 (comment) during my POC for a Kompose extension integrated in Podman Desktop I faced the issue of the docker-compose with profiles, that by default kompose ignore them.

@cdrage
Copy link
Member

cdrage commented Sep 21, 2023

The code LGTM and implementation! But you'll have to add a test if that's okay for it to be all merged in :)

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 21, 2023
@axel7083
Copy link
Contributor Author

The code LGTM and implementation! But you'll have to add a test if that's okay for it to be all merged in :)

I've added a test in the client. To do so, I added an example of docker-compose with some profile, and using the tool, I ensure it matches the expected output.

Copy link
Member

@cdrage cdrage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One TINNYYYY change (no period at end of sentence and little bit of grammar change), but otherwise LGTM!

@cdrage
Copy link
Member

cdrage commented Sep 26, 2023

/approve

@cdrage
Copy link
Member

cdrage commented Sep 26, 2023

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: axel7083, cdrage

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 26, 2023
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 26, 2023
@k8s-ci-robot k8s-ci-robot merged commit ddd5f33 into kubernetes:main Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] kompose convert ignoring services when profiles is set
3 participants