-
Notifications
You must be signed in to change notification settings - Fork 42
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
Fix: imgutil/local: Add a warning message when saving a local image and containerd storage is enable #284 #285
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ type ImageOptions struct { | |
BaseImageRepoName string | ||
PreviousImageRepoName string | ||
Config *v1.Config | ||
Logger Logger | ||
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. Now that I see the option carefully, I think we shouldn't expose the Logger as an I will remove it from here and move it to |
||
CreatedAt time.Time | ||
MediaTypes MediaTypes | ||
Platform Platform | ||
|
@@ -43,6 +44,10 @@ type RegistrySetting struct { | |
Insecure bool | ||
} | ||
|
||
type Logger interface { | ||
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. Should we move the Logger interface to |
||
Warn(msg string) | ||
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. @natalieparellano should we add a |
||
} | ||
|
||
// FromBaseImage loads the provided image as the manifest, config, and layers for the working image. | ||
// If the image is not found, it does nothing. | ||
func FromBaseImage(name string) func(*ImageOptions) { | ||
|
@@ -99,6 +104,13 @@ func WithPreviousImage(name string) func(*ImageOptions) { | |
} | ||
} | ||
|
||
// WithLogger if provided will check if contained is used. | ||
func WithLogger(logger Logger) func(*ImageOptions) { | ||
return func(o *ImageOptions) { | ||
o.Logger = logger | ||
} | ||
} | ||
|
||
type IndexOption func(options *IndexOptions) error | ||
|
||
type IndexOptions struct { | ||
|
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.
Base on my comment on the
ImageOption
, maybe we should change the constructor to:Also in the
NewStore
constructor we can receive theLogger
instance.I know this is going to break,
imgutil
library consumers, but theLogger
inside theImageOption
doesn't make sense for me, at least conceptually