diff options
Diffstat (limited to 'pkg/domain')
-rw-r--r-- | pkg/domain/entities/containers.go | 2 | ||||
-rw-r--r-- | pkg/domain/entities/pods.go | 5 | ||||
-rw-r--r-- | pkg/domain/infra/abi/containers.go | 3 | ||||
-rw-r--r-- | pkg/domain/infra/abi/play.go | 11 |
4 files changed, 18 insertions, 3 deletions
diff --git a/pkg/domain/entities/containers.go b/pkg/domain/entities/containers.go index 79795a221..072514d0f 100644 --- a/pkg/domain/entities/containers.go +++ b/pkg/domain/entities/containers.go @@ -257,6 +257,8 @@ type ContainerLogsOptions struct { Tail int64 // Show timestamps in the logs. Timestamps bool + // Show different colors in the logs. + Colors bool // Write the stdout to this Writer. StdoutWriter io.Writer // Write the stderr to this Writer. diff --git a/pkg/domain/entities/pods.go b/pkg/domain/entities/pods.go index da93d3f8b..f1d445c4b 100644 --- a/pkg/domain/entities/pods.go +++ b/pkg/domain/entities/pods.go @@ -149,6 +149,8 @@ type PodLogsOptions struct { ContainerLogsOptions // If specified will only fetch the logs of specified container ContainerName string + // Show different colors in the logs. + Color bool } type ContainerCreateOptions struct { @@ -210,7 +212,7 @@ type ContainerCreateOptions struct { Name string `json:"container_name"` NoHealthCheck bool OOMKillDisable bool - OOMScoreAdj int + OOMScoreAdj *int Arch string OS string Variant string @@ -482,6 +484,7 @@ func PodLogsOptionsToContainerLogsOptions(options PodLogsOptions) ContainerLogsO Until: options.Until, Tail: options.Tail, Timestamps: options.Timestamps, + Colors: options.Colors, StdoutWriter: options.StdoutWriter, StderrWriter: options.StderrWriter, } diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index f45bdeba5..100842c69 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -1088,6 +1088,7 @@ func (ic *ContainerEngine) ContainerLogs(ctx context.Context, containers []strin Until: options.Until, Tail: options.Tail, Timestamps: options.Timestamps, + Colors: options.Colors, UseName: options.Names, WaitGroup: &wg, } @@ -1491,7 +1492,7 @@ func (ic *ContainerEngine) ContainerRename(ctx context.Context, nameOrID string, func (ic *ContainerEngine) ContainerClone(ctx context.Context, ctrCloneOpts entities.ContainerCloneOptions) (*entities.ContainerCreateReport, error) { spec := specgen.NewSpecGenerator(ctrCloneOpts.Image, ctrCloneOpts.CreateOpts.RootFS) var c *libpod.Container - c, err := generate.ConfigToSpec(ic.Libpod, spec, ctrCloneOpts.ID) + c, _, err := generate.ConfigToSpec(ic.Libpod, spec, ctrCloneOpts.ID) if err != nil { return nil, err } diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index 1423ab06e..c3f6bb17d 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -290,7 +290,16 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY if v.Type == kube.KubeVolumeTypeConfigMap && !v.Optional { vol, err := ic.Libpod.NewVolume(ctx, libpod.WithVolumeName(v.Source)) if err != nil { - return nil, errors.Wrapf(err, "cannot create a local volume for volume from configmap %q", v.Source) + if errors.Is(err, define.ErrVolumeExists) { + // Volume for this configmap already exists do not + // error out instead reuse the current volume. + vol, err = ic.Libpod.GetVolume(v.Source) + if err != nil { + return nil, errors.Wrapf(err, "cannot re-use local volume for volume from configmap %q", v.Source) + } + } else { + return nil, errors.Wrapf(err, "cannot create a local volume for volume from configmap %q", v.Source) + } } mountPoint, err := vol.MountPoint() if err != nil || mountPoint == "" { |