summaryrefslogtreecommitdiff
path: root/pkg/domain/entities
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/domain/entities')
-rw-r--r--pkg/domain/entities/engine_container.go3
-rw-r--r--pkg/domain/entities/generate.go2
-rw-r--r--pkg/domain/entities/pods.go27
-rw-r--r--pkg/domain/entities/secrets.go2
4 files changed, 31 insertions, 3 deletions
diff --git a/pkg/domain/entities/engine_container.go b/pkg/domain/entities/engine_container.go
index bd011d309..3da31d8a0 100644
--- a/pkg/domain/entities/engine_container.go
+++ b/pkg/domain/entities/engine_container.go
@@ -72,6 +72,7 @@ type ContainerEngine interface {
PodExists(ctx context.Context, nameOrID string) (*BoolReport, error)
PodInspect(ctx context.Context, options PodInspectOptions) (*PodInspectReport, error)
PodKill(ctx context.Context, namesOrIds []string, options PodKillOptions) ([]*PodKillReport, error)
+ PodLogs(ctx context.Context, pod string, options PodLogsOptions) error
PodPause(ctx context.Context, namesOrIds []string, options PodPauseOptions) ([]*PodPauseReport, error)
PodPrune(ctx context.Context, options PodPruneOptions) ([]*PodPruneReport, error)
PodPs(ctx context.Context, options PodPSOptions) ([]*ListPodsReport, error)
@@ -85,7 +86,7 @@ type ContainerEngine interface {
SetupRootless(ctx context.Context, noMoveProcess bool) error
SecretCreate(ctx context.Context, name string, reader io.Reader, options SecretCreateOptions) (*SecretCreateReport, error)
SecretInspect(ctx context.Context, nameOrIDs []string) ([]*SecretInfoReport, []error, error)
- SecretList(ctx context.Context) ([]*SecretInfoReport, error)
+ SecretList(ctx context.Context, opts SecretListRequest) ([]*SecretInfoReport, error)
SecretRm(ctx context.Context, nameOrID []string, opts SecretRmOptions) ([]*SecretRmReport, error)
Shutdown(ctx context.Context)
SystemDf(ctx context.Context, options SystemDfOptions) (*SystemDfReport, error)
diff --git a/pkg/domain/entities/generate.go b/pkg/domain/entities/generate.go
index 8a437061f..7809c5241 100644
--- a/pkg/domain/entities/generate.go
+++ b/pkg/domain/entities/generate.go
@@ -9,7 +9,7 @@ type GenerateSystemdOptions struct {
// New - create a new container instead of starting a new one.
New bool
// RestartPolicy - systemd restart policy.
- RestartPolicy string
+ RestartPolicy *string
// StopTimeout - time when stopping the container.
StopTimeout *uint
// ContainerPrefix - systemd unit name prefix for containers
diff --git a/pkg/domain/entities/pods.go b/pkg/domain/entities/pods.go
index 10bd7e5ce..d9dd0c532 100644
--- a/pkg/domain/entities/pods.go
+++ b/pkg/domain/entities/pods.go
@@ -133,6 +133,14 @@ type PodCreateOptions struct {
Userns specgen.Namespace
}
+// PodLogsOptions describes the options to extract pod logs.
+type PodLogsOptions struct {
+ // Other fields are exactly same as ContainerLogOpts
+ ContainerLogsOptions
+ // If specified will only fetch the logs of specified container
+ ContainerName string
+}
+
type ContainerCreateOptions struct {
Annotation []string
Attach []string
@@ -426,3 +434,22 @@ func ValidatePodStatsOptions(args []string, options *PodStatsOptions) error {
return errors.New("--all, --latest and arguments cannot be used together")
}
}
+
+// Converts PodLogOptions to ContainerLogOptions
+func PodLogsOptionsToContainerLogsOptions(options PodLogsOptions) ContainerLogsOptions {
+ // PodLogsOptions are similar but contains few extra fields like ctrName
+ // So cast other values as is so we can re-use the code
+ containerLogsOpts := ContainerLogsOptions{
+ Details: options.Details,
+ Latest: options.Latest,
+ Follow: options.Follow,
+ Names: options.Names,
+ Since: options.Since,
+ Until: options.Until,
+ Tail: options.Tail,
+ Timestamps: options.Timestamps,
+ StdoutWriter: options.StdoutWriter,
+ StderrWriter: options.StderrWriter,
+ }
+ return containerLogsOpts
+}
diff --git a/pkg/domain/entities/secrets.go b/pkg/domain/entities/secrets.go
index 56a1465b7..55b470d7b 100644
--- a/pkg/domain/entities/secrets.go
+++ b/pkg/domain/entities/secrets.go
@@ -16,7 +16,7 @@ type SecretCreateOptions struct {
}
type SecretListRequest struct {
- Filters map[string]string
+ Filters map[string][]string
}
type SecretListReport struct {