Skip to content

Commit ce90bc7

Browse files
authored
Merge pull request #2 from hogklint/chore/clean
Some cleaning
2 parents d022aa0 + 022d007 commit ce90bc7

File tree

7 files changed

+5
-29
lines changed

7 files changed

+5
-29
lines changed

Dockerfile

-4
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The `container query` is a regular expression of the container name; you could p
3737
flag | default | purpose
3838
-----------------------------|---------------------------------|---------
3939
`--color` | `auto` | Force set color output. 'auto': colorize if tty attached, 'always': always colorize, 'never': never colorize.
40-
`--completion` | | Output stern command-line completion code for the specified shell. Can be 'bash', 'zsh' or 'fish'.
40+
`--completion` | | Output tailfin command-line completion code for the specified shell. Can be 'bash', 'zsh' or 'fish'.
4141
`--compose` | `[]` | Compose project name to match (regular expression)
4242
`--compose-colors` | | Specifies the colors used to highlight container names. Provide colors as a comma-separated list using SGR (Select Graphic Rendition) sequences, e.g., "91,92,93,94,95,96".
4343
`--config` | `~/.config/tailfin/config.yaml` | Path to the tailfin config file

cmd/tailfincmd/cmd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ func (o *options) overrideFlagSetDefaultFromConfig(fs *pflag.FlagSet) error {
334334
// AddFlags adds all the flags used by tailfin.
335335
func (o *options) AddFlags(fs *pflag.FlagSet) {
336336
fs.StringVar(&o.color, "color", o.color, "Force set color output. 'auto': colorize if tty attached, 'always': always colorize, 'never': never colorize.")
337-
fs.StringVar(&o.completion, "completion", o.completion, "Output stern command-line completion code for the specified shell. Can be 'bash', 'zsh' or 'fish'.")
337+
fs.StringVar(&o.completion, "completion", o.completion, "Output tailfin command-line completion code for the specified shell. Can be 'bash', 'zsh' or 'fish'.")
338338
fs.StringArrayVar(&o.compose, "compose", o.compose, "Compose project name to match (regular expression)")
339339
fs.StringArrayVarP(&o.exclude, "exclude", "e", o.exclude, "Log lines to exclude. (regular expression)")
340340
fs.StringArrayVarP(&o.excludeContainer, "exclude-container", "E", o.excludeContainer, "Container name to exclude. (regular expression)")

cmd/tailfincmd/cmd_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func TestOptionsGenerateTemplate(t *testing.T) {
234234
return o
235235
}(),
236236
"json message",
237-
`{"message":"json message","nodeName":"","namespace":"","podName":"","containerName":"container1","composeProject":"compose1"}
237+
`{"message":"json message","container":"container1","compose":"compose1"}
238238
`,
239239
false,
240240
true,

stern/docker_tail.go

-3
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,6 @@ func (t *DockerTail) consumeLine(line string) {
183183
func (t *DockerTail) Print(msg string) {
184184
vm := Log{
185185
Message: msg,
186-
NodeName: "",
187-
Namespace: "",
188-
PodName: "",
189186
ContainerName: t.ContainerName,
190187
ComposeProject: t.ComposeProject,
191188
ComposeColor: t.composeColor,

stern/file_tail.go

-4
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@ func (t *FileTail) ConsumeReader(reader *bufio.Reader) error {
6161
func (t *FileTail) Print(msg string) {
6262
vm := Log{
6363
Message: msg,
64-
NodeName: "",
65-
Namespace: "",
66-
PodName: "",
6764
ContainerName: "",
68-
PodColor: color.New(color.Reset),
6965
ContainerColor: color.New(color.Reset),
7066
}
7167

stern/tail_utils.go

+2-15
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,10 @@ type Log struct {
2222
// Message is the log message itself
2323
Message string `json:"message"`
2424

25-
// Node name of the pod
26-
NodeName string `json:"nodeName"`
25+
ContainerName string `json:"container"`
2726

28-
// Namespace of the pod
29-
Namespace string `json:"namespace"`
27+
ComposeProject string `json:"compose"`
3028

31-
// TODO REMOVE
32-
// PodName of the pod
33-
PodName string `json:"podName"`
34-
35-
// TODO change to container
36-
ContainerName string `json:"containerName"`
37-
38-
// TODO hange ot "compose"
39-
ComposeProject string `json:"composeProject"`
40-
41-
PodColor *color.Color `json:"-"`
4229
ComposeColor *color.Color `json:"-"`
4330
ContainerColor *color.Color `json:"-"`
4431
}

0 commit comments

Comments
 (0)