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

cmd/compose: add support for profiles #2042

Merged
merged 1 commit into from Mar 1, 2023

Conversation

danishprakash
Copy link
Contributor

@danishprakash danishprakash commented Feb 22, 2023

From https://github.com/compose-spec/compose-spec/blob/master/spec.md#profiles:

Profiles allow to adjust the Compose application model for various usages and environments. 
A Compose implementation SHOULD allow the user to define a set of active profiles. The exact 
mechanism is implementation specific and MAY include command line flags, environment variables, etc.

Closes #1831

Signed-off-by: danishprakash danish.prakash@suse.com

@danishprakash danishprakash force-pushed the compose-profile-support branch 3 times, most recently from a32feac to e645ba9 Compare February 22, 2023 12:35
@danishprakash danishprakash force-pushed the compose-profile-support branch 3 times, most recently from 26ac377 to 7d56e5e Compare February 23, 2023 05:58
@AkihiroSuda
Copy link
Member

Unverified

Could you fix the GPG error?

* add tests
* add command reference

Signed-off-by: danishprakash <danish.prakash@suse.com>
@AkihiroSuda AkihiroSuda added this to the v1.3.0 milestone Feb 24, 2023
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

Copy link
Member

@djdongjin djdongjin left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

On a side note, this PR only supports profile(s) for compose-up. Does the compose-spec or docker-compose mention it should be also supported by other compose commands?

@danishprakash
Copy link
Contributor Author

Thanks, It might seem a little misleading since I've added tests for compose up specifically but the profiles are applied on the compose command and then propagated to the sub-commands via the composer entity.

Although I haven't tested any other subcommand other than up, I've tried compose down with the profiles and it seems to work as expected. I've tried to keep the implementation similar to how docker/compose's in that sense.

@AkihiroSuda AkihiroSuda merged commit a56e239 into containerd:main Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support profiles in nerdctl compose
3 participants