18 Commits

Author SHA1 Message Date
f42c91448d chore: remove repetitive word
Signed-off-by: avoidalone <wuguangdong@outlook.com>
2024-06-11 23:56:04 +02:00
e3f6f0f8b3 misc: sinceSeconds -> sinceDuration
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-10-17 14:08:10 +02:00
cbdd71e44e Make flux logs more lenient
UX changes:

- Only print an error when a pod doesn't have a matching container
  instead of exiting early.
- Return a non-zero status code when no pod is found at all.

Details:

In certain situations there might be 3rd-party pods running in the
Flux namespace that cause the command to fail streaming logs, e.g.
when they have multiple containers but none of them is called
`manager` (which all Flux-maintained pods do). An example of such a
situation is when Flux is installed with the 3rd-party Flux extension
on AKS.

The `logs` command is now more forgiving and merely logs an error in
these situations instead of completely bailing out. It still returns a
non-zero exit code.

For the parallel log streaming with `-f` the code is now a little more
complex so that errors are now written to stderr in parallel with all
other logs written to stdout. That's what `asyncCopy` is for.

refs #3944

Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-06-05 10:07:38 +02:00
97b064be13 add a preview note for all non-bootstrap commands
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-04-05 16:05:21 +03:00
52acac1a37 Add /v2 suffix to module name in preparation of 2.0.0 release
Signed-off-by: Max Jonas Werner <mail@makk.es>
2023-04-05 16:05:21 +03:00
7b95e90a33 Update flux logs to accomodate the new format
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-31 17:58:43 +01:00
0cfdc5d674 move struct definition
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-02 19:46:19 +01:00
96afee996a Add unit tests for flux logs
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-08-02 19:44:23 +01:00
c24e738973 logs: write into writer from io.Pipe instead os.Stdout
Signed-off-by: TianZong48 <tianzong48@gmail.com>
2022-06-28 23:27:32 +08:00
d12e697769 logs: select manager container when multiple exist
This sets the container to `manager` which is used by all Flux
controllers as the container name.

The other options I thought about were selecting the first, or doing
something with image detection. But both can be sensitive to either
users adding their patch as a first entry, or e.g. mirroring the image
to a different name.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-06-23 13:52:08 +02:00
0d8194c800 Add the kube client qps and burst to the global args
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-03-25 10:43:59 +01:00
a30ffdb176 Use text/template
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-14 23:59:20 +01:00
ca7d2e783f Use k8s.io/cli-runtime for kubernetes flags
Signed-off-by: Jakob Schrettenbrunner <jakob.schrettenbrunner@telekom.de>
2022-01-07 16:01:24 +01:00
d5d8c340c8 Switch to app.kubernetes.io/part-of label selector
Use `app.kubernetes.io/part-of: flux` label instead of `app.kubernetes.io/instance` to select the in-cluster objects used in flux version, check, logs and uninstall commands.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-01 18:02:49 +02:00
50a1e32da3 Sort pods from each deployment to get first and ready pod
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-10-03 14:30:31 +01:00
54758b1692 add --since and --since-time
Signed-off-by: Tomas Tulka <tomas.tulka@gmail.com>
2021-08-25 22:10:47 +02:00
185252ba48 Update flux logs examples
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-18 11:10:21 +01:00
6d2e34e9b2 Add flux logs command
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-03-16 14:59:03 +01:00