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
upgrader: Use "pending" deployment for origin by default #611
Conversation
If we agree on this I'll do the tests. |
Yeah, I think that makes sense overall. We'll need to remember to note the backwards incompatibility at release time, even though the new behaviour is probably what most people want. |
ce70c55
to
afc16f0
Compare
Rebased 🏄 and with tests ☑️ |
|
||
# rollup: install/deploy/uninstall | ||
|
||
assert_status_jq ".deployments[0][\"base-checksum\"] == \"${commit}\"" \ |
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.
Ahh, I renamed this to vm_assert_status_jq
in my last PR. :)
'.deployments[0]["packages"]|index("nonrootcap")|not' | ||
vm_rpmostree install nonrootcap | ||
assert_status_jq ".deployments[0][\"base-checksum\"] == \"${commit}\"" \ | ||
'.deployments[0]["packages"]|index("foo") >= 0' \ |
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.
I think there's an has()
operator that would be nice here.
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.
Doesn't do what you'd think:
echo '["foo", "bar"]' | jq 'has("foo")'
jq: error (at <stdin>:1): Cannot check whether array has a string key
I looked but didn't see a jq operator for searching an array.
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.
Ahhh gotcha!
Until now, we always used the booted deployment, and would garbage collect the "pending" deployment. This is the way OSTree was designed, but I think for rpm-ostree given how mutable we are on the client side, there's a much stronger argument for being more stateful too. This is a relatively simple code change to split the "merge deployment" concept into two. There's now the "config merge deployment" and the "origin merge deployment". Basically, `rpm-ostree install foo; rpm-ostree install bar` will now install both `foo` and `bar`. But we will still use the booted deployment for `/etc`. Down the line, I think I'd like to drive into OSTree the concept of a "staged" deployment, that has the hardlink checkout done, but doesn't have the config merge. But we don't need to change the OSTree core for this yet; we can do it here in rpm-ostree, and this relatively simple code change fixes many issues at once. For example, `rpm-ostree upgrade && rpm-ostree install foo` now does what you expect as well. Obviously, we want to enable doing multiple things in *one* transaction, and we're not far away, but I think this is also the right thing to do now. I'm relatively confident it won't break anyone's workflow, as what we did before wasn't generally that useful. However, people will need to learn to `ostree admin undeploy 0` if they *don't* want this behavior. (We need to have `rpm-ostree cleanup`). Closes: coreos#406
afc16f0
to
123a5b6
Compare
Rebased 🏄 |
☀️ Test successful - status-atomicjenkins |
Until now, we always used the booted deployment, and would
garbage collect the "pending" deployment. This is the
way OSTree was designed, but I think for rpm-ostree given
how mutable we are on the client side, there's a much stronger
argument for being more stateful too.
This is a relatively simple code change to split the "merge deployment"
concept into two. There's now the "config merge deployment" and the
"origin merge deployment".
Basically,
rpm-ostree install foo; rpm-ostree install bar
willnow install both
foo
andbar
. But we will still use the booteddeployment for
/etc
.Down the line, I think I'd like to drive into OSTree the concept of
a "staged" deployment, that has the hardlink checkout done, but doesn't
have the config merge.
But we don't need to change the OSTree core for this yet; we can
do it here in rpm-ostree, and this relatively simple code change
fixes many issues at once.
For example,
rpm-ostree upgrade && rpm-ostree install foo
nowdoes what you expect as well.
Obviously, we want to enable doing multiple things in one transaction,
and we're not far away, but I think this is also the right thing to do now.
I'm relatively confident it won't break anyone's workflow, as what
we did before wasn't generally that useful. However, people will
need to learn to
ostree admin undeploy 0
if they don't wantthis behavior. (We need to have
rpm-ostree cleanup
).Closes: #406