-
Notifications
You must be signed in to change notification settings - Fork 307
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
Add a hidden option to ostree admin kargs edit-in-place
to update all existing deployments in place
#2639
Add a hidden option to ostree admin kargs edit-in-place
to update all existing deployments in place
#2639
Conversation
ostree admin kargs edit-in-place
toostree admin kargs edit-in-place
to update all existing deployments in place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a full review but looks good.
3bccc54
to
bc08c71
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for working on this!
1131f57
to
4ca6975
Compare
src/libostree/ostree-kernel-args.c
Outdated
{ | ||
char *duped = g_strdup (arg); | ||
|
||
if (g_hash_table_contains (kargs->table, duped)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The value that has
=
likeTESTARG=TESTVALUE
will be appended again if call twice, for example the result will be like:
# options root=LABEL=MOO quiet ostree=/ostree/boot.1/testos/7bd091ad6955c0e7ef41bab65adb016275664b55efc0d10a0c8cb263da3c1e4e/0 ARGWITHOUTKEY TESTARG=TESTVALUE TESTARG=TESTVALUE
- But value like
ARGWITHOUTKEY
will not be appended twice as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parse the key from key=value
and call g_hash_table_contains (kargs->table, key)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right...I think the logic we want here is more like:
g_autofree char *key = g_strdup (arg);
const char *val = split_keyeq (key);
// Don't insert a duplicate key.
if (g_hash_table_contains (kargs->table, key))
return;
ostree_kernel_args_append (kargs, arg);
or so?
Though, if the argument table already has e.g. TESTARG=VAL1
and we say append_if_missing (TESTARG=VAL2)
...do we expect it to be ignored, or to add a new value, or to replace the existing one? I guess in most cases we want it to be ignored, which is what will happen here.
e24f60a
to
74a3317
Compare
ostree admin kargs edit-in-place
to update all existing deployments in placeostree admin kargs edit-in-place
to update all existing deployments in place
/retest |
74a3317
to
c88370e
Compare
src/libostree/ostree-kernel-args.c
Outdated
{ | ||
char *duped = g_strdup (arg); | ||
|
||
if (g_hash_table_contains (kargs->table, duped)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right...I think the logic we want here is more like:
g_autofree char *key = g_strdup (arg);
const char *val = split_keyeq (key);
// Don't insert a duplicate key.
if (g_hash_table_contains (kargs->table, key))
return;
ostree_kernel_args_append (kargs, arg);
or so?
Though, if the argument table already has e.g. TESTARG=VAL1
and we say append_if_missing (TESTARG=VAL2)
...do we expect it to be ignored, or to add a new value, or to replace the existing one? I guess in most cases we want it to be ignored, which is what will happen here.
75718f9
to
fcc2b40
Compare
You are right, this will not add duplicate key. Update according to your suggestion, and make a little change for
|
Need to also add the new symbol to |
update all existing deployments in place Example: $ sudo ostree admin kargs edit-in-place --append-if-missing=rw See ostreedev#2617 This will not add duplicate key, if there is `TESTARG=VAL1` in the kernel arguments, `--append-if-missing=TESTARG=VAL2` will be ignored.
fcc2b40
to
3bc59a5
Compare
Update is done, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/override continuous-integration/jenkins/pr-merge |
@cgwalters: Overrode contexts on behalf of cgwalters: continuous-integration/jenkins/pr-merge In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
🎉 |
Thanks for the work here @HuijingHei ! |
I am much appreciated with the help of @cgwalters and @travier, thanks a lot! |
ostree admin kargs edit-in-place
to update all existing deployments in placeostree admin kargs edit-in-place
to update all existing deployments in place
Describe the enhancement
Add a hidden option to
ostree admin kargs edit-in-place
to update all existing deployments in place.Example:
$ sudo ostree admin kargs edit-in-place --append-if-missing=rw
This would be useful for: https://fedoraproject.org/wiki/Changes/Silverblue_Kinoite_readonly_sysroot