Update c/image from the main branch

> go get github.com/containers/image/v5@main
> make vendor

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2023-04-01 12:19:48 +02:00
parent 4f475bd4d2
commit bfe82593c8
285 changed files with 21881 additions and 4003 deletions

View File

@@ -39,10 +39,9 @@ func WithRefreshRate(d time.Duration) ContainerOption {
// WithManualRefresh disables internal auto refresh time.Ticker.
// Refresh will occur upon receive value from provided ch.
func WithManualRefresh(ch chan interface{}) ContainerOption {
func WithManualRefresh(ch <-chan interface{}) ContainerOption {
return func(s *pState) {
s.manualRefresh = ch
s.disableAutoRefresh = true
s.manualRC = ch
}
}
@@ -52,34 +51,27 @@ func WithManualRefresh(ch chan interface{}) ContainerOption {
// rendering will start as soon as provided chan is closed.
func WithRenderDelay(ch <-chan struct{}) ContainerOption {
return func(s *pState) {
s.renderDelay = ch
s.delayRC = ch
}
}
// WithShutdownNotifier provided chanel will be closed, after all bars
// have been rendered.
func WithShutdownNotifier(ch chan struct{}) ContainerOption {
// WithShutdownNotifier value of type `[]*mpb.Bar` will be send into provided
// channel upon container shutdown.
func WithShutdownNotifier(ch chan<- interface{}) ContainerOption {
return func(s *pState) {
select {
case <-ch:
default:
s.shutdownNotifier = ch
}
s.shutdownNotifier = ch
}
}
// WithOutput overrides default os.Stdout output. Setting it to nil
// will effectively disable auto refresh rate and discard any output,
// useful if you want to disable progress bars with little overhead.
// WithOutput overrides default os.Stdout output. If underlying io.Writer
// is not a terminal then auto refresh is disabled unless WithAutoRefresh
// option is set.
func WithOutput(w io.Writer) ContainerOption {
var discarded bool
if w == nil {
w = io.Discard
discarded = true
}
return func(s *pState) {
s.output = w
s.outputDiscarded = discarded
}
}
@@ -93,6 +85,14 @@ func WithDebugOutput(w io.Writer) ContainerOption {
}
}
// WithAutoRefresh force auto refresh regardless of what output is set to.
// Applicable only if not WithManualRefresh set.
func WithAutoRefresh() ContainerOption {
return func(s *pState) {
s.autoRefresh = true
}
}
// PopCompletedMode will pop completed bars to the top.
// To stop rendering bar after it has been popped, use
// mpb.BarRemoveOnComplete() option on that bar.