-
Notifications
You must be signed in to change notification settings - Fork 316
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
REFACTOR: Remove ImageBuilder struct #7682
Conversation
christophermaier
commented
May 12, 2020
As these refactorings have progressed, `ImageBuilder` has been revealed to be the equivalent of Tom Smykowski in the movie Office Space. Now, the `Naming` struct generates the "expanded identifiers" that `ImageBuilder` was via the `Identified` trait. This makes more sense, in that all the identifier logic is consolidated in the `Naming` struct. A future commit will remove the `Identified` trait altogether, thus fulfilling the prophecy foretold in 70a8aca. Signed-off-by: Christopher Maier <cmaier@chef.io>
This allows us to get rid of the `Identified` trait entirely. Signed-off-by: Christopher Maier <cmaier@chef.io>
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.
Very nice! It has been cool to see this series of PRs come together.
pub fn image_identifiers(&self, | ||
ident: &FullyQualifiedPackageIdent, | ||
channel: &ChannelIdent) | ||
-> Result<(String, Vec<String>)> { | ||
-> Result<(String, Vec<String>, Vec<String>)> { |
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.
Would it be worth having a type alias or maybe even a new type for the different types of tags?
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.
Maybe... writing this return type killed a little bit of my soul.
I think that with some additional future refactorings this would get a lot simpler, but it may be a good idea to contain the gnarliness until then.
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.
Addressed in f057ddb; much better 😄
} | ||
|
||
impl ContainerImage { | ||
// TODO (CM): temporary; we shouldn't use this at all | ||
pub fn workdir(&self) -> &Path { self.workdir.as_path() } | ||
|
||
pub fn expanded_identifiers(&self) -> &Vec<String> { &self.expanded_identifiers } |
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.
Can we make the return type &[String]
?
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.
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.
Addressed in decc378
Signed-off-by: Christopher Maier <cmaier@chef.io>
Signed-off-by: Christopher Maier <cmaier@chef.io>
f057ddb
to
d470028
Compare