This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 302
fleetd: support operators in metadata #1632
Open
dongsupark
wants to merge
6
commits into
coreos:master
Choose a base branch
from
endocode:dongsu/fleetd-metadata-operators
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fleetd: support operators in metadata #1632
dongsupark
wants to merge
6
commits into
coreos:master
from
endocode:dongsu/fleetd-metadata-operators
Conversation
This file contains 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
If define metadata in fleet conf, such as "ram=1024", we can define the operator in [X-Fleet] unit as below: [X-Fleet] MachineMetadata=ram>=2048 The operators have been supported: "<=", ">=", "!=", "<", ">", "=" If the operatior are "<=", ">=", "!=", "<", ">", the value should be integer, otherwise, the unit will never be launched. Fixes coreos#1143
To follow the maintainer's suggestion, also support the operator "==", which is actually the same as "=".
Update documentation. Fixes coreos#1143
TestHasMetadata should also test more cases for metadata operators.
fleetctl list-machines should distinguish normal metadata from metadata with operators, to print out human-readable messages.
dongsupark
force-pushed
the
dongsu/fleetd-metadata-operators
branch
2 times, most recently
from
July 14, 2016 10:58
cde04ef
to
7e765fe
Compare
TestMetadataOperator ensures that metadata operators work also for extended operators such as ">=", "<=", "<", ">", "!=", or "==". First make the test machine have "ram=1024" in its machine metadata. Then in TestMetadataOperator, check each possible operator one after another, to make sure that each works without error.
dongsupark
force-pushed
the
dongsu/fleetd-metadata-operators
branch
from
July 14, 2016 11:39
7e765fe
to
68028c7
Compare
Updated the functional test
|
dongsupark
force-pushed
the
master
branch
3 times, most recently
from
August 16, 2016 08:54
150d30c
to
4002bf5
Compare
dongsupark
force-pushed
the
master
branch
7 times, most recently
from
August 23, 2016 11:00
3b60e93
to
875d938
Compare
dongsupark
force-pushed
the
master
branch
2 times, most recently
from
August 30, 2016 12:26
bdc94e8
to
fa5aa3a
Compare
dongsupark
force-pushed
the
master
branch
2 times, most recently
from
November 10, 2016 15:24
20a3e96
to
3aaa1ab
Compare
dongsupark
force-pushed
the
master
branch
2 times, most recently
from
November 24, 2016 15:35
eb6872f
to
365565e
Compare
dongsupark
force-pushed
the
master
branch
6 times, most recently
from
December 15, 2016 19:48
39a99ba
to
44591b0
Compare
dongsupark
force-pushed
the
master
branch
3 times, most recently
from
February 8, 2017 10:21
0132632
to
6974811
Compare
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.
This PR allows users to define metadata in units, such as
"ram=1024"
. Precisely we can define the operator in the[X-Fleet]
section in a unit as below:Supported operators are
"<="
,">="
,"!="
,"=="
,"<"
,">"
.This PR also contains more checks in fleetctl, more test cases in unit tests, and a new functional test.
Originally written by @wuqixuan.
Fixes #1143
Supersedes #1294