[fix] Document the tailer configuration somewhat more.
@@ -13,21 +13,28 @@ import (
// Config contains the config for stern
type Config struct {
- Namespace string
- PodQuery *regexp.Regexp
- Timestamps bool
- ContainerQuery *regexp.Regexp
- ExcludeContainerQuery *regexp.Regexp
- ContainerState ContainerState
- Exclude []*regexp.Regexp
- Include []*regexp.Regexp
- Since time.Duration
+ Namespace string // Name of the namespace to monitor
+ PodQuery *regexp.Regexp // Limit monitoring to pods matching the RE
+ Timestamps bool // Print timestamps before each entry.
+ ContainerQuery *regexp.Regexp // Limit monitoring to containers matching the RE
+ ExcludeContainerQuery *regexp.Regexp // Exclusion list if the above alone is not enough.
+ ContainerState ContainerState // Limit monitoring to containers in this state.
+ Exclude []*regexp.Regexp // If specified suppress all log entries matching the RE
+ Include []*regexp.Regexp // If specified show only log entries matching this RE
+ Since time.Duration // Show only log entries younger than the duration.
AllNamespaces bool
LabelSelector labels.Selector
TailLines *int64
- Template *template.Template
+ Template *template.Template // Template to apply to log entries for formatting
}
+// Notes on the above:
+// - For containers `ContainerQuery` is applied before
+// `ExcludeContainerQuery`. IOW use `CQ` to get an initial list of
+// containers and then use `ECQ` to pare that down further.
+//
+// - For log entries `Exclude` is applied before `Include`.
+
// Run starts the log watching
func Run(ctx context.Context, config *Config, cluster *kubernetes.Cluster) error {
var namespace string
