Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

chore(*): rename Batch to Oneshot #533

Merged
merged 1 commit into from
Jun 10, 2014
Merged

Conversation

jonboulle
Copy link
Contributor

No description provided.

// completion, not be migrated around the cluster. This is determined by
// whether the unit file associated with the Job is a Service of type "oneshot".
func (j *Job) IsBatch() bool {
func (j *Job) IsOneshot() bool {
s, ok := j.Unit.Contents["Service"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it valid for a unit to have a .socket extension yet define a [Service] section?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope:

Jun 10 01:13:45 core-01 systemd[1]: [/etc/systemd/system/foo.socket:1] Unknown section 'Service'. Ignoring.

Copy link
Contributor

Choose a reason for hiding this comment

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

But in our case, we will not ignore the Service section in a non-service unit. That feels wrong.

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 am not sure making this particular function handle all edge cases like
that is the right answer. This sounds more like the task of a proper unit
linter (used at submission time, ideally) as we've talked about previously.
On Jun 10, 2014 6:44 AM, "Brian Waldon" notifications@github.com wrote:

In job/job.go:

// completion, not be migrated around the cluster. This is determined by
// whether the unit file associated with the Job is a Service of type "oneshot".
-func (j *Job) IsBatch() bool {
+func (j *Job) IsOneshot() bool {
s, ok := j.Unit.Contents["Service"]

But in our case, we will not ignore the Service section in a non-service
unit. That feels wrong.


Reply to this email directly or view it on GitHub
https://github.com/coreos/fleet/pull/533/files#r13593569.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, I'm not suggesting this function has to solve the problem. I'd like to address this problem before oneshot support ships, though.

@bcwaldon
Copy link
Contributor

lgtm

jonboulle added a commit that referenced this pull request Jun 10, 2014
chore(*): rename Batch to Oneshot
@jonboulle jonboulle merged commit cc7616b into coreos:master Jun 10, 2014
@jonboulle jonboulle deleted the oneshot branch June 10, 2014 05:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants