-
Notifications
You must be signed in to change notification settings - Fork 296
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
lib/pull: Add timestamp-check-from-rev
#2099
lib/pull: Add timestamp-check-from-rev
#2099
Conversation
The way `timestamp-check` works might be too restrictive in some situations. Essentially, we need to support the case where users want to pull an older commit than the current tip, but while still guaranteeing that it is newer than some even older commit. This will be used in Fedora CoreOS. For more information see: coreos/rpm-ostree#2094 coreos/fedora-coreos-tracker#481
This seems fine but...I don't see any downsides to changing libostree to do what rpm-ostree is doing by default instead. |
2ae969e
to
c8efce0
Compare
Hmm, can you expand? The pull code has no concept of deployments, right? How would it know what the base revision is? |
I think |
I think I agree (if technically possible). The description of the behavior in coreos/rpm-ostree#2094 (comment) is what I thought downgrade protection meant universally:
If that's true then do we need downgrade protection here (in addition to rpm-ostree)? |
I want libostree to work on its own too - with this we aren't helping |
aside: I am pretty happy with how the "layers" in libostree ended up, but man there are some fun "layer-crossing" problems (this always happens). |
Yep I was forgetting about libostree without rpm-ostree. |
Making the OSTree sysroot upgrader use this flag too WFM. I misunderstood your original comment as suggesting an alternative way to solve this. |
For the same reason as coreos/rpm-ostree#2094. What we care most about is that the new commit we pull is newer than the one we're currently sitting on, not necessarily that it's newer than the branch itself, which it might not be if e.g. we're trying to deploy a commit older than the tip but still newer than the deployment (via `--override-commit`).
Updated sysroot upgrader! ⬆️ |
This is a short-term hack until we can depend on the new `timestamp-check-from-rev` from ostree: ostreedev/ostree#2099 That way, we still get downgrade protection, but wrt the checked out deployment, not the local ref. For more information, see coreos#2094 coreos/fedora-coreos-tracker#481
All green! |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, jlebon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Isn't that what the last commit here is doing? |
Yep, you're right, thanks! |
This is a short-term hack until we can depend on the new `timestamp-check-from-rev` from ostree: ostreedev/ostree#2099 That way, we still get downgrade protection, but wrt the checked out deployment, not the local ref. For more information, see #2094 coreos/fedora-coreos-tracker#481
Hum interesting, this PR changing unrelated code failed here. I haven't debugged why yet; at first I thought it might be we were making commits in under a second, but that still wouldn't appear as a downgrade. I wonder if it could be something like clock skew on the builder machine. |
|
I saw `tests/test-admin-deploy.none.sh` fail in one CI run, and I want to check if it was because of clock skew, so fail fast if we detect that. xref ostreedev#2099 (comment)
I saw `tests/test-admin-deploy.none.sh` fail in one CI run, and I want to check if it was because of clock skew, so fail fast if we detect that. xref ostreedev#2099 (comment)
I saw `tests/test-admin-deploy.none.sh` fail in one CI run, and I want to check if it was because of clock skew, so fail fast if we detect that. xref ostreedev#2099 (comment)
Ahhh I think I know what this is. In the first diff hunk in that file (https://github.com/ostreedev/ostree/pull/2099/files#diff-5092e9dd89d398d2a7b46be8e0dbe787R307), I added a sanity-check that |
Otherwise the new check we added there to verify that upgrading without `--allow-downgrade` fails itself fails. See: ostreedev#2099 (comment)
The way
timestamp-check
works might be too restrictive in somesituations. Essentially, we need to support the case where users want to
pull an older commit than the current tip, but while still guaranteeing
that it is newer than some even older commit.
This will be used in Fedora CoreOS. For more information see:
coreos/rpm-ostree#2094
coreos/fedora-coreos-tracker#481