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

Allow setting the service name of Quadlet .pod units #23427

Merged

Conversation

ygalblum
Copy link
Contributor

Does this PR introduce a user-facing change?

Yes

Allow setting the service name of Quadlet .pod units 

Resolves: #23414

Copy link
Contributor

openshift-ci bot commented Jul 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ygalblum

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 29, 2024
ygalblum added 2 commits July 29, 2024 16:11
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
@ygalblum ygalblum force-pushed the quadlet-pod-service-name branch from 7e48af6 to f3a8626 Compare July 29, 2024 13:11
@@ -788,229 +793,229 @@ BOGUS=foo

DescribeTable("Running quadlet test case",
runQuadletTestCase,
Entry("Basic container", "basic.container", 0, ""),
Copy link
Member

Choose a reason for hiding this comment

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

this diff is gigantic, is ther eno better wya to do that? i.e. wrapper function or new test case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I put it in a separate commit in order to make it more readable. I guess it didn't work :).
Originally, I thought I'd add this feature to other unit types, but, I'm not sure it's really needed for the units that are intended to be used as dependencies.
I can look into separating this test if you think it's better

Copy link
Member

Choose a reason for hiding this comment

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

sure a separate commit helps but the point you still touch a lot of lines for no good reason, duplicating ...0, "", ""), is annoying to see and makes it harder to read.

So thinking about this there should really be a way to pass optional arguments. Because the next time someone adds a new arg I don't want to see such a bug diff again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've opened a PR to split the tables so that they can use default values: #23443. Once it's merged, I'll rebase this one

@@ -947,6 +948,14 @@ When using `host` networking via `Network=host`, the `PublishPort=` option canno

This key can be listed multiple times.


### `ServiceName=`
Copy link
Member

Choose a reason for hiding this comment

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

I have nothing against setting a a specific service name but IMO this should not be added for just pods. This is totally inconsistent like that and if we do it then it should be done for all units IMO

Copy link
Contributor Author

@ygalblum ygalblum Jul 29, 2024

Choose a reason for hiding this comment

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

I thought about it as well. But then I thought:

  • The service for .container and .kube files keeps the name
  • Unit types .network, .volume, .image and .build are intended mostly for dependencies
  • .pod are the only ones that both the users interact with and the name is not kept.

Plus, making these change for other types is more complicated because it requires handling the order differently. Something along the line of what I already did for .pod files. So, this gives a quick response for the issue that was raised

Copy link
Member

Choose a reason for hiding this comment

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

I guess I am open to wait for user feedback on this, but generally I find doing this for one option inconsistent and I am pretty sure that someone will request this for other types as well.
(I do agree that kube and container units are fine without it as they do not append anything)

@rhatdan
Copy link
Member

rhatdan commented Jul 29, 2024

LGTM

@mheon
Copy link
Member

mheon commented Jul 30, 2024

@Luap99 Are you good to merge, or would you like to see the test changes happen in this PR?

@Luap99
Copy link
Member

Luap99 commented Jul 30, 2024

No please merge #23443 first then this can rebased which makes it much cleaner.

@rhatdan
Copy link
Member

rhatdan commented Jul 30, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 30, 2024
@Luap99 Luap99 removed the lgtm Indicates that a PR is ready to be merged. label Jul 30, 2024
@Luap99
Copy link
Member

Luap99 commented Jul 30, 2024

/hold

Please do not merge it before the test cleanup

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 30, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit b4d0c95 into containers:main Jul 30, 2024
83 checks passed
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Oct 29, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to customize Quadlet service names
4 participants