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 option for job name to be passed to docker as container name #78

Open
chrishoage opened this issue Feb 2, 2025 · 0 comments
Open

Comments

@chrishoage
Copy link

I wish to be able to give "run" spawned containers meaningful names so they are easier to identify.

Here is my proposal for this feature:

By default BareJob.Name is to be passed to docker.CreateContainerOptions. In Addition to this RunJob gains Name *string.

When RunJob.Name == null then BareJob.Name is used. This allows for RunJob.Name == "" to allow the current behavior allowing docker to choose a random name should a user not want to deal with name conflicts.

This allows for a name which we already must define for ofelia to keep track of schedules to be re-used for a container now.

However - this is certainly a "breaking change".

Some ideas to mitigate this:

  • opt in this feature via new global setting. e.g. global.useJobNameForContainer = "true"
  • Only rely on RunJob Name *string and force name to be defined twice (e.g. Name is no longer an override for the job name)
  • Live with the breaking change, since this is a fork of the original project which is in "maintenance mode"

I write this issue as I plan to make these changes no matter what - however if i can do it in a way that allows it to be upstreamed instead of a way that is easiest for me - all the better.

Let me know if this feature is desirable and which of the following approaches is best for this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant