-
Notifications
You must be signed in to change notification settings - Fork 48
[10/n] [sled-agent] validate zone images as written in zone manifest #8190
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
Changes from all commits
1dabbbb
1035ba6
66ba3a4
265979f
75faa95
7336cb6
756312b
f5d4254
afc07f8
d6ae89c
6942a3d
96cc611
93d82e1
e158747
725f75a
4cccaac
156e16b
ad73216
ba14ce1
a795a51
f079b31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
use std::{io, sync::Arc}; | ||
use thiserror::Error; | ||
|
||
/// An `io::Error` wrapper that implements `Clone` and `PartialEq`. | ||
#[derive(Clone, Debug, Error)] | ||
#[error(transparent)] | ||
pub struct ArcIoError(pub Arc<io::Error>); | ||
|
||
impl ArcIoError { | ||
pub(crate) fn new(error: io::Error) -> Self { | ||
Self(Arc::new(error)) | ||
} | ||
} | ||
|
||
/// Testing aid. | ||
impl PartialEq for ArcIoError { | ||
fn eq(&self, other: &Self) -> bool { | ||
// Simply comparing io::ErrorKind is good enough for tests. | ||
self.0.kind() == other.0.kind() | ||
} | ||
} | ||
|
||
/// A `serde_json::Error` that implements `Clone` and `PartialEq`. | ||
#[derive(Clone, Debug, Error)] | ||
#[error(transparent)] | ||
pub struct ArcSerdeJsonError(pub Arc<serde_json::Error>); | ||
|
||
impl ArcSerdeJsonError { | ||
pub(crate) fn new(error: serde_json::Error) -> Self { | ||
Self(Arc::new(error)) | ||
} | ||
} | ||
|
||
/// Testing aid. | ||
impl PartialEq for ArcSerdeJsonError { | ||
Comment on lines
+38
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to put this behind There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be ok for now, but in an upcoming PR I move this into a more central location and it would become more annoying to manage. |
||
fn eq(&self, other: &Self) -> bool { | ||
// Simply comparing line/column/category is good enough for tests. | ||
self.0.line() == other.0.line() | ||
&& self.0.column() == other.0.column() | ||
&& self.0.classify() == other.0.classify() | ||
} | ||
} |
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.
Was this just wrong before? (Hopefully only used by tests??)
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.
Yeah it was only used by tests. Actually hooking sled-agent's zone logic to installinator found the issue.