This repository was archived by the owner on Jan 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 301
agent: allow HasConflict() to handle multiple values defined in Conflicts #1695
Merged
dongsupark
merged 4 commits into
coreos:master
from
endocode:dongsu/agent-conflict-multi-units
Dec 15, 2016
Merged
agent: allow HasConflict() to handle multiple values defined in Conflicts #1695
dongsupark
merged 4 commits into
coreos:master
from
endocode:dongsu/agent-conflict-multi-units
Dec 15, 2016
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3dcaddf
to
1213dbb
Compare
Updated.
|
1213dbb
to
71811a1
Compare
71811a1
to
570080b
Compare
So far when parsing values defined in the Conflicts option, it hasn't taken multiple values into account. So let's allow j.Conflicts() to parse multiple values, splitting with white-space delimiters into a slice of each string.
…icts In AgentState.HasConflict(), split a common part for checking if a unit belongs to a Conflicts list, into a new helper hasStringInSlice(). Also return a slice of conflicted strings, instead of a single string. Doing that, HasConflict() can be more readable.
Now that it's possible to parse multiple values defined in Conflicts, we should add new test cases for unit tests, TestAbleToRun(), TestHasConflicts(), and TestJobConflicts(), e.g.: Conflicts=pong.service Conflicts=ping.service and Conflicts=pong.service ping.service
d2a2c12
to
e06ce1d
Compare
To test the new feature of having multiple values in Conflicts, introduce a functional test TestScheduleMultipleConflicts().
20a3e96
to
3aaa1ab
Compare
eb6872f
to
365565e
Compare
I just double-checked. It looks fine. |
dongsupark
pushed a commit
that referenced
this pull request
Dec 15, 2016
agent: allow HasConflict() to handle multiple values defined in Conflicts
dongsupark
pushed a commit
that referenced
this pull request
Dec 15, 2016
agent: allow HasConflict() to handle multiple values defined in Conflicts
dongsupark
pushed a commit
that referenced
this pull request
Dec 15, 2016
agent: allow HasConflict() to handle multiple values defined in Conflicts
dongsupark
pushed a commit
that referenced
this pull request
Dec 15, 2016
agent: allow HasConflict() to handle multiple values defined in Conflicts
dongsupark
pushed a commit
that referenced
this pull request
Dec 15, 2016
agent: allow HasConflict() to handle multiple values defined in Conflicts
dongsupark
pushed a commit
that referenced
this pull request
Dec 15, 2016
agent: allow HasConflict() to handle multiple values defined in Conflicts
dongsupark
pushed a commit
that referenced
this pull request
Dec 15, 2016
agent: allow HasConflict() to handle multiple values defined in Conflicts
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So far when parsing values defined in the
Conflicts
option, it hasn't taken multiple values into account. So let's allowj.Conflicts()
to parse multiple values, splitting with white-space delimiters into a slice of each string.In
AgentState.HasConflict()
, split a common part for checking if a unit belongs to a Conflicts list, into a new helperhasStringInSlice()
Also return a slice of conflicted strings, instead of a single string. Doing that,HasConflict()
can be more readable.Also extend unit tests and functional tests.
Fixes #1245